Simon Lydell [Wed, 11 Nov 2015 06:51:49 +0000 (07:51 +0100)]
Allow to use numbers as shortcuts, overriding counts
... properly handling the special-case for `0`:
- `0J` is _not_ a count, because a count of zero makes no sense. It first
invokes the `0` command, and then the `J` command.
- `20J` _is_ a count, repeating twenty times. In other words, pressing `2` and
then `0` does _not_ run the `0` command (scroll to the far left) with a count
of two. Instead, it sets the waiting count to twenty.
Simon Lydell [Tue, 10 Nov 2015 18:27:20 +0000 (19:27 +0100)]
Add migration to add `<force>` to `mode.normal.esc`
We already migrate old shortcut customizations to the new 0.6.0 format. However,
I forgot that if the user had customized the shortcut for the esc command, it
most likely needs `<force>` at the beginning as well.
This commit adds `<force>` to every shortcut for that command (if needed).
Ideally this should have been done already in the 0.6.0 release. Now we run the
tiny risk of adding `<force>` to a shortcut that the user actually intended not
to have `<force>` in, but it's worth it: See #577, #571, #582 and #583.
Simon Lydell [Mon, 9 Nov 2015 18:01:39 +0000 (19:01 +0100)]
Silence AMO `Function` warnings
The AMO validator thinks that if `Function` appears anywhere, it is a type of
`eval`. However, we use it to access `Function.prototype.call`. This commit
replaces the `Function` occurances with other methods in order to silence those
warnings.
Commit c1bc315c tried to simplify the compatible Firefox version management by
using `*` as the maximum version. However, that is not allowed when uploading to
AMO.
Simon Lydell [Wed, 4 Nov 2015 16:27:51 +0000 (17:27 +0100)]
Make it possible to blur scrollable elements
Scrollable elements _are_ focusable (both by using `<tab>` and by using VimFx's
`f` commands), but they aren't marked as such by the browser. In order to
interfere as little as possible, VimFx only blurs elements marked as focusable.
This made it impossible to blur scrollable elements, preventing you from
scrolling the entire page again. This commits now also allows scrollable
elements to blurred as a special-case.
Simon Lydell [Tue, 3 Nov 2015 18:46:49 +0000 (19:46 +0100)]
Fix global variable leaks in frame scripts
Apparently, frame scripts for the same `<browser>` but from different add-ons
share the same scope. Previously, bootstrap.coffee used to set up a few global
variables. However, those were then leaked to other add-ons in frame scripts.
Now they are explicitly set in the `scope` of each `require`d module instead.
Simon Lydell [Thu, 29 Oct 2015 07:52:24 +0000 (08:52 +0100)]
Play nicer with the dev tools
- Previously, events that occured in the dev tools were erraneously marked as
frame events, which made it impossible to blur the dev tools using VimFx.
- Improved Escape key handling: Blurring the dev tools using the Escape key no
longer toggles the split console.
Simon Lydell [Wed, 28 Oct 2015 17:53:38 +0000 (18:53 +0100)]
Make hints mode more robust
- Revive `hints.removeHints()`. While looking for an element that happens to
have the VimFx container ID and removing it perhaps is not very elegant, it is
very robust. If the reference to the hints container is ever lost (bugs
inevitably slip through, or if `gulp` is run while in hints mode), unremovable
hints are left on the screen.
- Enter hints mode _immediately_ when invoking one of the `f` commands. Hints
mode used to be entered first when the frame script had found all markable
elements. Remember that communicating with a frame script is asynchronous, and
that finding all markable elements may take time. In that time span, user key
presses should be handled in hints mode, not in normal mode.
Simon Lydell [Tue, 27 Oct 2015 06:25:34 +0000 (07:25 +0100)]
Use the red icon for ignore mode (for the button)
Simply mkaing it grayscale didn't stand out enough. I had a hard time seeing the
difference sometimes. Besides, it's a shame having that beautiful red version
lying around but not being used.
Simon Lydell [Mon, 26 Oct 2015 19:09:18 +0000 (20:09 +0100)]
Optimize the API
- Before, if an add-on called `vimfx.set()` around 200 times it could delay
Firefox's startup time with almost a second. Now there's no delay at all.
- Marks internal variables in public.coffee with a leading underscore. There's
nothing stopping people from importing them, but no they at least look
private.
- Remove `vimfx.refresh()`. That is done automatically now, in an efficient way.
- This also makes the test's teardown more robust.
Simon Lydell [Mon, 26 Oct 2015 06:37:49 +0000 (07:37 +0100)]
Fix broken setting of the API URL pref
Accidentally broken in commit 33ed14df. I hadn't noticed before, since the
correct pref still remained in my profiles. Testing in a new profile revealed
the error.
Simon Lydell [Sun, 25 Oct 2015 17:44:33 +0000 (18:44 +0100)]
Increase hackability of the help dialog
Provide `data-mode`, `data-category` and `data-command` attributes, that can be
used by custom CSS to, for example, hide unwanted modes, categories and/or
commands from the dialog.
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.