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.
Simon Lydell [Sat, 27 Jun 2015 19:02:22 +0000 (21:02 +0200)]
Change `vf` into `zf` to free up `v`
Using the default shortcuts, `a`, `g`, `y` and `v` are prefix keys. `v` is only
used in `vf`. While `v` in `vf` kind of makes sense if you come from vim, it
would make a lot more sense to use `v` for a possible future text selection mode
(#480). `zf` is better since `z` is a prefix key in vim as well. The `z`
"namespace" will be useful as we add more commands.
Simon Lydell [Sat, 27 Jun 2015 14:02:09 +0000 (16:02 +0200)]
Make hint markers transparent when shift is held
The `vimfx-held-modifiers` attribute is now added on `#main-window`. It is a
space-separated list of the currently held modifiers (alt, ctrl, meta and
shift). This can be used in CSS: `#main-window[vimfx-held-modifiers~="alt"]`.
Simon Lydell [Fri, 26 Jun 2015 22:32:52 +0000 (00:32 +0200)]
Rename Insert mode into Ignore mode
... because that's what it is. Insert mode was a bit confusing since you could
easily think that Insert mode was entered any time you focused a text input. See
also #506.
Simon Lydell [Mon, 22 Jun 2015 19:36:04 +0000 (21:36 +0200)]
Improve the font size in the help dialog
When testing on a different computer I noticed the help dialog text being way
too large. I tried adjusting the CSS, but there was no sweet spot where the font
size was pleasant on both my regular computer and the other one I tried on.
This commits changes the default font size is the same as for menus, which is
usually quite small. It is then increased programmatically until just before a
scrollbar is caused.
Simon Lydell [Thu, 4 Jun 2015 20:22:17 +0000 (22:22 +0200)]
Major refactor: Rework all UI and related improvements
This commit is unfortunately very large. I do not like that, but most of the
things in this commit are very closely related, which made it easier to do it
this way.
Help dialog
===========
- It is no longer used to customize shortcuts. That's done in VimFx's settings
in the Add-ons Manager instead.
- Moved "enjoying/found bug" from the Help dialog and into the readme. The
readme will be used as the extension description on AMO. That description is
also shown in the Add-ons Manager, so users will see it when customizing
VimFx.
- It is no longer injected inside web pages, but in the Firefox chrome. This
allows to get rid of the nasty resets in the CSS and makes it impossible for
page elements to cover it. #477
- It now fills the entire page and adjusts based on your screen size. It is
designed to work with lots of shortcut customization and the additon of new
modes by other extensions.
- Added `gulp help.html` to make it easier to style the help dialog.
Settings UI
===========
- Shortcuts customization is now done in VimFx's settings page in the Add-ons
Manager. This keeps all settings together and makes it obvious that you can
customize the shortcuts. The new UI is also more accessible.
- The new UI also lets you:
- Insert the default value of a pref. This is useful for the "prev/next
patterns" by letting you merge in new defaults into your own customizations.
- Reset to the default value. #262
- Insert the next keypress as text. The default shortcut for this is `<c-q>`.
(q as in quote. vim also has this shortcut, which works like its `<c-v>`.)
For example, if the user is unsure how to express `<c-enter>` (s)he could
simply press `<c-q><c-enter>` and `<c-enter>` would be inserted as text.
Button
======
- Now has high-resolution images. #383
- Is now implemented using CustomizableUI. #303 #349
- Greatly simplified:
- If in normal mode, clicking it opens the help dialog.
- Otherwise it exits the current mode returning to normal mode. This is
useful if the user accidentally removes the keyboard shortcuts to exit
modes, or don't know how to exit insert mode, for example.
The above means that the "disable" feature has been removed. The UI to
"blacklist" sites has been removed as well. See the "Removed/Changed/Addesd
features" section for more info.
- It is now easily stylable with user CSS.
- State is no longer lost when moving a tab into a new window. #57
Removed/Changed/Added features
==============================
- The "disable" feature has been completely removed. It is rather useless
compared to insert mode, and sometimes trips new users up. #327
- The "blacklist" feature has been changed into an "auto-insert-mode" feature.
It is basically the same, except that you can actually choose to leave the
blacklisted state for a while if you feel like it. The default shortcut to
leave insert (`<s-escape>`) is not likely to conflict with page shortcuts.
It is possible to disable the exit shortcut on certain pages using the public
API.
- The "blacklist" feature has been de-emphasized. The button no longer offers
any UI to blacklist and un-blacklist sites (see above). VimFx is supposed to
be keyboard driven, so having a mouse-oriented UI makes no sense. Blacklisting
is also a bit of an anti-feature, so we shouldn't maintain lots of UI code for
it. It's simple enough to just open the Add-ons Manager and add
`*currentdomain.com*` to the blacklist setting.
- The "blacklist" no longer supports the `!` wild card (that matched a single
character) to keep things simple. The less to explain to the user the better.
If users need more advanced wildcards than the simple `*` they can use the
public API (see the Public API section) which allows to use all of
JavaScript's power.
- The "blacklist" no longer supports the `##key1#key2` syntax to disable certain
keys on certain sites. Instead a superior public API function is offered. This
feature only existed in the develop branch for a while and was never released.
Any users of it must manually move to the public API.
- The "prev/next patterns" no longer support the `*` and `!` wildcards. Instead
they are treated as regexes (which allows to use `.*` and `.` instead). This
is way simpler, and more powerful. Non-technical users can just keep adding
simple patterns such as "next" translated into their language without being
troubled by regex syntax, while advanced users can use the full power of regex
if needed. The public API may of course also be used for unlimited power.
- The "blacklist" and "prev/next patterns" are no longer comma/space-separated.
To keep things simple their just space-separated. Space is not a valid URL
character, but a comma is, so this allows to match a URL which ends with a
comma (but that is probably too rare to ever be useful). More importantly it
makes the settings easier to read. Space could be part of a "prev/next
pattern", though. Thanks to the above point one may use `\s` instead, which is
also more robust. The prefs are automatically migrated to the new format.
- The "translations" pref in about:config is no longer used. Instead you have to
use the public API. This is because it is an advanced feature and next to
impossible to manage as a single line of JSON. This also keeps the code
simpler. The pref only existed in the develop branch for a while and was never
released. Any users of it must manually move to the public API.
- Most hard-coded constants have been moved into prefs, which can only be
changed via about:config or the public API. For advanced users only. For
example:
- Pressing `aj` used to trigger the `j` shortcut, but doesn't any longer. Since
there is no `aj` shortcut (by default) nothing happens. The reason that
"feature" used to exist was because there used to be no concept of a timeout.
For example if you pressed `a`, went from the computer for a while, came back
and pressed `/` the `a/` shortcut would be invoked, which is a bit surprising.
Now there is a timeout instead, which defaults to 2 seconds. So if you type
`aj` with less than 2 seconds between the key presses, nothing will happen.
Otherwise the `a` partial match will be cancelled and the `j` command will be
invoked. This is more like vim works.
- The escape command used to be special-cased so that you could trigger it
inside text boxes. Now this is done through the concept of "force keys"
instead. If you add `<force>` at the beginning of a shortcut it will be
available in text boxes as well. #194
Refactoring
===========
- All modes are know implemented the same way. Normal mode used to be
special-cased and all other modes were rather limited.
- Commands and modes are now a lot more DRY.
- defaults.coffee now takes care of command categorization and ordering. It is
essentially the text version of the help dialog. Changing order and/or
categories there automatically affects the help dialog (and the settings UI)
as well.
- The command matching algorithm is now much more simple and flexible.
- Because the help dialog was moved into browser chrome, there is no longer any
need to insert the style sheet as an `AGENT_SHEET`, which made it difficult to
override it with user CSS, for example to change the font size or color of
hint markers. #465 #424 #233 #220
Public API
==========
Added a public API. This will be used by advanced users and by other extensions
that wish to extend VimFx. It allows to:
- Keep all VimFx configuration in a text file (instead of configuring it via
VimFx’s GUI and storing it in Firefox’s prefs system). #245
- Add your own custom commands. #508 #490 #235
- Add site-specific options.
- Disable specific keys on some sites. #255
- Do things when entering pages, such as automatically entering insert mode
(this can be used instead of the "blacklist" feature) or hints mode. #408
- Set some advanced settings that cannot be set any other way.
- Add new command categories.
- Add new modes.
Simon Lydell [Sun, 24 May 2015 14:07:33 +0000 (16:07 +0200)]
Rework custom shortcut prefs
- Defaults are now set for all prefs (including custom shortcuts and advanced
options), not just the options that can be seen in the options UI.
- All command prefs are now named 'mode.<mode>.<command>'. So are the
translation IDs for the commands. This helps to simplify the code.
- Migration from the 0.5.x format and the format used in the devlopment version
up until this commit can now be done once, instead of at every startup and
every shortcut change.
- All old custom shortcut prefs are migrated automatically, using a generalized
migration facility that can be reused for other migrations in the future.
- Some command names were slightly renamed to improve consistency and to make
the more descriptive. The latter is important since regular users are now
expected to be able to read lib/defaults.coffee as documentation on all
default shortcuts.
Simon Lydell [Mon, 15 Jun 2015 19:29:26 +0000 (21:29 +0200)]
Simplify compatible Firefox version management
The only thing that matters is the minimum version, and it is only the major
number of it that matters.
Including a maximum version number is pretty pointless since most of the time
we've just set it to some version in the future without actually knowing if
VimFx works with that version or not. Firefox's release cycle is also so fast
that it is very hard to keep up with it. Finally, AMO automatically bumps the
maximum version if the addon passes their tests. So it is better to simply set
it to `*` and be done with it.
Simon Lydell [Sat, 23 May 2015 21:17:44 +0000 (23:17 +0200)]
Rewrite the README key features / shortcuts parts
This commit merges those parts into one. The complete list of shortcuts has been
removed. As it will only grow, it gets a little overwhelming. It is also a PITA
to maintain. Instead, only some of the most important default shortcuts are
mentioned, more like on the current AMO page, and there's a link to
lib/defaults.coffee in case somebody wants to easily view all defaults before
installing the add-on.
The above makes the readme suitable as the text used on AMO. Therefore I also
updated a few links to make them work on AMO as well.
Simon Lydell [Sat, 23 May 2015 21:11:13 +0000 (23:11 +0200)]
Refactor defaults
- Define all defaults in lib/defaults.coffee, instead of some in
defaults/preferences/defaults.js, some in lib/commands.coffee and some in
lib/modes.coffee.
- Fix saving of non-ascii strings.
- Remove the autofocus limit option from the UI.
- Make the options UI in the Add-ons Manager DRY.
Simon Lydell [Fri, 30 Jan 2015 21:17:45 +0000 (22:17 +0100)]
Make scrolling commands scroll the focused element
Fixes #11. If the currently focused element is scrollable, it is scrolled by the
scrolling commands. Otherwise the whole document is scrolled.
In other words, you may now choose which element to scroll with the 'f' or 'vf'
command, and then you can scroll it with the scroll commands.
Fixes #399. Using counts with scrolling commands now works reliably.
The scrolling commands respect built-in Firefox prefs:
- general.smoothScroll: Turn smooth scrolling on/off for _all_ scrolling
commands.
- general.smoothScroll.lines: h, j, k, l only.
- general.smoothScroll.pages: d, u, <space>, <s-space> only.
- general.smoothScroll.other: gg, G only.
- toolkit.scrollbox.horizontalScrollDistance: Scroll step for h, l.
- toolkit.scrollbox.verticalScrollDistance: Scroll step for j, k.
The two last prefs replace the scroll step setting.
A bunch of new (hidden) prefs let you customize the smooth scrolling, in the
same spirit as the built-in `general.smoothScroll.<type>.duration{Min,Max}MS`.
They're called `smoothScroll.<type>.spring-constant` and work like
`layout.css.scroll-behavior.spring-constant`.
This commit also bumps the minimum Firefox version to 36, since
`Element.prototype.scroll{To,By}` are used and first available in that version.
Simon Lydell [Thu, 14 May 2015 17:57:48 +0000 (19:57 +0200)]
Split CONTRIBUTING.md into two files and improve them
CONTRIBUTING.md now only contains issue reporting instructions, to make it look
less overwhelming.
CONTRIBUTING-CODE.md contains the rest. Added information about the current
state of development, about the upcoming 0.6.0 release and the future rapid
release cycle plans.