Commit graph

78 commits

Author SHA1 Message Date
Jeff King
a9dd3ca25f hinting: add "numeric" name mode
This is similar to setting "hintchars" to "1234567890", but
ends up with more predictable and stable hints (see the
included documentation).

Setting "hintfiltermode" to "vimperator-reflow" and
"hintnames" to "numeric" provides more or less the same
experience that pentadactyl did.
2018-06-14 16:23:26 -04:00
Jeff King
87529877b9 hinting: add "hintnames" config
We always generate hints using the "short" mechanism added
by 34aa42061e. In preparation
for adding a new mode, let's add a config option to select
this.

I've made "uniform" a separate mode. I don't actually care
about this mode myself, but it looks like there's no other
way to trigger the pre-34aa4206 behavior, even though we're
still carrying the code. It's possible that nobody cares and
it should simply be removed.
2018-06-14 16:22:37 -04:00
Jeff King
da267dadc7 hinting: factor out default hint char selection
Right now this just comes from a single config variable. In
preparation for more complex logic, let's pull it out into
its own function.
2018-06-14 16:21:37 -04:00
Mohammad AlSaleh
a5d25f4abc hinting: Add header, footer, and nav to killable selectors
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2018-06-05 15:18:46 +03:00
Oliver Blanthorn
5d8b20c557
Support uppercase hints
I wouldn't recommend that you use mixed case hints as they're all displayed as uppercase.
2018-05-23 17:38:17 +01:00
Bruno Oliveira
0feaa3d2ca
Improve Tridactyl theming capabilities 2018-05-20 16:22:46 +01:00
Mohammad AlSaleh
36667348f1 Add a hint option for copying 'title' or 'alt' text
Similar to Vimperator's `;x`.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
2018-05-18 18:47:31 +03:00
Oliver Blanthorn
14919b7e2f
Make hint -; accept selectors 2018-05-18 15:25:11 +01:00
Anton
19fd1196f8 hint -b now follows current tab's container, similar tabopen behaviour now behind a new setting 'tabopencontaineraware', defaults to false. 2018-05-08 12:27:30 +00:00
Oliver Blanthorn
6088ebff6c
Add hint -W [exstr] to execute exstr on hint's href 2018-04-20 19:32:09 +01:00
Oliver Blanthorn
095ce771ea
Formatting: run all typescript through prettier 2018-04-13 19:28:03 +01:00
glacambre
e59dde5a0f
{dom,hinting}.ts: Add elements located in iframes to hintable elements 2018-04-02 19:15:29 +02:00
glacambre
ddc83c7c37
{excmds,hinting}.ts: use DOM.focus() instead of elem.focus() 2018-04-02 14:53:13 +02:00
Oliver Blanthorn
120f1951c5
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-hijack_listeners 2018-04-02 13:00:04 +01:00
glacambre
1eea9ea76f
hinting.ts: Prevent hint auto-selection on 'javascript:' hrefs 2018-03-18 17:57:42 +01:00
Oliver Blanthorn
972e69ad9c
Find mode tidied up for intrepid explorers. 2018-03-18 15:08:09 +00:00
Oliver Blanthorn
6d8fe17069
Add nascent find mode 2018-03-18 13:11:11 +00:00
Colin Caine
6afda3b632 Rewrite tabopen and openInNewTab
Fixes #342 and a bug where I used id rather than index.
2018-03-12 22:42:51 +00:00
Oliver Blanthorn
c042fd14b3
Add winopen equivalent to webext.ts, add and document private and window hints 2018-03-12 17:07:42 +00:00
Oliver Blanthorn
b8e1131281
Add hint window/private (untested) 2018-03-11 12:53:02 +00:00
Fabian Furger
9a19d872b1 WIP: Attempt to apply theme to hints
CSS adapted from here:
https://gist.github.com/KrazyCavin/a2fcda9d0e2980ab9a3caf5576081397
2018-03-08 21:57:21 +00:00
Colin Caine
7ea938f74f Revert "src: Simplify HintState constructor"
This reverts commit 092e501db4.

This was causing a bug identified by @glacambre and @Lexi where
sometimes the html function isn't defined when returning to a page with
history back.

Personally, I think it's probably webpack or Firefox's fault: content.ts
clearly imports html-tagged-template as it's first action.

If it's not their fault then it's html-tagged-template's fault: it must
be refusing to set window.html.
2018-03-05 23:06:18 +00:00
Oliver Blanthorn
a0e465c7b0
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-impl_#309 2018-03-05 13:23:26 +00:00
glacambre
119758454f
Add cleanslate.css 2018-03-04 14:15:26 +01:00
glacambre
21994a1102
hinting.ts: Only add js elems to hintables for hintPageSimple/Background 2018-03-03 14:20:13 +01:00
glacambre
f584c67f16
src/{content,dom,hinting}.ts: Implement addEventListener hijacking
This commit makes Tridactyl aware of elements made interactive through
JavaScript and lets Tridactyl put hints on them.
Something possibly dangerous is done here: exporting a function to the
page's context. While it is believed that the current implementation is
secure and that pages can't discover whether the function has been
exported or not, this might change due to new standards being adopted by
firefox. One of these standards is the Custom Elements api:
https://developer.mozilla.org/en-US/docs/Web/Web_Components/Custom_Elements

It will be necessary to check how Tridactyl behaves once this API has
landed. The status of this API seems to be tracked here:
https://bugzilla.mozilla.org/show_bug.cgi?id=1406825
2018-03-03 14:20:06 +01:00
glacambre
3cd0125783
hinting.ts: Make hintPage follow link if there's only 1 option 2018-02-28 22:01:36 +01:00
Colin Caine
5937ee284b Fix #288 2018-02-18 22:22:47 +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
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
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
Colin Caine
53e51497e7 logging: rewrite in OOP style 2017-12-30 00:46:26 +00:00
Colin Caine
f398895dce logging: introduce convenience functions 2017-12-29 23:58:23 +00:00
John Beard
fde956df53 Add save link/img hint submode (;s, ;S, ;a, ;A)
This adds the ability to save link targets or images. The save location
can be default, or the save as dialog can be invoked.

Somewhat sensible default filenames are provided.

Data URLs are also supported (though they need quite a bit of massaging
to get past the WebExt security limitations). Specificially, they need
to be round-tripped though a Blob, and must be saved from the background
context.
2017-12-24 11:20:26 +00:00
John Beard
080d6df9a3 Add hint kill submode (;k)
This submode deletes the selected hinted item. Useful for removing
overlay blockers or even unwanted/annoying content.
2017-12-17 17:39:54 +00:00
John Beard
c80d610068 Add <summary> tags to standard hinting
Used at least for Github user menu (top right) and Github wiki
expandable sections.
2017-12-04 02:20:29 +00:00
Oliver Blanthorn
8fa42bc442
Remove now disused hintorder setting 2017-12-03 13:55:56 +00:00
Orangenschalen
e06b98d220 fix 'if' scope and respect the javascript integer arithmetic 2017-12-02 16:34:06 +01:00
Orangenschalen
4991689dd7 use hint names of various lenghts 2017-12-02 14:49:19 +01:00
Orangenschalen
34aa42061e generate hint names with variable length
If the longer hint names use a shorter one as prefix,
then the shorter hint name is dropped from the hint
name list.
2017-12-02 14:48:46 +01:00
Oliver Blanthorn
8695552fe6
Fix #168: some pages didn't like the htmlblah strings. 2017-11-30 15:35:37 +00:00