]> git.gir.st - VimFx.git/log
VimFx.git
8 years agoAdd Caret mode
Simon Lydell [Tue, 19 Apr 2016 18:27:08 +0000 (19:27 +0100)]
Add Caret mode

Fixes #480.

8 years agoImprove "open link in new tab" interoperability
Simon Lydell [Sun, 24 Apr 2016 10:01:52 +0000 (12:01 +0200)]
Improve "open link in new tab" interoperability

When opening a link in a new tab, such as when using the `F` or `gf` commands,
we now try to closely mimic what Firefox does when you click links using the
mouse, instead of directly using `gBrowser.loadOneTab(url, options)`.

This provides interoperability with the BackTrack Tab History add-on, which
fixes #720, and allows to remove Tree Style Tab-specific code.

8 years agoMove viewport calculations from hints.coffee to utils.coffee
Simon Lydell [Tue, 19 Apr 2016 18:16:40 +0000 (20:16 +0200)]
Move viewport calculations from hints.coffee to utils.coffee

It's cleaner and more reusable.

This also fixes a slight bug for markers in frames. Previously, if the frame had
padding and/or borders its calculated viewport was a tiny bit too large. Now,
padding and borders are taken into account.

8 years agoChange `<c-a>` to `<c-enter>` in Hints mode
Simon Lydell [Mon, 18 Apr 2016 19:22:38 +0000 (21:22 +0200)]
Change `<c-a>` to `<c-enter>` in Hints mode

Using `<c-a>` for marking _all_ elements was nice, because `<c-a>` usually means
"select all". However, it conflicts with the "hold ctrl when typing the last
hint character to toggle if the link opens in a new tab or not" feature. If the
last character was an "a" that wouldn't happen; instead, the `<c-a>` command
would be invoked. This commit changes to `<c-enter>` which should be conflict
free.

8 years agoAdd the `<c-a>` Hints mode command to mark everything
Simon Lydell [Sun, 17 Apr 2016 12:41:08 +0000 (14:41 +0200)]
Add the `<c-a>` Hints mode command to mark everything

8 years agoFix argument order of an `isInsideViewport` call
Simon Lydell [Thu, 14 Apr 2016 16:56:49 +0000 (18:56 +0200)]
Fix argument order of an `isInsideViewport` call

8 years agoRemove horizontal alignment in multiline function calls
Simon Lydell [Wed, 13 Apr 2016 15:10:56 +0000 (17:10 +0200)]
Remove horizontal alignment in multiline function calls

This is to reduce unnecessary diffs and to be able to use search-and-replace to
rename things without having to worry about fixing alignment.

8 years agoFix `__dirname` in config files on Windows
Simon Lydell [Mon, 11 Apr 2016 06:59:10 +0000 (08:59 +0200)]
Fix `__dirname` in config files on Windows

`OS.Path.dirname` does not seem to support `file://` URIs on Windows.
`OS.Path.dirname('file:///C:/Users/foo/.vimfx/config.js')` returns `'file:'`.

This commit calculates the dirname in a different way to work around the above
problem.

Thanks to @azuwis for finding out and suggesting a fix.

Supersedes and closes #719.

8 years agoRemove unnecessary full-page hint marker on Hackernews
Simon Lydell [Sat, 9 Apr 2016 13:50:09 +0000 (15:50 +0200)]
Remove unnecessary full-page hint marker on Hackernews

8 years agoVimFx v0.13.2 v0.13.2
Simon Lydell [Fri, 8 Apr 2016 17:11:04 +0000 (19:11 +0200)]
VimFx v0.13.2

8 years agoFix illogical code order in scrolling commands
Simon Lydell [Wed, 6 Apr 2016 15:53:42 +0000 (17:53 +0200)]
Fix illogical code order in scrolling commands

Logically, one should set the `last_position_mark` mark _before_ jumping
somwhere. However, for the `G`, `g`, `$` and `0` commands, the message to set it
was sent _after_ the message to scroll was sent!

Somehow it has still worked as intended for me.

This commit reverses the order.

This might fix #717.

8 years agoAllow `<space>` to toggle play/pause in more video players
Simon Lydell [Wed, 6 Apr 2016 06:47:51 +0000 (08:47 +0200)]
Allow `<space>` to toggle play/pause in more video players

8 years agoFix wrong viewport size for hints in quirks mode
Simon Lydell [Sun, 3 Apr 2016 16:18:17 +0000 (18:18 +0200)]
Fix wrong viewport size for hints in quirks mode

8 years agoUpdate devDependencies
Simon Lydell [Sun, 3 Apr 2016 09:43:11 +0000 (11:43 +0200)]
Update devDependencies

8 years agoFix lint error
Simon Lydell [Sun, 3 Apr 2016 09:38:08 +0000 (11:38 +0200)]
Fix lint error

8 years agoRemove unnecessary `return` in commands.coffee
Simon Lydell [Sun, 3 Apr 2016 09:37:40 +0000 (11:37 +0200)]
Remove unnecessary `return` in commands.coffee

8 years agoVimFx v0.13.1 v0.13.1
Simon Lydell [Fri, 1 Apr 2016 16:28:12 +0000 (18:28 +0200)]
VimFx v0.13.1

8 years agoImprove automatic mode switching on page load
Simon Lydell [Fri, 1 Apr 2016 14:30:08 +0000 (16:30 +0200)]
Improve automatic mode switching on page load

Previously, Normal mode was _always_ entered on location change (page load)
(unless the page is blacklisted; then Ignore mode is entered instead). There
were to reasons for this: Handling the blacklist, and auto-exiting hints mode
(because hints left over from another page does not make sense in a new page).
However, this caused a few problems:

- If you used the `zF` command while a page was loading, the markers would
  disappear when the page fired the "location change" event.
- There was an ugly special case for Find mode, making sure not to enter Normal
  mode if currently in Find mode (see commit fc7e61e7c).
- Sometimes, you can enter Hints mode on a newly loaded page just before the
  page fires the "location change" event, making hints annoyingly disappear.

This commit changes two things:

- Hints mode is automatically exited (by returning to Normal mode) on the
  'pagehide' event instead.
- The current mode is only changed on location change _if needed._ That is, to
  auto-exit Ignore mode after navigating away from a blacklisted page, or
  auto-enter Ignore mode on blacklisted pages.

8 years agoClear artificial hover on blur
Simon Lydell [Fri, 1 Apr 2016 05:44:09 +0000 (07:44 +0200)]
Clear artificial hover on blur

Previously, if you focused an element using an `f` command and then pressed
`<tab>` to focus the next element, or if the element was automatically blurred,
the element would still look hovered until you pressed `<escape>`. This is
because many `f` commands lock the `:hover` pseudo-class on their target
element. This commit unlocks that pseudo-class if that element blurs, preventing
elements from getting "stuck". It is only done if the element itself is blurred,
not if anything else is. That's to make sure that dropdown menus opened using
`zf` don't close unexpectedly.

8 years agoFix blacklisting of some XUL pages
Simon Lydell [Mon, 28 Mar 2016 14:39:06 +0000 (16:39 +0200)]
Fix blacklisting of some XUL pages

Fixes #716.

8 years agoMerge pull request #714 from mozillazg/zh-CN
Simon Lydell [Sun, 20 Mar 2016 15:02:45 +0000 (16:02 +0100)]
Merge pull request #714 from mozillazg/zh-CN

Update zh-CN locale

8 years agoUpdate zh-CN locale
mozillazg [Sun, 20 Mar 2016 14:45:04 +0000 (22:45 +0800)]
Update zh-CN locale

8 years agoVimFx v0.13.0 v0.13.0
Simon Lydell [Sat, 19 Mar 2016 10:55:03 +0000 (11:55 +0100)]
VimFx v0.13.0

8 years agoUpdate addons-linter
Simon Lydell [Sat, 19 Mar 2016 10:22:31 +0000 (11:22 +0100)]
Update addons-linter

8 years agoMerge branch 'master' into develop
Simon Lydell [Sat, 19 Mar 2016 10:14:22 +0000 (11:14 +0100)]
Merge branch 'master' into develop

8 years agoFix broken link in tools.md
Simon Lydell [Sat, 19 Mar 2016 10:10:02 +0000 (11:10 +0100)]
Fix broken link in tools.md

8 years agoDrop support for Firefox < 45
Simon Lydell [Sat, 19 Mar 2016 09:39:34 +0000 (10:39 +0100)]
Drop support for Firefox < 45

8 years agoDon't set the width of the button in CSS
Simon Lydell [Sat, 19 Mar 2016 08:54:38 +0000 (09:54 +0100)]
Don't set the width of the button in CSS

It is not needed since bug 1208715 was fixed, which was released in Firefox 44.
See #708, #702 and #591.

8 years agoFix text input focus issues in non-multi-process
Simon Lydell [Wed, 16 Mar 2016 18:26:07 +0000 (19:26 +0100)]
Fix text input focus issues in non-multi-process

Sometimes when focusing text inputs, it wouldn't really be focused and VimFx
wouldn't recognize it as editable. This was because of commit 33d1fdeb, where I
somehow looked for the 'context' attribute instead of the 'contextmenu'
attribute.

8 years agoUpdate copyright years
Simon Lydell [Sun, 13 Mar 2016 14:13:19 +0000 (15:13 +0100)]
Update copyright years

8 years agoFix Find mode being exited on location change
Simon Lydell [Sun, 13 Mar 2016 13:00:20 +0000 (14:00 +0100)]
Fix Find mode being exited on location change

Fixes #710.

8 years agoDisallow old version of VimFx to communicate with new version
Simon Lydell [Sun, 13 Mar 2016 11:55:49 +0000 (12:55 +0100)]
Disallow old version of VimFx to communicate with new version

Commit 865fdaba attempted to fix an issue where frame script message listeners
from the old version of VimFx wasn't shut down properly when VimFx was updated.

Since then, the problem has become very rare, but unfortunately still happens
occasionally. I really have no idea why it can still happen. It might even be
that there's nothing that can be done due to the way Firefox works.

This commit tries to make any leftover frame script message listeners useless,
by adding the `BUILD_TIME` in all message names.

8 years agoAdd a preprocessor to simplify builds
Simon Lydell [Sun, 13 Mar 2016 11:54:10 +0000 (12:54 +0100)]
Add a preprocessor to simplify builds

8 years agoDon't modify the global, shared scope in frame scripts
Simon Lydell [Sun, 13 Mar 2016 10:37:41 +0000 (11:37 +0100)]
Don't modify the global, shared scope in frame scripts

8 years agoShow notification when entering Marks mode
Simon Lydell [Sun, 13 Mar 2016 08:49:39 +0000 (09:49 +0100)]
Show notification when entering Marks mode

8 years agoConsistently name the translation ID for the `yy` notification
Simon Lydell [Sun, 13 Mar 2016 08:28:51 +0000 (09:28 +0100)]
Consistently name the translation ID for the `yy` notification

8 years agoAdd notification for the `O` command when no search bar
Simon Lydell [Sun, 13 Mar 2016 08:26:38 +0000 (09:26 +0100)]
Add notification for the `O` command when no search bar

8 years agoSimplify and improve Find mode auto-enter and -exit
Simon Lydell [Sun, 13 Mar 2016 08:13:31 +0000 (09:13 +0100)]
Simplify and improve Find mode auto-enter and -exit

In rare circumstances I've found that if you enter Find mode (via the `/`
command) very quickly after just having opened a new foreground tab which loads
a bit slowly, you could sometimes end up with the findbar focused but still in
Normal mode. This should no longer happen.

8 years agoSet correct focusType on startup
Simon Lydell [Sun, 13 Mar 2016 07:46:12 +0000 (08:46 +0100)]
Set correct focusType on startup

8 years agoTweak the issue template
Simon Lydell [Sun, 13 Mar 2016 07:15:51 +0000 (08:15 +0100)]
Tweak the issue template

8 years agoMake the button greyed out in Find mode
Simon Lydell [Sun, 13 Mar 2016 07:05:59 +0000 (08:05 +0100)]
Make the button greyed out in Find mode

8 years agoFix toolbar button icon size in high dpi
Simon Lydell [Sat, 12 Mar 2016 13:58:14 +0000 (14:58 +0100)]
Fix toolbar button icon size in high dpi

Fixes #708 and #702. See also #591.

Thanks to @Hexcles for coming up with the solution and @dwhinham for testing.

8 years agoRecognize text inputs in `about:preferences` dialogs as editable
Simon Lydell [Sat, 12 Mar 2016 12:34:19 +0000 (13:34 +0100)]
Recognize text inputs in `about:preferences` dialogs as editable

For example, the search field in Privacy > Show cookies.

8 years agoUnify `f` in XUL with `zF`
Simon Lydell [Wed, 9 Mar 2016 09:32:14 +0000 (10:32 +0100)]
Unify `f` in XUL with `zF`

`zF` filters out some elements, based on specific XUL knowledge. This brings
those filters to `f`, for use in for example `about:preferences`.

8 years agoAlways trigger only 'mousedown' events on XUL tab elements
Simon Lydell [Wed, 9 Mar 2016 09:20:16 +0000 (10:20 +0100)]
Always trigger only 'mousedown' events on XUL tab elements

Previously, this was only done for the main browser tabs. It appears that the
same treatment is needed for `<tab>`s in `about:preferences`.

8 years agoMake `gi` work in `about:config`
Simon Lydell [Wed, 9 Mar 2016 08:55:08 +0000 (09:55 +0100)]
Make `gi` work in `about:config`

8 years agogulp: Simplify updating all locales with new wording
Simon Lydell [Wed, 9 Mar 2016 07:28:14 +0000 (08:28 +0100)]
gulp: Simplify updating all locales with new wording

8 years agoClarify the blacklist option
Simon Lydell [Wed, 9 Mar 2016 06:43:55 +0000 (07:43 +0100)]
Clarify the blacklist option

- Improve wording in the Add-ons Manager. Explicitly say that the list is space
  separated, since several users had problems with that.
- Add default example blacklist patterns. It's much easier to adapt an example
  than to write something from scratch (or copy-paste). The default patterns are
  for example.com and example.org which are reserved for documentation purposes,
  so it doesn't matter that those get blacklisted by default.

See #704.

8 years agoUpdate es locale
Simon Lydell [Wed, 9 Mar 2016 06:45:50 +0000 (07:45 +0100)]
Update es locale

8 years agoFix uncaught error when using VimFx to disable VimFx
Simon Lydell [Mon, 7 Mar 2016 16:39:06 +0000 (17:39 +0100)]
Fix uncaught error when using VimFx to disable VimFx

8 years agoFix "cannot access dead object" uncaught error on shutdown
Simon Lydell [Mon, 7 Mar 2016 16:36:53 +0000 (17:36 +0100)]
Fix "cannot access dead object" uncaught error on shutdown

8 years agoMerge branch 'master' into develop
Simon Lydell [Mon, 7 Mar 2016 14:54:14 +0000 (15:54 +0100)]
Merge branch 'master' into develop

8 years agoFix loading of `frame.js` on startup
Simon Lydell [Mon, 7 Mar 2016 09:39:27 +0000 (10:39 +0100)]
Fix loading of `frame.js` on startup

8 years agoImprove click simulation
Simon Lydell [Mon, 7 Mar 2016 08:14:28 +0000 (09:14 +0100)]
Improve click simulation

- Don't leak 'command' events to web pages. They're only needed for XUL.
- Don't generate 'mousedown' and 'mouseup' when simlating clicks for browser UI
  elements. They seem to sometimes trigger some buttons' actions twice. It also
  caused background tabs to be selected before closed when clicking on their
  close button, which caused the selected tab to change. However, an exception
  had to be made for tabs. 'mousedown' seems to be the only relevant event
  there.

8 years agoAdd the `T` command to open tab after current
Simon Lydell [Mon, 7 Mar 2016 06:49:34 +0000 (07:49 +0100)]
Add the `T` command to open tab after current

I finally found a way to do it reliably. See #300 and #386.

8 years agoFix crash when showing the help dialog
Simon Lydell [Mon, 7 Mar 2016 06:53:29 +0000 (07:53 +0100)]
Fix crash when showing the help dialog

Regression since commit 8f9c8550.

8 years agoAdd `__dirname` to config file scope
Simon Lydell [Sun, 6 Mar 2016 19:42:04 +0000 (20:42 +0100)]
Add `__dirname` to config file scope

Inspired by Node.js' `__dirname` variable. This lets you more easily import
files relative to the config file.

(There's no need to add Node.js' `__filename`, because the config files are
always named `config.js` and `frame.js`.)

8 years agoImprove `Cu.import`s
Simon Lydell [Sun, 6 Mar 2016 19:35:25 +0000 (20:35 +0100)]
Improve `Cu.import`s

- Fixed two cases where things were accidentally imported into the global scope.
- Consistenly prefer the explicit `{a, b} = Cu.import('...', {})` style, rather
  than the implicit import-all-into-global-scope `Cu.import('...')` style.

8 years agoTurn `anyPopupsOpen` into a class method for readability
Simon Lydell [Sat, 5 Mar 2016 18:54:38 +0000 (19:54 +0100)]
Turn `anyPopupsOpen` into a class method for readability

8 years agoLet `gL` deal with unvisited tabs instead of unread ones
Simon Lydell [Sat, 5 Mar 2016 14:33:32 +0000 (15:33 +0100)]
Let `gL` deal with unvisited tabs instead of unread ones

Firefox considers a tab to be "unread" if it finishes loading in the background.
This means that if the current tab is loading, but very slowly, and you
therefore switch to another tab while waiting for it to finish, you can't use
`gl` to go back to the slowly-loading tab when it's done, because then it would
be marked as "unread", forcing you to use `gL` instead. This often tripped me
up.

This commit uses the notion of "unvisited" instead of "unread". This works much
better.

8 years agoFix `gi` after searching issues on github
Simon Lydell [Sat, 5 Mar 2016 12:59:01 +0000 (13:59 +0100)]
Fix `gi` after searching issues on github

After searching for issues on github, the search input gets removed from the DOM
and replaced with a new one. This means that the last focused text input is no
longer on the page, but `gi` still tried to focus it. This commit checks that
the last focused element really is present in the DOM first.

8 years agoFix focusType after searching issues on github
Simon Lydell [Sat, 5 Mar 2016 12:29:52 +0000 (13:29 +0100)]
Fix focusType after searching issues on github

When searching for issues on github, the results are fetched with AJAX and then
inserted into the page. More accurately, the fetched content _replaces_ already
existing content on the page, including the search input. It turns out that
neither 'focus' nor 'blur' events are fired when a focused text input is removed
from the DOM (even though that actually blurs it and focuses `<body>`). This
caused VimFx to believe that the text input was still focused, which meant that
you had to press `<escape>` before you could use any VimFx commands. Using a
`MutationObserver`, this commit temporarily observes the currently focused
element (unless `focusType == 'none'`, because that's unnecessary and might
degrade performance). If the element gets removed, the current `focusType` is
updated, fixing the problem.

To check if an element gets removed from the DOM requires observing the _entire_
document tree, recursively. The `utils.onRemoved` function did (wrongly) not do
that, so it had to be updated.

Because of the update to `utils.onRemoved`, this commit also removes the
`MutationObserver`s for scrollable elements. The reason they were added in the
first place was to try to reduce memory consumption by pruning the list of
scrollable elements from elements removed from the DOM. However, the observers
were buggy: They were only triggered if _only_ the scrollable element was
removed, not if one of its parents were removed. Since this "buggy" behavior has
been used for quite some time now and it hasn't caused any memory problems, one
can draw the conclusion that the observers are not needed. That's good, because
it means that there's no need to add observers for the entire document on
basically _every_ page.

8 years agoRecognize text inputs in the sidebar as editable
Simon Lydell [Sat, 5 Mar 2016 09:37:46 +0000 (10:37 +0100)]
Recognize text inputs in the sidebar as editable

For example, the search field in the history sidebar.

8 years agoMerge pull request #701 from pluser/localize_ja
Simon Lydell [Mon, 29 Feb 2016 17:32:02 +0000 (18:32 +0100)]
Merge pull request #701 from pluser/localize_ja

Update Japanese translation

8 years agoUpdate Japanese translation
Kaoru Esashika [Mon, 29 Feb 2016 17:14:58 +0000 (02:14 +0900)]
Update Japanese translation

8 years agoHarden the `f` commands
Simon Lydell [Mon, 29 Feb 2016 12:50:48 +0000 (13:50 +0100)]
Harden the `f` commands

It sucks that you can't trust the DOM. It sucks that on rare occasions, pressing
`f` shows no hints, but still enters Hints mode, leaving a
“element.href.startsWith is not a function” (or similar) error in the browser
console.

This commit tries to harden against such cases, by never trusting DOM properties
or methods to exist and be of the correct type. CoffeeScripts `?` is awesome for
this.

8 years agoStreamline `vimfx.on` events
Simon Lydell [Sun, 28 Feb 2016 15:55:23 +0000 (16:55 +0100)]
Streamline `vimfx.on` events

_Always_ pass an object with event-specific properties, instead of sometimes
passing data directly. This is more consistent, and more future-proof since it
allows passing additional data without breaking backwards compatibility.

8 years agoSimplify the `config_file_directory` pref
Simon Lydell [Sun, 28 Feb 2016 15:24:41 +0000 (16:24 +0100)]
Simplify the `config_file_directory` pref

- Set it to a normal system path, and let Firefox add `file://` and handle
  Windows paths.
- Expand path starting with `~/` or `~\` to the user's home directory.

Closes #700.

8 years agoFix mutation errors in some `f` commands
Simon Lydell [Sat, 27 Feb 2016 16:39:30 +0000 (17:39 +0100)]
Fix mutation errors in some `f` commands

For example, `2f` is supposed to open the first link in a new background tab and
the second link in the current tab. However, both were opened in background tabs
due to accidental mutation.

8 years agoImprove `npm run addons-linter`
Simon Lydell [Sat, 27 Feb 2016 16:18:19 +0000 (17:18 +0100)]
Improve `npm run addons-linter`

8 years agoRevert "Work around a CoffeeLint bug"
Simon Lydell [Sat, 27 Feb 2016 16:15:13 +0000 (17:15 +0100)]
Revert "Work around a CoffeeLint bug"

This reverts commit 0f280108c6a7bd84027c663abb34c4a03fefb091.

This is no longer needed since the bug has been fixed in CoffeeLint.

8 years agoUpdate devDependencies
Simon Lydell [Sat, 27 Feb 2016 16:15:09 +0000 (17:15 +0100)]
Update devDependencies

8 years agoUpdate vim-like-key-notation to 1.0.0
Simon Lydell [Sat, 27 Feb 2016 16:05:03 +0000 (17:05 +0100)]
Update vim-like-key-notation to 1.0.0

8 years agoFix typo in comment in events.coffee
Simon Lydell [Fri, 26 Feb 2016 16:47:03 +0000 (17:47 +0100)]
Fix typo in comment in events.coffee

8 years agoOnly allow `<late>` in single-key shortcuts
Simon Lydell [Fri, 26 Feb 2016 14:17:42 +0000 (15:17 +0100)]
Only allow `<late>` in single-key shortcuts

Previously, it was allowed in any shortcut sequence, but it only made a
difference for the last character. It really only makes sense to use `<late>`
with singe-key shortcuts.

8 years agoAvoid sending a synchronous message on every keydown
Simon Lydell [Fri, 26 Feb 2016 13:54:54 +0000 (14:54 +0100)]
Avoid sending a synchronous message on every keydown

8 years agoUse `prefs.get` directly in events-frame.coffee
Simon Lydell [Fri, 26 Feb 2016 13:31:33 +0000 (14:31 +0100)]
Use `prefs.get` directly in events-frame.coffee

... instead of using `messageManager.get`. This avoids synchronous messages,
which is a good thing. It violates the nice principle of only using the parsed
options of the `vimfx` object, but it doesn't really matter right now since only
four prefs are used in events-frame.coffee and they need little to none parsing.
One could probably pass the entire `vimfx.options` object down to frame scripts
when they start up and send updates whenever it updates, but let's do that when
a need for it comes up.

8 years agoUse `vim.options` instead of `prefs.get` in commands.coffee
Simon Lydell [Fri, 26 Feb 2016 13:11:00 +0000 (14:11 +0100)]
Use `vim.options` instead of `prefs.get` in commands.coffee

8 years agoUse `@options` instead of `@_parent.options` in vim.coffee
Simon Lydell [Fri, 26 Feb 2016 13:07:08 +0000 (14:07 +0100)]
Use `@options` instead of `@_parent.options` in vim.coffee

8 years agoUpdate tests to the new `vimfx.consumeKeyEvent` signature
Simon Lydell [Fri, 26 Feb 2016 12:59:18 +0000 (13:59 +0100)]
Update tests to the new `vimfx.consumeKeyEvent` signature

8 years agoHandle non-late keys on the UI layer
Simon Lydell [Fri, 26 Feb 2016 12:35:40 +0000 (13:35 +0100)]
Handle non-late keys on the UI layer

This is simpler and should be more robust. This is possible since we no longer
check get the focusType on each keydown.

8 years agoSimplify handling of `uiEvent` in events.coffee
Simon Lydell [Fri, 26 Feb 2016 12:18:56 +0000 (13:18 +0100)]
Simplify handling of `uiEvent` in events.coffee

8 years agoFix activatable and adjustable keys handling
Simon Lydell [Fri, 26 Feb 2016 12:14:30 +0000 (13:14 +0100)]
Fix activatable and adjustable keys handling

Regression since commit da8b3ccb.

8 years agoSave the focusType instead of getting it on every keydown
Simon Lydell [Fri, 26 Feb 2016 08:55:14 +0000 (09:55 +0100)]
Save the focusType instead of getting it on every keydown

This is simpler and more efficient. Also, we were basically already storing the
current focusType, since the button uses it to grey out when a text is focused.

Config API changes:

- `match` objects no longer have a `focus` property. It has been replaced with
  the `likelyConflict` property. (Theoretically a breaking change.)
- `vim.focusType` is now available and contains the current focus type.
- The `focusTypeChange` event now passes only the current `vim` object to
  listeners, instead of an object of data. Use `vim.focusType` to get the new
  focusType. (Theoretically a breaking change.)

8 years agoFix count for the `I` command
Simon Lydell [Wed, 24 Feb 2016 15:26:52 +0000 (16:26 +0100)]
Fix count for the `I` command

Silly mistake from commit 1176cde8.

8 years agoFix yet some uncaught errors on shutdown
Simon Lydell [Wed, 24 Feb 2016 14:41:58 +0000 (15:41 +0100)]
Fix yet some uncaught errors on shutdown

8 years agoFix "args.messageManager.sendAsyncMessage is no a function" errors
Simon Lydell [Wed, 24 Feb 2016 14:37:44 +0000 (15:37 +0100)]
Fix "args.messageManager.sendAsyncMessage is no a function" errors

A continuation of commit 14d46629.

8 years agoAllow to temporarily enter Ignore mode based on focusType
Simon Lydell [Wed, 24 Feb 2016 14:32:45 +0000 (15:32 +0100)]
Allow to temporarily enter Ignore mode based on focusType

Currently supports the wasavi extension and CodeMirror's Vim mode.

Fixes #532.

8 years agoImprove commit e0ae646e
Simon Lydell [Wed, 24 Feb 2016 12:40:22 +0000 (13:40 +0100)]
Improve commit e0ae646e

> Fix "invokeListener is not a function" uncaught errors

The commit indeed solved the above problem, but apparently replaced it with
another. When `invokeListener` has been `null`ed out, a copy of it can try to
reference things that also have been `null`ed out. So instead of storing copies
of it, we now check if the function exists before calling it. Otherwise, simply
do nothing. This commit also applies this to _all_ places `invokeListener` is
used.

8 years agoImprove Ignore mode and the blacklist
Simon Lydell [Wed, 24 Feb 2016 12:29:13 +0000 (13:29 +0100)]
Improve Ignore mode and the blacklist

When you reloaded the page or visited some other page in the same time while in
Ignore mode, you'd always end up in Normal mode (unless the newly loaded page
was blacklisted). Now, you stay in Ignore mode in that case. This lets you press
`i` and browse around in that tab in Ignore mode, without having to press `i`
again any time a full page reload is caused.

However, if Ignore mode was entered automatically because of the blacklist, it
is also exited as expected if you browse to a non-blacklisted page.

This new behavior is possible by tracking the "type" of the Ignore mode. There
are currently two types, 'explicit' and 'blacklist', which correspond to the
above two cases.

8 years agoImprove blacklist documentation
Simon Lydell [Wed, 24 Feb 2016 12:25:12 +0000 (13:25 +0100)]
Improve blacklist documentation

8 years agoFix issues when updating VimFx
Simon Lydell [Wed, 24 Feb 2016 07:03:39 +0000 (08:03 +0100)]
Fix issues when updating VimFx

After having updated VimFx, trying to use the `f` command on toggle buttons
often failed. This was because the frame script message listeners from the old
version wasn't shut down properly, which resulted in there being _two_ listeners
for the message to simulate a click on an element. The effects of this was
especially noticeable on toggle buttons, because clicking a toggle button twice
is a no-op. That gave the impression of VimFx failing to simulate a click at
all.

I think this erraneous shutdown behavior must have been introduced in commit
24b701e9, which switched from a synchronous message passing to an asynchronous
one in bootstrap.coffee. Previously, the shutdown message listener for frame
scripts had to be added after a timeout. Since mentioned commit, that timeout is
added in the response callback for the mentioned asynchronous message, which
should make the timeout unnecessary, but the timeout was still kept in that
commit. It shouldn't matter, but somehow it does. Removing the timeout fixes the
double message listeners problem, and does not seem to re-introduce the problems
that were fixed be adding the timeout in the first place (commit ec3a4394).

8 years agoFix "invokeListener is not a function" uncaught errors
Simon Lydell [Wed, 24 Feb 2016 07:40:23 +0000 (08:40 +0100)]
Fix "invokeListener is not a function" uncaught errors

8 years agoFix `@popupPassThrough` for menus in frames
Simon Lydell [Tue, 23 Feb 2016 08:13:46 +0000 (09:13 +0100)]
Fix `@popupPassThrough` for menus in frames

When a menu, such as a context menu is open, VimFx is automatically disabled to
allow using the access keys of the open menu, as well as pressing `<escape>` to
close the menu. However, this used not to work for the context menus in the
devtools and in about:config. Now it does.

This also fixes a bug where VimFx stopped being automatically disabled after
closing a sub-menu of a context menu.

8 years agoTreat everything in the devtools as adjustable
Simon Lydell [Tue, 23 Feb 2016 07:54:42 +0000 (08:54 +0100)]
Treat everything in the devtools as adjustable

Many things in the devtools can be "adjusted" with the arrow keys. For example,
if you `console.log` an object you can click it to get an interactive inspection
tree of that object. The tree can be navigated using the arrow keys, but not if
you, for example, use the arrow keys for VimFx's scrolling commands. With this
commit, that is no longer a problem.

8 years agoAdd better hints support for CodeMirror
Simon Lydell [Tue, 23 Feb 2016 07:40:42 +0000 (08:40 +0100)]
Add better hints support for CodeMirror

8 years agoConsider multimedia elements as adjustable
Simon Lydell [Tue, 23 Feb 2016 06:23:39 +0000 (07:23 +0100)]
Consider multimedia elements as adjustable

`<video>`, `<audio>`, `<embed>` and `<object>`. This allows pressing `<space>`
to toggle between play and pause, for instance.

This also allows to get rid of the check for fullscreen elements. That's good,
because _any_ element can be fullscreened, not just `<video>` elements.

8 years agoReplace element `instanceof` checks with `.localName`
Simon Lydell [Sun, 21 Feb 2016 14:35:12 +0000 (15:35 +0100)]
Replace element `instanceof` checks with `.localName`

KISS.

Note: `instanceof` checks are still often useful for XUL elements, because some
interfaces are extended by several elements.

Also note that `.localName` is used instead of `.nodeName` because many XUL
pages embed HTML elements. When mixing namespaces like that, the `.nodeName`s of
HTML elements will start with `html:`, while `.localName` skips the prefix.
`.localName` also nicely always returns valid HTML node names in lowercase.

8 years agoSplit `gl` into `gl` and `gL`
Simon Lydell [Mon, 22 Feb 2016 18:29:26 +0000 (19:29 +0100)]
Split `gl` into `gl` and `gL`

`gl` selects the most recent tab. Simple, right? But what if you open a
background tab? Which is the most recent tab now? Or if you open several
background tabs?

Previously, if you opened several background tabs and then pressed `gl`, the
last opened new background tab would be selected. That behavior just happened to
be.

In my opinion, it is more consistent if `gl` always selects the last _visited_
tab. An unread background tab has _not_ been visited (yet). This commit makes
this change.

If there is only one visited tab (but possibly several unread tabs), a
notification is shown telling that there is no most recent tab.

The `gL` command selects the oldest unread tab. This is useful when having
opened a bunch of background tabs. `gL` then lets you step them through in the
order you opened them. (If there are no unread tabs, a notification is shown.)

In other words, `gl` deals with _visited_ tabs only (from now on), while `gL`
deals with _unread_ tabs only.

The motivation for this commit came from piroor/treestyletab#874.

8 years agoClean up the es locale
Simon Lydell [Sun, 21 Feb 2016 20:08:23 +0000 (21:08 +0100)]
Clean up the es locale

Imprint / Impressum