Commit graph

818 commits

Author SHA1 Message Date
Colin Caine
58d38a9f70 Support changing followpage pattern 2018-02-18 18:23:40 +00:00
Colin Caine
3ba21592cc Simplify findRelLink 2018-02-18 18:21:59 +00:00
Colin Caine
259e4f182f Make tab opening behaviour more consistent 2018-02-18 16:08:19 +00:00
Colin Caine
b9292cd25e Typo: fix #310
Testing is hard.
2018-02-14 17:38:09 +00:00
Oliver Blanthorn
5d3dff568e
Merge pull request #306 from johnbeard/floating-iframes
Fix floating commandline iframe on some sites #289
2018-02-14 09:01:46 +00:00
Oliver Blanthorn
94184b2839
Merge pull request #305 from johnbeard/readme
Expand readme with most common normal bindings
2018-02-14 08:42:17 +00:00
John Beard
309dafaa7b Fix floating commandline iframe on some sites #289
This is caused (at least in this instance) by sites setting a CSS
min-height rule for `iframe` elements, which is then applied to the
Tridactyl iframe too.

Fix this by adding `min-height: 0` to the CSS for `#cmdline_iframe`.
Because this is an ID, it will always have higher specificity than any
CSS the site sets (unless we collide the ID, maybe), so it doesn't need
important.

Also add `max-height: none` in case anyone tries to cramp our iframe
style.

Perhaps there will be more styles that can mess up the iframe styling
but this seems to fix all the sites reported in #289 and #282. Using
cleanslate might help if it turns out there are very many more ways for
the outer site to ruin our day, but since it's only the iframe that the
site CSS can touch (inner HTML is safe), maybe this will be enough and
save a lot of !important'ing.
2018-02-14 01:15:06 +00:00
John Beard
7a65c2af47 Expand readme with most common normal bindings
This provides a quick-look overview of a good percentage of Tridactyl's
basic commands to potential users looking at project page.
2018-02-14 00:15:31 +00:00
Colin Caine
092e501db4 src: Simplify HintState constructor 2018-02-13 23:57:29 +00:00
Colin Caine
128080fed2 src: Fix vimperator-reflow hintfilter 2018-02-13 23:56:37 +00:00
Colin Caine
4884e0d6bb src: Truncate long hint text 2018-02-13 23:28:04 +00:00
Colin Caine
772da93894 src: simplify hintnames 2018-02-13 23:14:20 +00:00
Colin Caine
1b8e8d6a39 src: Enhance itertools 2018-02-13 23:10:36 +00:00
Saul Reynolds-Haertle
b53de98903 escape hintchar regex in hint building for vimperator hintfiltermode 2018-02-13 23:08:53 +00:00
Saul Reynolds-Haertle
3231852dab Code quality: replace if-else blocks with switches 2018-02-13 23:08:53 +00:00
Saul Reynolds-Haertle
335d4bb167 Default hint build/filter is a function instead of a const dict 2018-02-13 23:08:53 +00:00
Saul Reynolds-Haertle
fcbda44a4f Unify code for 'vimperator' and 'vimperator-reflow' hintfiltermodes 2018-02-13 23:08:53 +00:00
Saul Reynolds-Haertle
282766ed1e Add vimperator-reflow hint filter mode
This mode works like vimperator-mode, but additionally renames hints
as they're filtered.
2018-02-13 23:08:53 +00:00
Saul Reynolds-Haertle
30d6dd1c2f Add hintmode config and new "vimperator" hinting mode
hintmode = "simple" is the default hinting mode, naming hints using
the hintchars configuration. It is the current tridactyl behavior and
is preserved unchanged.

hintmode = "vimperator" is a new hinting mode that allows the user to
filter hints using non-hintchar :alnum: characters. Hints with targets
whose html does not contain these characters as a subsequence (not
contiguous) will be filtered out.
2018-02-13 23:08:53 +00:00
Oliver Blanthorn
c17878098d
Merge branch 'master' of github.com:cmcaine/tridactyl into aucmd 2018-02-02 15:00:10 +00:00
Oliver Blanthorn
a1cc6ade8f
Add event type checking to autocmd, change default autocmd 2018-02-02 14:53:58 +00:00
Oliver Blanthorn
5b6b473af3
Fix getAsync, add au alias, fix loadaucmds 2018-02-02 14:12:47 +00:00
Colin Caine
7a22bc8c2c Stop testing on pre-commit 2018-02-02 13:23:27 +00:00
Colin Caine
083600750b Fix bug typo in setDeepProperty 2018-02-02 13:11:23 +00:00
Oliver Blanthorn
2174224244
Rename setnew to set, correct order for set in autocmds, ensure people cannot wipe entire config with unset 2018-02-02 13:06:30 +00:00
Colin Caine
c1ab1ebae9 Remove superfluous variable 2018-02-02 13:05:40 +00:00
John Beard
e50119d466 Use new UrlUtil interpolate function in excmd
Document user-facing interpolation behaviour on excmd
`searchsetkeyword`.
2018-02-02 11:56:01 +00:00
Colin Caine
ca19b87807 Improve config API
- set, unset, get now all support an arbitrary depth of keys
 - set has a less confusing argument order
 - getAsync added: it will sleep until the config is read from disk for
   the first time

Config isn't really fit for purpose. Should consider custom objects (for
recording type, defaults, etc) and maybe decoupling internal
representation from UI.

Found a couple of bugs as well:

   excmds.ts: set() Could write a string to the config where the config
              expected an array (Fixes #275)
   config.ts: If both sync and local storage are in use the behaviour is
              not intuitive.
2018-02-01 23:45:45 +00:00
John Beard
feda3bc8e6 Add URL interpolation function and tests
This includes logic to automatically percent-encode the query if it
occurs in the the query string of the URL pattern.

If this automatic logic is not enough in future, the same function can
be extended with an explicit encoding flag as needed.
2018-02-01 16:43:13 +00:00
Oliver Blanthorn
5f9bd063c2
First attempt at aucmds. Main issue - config does not seem to load userconfig, only defaults 2018-01-31 19:51:08 +00:00
Oliver Blanthorn
9304dee31e
Merge pull request #298 from johnbeard/urlmodify-doc
Urlmodify documentation
2018-01-28 20:30:52 +00:00
John Beard
931fa12bd7 Expand urlmodify docs with prose and examples 2018-01-28 20:10:52 +00:00
John Beard
b2a31b9b72 Fix incorrectly quoted regex in urlmodify -r 2018-01-28 19:39:29 +00:00
Colin Caine
d16cbb980b Merge: Support excmd aliases via command
Merge remote-tracking branch 'isaackhor/i236-common-ex-aliases'
2018-01-28 18:19:20 +00:00
Colin Caine
0f40e19035 Revise alias expansion
Simplify alias interface to one function.

Enable aliases that expand to multiple words.
2018-01-28 18:13:21 +00:00
Colin Caine
d588e364f2 Fix typo in command 2018-01-28 17:57:46 +00:00
Colin Caine
9f1f761310 Fix whitespace errrors 2018-01-28 15:18:50 +00:00
Colin Caine
0693cdc45d Merge remote-tracking branch 'origin/master' into HEAD 2018-01-28 15:04:47 +00:00
Oliver Blanthorn
555e543b00
Merge pull request #277 from Koushien/cmdline-emacs-binds
Support Emacs-style C-(a|e|k|u) in cmdline
2018-01-25 09:39:36 +00:00
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
Oliver Blanthorn
d23d3b9172
Merge pull request #286 from johnbeard/urlmodify
Add urlmodify command
2018-01-25 09:14:44 +00:00
Oliver Blanthorn
c46c912dd6
Merge pull request #287 from johnbeard/tag-casing
Case insensitive isEditable check on tag names
2018-01-25 08:48:35 +00:00
Oliver Blanthorn
2f998caeb1
Merge pull request #292 from Koushien/reloadall
Make :reloadall only refresh current window tabs.
2018-01-25 08:47:44 +00:00
Oliver Blanthorn
a13fa1a009
Merge pull request #291 from Koushien/help-links
Fix 'project page' link in :help
2018-01-25 08:46:18 +00:00
Koushien
2884b1fb5c
Make :reloadall only refresh current window tabs.
Closes #288.
2018-01-23 22:29:39 -08:00
Koushien
5ea1447bb9
Fix 'project page' link in :help 2018-01-23 21:07:36 -08: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
John Beard
6bc3b5ae97 Add urlmodify command
Has a few modes:

    -t: Straight text replacement
    -r: Regexp replacement
    -q: Change a query's value to a new one
    -Q: Delete a given query (and value if present)
    -g: Graft a path onto the current URL (or a parent path of it)

These can be used direct on the command line, or bound to keybindings.
The idea is to allow commands to easily navigate around a website. For
example, navigating to a project's issues page on GitHub can be done
with a graft command, and changing an query is useful on sites like
eBay.

As a URL modification is generally site-specific, binding will be much
more useful with aucmds.
2018-01-21 17:14:57 +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
Isaac Khor
cd3396d39c
Delete leftover comment 2018-01-09 17:37:16 +08:00