Commit graph

162 commits

Author SHA1 Message Date
Colin Caine
426ffe6be8 Throw exceptions rather than logging
Some error conditions were being logged when they should throw
exceptions. Some uninteresting things were being logged.
2017-12-29 23:56:24 +00:00
John Beard
baefd09973 Allow levelled logging for debug
This is useful for suppressing spew, but still allowing easy debugging
when needed, without rebuilding.

To use, use excmd:

     setlogginglevel <prefix> <level>

Where the level is one of:

    - never:  never log
    - error
    - warning
    - info
    - debug:  most verbose

Output is directed to console methods "error", "warn", "log", "debug".
2017-12-29 18:57:16 +00:00
Colin Caine
33f4ade9a9 excmds: remove redundant conversion 2017-12-28 18:07:06 +00:00
Fabian Furger
13fcbd7890 Support %s magic string for search providers 2017-12-28 18:06:56 +00:00
Colin Caine
c4ffd2143c excmd: document hintsave 2017-12-24 11:42:28 +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
Oliver Blanthorn
0f6d96c0ad
Merge branch 'master' of github.com:cmcaine/tridactyl into antonva-master 2017-12-22 12:26:33 +00:00
Oliver Blanthorn
8bc4239138
Fix #228: broken link to keybinds in help 2017-12-22 11:14:58 +00:00
Anton
022f462396 addressing issue #231, urlparent now accepts a count. 2017-12-19 18:47:34 +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
Koushien
850104e0fe Implement ^,$ navigating to 0%,100% in x-direction
This is made possible by also allowing the second
argument to be "x" or "y". We supply "y" as the
default to retain the current, more commonly
desired behavior.
2017-12-11 01:19:20 +00:00
Oliver Blanthorn
baaa4cef61
Support multiple URLs for quickmarks 2017-12-08 11:56:21 +00:00
glacambre
dab97fea10 src/{controller,excmds}.ts: Fix endless repeat, implement more intuitive behavior. 2017-12-06 16:31:53 +00:00
glacambre
e61358b63f src/{config,controller,excmds,state}.ts: Implement dot repeat. 2017-12-06 16:31:53 +00:00
Oliver Blanthorn
001fb17bd2
Fix set newtab failing to set newtab 2017-12-06 14:59:00 +00:00
Jeff King
65ba4c03e4 excmds: add q, qa, and quit synonyms
Other vim-likes map `q` and `quit` to `tabclose`, so let's
do the same to appease their muscle memory.

While we're at it, we can add `qa` as a shortcut for `qall`
(vim also supports this shorthand).
2017-12-06 05:37:18 -05:00
Colin Caine
dcc816ff86 Clean up inputmode
Code quality, introduce config option.
2017-12-05 22:13:08 +00:00
Zhong Jianxin
01221f3052 Add inputmode
- Add `focusinput -n` and `focusinput -N`
- Press `gi` to focus input and enter inputmode
- When in inputmode, `Tab` to focus input after last focussed one, `Shift+Tab`
  to focus input before last focussed one
2017-12-05 22:12:34 +00:00
Colin Caine
4ed2031d69 Small readme updates
Change to ircs:// link
Mention channels on newtab
2017-12-04 15:41:48 +00:00
John Beard
0d6405f498 Help preface text: minor tweaks and add chat badges
- Reflowed text
- Added Matrix/Gitter chat badges
- Added Freenode badge and link
- Used static images for badges on help page to avoid external loads
- Inlined some links, rather than using [1] suffixes
2017-12-04 13:32:21 +00:00
Oliver Blanthorn
c8dc8387cf
Add relative zoom and z{i,z,o} binds 2017-12-04 11:50:35 +00:00
Oliver Blanthorn
9dd2555984
Merge branch 'master' of github.com:cmcaine/tridactyl into orangenschalen-variable_hintname_length 2017-12-03 13:56:10 +00:00
Oliver Blanthorn
8fa42bc442
Remove now disused hintorder setting 2017-12-03 13:55:56 +00:00
Oliver Blanthorn
11b208c2a2
Fix #194: add searchsetkeyword [keyword] [url]
Also, add config to the `tri` namespace for debugging.
2017-12-03 11:30:44 +00:00
Oliver Blanthorn
e416c9afe4
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-impl_sanitize 2017-12-02 13:27:06 +00:00
Oliver Blanthorn
fccaa37087
Improve sanitize help 2017-12-02 13:27:02 +00:00
glacambre
379273396e src/excmds.ts: Fix gh failing to open the homepage.
Problem: When using home() to open the homepage, tridactyl opens the
default search engine instead.

Solution: This was due to calling open(homepages[-1]). Open recieved
`undefined` as argument, gave it to forceURI which returned the default
search engine URL. Replacing `-1` with `homepages.length-1` fixes the
issue.

Fixes issue https://github.com/cmcaine/tridactyl/issues/188
2017-12-02 12:30:04 +01:00
glacambre
1a273d62d2 src/excmds.ts, src/manifest.json: Implement :sanitize. 2017-12-02 00:20:32 +01:00
glacambre
469bc551ee src/excmds.ts: Fix yankshort not always yanking short urls.
Problem: Yankshort didn't yank short urls on bugzilla.mozilla.org. This
was due to bugzilla.mozilla.org using an old, non-standard, non-html5
compliant way of advertising its short urls.

Solution: Make yankshort check if a rev="canonical" link exists if it
cannot find a rel="shortlink" url.

Fixes issue https://github.com/cmcaine/tridactyl/issues/172 .
2017-11-30 18:04:16 +01:00
Oliver Blanthorn
2595ed4d14
Allow bmark to accept titles with spaces 2017-11-30 14:34:10 +00:00
Oliver Blanthorn
fdcaea0849
Fix #96: Allow set to set arrays and add homepages setting 2017-11-30 13:53:53 +00:00
Oliver Blanthorn
3a957a1e5a
Fix #59: newtab can be configured with set newtab [url] 2017-11-30 11:47:37 +00:00
John Beard
c69aac0a53 Add Text To Speech API (and hint mode)
This adds an excmd interface to the Web Speech API (TTS), which allows
users to read text out and set voice and parameters via config options.

Excmds:

    - ttsread: reads out the given text or element content (CSS selected)
    - ttsvoices: lists available voice names (can be used in the
      'ttsvoice' option)
    - ttscontrol: stops the current reading (should also pause/resume,
      but that doesn't seem to work right now)

Config options:
    - ttsvoice: the name of the voice to use
    - ttsrate: (0.1-10)
    - ttsvolume: (0-1)
    - ttspitch: (0-2)

Also the ;r hint submode is added which reads the textcontent of the
element with the configured voice
2017-11-30 04:43:55 +00:00
Oliver Blanthorn
2acfa3fbb0
set [setting] without a value will inform you of the current value 2017-11-29 21:38:30 +00:00
Oliver Blanthorn
bd6d3d4bb6
Add configuration options for hinting and documentation 2017-11-29 20:22:56 +00:00
Oliver Blanthorn
7713d5e5ff
Make all changes to config persistent, import legacy binds 2017-11-29 19:51:18 +00:00
Oliver Blanthorn
6ae704876c
Add unset for resetting a bind to default 2017-11-29 18:57:04 +00:00
Oliver Blanthorn
712037ae79
Allow users to save configuration via command line 2017-11-29 16:56:56 +00:00
Oliver Blanthorn
f23118e166
Fix #60: allow users to change default search engine 2017-11-29 16:40:16 +00:00
Oliver Blanthorn
da68d5f398
Add basic configuration with set
Currently does not import previous binds
2017-11-29 16:28:06 +00:00
Oliver Blanthorn
b990125792
Add hint -c [selector]: add hints that match selector
It's particularly good on Hacker News and Reddit with

`bind ;c hint -c [class*="expand"],[class="togg"]` for minimising
comments and expanding images.
2017-11-29 13:23:30 +00:00
Oliver Blanthorn
3c282ab1df
Merge branch 'master' of github.com:cmcaine/tridactyl into johnbeard-hintanchor 2017-11-29 11:47:50 +00: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
a3ca5cd2c1 Add yank anchor hint submode (;#)
THis yanks the page URL with the hinted elements id or title as a hash
fragment, which can be used to link to the page at that element's
location.

For example: https://en.wikipedia.org/wiki/Vim_(text_editor)#History

;# nmap added, from Vimperator
2017-11-29 02:27:23 +00:00
Colin Caine
b4a5edd20c excmd: remove tabs. Simplify tabonly 2017-11-29 00:37:21 +00:00
Alex Kir
23f845eb3f Now looking for tabs to close only in current window 2017-11-29 00:37:21 +00:00
Alex Kir
a781c4bdd4 Added tabonly command
Executing `tabonly` will close all tabs but active and pinned
2017-11-29 00:32:31 +00:00
Colin Caine
3cae9a5334 Revert "excmd: fix :version"
This reverts commit baa5a9b861.
2017-11-28 17:23:16 +00:00
Colin Caine
e933c100d3 excmd: Replace tabchoose with tabprev_gt
The gT and gt maps in vim aren't symmetric, this better preserves
those semantics while removing a confusingly named excmd
2017-11-28 16:16:41 +00:00
Colin Caine
baa5a9b861 excmd: fix :version 2017-11-28 16:05:08 +00:00