Simon Lydell [Sat, 24 Oct 2015 15:51:17 +0000 (17:51 +0200)]
Fix `<late>` + `event.stopPropagation()`
If the page calls `event.stopPropagation()`, late listenOnce:es are of course
not triggered for that event. However, the listeners still remain. This caused
them to erraneously trigger commands on the _next_ keypress. This commit adds a
flag telling the late listeners if their event was `.stopPropagation()`:ed.
Simon Lydell [Sat, 24 Oct 2015 12:21:41 +0000 (14:21 +0200)]
Improve the public API consumption
Re-run all `.getAPI` calls when VimFx is updated. Otherwise you need to restart
Firefox, or disable and then enable every add-on that uses the API in order for
them to take effect on the new version.
Simon Lydell [Thu, 22 Oct 2015 17:08:00 +0000 (19:08 +0200)]
Properly handle key events in non-multi-process
This commit can alternatively be lableled:
"Fix `Vim::isFrameEvent`" in in-multi-process.
Before, _no key events were considered frame events non-multi-process, because
the check didn't work there. Most notably, this caused `<escape>` to be leaked
to the page when blurring text inputs.
Simon Lydell [Wed, 21 Oct 2015 16:46:42 +0000 (18:46 +0200)]
Replace a `console.log` in gulpfile.coffee
... with `process.stdout.write`. This means that there is only one `console.log`
occurance in all .coffee files, which makes it easier to search for left-over
temporary `console.log`s.
Simon Lydell [Sun, 18 Oct 2015 18:57:09 +0000 (20:57 +0200)]
Add support for `<late>` shortcuts
By including the special key `<late>` in a shortcut it is run _after_ web page
event listeners, allowing them to override the VimFx shortcut. This is useful
when binding to `<tab>` and the arrow keys.
Simon Lydell [Sat, 17 Oct 2015 22:30:18 +0000 (00:30 +0200)]
Fix documentation link in the readme
It pointed to master, which will be correct when 0.6.0 is released. However,
there are already other links in the readme that point to develop, so we could
just as well make that link work for the time being as well.
Simon Lydell [Sat, 17 Oct 2015 18:52:53 +0000 (20:52 +0200)]
Fix shortcut triggering on slowly loadnig pages
Frame scripts cannot receive events until a DOMWindow has been created in it. If
you opened a link in a new tab, and the page loaded very slowly making it take a
long time before a DOMWindow is created, it meant that no VimFx shortcuts could
used during that time.
The solution is to handle shortcuts in the main process until a DOMWindow has
been created.
Simon Lydell [Sat, 17 Oct 2015 13:35:36 +0000 (15:35 +0200)]
Fix VimFx being broken in new windows
Apparently, the VimFx button only needs to be added once, not once per window.
Trying to add it more than once caused an exception that prevented the rest of
VimFx from being set up.
Simon Lydell [Sun, 11 Oct 2015 16:41:08 +0000 (18:41 +0200)]
Improve keyboard shortcut overriding behavior
- When the feature was initially implemented, it was modeled after putting a
series of `map` commands after each other in .vimrc, which is written in a
procedural programming language. Then it makes sense that latter `map` calls
override earlier ones. That's why VimFx used to let commands further down the
list in VimFx's settings page in the Add-ons Manager override earlier
commands. The more I used it, though, that didn't feel entirely natural. After
a while I realized that in such an interface it makes sense having _earlier_
commands win. With this commit, latter commands _don't_ override earlier ones
anymore, and are ignored, showing an error message.
- The above point also means that editing a shortcut can never result in error
messages appearing _above_ that command. If you add `g` to a shortcut near the
end of the list, there used to appear an error message for every shortcut
starting with `g` above it (which is quite a few), causing dis-orientation
when the focused text box was moved down because of all those error messages.
- With this commit, the order of the modes, categories and commands is taken
into account. That used to work only when the user hadn't customized the
orders or hadn't added new modes, categories and/or commands.
- A small fix for `<force>` is also included. If a shortcut contains invalid
usage of `<force>` it is now properly ignored (still showing an error
message).
Simon Lydell [Sun, 28 Jun 2015 09:57:56 +0000 (11:57 +0200)]
Lay the foundation for using multi-process Firefox
This also fixes leaking of variables in bootstrap.coffee (which masked a missing
`require` call in parse-prefs.coffee). Apparently all modules share its scope,
which I had never realized before.
This also exposes `Cc`, `Ci` and `Cu` globally to all modules (which actually
was done before, too, but only accidentally.)
Simon Lydell [Sat, 29 Aug 2015 21:08:58 +0000 (23:08 +0200)]
Stop URI encoding the API URL pref
The reason we used to was to make it easier to consume the public API (because
it is easier to read an ASCII string pref than a unicode one). However, some
systems return spaces already URI encoded, which breaks when encoding it once
more. In the end, this tiny simplification of the API consumption is not worth
it. Better to simply store the API URL as-is in a complex string pref.
Simon Lydell [Mon, 29 Jun 2015 19:25:39 +0000 (21:25 +0200)]
Remove ability to select text in help dialog
It was added so that you could select text and copy it, but unfortunately
nothing seems to happen when trying to copy. Then its better to leave the text
selection out entirely.