Commit graph

10 commits

Author SHA1 Message Date
Oliver Blanthorn
3ccd330a89
Merge pull request #284 from Koushien/dropdown
Unless cancelled, insert mode when select tag focused
2018-01-25 09:37:16 +00:00
John Beard
de94ac5007 Case insensitive isEditable check on tag names
Previously was a case-sensitive check against an uppercase name. This
works for HTML.

XHTML will be whatever the source document is, which could be upper or
lower. Firefox will render either one the same, but only uppercase will
be deemed editable by Tridactyl. Fix this by doing a case-insensitive
comparision.

Tag casing is described in:
https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName

Thanks Koushien for working this one out!
2018-01-21 17:36:00 +00:00
Koushien
104e1a98f3
Unless cancelled, insert mode on select tag focus
Added case to nodeName switch; handles basic
dropdown menus.
2018-01-20 17:17:14 -08:00
Oliver Blanthorn
d9fc24dc62
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-fix_pcgamer_hints 2017-11-30 08:58:45 +00:00
glacambre
24632c8dfb src/dom.ts: Fix hints not being displayed on certain sites.
Problem: Hints aren't displayed for certain elements. This was because
the isVisible function didn't pay attention to the element's 'display'
attribute when deciding whether an element is visible according to its
height/width.

Solution: Add two functions to help decide whether the height and width
attribute of an element matter.

Note: The two functions do not do anything if an element's 'display'
attribute is set to either 'initial' or 'inherit' because taking these
into account seems complicated.

Fixes issue https://github.com/cmcaine/tridactyl/issues/127 .
2017-11-30 05:47:18 +01:00
John Beard
f0dfe1d5da Refactor document CSS selector queries with dom.ts
The DOM.getElemsBySelector function makes it a bit less verbose to
construct an array of filtered elements matching a selector.

Also, this function is expanded to take multiple filters, applied
sequentially.
2017-11-29 02:27:49 +00:00
John Beard
6a48990751 Add focusinput command (gi)
Can focus the nth input from the start or end of a page.

Also has some special modes:

  -l: last focussed input
  -p: first password input
  -b: the largest input by area
2017-11-25 01:41:38 +00:00
Colin Caine
927e19c818 hinting: First working version
state.ts also reworked into a sexy new machine. Check it out!
2017-11-09 05:44:48 +00:00
Colin Caine
adfca7cf69 hinting WIP: plumb to background 2017-11-09 05:44:40 +00:00
Colin Caine
8d53fd60eb Rework messaging, key suppression, exmode parser
exmode.parser now converts strings to the types given in excmd
signatures.

Messaging now works in both directions (but I haven't made excmds.ts use
the new system yet. Exercise for the reader (see keydown_* state() for a
simple example)).

keys are now being suppressed, but in a pretty stupid way.

I got fed up of not having proper itertools, or str conversions, so I
wrote some. Others have written them in JS, but they were fun to make.
Only the ones I'm using are tested.
2017-10-23 09:42:50 +01:00