Commit graph

2282 commits

Author SHA1 Message Date
glacambre
a56c185935
native_main.py: Add ".txt" suffix to temporary file names
Reasons explained in https://github.com/tridactyl/tridactyl/issues/1204

Closes #1204
2018-12-12 07:14:20 +01:00
Fabian Furger
42cdadb97c Fix minor issue with active hint when filtering
Previously, the focussed hint may be unfocussed after it's being hidden,
adding the `TridactylHintElem` class is again which makes it visible.

Also, undo a change to the filter if no hints remain. This is consistent
with the behavior of ignoring keys that wouldn't match any hints.
2018-12-10 16:16:33 +01:00
Fabian Furger
9c01f57f2d Cycle the hint focus through the available hints 2018-12-10 16:16:33 +01:00
Fabian Furger
f505afe880 Add comment about ´vimperator-reflow´ to config
Based on
https://github.com/tridactyl/tridactyl/issues/1028#issuecomment-424473945,
since I was also looking for the difference between the two modes.

Also: fix a typo in my alias :)
2018-12-10 16:16:33 +01:00
Oliver Blanthorn
1577a8e32e
Merge pull request #1225 from glacambre/fix_1223
Fix "tab" alias breaking completions
2018-12-10 08:39:39 +00:00
glacambre
4a6305df47
Fix "tab" alias breaking completions
PR#1183 broke completions for users that had a tab -> buffer alias. This
is because having such an alias created a loop, which made
BufferCompletionSource throw errors when being instanciated, which
resulted in the activeCompletions array not being created.

This is fixed in two ways: first, a config updater is created in order
to remove the alias. Second, completions are instantiated in
try/catchs, which should hopefully prevent a faulty completion source
constructor from breaking every completion source.
2018-12-10 07:00:11 +01:00
Oliver Blanthorn
2e0774df79
Merge branch 'thwart-yellow' 2018-12-08 19:59:43 +00:00
Oliver Blanthorn
2aad15177e
Make updatecheck only fire once per new version 2018-12-08 19:59:21 +00:00
Oliver Blanthorn
84d26ec063
Merge pull request #1221 from glacambre/hint_selectors
excmds.ts: Make hint -c use all given selectors
2018-12-08 12:07:45 +00:00
glacambre
504db0f8c0
excmds.ts: Make hint -c use all given selectors
Before this commit, hint -c would only use the `selectors` parameter in
order to find the elements it needed to add hints to. This was a problem
when using invocations such as `:hint -c a, b`, because `b` would be put
in the rest argument by the excmd parser and `:hint` would end up trying
to use the `a, ` selector alone, which isn't a valid selector and then
would make the whole command fail.

This commit fixes that by making sure `hint -c` uses all available
arguments as selectors.
2018-12-08 05:59:49 +01:00
Oliver Blanthorn
2aa36f7554
Check for updates at start, only nag if it's been a while 2018-12-07 15:40:20 +00:00
Oliver Blanthorn
5857b561b8
Merge pull request #1219 from glacambre/hint_a_priority
hinting.ts: Give higher z-index to <a> hints
2018-12-07 11:46:54 +00:00
glacambre
b501930aa6
hinting.ts: Give higher z-index to <a> hints
Closes #1215.
2018-12-07 06:37:53 +01:00
Oliver Blanthorn
a5ff5ccbca
Add rudimentary version checker 2018-12-07 00:31:16 +00:00
Oliver Blanthorn
27e8ca3701
Merge branch 'urlspecific_noiframe' 2018-12-06 14:47:02 +00:00
Oliver Blanthorn
fb42dad708
Update package-lock 2018-12-06 14:46:52 +00:00
Oliver Blanthorn
c706a6630f
Merge pull request #1216 from glacambre/fix_style
styling.ts: Fix style not being loaded when opening tabs in bg
2018-12-06 09:44:40 +00:00
glacambre
950b149fcc
styling.ts: Fix style not being loaded when opening tabs in bg
By default, insertCSS and removeCSS operate in the active tab. This is a
problem when opening tabs in the background (e.g. with `hint -b`)
because the transformations will be applied to the current tab instead
of the newly opened one.
This commit fixes that.
2018-12-06 07:05:57 +01:00
Oliver Blanthorn
7c7d59ef46
Merge pull request #1213 from glacambre/fix_1209
lib/editor.ts: Make editor functions work on input where type = "email"
2018-12-05 19:37:22 +00:00
arcnmx
2e0a55a4eb
lib/editor.ts: Make editor functions work on input where type = "email"
Before this commit, editor functions that read or modified caret
position in input fields did not work on input fields the type of which
was "email". This was because browsers implement the selectionStart and
selectionEnd attributes only for a few input types.
This problem is fixed by first converting the input field to text,
applying the wanted modifications and then changing the input field's
type back to whatever it was before.

Closes #1209.
2018-12-05 19:24:45 +01:00
Oliver Blanthorn
55aadcb5c7
release 1.14.3 2018-12-04 15:24:43 +00:00
Oliver Blanthorn
435cad413a
Update changelog for 1.14.3 2018-12-04 15:24:24 +00:00
Oliver Blanthorn
3a5e74e518
Merge pull request #1207 from scde/patch-1
Reapply PR #1150 "Only cycle through visible tabs"
2018-12-04 13:57:32 +00:00
scde
9ad3e09c79
Reapply PR #1150 "Only cycle through visible tabs"
It seems the actual change in PR #1150 (a09a771) has been lost in its merge (6562699).

This should now actually fix Issue #1084 and ignore hidden tabs when cycling through tabs.
2018-12-04 12:55:56 +01:00
Oliver Blanthorn
10a6598c32
Merge pull request #1206 from glacambre/fix_1205
Fix 'clipboard yanksel' not working in commandline frame
2018-12-04 10:30:49 +00:00
glacambre
6e1e24b3d3
Fix 'clipboard yanksel' not working in commandline frame
Closes #1205.
2018-12-04 07:12:26 +01:00
Oliver Blanthorn
32568af966
release 1.14.2 2018-12-02 13:49:35 +00:00
Oliver Blanthorn
1aef2ec906
Update changelog for 1.14.2 2018-12-02 13:49:19 +00:00
Milan Vancura
54f78d6b79 Make 'showcmd' feature configurable 2018-11-28 17:29:44 +01:00
Milan Vancura
55aed8e343 Handle key modifiers in showing command prefix 2018-11-28 13:26:09 +01:00
Milan Vancura
634ca26e10 Show the command prefix
For (normal mode) commands invoked by more then one letter, show keys
typed until the command sequence is reached.
2018-11-28 13:26:09 +01:00
Oliver Blanthorn
bc884bf9d6
Merge pull request #1200 from glacambre/move_typedoc_to_tridactyl
Move glacambre/typedoc-default-themes to tridactyl/typedoc-default-theme
2018-11-28 09:49:47 +00:00
glacambre
1f2cff2535
Move glacambre/typedoc-default-themes to tridactyl/typedoc-default-theme 2018-11-28 09:02:56 +01:00
glacambre
2b44d73ac9
Turn noiframeon setting into a site-specific setting
As discussed on riot, turning noiframeon into a site-specific setting
is a good thing for consistency. This commit also adds a deprecation
warning when users try to `:set noiframeon` and updates the
troubleshooting guide.
2018-11-28 07:58:46 +01:00
glacambre
3f6dee0342
commandline_content.ts: Move try/catch out of init() function
The try/catch in init() prevents errors from bubbling up and thus
also prevents the document.addEventListener("DOMContentLoaded", init)
call from being performed. We fix this by removing the try/catch from
init() and adding a new one in the document.addEventListener call.
2018-11-28 07:07:41 +01:00
Oliver Blanthorn
d2e71aaf92
Merge pull request #1198 from glacambre/various_fixes
Various fixes
2018-11-27 19:32:25 +00:00
glacambre
a1d20057f9
config.ts: Fix getURL returning {} for keys that do not exist
https://github.com/tridactyl/tridactyl/pull/1194 introduced a huge bug.
Config.get relies on config.getURL returning undefined when a target
doesn't exist for a url in order to know whether it should return the
default value or not. However, #1194 accidentally made getURL return
empty objects for every target that does not have a url-specific
setting.

This commit fixes that and maybe
https://github.com/tridactyl/tridactyl/issues/1197, although I am not
100% sure.
2018-11-27 19:05:04 +01:00
glacambre
9d11aeaf9b
build.sh: Replace [[ with [
[[ is a bashism and is not defined in posix sh. Since the shebang is
 #!/bin/sh, the build script is executed with posix sh and this caused
error messages to be printed when building.
[[ couldn't just be replaced with [ because [ doesn't allow matching
globs, so a switch/case was used instead.
2018-11-27 18:47:58 +01:00
Oliver Blanthorn
6cd0a1deea
Remove indirect event-stream dependency
See https://github.com/dominictarr/event-stream/issues/116
2018-11-26 19:54:34 +00:00
Oliver Blanthorn
cd2f964136
Merge pull request #1194 from glacambre/fix_1193
config.ts: Fix getURL not merging site-specific config objects
2018-11-26 11:57:05 +00:00
Oliver Blanthorn
cbfcf94c45
Merge pull request #1195 from keegancsmith/mac
scripts: Use different flags for sed and base64 on Mac
2018-11-26 11:54:49 +00:00
Keegan Carruthers-Smith
74a52a61eb scripts: Use different flags for sed and base64 on Mac
sed and base64 have different flags on darwin (and possibly other
BSDs). Alternatively we could encourage the user to install coreutils and use
gsed and gbase64.
2018-11-26 11:45:48 +02:00
glacambre
57afbfedac
config.ts: Fix getURL not merging site-specific config objects
https://github.com/tridactyl/tridactyl/issues/1193 happened because
before this commit, getURL did not merge objects from different
site-specific configs. This means that if a user had the following site
specific configs:

"example": {
        "priority": 1,
        "nmaps": {
                "a": "js alert('')"
        },
}
"example.org": {
        "priority": 2,
        "nmaps": {}
}

A call to config.getURL("example.org", ["nmaps"]) resulted in the empty
object from the "example.org" config being returned and the mappings for
"example" to be ignored. This obviously is not the desired behavior.

This is fixed by mergeDeep()'ing objects found in matching site-specific
configs.

Closes #1193.
2018-11-25 19:06:17 +01:00
glacambre
47c0fcc16a
config.ts: Hide internal functions 2018-11-24 14:01:42 +01:00
glacambre
51b4480b3f
Replace browser.storage.onChanged with config.addChangeListener
This commit replaces the use of browser.storage.onChanged.addListener
with the newly-implemented config.addChangeListener.
2018-11-23 22:42:52 +01:00
glacambre
a1d55df6bc
config.ts: improve addChangeListener handling of objects
This commit prevents triggering of event listeners when values that
aren't set in USERCONFIG are set to the value they have in
default_config.

Also, before this commit, listeners added to setting objects (e.g.
`nmaps`) with addChangeListener would always be triggered, even if the
new object was structurally equivalent to the previous one. This commit
stringifies both object in order to perform comparisons, this prevents
this case from happening.

Note that there's still a problem with the way objects are handled: when
setting the key of an object (e.g. `nmaps.j`), eventListeners set on the
object (`nmaps`) will be triggered even if no user-facing change happens
(e.g. the user set `nmaps.j` to whatever value `nmaps.j` already had in
default_config). This is because the user config is actually the result
of a merge between the default config and their custom config, but the
event listener code performs no such merges for simplicity's sake.
2018-11-23 22:24:14 +01:00
Oliver Blanthorn
abbdd09b70
Fix broken link to tutorial on new tab page 2018-11-23 19:48:52 +00:00
glacambre
ed6f1edb0b
src/lib/config.ts: Implement config.addChangeListener
This commit implements an addChangeListener and a removeChangeListener
function that enable tracking changes to the config in a less error
prone way, as proposed in #1180
2018-11-22 07:38:09 +01:00
Oliver Blanthorn
2a520a3b2a
Merge pull request #1187 from glacambre/singleton_types
Metadata Types: Use a single type instance where it makes sense
2018-11-21 13:06:56 +00:00
glacambre
a808e9e742
Metadata Types: Use a single type instance where it makes sense
One of the possible problems of #1184 (firefox freezing periodically
with Tridactyl enabled) is that Tridactyl uses too much RAM, which could
cause Firefox to attempt to GC it from time to time.
One easy optimisation to try to reduce this problem is to use singletons
for metadata when possible (VoidType, AnyType...).
According to my measurements, this saves the allocation of 933 objects,
which amounted to ~0.03MB. Multiply this by 40 tabs and you get about
1.20MB saved, the space of a whole 1980-era floppy disk.
2018-11-21 06:56:01 +01:00