Commit graph

2038 commits

Author SHA1 Message Date
glacambre
8744d73423
lib/webext.ts: Fix error thrown on page load
It is not useful to await in ownTabContainer as it could cause an
unnecessary context switch and will throw an error if the tab is not in
a container.
While it could seem like throwing errors in ownTabContainer is not a big
deal, it is actually quite annoying when using Firefox's "Pause on
exceptions" feature: execution is paused even if the error is caught by
the caller and there is no stack trace to help us understand what's
happening because ownTabContainer is async.

Thus, removing this await is very useful.
2018-10-10 16:09:34 +02:00
glacambre
848eb89fe8
help.ts: Jump back to hash after elements have been added to page 2018-10-10 15:43:32 +02:00
glacambre
1c63478b5c
Add HelpCompletionSource
The help completion source provides completions for settings, excmds,
aliases and bindings, sorted in lexicographical order. It's basically a
huge copy-paste of the Settings and Excmd completion sources but should
be enough until we have a way to provide multiple completion sources for
a single excmd.
2018-10-10 11:31:27 +02:00
glacambre
d8c59a5a21
Update default_config help page layout
The previous layout behaved badly on small screens.
2018-10-10 10:26:28 +02:00
glacambre
5a837397f2
excmds.ts: s/cursor/caret/g 2018-10-10 09:28:44 +02:00
Oliver Blanthorn
1123554970
Merge pull request #1073 from joaomsa/feature/control-filename-position-in-editorcmd
Allow control over filename position in editorcmd
2018-10-09 17:24:17 +01:00
Joao Sa
9f39b6fb53 use %f instead of {} for editorcmd 2018-10-09 15:56:02 +00:00
glacambre
8acfbafe36
Add default_config help page to Tridactyl's about:addons entry 2018-10-09 16:09:30 +02:00
glacambre
68d337084b
Embed setting values in the help page
This commit adds input fields to some of the settings in the help page.
These input fields are filled with the value of the setting they
correspong to. Users can edit these values and save their modifications
by pressing <Enter>. This is an easy way to see and change settings and
hopefully enough to use as option page.

This is achieved by adding more ugly code to help.ts. Hopefully one day
we'll get rid of TypeDoc and do our own thing in React or whatever
framework we'll have choosen and things will be cleaner.
2018-10-09 15:58:17 +02:00
glacambre
e9aabaa865
Slightly improve documentation
This commit removes unnecessary documentation, tries to make the
introduction shorter and fleshes out the documentation of a few
under-documented functions.
2018-10-09 15:57:36 +02:00
glacambre
884b8fbe6d
Make :help configoption work
This commits makes getting to the help page of a configuration option
easier.
2018-10-09 15:57:10 +02:00
glacambre
8514209cf9
Allow embedded settings to wrap
The previous code used <ul> and <li> in order to generate the list of
aliases/bindings related to an ex command. This was semantically correct
but required ugly CSS hacks in order to display them on a single line.
On top of that, this line didn't wrap when the list of bindings/commands
was longer that the page and thus required scrolling horizontally.

This commit replaces <ul> with <p> and <li> with span. It inserts a
space between each span and simplifies the css a bit, this results in
lines of bindings/aliases wrapping neatly.
2018-10-09 15:40:06 +02:00
Oliver Blanthorn
0552d3d5ab
Merge pull request #1074 from glacambre/fix_doc_path
Fix default config doc path
2018-10-09 14:12:06 +01:00
glacambre
7375f8b7db
Fix default config doc path
3ec27fd broke the path to the default config documentation when moving
directories around. This commits fixes that.
2018-10-09 15:01:49 +02:00
Joao Sa
fe62ebe96b Allow control over filename position in editorcmd 2018-10-08 23:56:35 +00:00
Oliver Blanthorn
d5de3bf91c
Revert "Turn :bmarks into a proper excmd"
This reverts commit ad5e9db562.

Fixes broken `tabopen -c [container] [url]`.
2018-10-08 22:01:15 +01:00
Oliver Blanthorn
af405af883
Try to make exclaim give better errors 2018-10-08 18:25:37 +01:00
glacambre
3fe4e0f693
styling.ts: Fix theme not loading on non-tridactyl pages 2018-10-08 14:48:23 +02:00
glacambre
771ce6f983
excmds.ts: Fix loadtheme breaking when loading some themes
When trying to load a theme named `test.css`, `loadtheme()` would
attempt to store it in the config as `test.css`. But the config stored
it as an object named `test` which contained a key named `css` and this
broked everything. This is fixed by making sure that users do not
specify the `.css` part of the theme themselves, instead it will be
automatically added when trying to load the file.

Documentation has been updated accordingly.
2018-10-08 14:47:31 +02:00
glacambre
9788600d5d
colourschemes: Add various small improvements
- Update the readme to mention `colors $theme` rather than `set theme
  $theme` because `colors` is more powerful than `set theme`.
- Update the doc
- Version bump native messenger and nativegate check
2018-10-08 14:47:27 +02:00
glacambre
113fd9ef80
Implement loading themes from disk.
This fixes https://github.com/cmcaine/tridactyl/issues/491.
2018-10-08 14:47:06 +02:00
Oliver Blanthorn
048349bd37
Merge branch 'fix_902' 2018-10-08 12:23:40 +01:00
glacambre
ad5e9db562
Turn :bmarks into a proper excmd
Turning `:bmarks` into a proper excmd has several advantages: it will
show up in the `:help` pages, be available for excmd completions and
enbales adding specific arguments (such as "-t") in order to open
bookmarks in other tabs.

Doing this required moving tabopen and some of its dependencies to the
content script.

Closes https://github.com/tridactyl/tridactyl/issues/902.
2018-10-08 09:53:20 +02:00
glacambre
d48bf00f1f
Implement mergedeep function
Previously, running `config.get()` would result in only top level
objects being merged and returned. This means that if you ran
`config.get()`, the `nmaps` object would be the default one if no custom
bindings were defined, but it would not contain the default bindings if
custom bindings were defined.

This commit fixes that by implementing a mergeDeep function that makes
sure that children of the returned are merged with the default config.

Closes https://github.com/tridactyl/tridactyl/issues/390.
2018-10-07 17:03:46 +02:00
Oliver Blanthorn
d1479b2aaf
Merge pull request #1067 from glacambre/fix_noiframeon
Fix `:set noiframeon`
2018-10-07 14:38:24 +01:00
glacambre
42908799ae
Fix :set noiframeon
`:set noiframeon` has been broken since at least 1a1588a8 because of the
use of target.concat instead of target.push. This caused subsequent
config.set() calls to interpret every url except the last as being part
of the keys that needed to be set in the config rather that as urls that
should be saved in the noiframeon setting.
2018-10-07 13:52:48 +02:00
Oliver Blanthorn
98fca088a5
Merge pull request #1064 from glacambre/fix_825
Fix completions preventing relative tabmoves
2018-10-06 15:50:44 +01:00
glacambre
7c1718aac0
Fix completions preventing relative tabmoves
Buffer completions autoselect matches and this prevents relative
tabmoves from being easily performed. This is fixed by making sure that
autoselection only happens when the command doesn't look like a relative
tabmove.

Fixes https://github.com/tridactyl/tridactyl/issues/825
2018-10-06 16:39:23 +02:00
Oliver Blanthorn
86ddc368e1
Merge pull request #1062 from glacambre/catch_exception
commandline_frame.ts: Catch exception in input handler
2018-10-05 13:02:31 +01:00
glacambre
0fff3056cd
commandline_frame.ts: Catch exception in input handler
Because of the await in the input handler, exceptions that are thrown
for previous computations will be thrown for the current one too, even
if there's no reason for it to go wrong. We fix this by surrounding the
await keyword with a try/catch and simply logging the error.
2018-10-05 13:10:52 +02:00
Oliver Blanthorn
6ef16cc03b
Merge pull request #1061 from glacambre/errormsg_on_failed_xselection
excmds.ts: Display error messages when setclip/getclip fails
2018-10-05 10:32:05 +01:00
glacambre
e48951ca3c
excmds.ts: Display error messages when setclip/getclip fails
This commit makes {set,get}clip display error messages when they fail to
interact with the X selection. Somehow exceptions are lost somewhere so
we use fillcmdline manually. This problem will disappear once these
functions are moved to the content script.

Fixes https://github.com/tridactyl/tridactyl/issues/959
2018-10-05 10:36:37 +02:00
Oliver Blanthorn
016fc77426
Merge pull request #1059 from glacambre/update_documentation
Mention tridactyl overriding default keybinding in readme/tutor
2018-10-05 08:45:17 +01:00
glacambre
11272ce958
Mention tridactyl overriding default keybinding in readme/tutor
Closes https://github.com/tridactyl/tridactyl/issues/939.
2018-10-05 09:25:21 +02:00
Oliver Blanthorn
9e71724a06
Merge pull request #1058 from WorldCodeCentral/patch-1
Correct * href to a href
2018-10-04 18:44:45 +01:00
WorldCodeCentral
38d83ed323
Correct * href to a href 2018-10-04 19:37:39 +02:00
Oliver Blanthorn
02160ad694
Merge pull request #1057 from glacambre/fix_metadata
Update metadata names
2018-10-04 17:34:29 +01:00
glacambre
f937a29e8a
Update metadata names
3ec27fd broke the commandline by moving config.ts while
metadata-generation/using code relied on its path. This commit updates
the path. A proper fix is to stop using paths and use names instead.
2018-10-04 17:57:44 +02:00
Oliver Blanthorn
3ec27fd40c
Merge branch 'reorganize-directories' 2018-10-04 13:59:19 +01:00
Oliver Blanthorn
2a05a2ffc7
Merge branch 'performance-counters' 2018-10-04 13:25:11 +01:00
Oliver Blanthorn
89b51e8822
Merge pull request #1046 from glacambre/async_completions
commandline_frame.ts: Make completions async again
2018-10-04 13:22:21 +01:00
Oliver Blanthorn
25c8773948
Merge branch 'fix_816' 2018-10-04 13:20:01 +01:00
glacambre
666f9cfc51
Implement {bind,unbind,reset}url 2018-10-04 13:18:12 +01:00
Oliver Blanthorn
c2834ecc19
Merge pull request #1055 from glacambre/improve_guiset
Improve guiset
2018-10-04 12:48:32 +01:00
glacambre
1d8edb5a4b
excmds.ts: Remove profile-finding code in guiset
:guiset implemented a bit of its own profile-finding code (checking for
auto, making sure it's using the right platforms...) which isn't really
necessary since all of these checks (and more!) are already implemented
in Native.getProfileDir().

Closes https://github.com/tridactyl/tridactyl/issues/705.
2018-10-04 12:35:13 +02:00
glacambre
1f3ddce189
css_util.ts: Make findCssRules find rules with more that one selector
findCssRules only took one selector. This became a problem when
f017f74973 changed the hoverlink rule to
match two different selectors. The problem is solved by making
findCssRules accept an array of selectors.

This fixes https://github.com/tridactyl/tridactyl/issues/803 .
2018-10-04 11:48:49 +02:00
Oliver Blanthorn
f014671359
Merge pull request #1054 from antonva/allownewtabfocus
Add new config variable 'newtabfocus'.
2018-10-04 09:46:06 +01:00
glacambre
c4fc5cc8fe
Rename ffargs to ff_cmdline() and remove constraint on profile name
The rename of ffargs to a more sensible ff_cmdline was suggested in
https://github.com/tridactyl/tridactyl/pull/510#discussion_r188589211

The constraint on profile names was that the `find` command tridactyl
ran looked for profiles the name of which contained a dot. While all
profiles generated by firefox contain a dot in their path, users can
easily rename them to something that doesn't contain a dot, provided
that they also modify their profile.ini file.
2018-10-04 10:04:20 +02:00
glacambre
c7c152bc33
excmds.ts: Fix guiset profile not found error being overwritten 2018-10-04 09:28:03 +02:00
Anton Vilhelm Ásgeirsson
521a039ade Change name to 'newtabfocus' and clear up ambiguities in comments. 2018-10-03 23:56:27 +00:00