]> git.gir.st - VimFx.git/log
VimFx.git
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 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

8 years agoFix commit 241c9bf5 in a better way
Simon Lydell [Sun, 21 Feb 2016 15:30:57 +0000 (16:30 +0100)]
Fix commit 241c9bf5 in a better way

Mentioned commit attempted to fix a problem where `vim.mode` could be
`undefined` in some `vimfx.on(...)` listeners. The button uses such an event
listener, and uses `vim.mode` in the key for a `translate(key)` call, which
caused `translate` to throw an error. This was because `vim.mode` wasn't set
until after a timeout. The fix was to emit the events after the same timeout.

However, the above solution is very unreliable, and the problem still slipped
through every now and then.

The reason the first timeout was added in the first place was to allow calling
`vimfx.getCurrentVim()` inside `vimfx.on(...)` listeners. This commit removes
both timeouts, while still preserving that behavior by splitting the contructor
of `Vim` into a new method, `._start`. This should be bullet-proof, less hacky
and faster.

8 years agoAdd partial support for the wasavi extension
Simon Lydell [Sun, 21 Feb 2016 14:05:49 +0000 (15:05 +0100)]
Add partial support for the wasavi extension

It's editor is now recognized as an editable element, but pressing `<escape>` in
its insert mode still blurs the editor instead of exiting its insert mode.
(`<escape>`) should ideally only blur in wasavi's normal mode.

See #532.

8 years agoTake fixed headers into account when scrolling by pages
Simon Lydell [Sun, 21 Feb 2016 13:58:36 +0000 (14:58 +0100)]
Take fixed headers into account when scrolling by pages

Just like the standard Firefox `<space>` shortcut. Also takes fixed footers into
account. Fixes #698.

8 years agoFix a `z-index` bug for markers with the same hint
Simon Lydell [Sat, 20 Feb 2016 08:35:11 +0000 (09:35 +0100)]
Fix a `z-index` bug for markers with the same hint

Regression since commit 1176cde8.

- `element.style.zIndex`: Always string.
- `element.style.zIndex = value`: Turns `value` into a string.
- `a = '5'; a++`: `a` is now `6`.
- `element.style.zIndex++`: If the previous value was `'5'`, the new value is
  `'6'`. This method was used before above commit.
- `element.style.zIndex += 1`: If the previous value was `'5'`, the new value is
  `'51'`. This was introduced by above commit.

The above really shows that you should always be explicit about types. Since
`element.style.zIndex` is always a string, `element.style.zIndex++` was a
terrible hack that happened to work, but caused a bug when it was rewritten to
a seemingly equivalent expression.

This commit first reads the `z-index` of the element and explicitly makes it a
`Number`, allowing incrementing to work as expected.

8 years agoMerge pull request #697 from strel/master
Simon Lydell [Sat, 20 Feb 2016 07:37:41 +0000 (08:37 +0100)]
Merge pull request #697 from strel/master

Add es locale

8 years agoAdd es locale
strel [Sat, 20 Feb 2016 07:33:36 +0000 (08:33 +0100)]
Add es locale

8 years agoFix typo in the en-US locale
Simon Lydell [Sat, 20 Feb 2016 07:23:12 +0000 (08:23 +0100)]
Fix typo in the en-US locale

8 years agoMerge branch 'master' into develop
Simon Lydell [Fri, 19 Feb 2016 18:27:01 +0000 (19:27 +0100)]
Merge branch 'master' into develop

Conflicts:
extension/lib/api.coffee
extension/lib/commands.coffee
extension/lib/main-frame.coffee
extension/lib/main.coffee
extension/lib/message-manager.coffee
extension/test/index.coffee
extension/test/test-api.coffee

8 years agoMerge branch 'lint'
Simon Lydell [Fri, 19 Feb 2016 18:17:10 +0000 (19:17 +0100)]
Merge branch 'lint'

8 years agoUpdate code style guidelines
Simon Lydell [Fri, 19 Feb 2016 18:06:26 +0000 (19:06 +0100)]
Update code style guidelines

8 years agoReplace `when ... then` with multliners
Simon Lydell [Fri, 19 Feb 2016 08:33:55 +0000 (09:33 +0100)]
Replace `when ... then` with multliners

For the sake of smaller diffs, simpler merges and consistency.

8 years agoReduce unnecessary vertical code alignment
Simon Lydell [Fri, 19 Feb 2016 06:55:41 +0000 (07:55 +0100)]
Reduce unnecessary vertical code alignment

While it may look nice many times, it causes annoying merge conflicts.
Especially aligning all `require(...)` calls has bitten me many times, since
adding or removing one often requires reformatting the entire block.

This commit attempts to remove vertical alignment (especially around `=`) for
the sake of smaller diffs and simpler merges.

Vertical alignment has been kept, though, where it really makes the code easier
to read and you're likely to edit all of the aligned lines anyway if changing
one of them. The most common example is code dealing with X and Y coordinates
and having to do the same thing to both of them. Only the words X, Y, left,
right, top, bottom, width, height etc. differ between the lines. It's easier to
see that they are really up-to-date with each other if the common parts are
aligned.

8 years agoEnable the `colon_assignment_spacing` CoffeeLint rule
Simon Lydell [Fri, 19 Feb 2016 06:39:21 +0000 (07:39 +0100)]
Enable the `colon_assignment_spacing` CoffeeLint rule

Exceptions are made for the DSL in defaults.coffee and migrations.coffee.

8 years agoWork around a CoffeeLint bug
Simon Lydell [Fri, 19 Feb 2016 08:37:55 +0000 (09:37 +0100)]
Work around a CoffeeLint bug

A `no_implicit_braces` false positive.

8 years agoEnable the `no_implicit_braces` CoffeeLint rule
Simon Lydell [Fri, 19 Feb 2016 06:53:18 +0000 (07:53 +0100)]
Enable the `no_implicit_braces` CoffeeLint rule

Exceptions are made for the DSL in defaults.coffee and migrations.coffee.

8 years agoEnable the `no_plusplus` CoffeeLint rule
Simon Lydell [Fri, 19 Feb 2016 06:54:18 +0000 (07:54 +0100)]
Enable the `no_plusplus` CoffeeLint rule

8 years agoEnable the `newlines_after_classes` CoffeeLint rule
Simon Lydell [Fri, 19 Feb 2016 06:41:18 +0000 (07:41 +0100)]
Enable the `newlines_after_classes` CoffeeLint rule

8 years agoTweak issue templates
Simon Lydell [Thu, 18 Feb 2016 17:02:31 +0000 (18:02 +0100)]
Tweak issue templates

8 years agoReplace CONTRIBUTING.md with issue template
Simon Lydell [Thu, 18 Feb 2016 08:35:55 +0000 (09:35 +0100)]
Replace CONTRIBUTING.md with issue template

8 years agoTweak code contribution documentation
Simon Lydell [Thu, 18 Feb 2016 08:34:50 +0000 (09:34 +0100)]
Tweak code contribution documentation

8 years agoRework programmatic customization of VimFx
Simon Lydell [Thu, 28 Jan 2016 21:05:54 +0000 (22:05 +0100)]
Rework programmatic customization of VimFx

- The public API has been removed. While the idea of allowing other extensions
  to extend VimFx is neat, I don't think it'll ever be used. KISS. As a
  replacement, the config files have become more top-notch.

- The former public API is now the config file API.

- Config files are no longer regular add-ons. We used to provide a boilerplate
  for such an add-on, which consisted of a bunch of files users most likely
  wouldn't touch as well as `config.js` and `frame.js`. Now, the concept of
  `config.js` and `frame.js` has been kept, but they are loaded directly, if the
  path to their parent directory is given in the `config_file_directory` pref.
  This is much easier and simpler, and does not require the user to install a
  version of Firefox with the ability to install unsign add-ons (or having to go
  through the hassle of actually signing the "config file add-on").

- `zr` reloads the config file(s). This is possible because of the above point
  and is much nicer than having to restart Firefox every time you change your
  config (or setting up something like the Extension Auto-Installer).

- `vimfx.send(...)` and `vimfx.listen(...)` have been added, to make it easier
  to create custom commands that interact with web page content, which is quite
  common. These are basically `messageManager.send` and `messageManager.listen`.
  To make the API simpler, instead of passing the name of the callback message
  to listeners and having to do `messageManager.send(callback, data)` to respond
  to a message, a real callback _function_ is now passed instead, which does the
  message sending behind the scenes. This also resulted in some nice code
  cleanup overall.

- `vimfx.off(...)` has been added, to remove `vimfx.on(...)` listeners. This is
  mostly used internally. Since `zr` allows reloading the config file,
  everything in it must be undoable.

- By loading `frame.js` directly, it is now possible to pass a real API to it,
  rather than relying on `VimFx*` properties on the global frame script object.

- The new, "real" frame script API now has tests. This involved adding support
  for running tests in frame scripts.

Fixes #682.

8 years agoImprove error messages for l10n.coffee
Simon Lydell [Tue, 16 Feb 2016 06:54:00 +0000 (07:54 +0100)]
Improve error messages for l10n.coffee

8 years agoFix `vim.mode` being `undefined` in 'modeDisplayChange'
Simon Lydell [Sun, 14 Feb 2016 07:28:12 +0000 (08:28 +0100)]
Fix `vim.mode` being `undefined` in 'modeDisplayChange'

8 years agoFix uncaught exception after dragging tabs between windows
Simon Lydell [Sun, 14 Feb 2016 07:15:56 +0000 (08:15 +0100)]
Fix uncaught exception after dragging tabs between windows

8 years agoDocument a NoScript bug
Simon Lydell [Sat, 13 Feb 2016 20:37:25 +0000 (21:37 +0100)]
Document a NoScript bug

Closes #588.

8 years agoImprove and add more documentation
Simon Lydell [Sat, 6 Feb 2016 16:52:18 +0000 (17:52 +0100)]
Improve and add more documentation

- Improved wording and consistency.
- Add short summaries of each section in the table of contents.
- Document how to install VimFx. Fixes #686.
- Document modes.
- Don't refer to the "Public API" anymore, but the "config file API". It is no
  longer intended to be used by other add-ons. (The plan is to load config files
  in a different way in the future.)

8 years agoImprove CONTRIBUTING.md
Simon Lydell [Sat, 6 Feb 2016 17:22:42 +0000 (18:22 +0100)]
Improve CONTRIBUTING.md

- Remove "Use English". That's understood since the bug template is in English.
- Put the instruction about bugs at the top.
- Make the paragraph about the changelog a bullet point. It makes the
  instructions look shorter. Since the "Use English" bullet point was removed,
  the list does not look too long either.
- Move the "Contributing code?" link off to the right to get it out of the way.
- Use fewer words in a few places. The less to read the better.

Also: Link to CONTRIBUTING.md instead of directly to the issue tracker in the
readme, to increase the chance of people actually reading it. Therefore a "Go to
the issue tracker" link was added in CONTRIBUTING.md (it goes to the issues
list, not a new issue, to increase the chance of people looking for duplicates).

8 years agoApply the blacklist faster on some pages
Simon Lydell [Sat, 6 Feb 2016 16:30:41 +0000 (17:30 +0100)]
Apply the blacklist faster on some pages

Fixes #688.

8 years agoVimFx v0.12.0 v0.12.0
Simon Lydell [Wed, 3 Feb 2016 17:26:43 +0000 (18:26 +0100)]
VimFx v0.12.0

8 years agoMake the `H` and `L` commands more reliable
Simon Lydell [Wed, 3 Feb 2016 17:11:33 +0000 (18:11 +0100)]
Make the `H` and `L` commands more reliable

It seems like using `window.BrowserBack()` and `window.BrowserForward()` are the
most reliable ways of navigating the history, rather than having to wait for
`SessionStore.getSessionHistory()` to finish and then going to a certain history
index. This commit optimizes the case where the count is 1 to use the mentioned
functions instead. Some extensions also override those, so calling them results
in better interoperability.

(Hopefully/Likely) fixes #687.

To keep the code changes simple, the support for Firefox < 43 was dropped.
That's fine, since Firefox 44 has already been released.

8 years agoSilence `addons-linter` warnings
Simon Lydell [Fri, 29 Jan 2016 08:16:32 +0000 (09:16 +0100)]
Silence `addons-linter` warnings

8 years agoMerge branch 'master' into develop
Simon Lydell [Fri, 29 Jan 2016 07:51:28 +0000 (08:51 +0100)]
Merge branch 'master' into develop

8 years agoAdd `npm run addons-linter`
Simon Lydell [Fri, 29 Jan 2016 07:50:58 +0000 (08:50 +0100)]
Add `npm run addons-linter`

8 years agos/Keyboard layout/Keyboard language/ in CONTRIBUTING.md
Simon Lydell [Thu, 28 Jan 2016 19:12:31 +0000 (20:12 +0100)]
s/Keyboard layout/Keyboard language/ in CONTRIBUTING.md

It's really the language (en-US, en-UK, sv-SE, de, ru, etc.) of the keyboard
that is relevant. (Many of those examples are variations of QWERTY.)

8 years agoConvert most of CONTRIBUTING.md into copy-paste template
Simon Lydell [Wed, 27 Jan 2016 06:59:10 +0000 (07:59 +0100)]
Convert most of CONTRIBUTING.md into copy-paste template

8 years agoRecognize Codeacademy terminals as text inputs
Simon Lydell [Wed, 27 Jan 2016 06:40:42 +0000 (07:40 +0100)]
Recognize Codeacademy terminals as text inputs

Fixes #680.

8 years agoAdd handy links to location bar docs
Simon Lydell [Wed, 27 Jan 2016 06:26:44 +0000 (07:26 +0100)]
Add handy links to location bar docs

Related: #540.

8 years agoUse async messaging in bootstrap.coffee
Simon Lydell [Tue, 26 Jan 2016 21:50:10 +0000 (22:50 +0100)]
Use async messaging in bootstrap.coffee

The initial message from new frame scripts is now async. This is possible since
commit bd00a85e0. Other than following the recommendation to avoid sync
messaging whenever possible, this fixes #679 and fixes #624.

8 years agoUse explicit `return`s in message-manager.coffee
Simon Lydell [Tue, 26 Jan 2016 21:24:17 +0000 (22:24 +0100)]
Use explicit `return`s in message-manager.coffee

8 years agoUpdate copyright notices
Simon Lydell [Tue, 26 Jan 2016 19:17:12 +0000 (20:17 +0100)]
Update copyright notices

8 years agoConsistently name the help dialog is user-facing code
Simon Lydell [Tue, 26 Jan 2016 18:50:04 +0000 (19:50 +0100)]
Consistently name the help dialog is user-facing code

Always call it the "Keyboard Shortcuts help dialog".

8 years agoUse strings instead of functions in the `modes` object
Simon Lydell [Tue, 26 Jan 2016 18:41:38 +0000 (19:41 +0100)]
Use strings instead of functions in the `modes` object

Since we run things properly in the `startup()` function of bootstrap.js since
last commit, the `chrome://` URI to the string bundles is now available when the
`modes` object is constructed. This means that there's no need anymore to let
mode names, category names and command descriptions be functions. Instead they
can be the sane thing: Simply strings.

Note that this is a backwards incompatible change. Luckily it does not affect
the `.addCommand()` API method, so propably won't impact anyone.

8 years agoUse `chrome://` URIs for `require()` calls
Simon Lydell [Tue, 26 Jan 2016 18:15:05 +0000 (19:15 +0100)]
Use `chrome://` URIs for `require()` calls

Apparently, `chrome://` URIs registered in chrome.manifest cannot be used in
bootstrap.js until its `startup()` function is called. Therefore this commit
reorganizes the code of bootstrap.coffee a bit, so that actual work is done
inside `startup()` (where it is supposed to be, after all). Outside of that
function we now mostly simply declare variables that the `shutdown()` function
needs to access as well. Some things were moved into main.coffee as well.

- Using `chrome://` URIs is the way add-ons are "supposed" to do it.
- If a `require()` call fails, we now get much shorter URIs in the error
  message, making things easier to debug.
- This allows to get rid of the hack of sending `__SCRIPT_URI_SPEC__` to frame
  scripts.

8 years agoImprove CPU usage in Hints mode
Simon Lydell [Tue, 26 Jan 2016 07:31:39 +0000 (08:31 +0100)]
Improve CPU usage in Hints mode

Raising the "check for marker element movements" interval from 0 to 15 results
in no noticeable CPU usage change on my system, while still allowing markers to
move smoothly. Setting it to 20 results in noticeable stutter.

This commit also add the `hints_sleep` pref to control the interval, or disable
the feature altogether.

Additionally, the interval now doesn't run at all for the `zF` command.
Previously, it ran as usual, but didn't do anything (as marker movement isn't
supported (YAGNI) for the `zF` command).

Fixes #678.

8 years agoFix missing hint markers for tabs on caniuse.com
Simon Lydell [Mon, 25 Jan 2016 17:57:16 +0000 (18:57 +0100)]
Fix missing hint markers for tabs on caniuse.com

The "feature" tabs for a specific feature on caniuse.com look like this:

    ___________ ___________
    |         :\|         :\
    |  Tab 1  :+\  Tab 2  : \
    |_________:__\________:__\

The "real" tab elements are the rectangles to the left of the dotted vertical
lines. The triangle parts are made using the `::before` or `::after`
pseudo-elements of the tabs.

When calling `.elementFromPoint()` on a pseudo-element, its parent element is
returned. But calling `.getBoundingClientRect()` on the parent element returns a
rectangle only around the the parent element, excluding the pseudo-element.

Because of the pseudo-elements overlap the next tab, the second tab is
considered covered by the first tab.

Previously, a point to the right of the first tab would then be tried. But since
the pseudo-element isn't included in `.getBoundingClientRect()` that would mean
the point marked with a `+`, which is actually to the _left_ of the original
point, not to the right! That obviously didn't work.

With this commit, if the "try-right point" is to the left of the initial point
and the covering element and the queried element are in the same frame, the
point is tried again but this time forcing the element to be considered located
at that point, solving the issue.

Using pseudo-elements to create non-rectangular tabs is quite common, so this
will help on other sites as well.

8 years agoAdd tips about the menu key and access keys
Simon Lydell [Sun, 24 Jan 2016 18:54:45 +0000 (19:54 +0100)]
Add tips about the menu key and access keys

8 years agoFix the empty notification for the `gH` command
Simon Lydell [Sun, 24 Jan 2016 18:42:12 +0000 (19:42 +0100)]
Fix the empty notification for the `gH` command

Imprint / Impressum