aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/commands.coffee
AgeCommit message (Collapse)Author
2017-04-17Regenerate help page data when key bindings are updatedmrmr1993
2016-12-11Better wording fo command description.Stephen Blott
2016-12-11Add the raw option list to the command registry.Stephen Blott
Keep the option list (in addition to the parsed command options) because some commands may depend upon the command option order. One currect example is #2318.
2016-12-11Ensure that we get the last for a key.Stephen Blott
(Because we're scanning backwards throught the mappings, we shouldn't overwrite an existing mapping.)
2016-12-11Remove Utils.nextTick() to fix tests.Stephen Blott
2016-12-11Rework help-dialog HTML.Stephen Blott
Previously, the dynamic HTML for the help dialog was generated on the background page. The HTML itself was tangled in with program logic. Here, we move all of the HTML to HTML5 templates; also, we build the help-dialog contents in the help dialog itself, not on the background page. Note: #2368 is included here too. (Background: I'm trying to clean up some of the command and help-dialog logic in preparation for addressing the issue of how to document command options, see #2319.)
2016-12-11Rework key-mapping parsing.Stephen Blott
There are two changes here: 1. Treat built-in key mappings and custom key mappings in the same way; that is, we prepend the built-in mappings to the custom mappings and then parse them all together. This results in a number of simplifications due to previous duplication of logic and the elimination of special cases. 2. Parse key mappings in reverse order, so we can just ignore key mappings after first encountering a key sequence. So, `map`, `unmap` and `unmapAll` are all treated in more or less the same way. This is preparatory to reworking some aspects of the help page. In particular, regardless of the order of maps, unmaps, etc., this approach makes it easier to find the mapping in effect for a key sequence (and be able to recreate the order of those mappings).
2016-10-23Better line parsing (simplified).Stephen Blott
2016-10-17Better line parsing.Stephen Blott
1. Explicitly remove comments. 2. A trailing backslash means the current line continues on the next line. E.g. a \ b \ c is a single line `a b c`. This helps alleviate the fact that configuration lines can be very long, whereas the *Custom key mappings* input is quite narrow. TODO: We should use the same line parser in the custom-search-engines input.
2016-10-10Rename 'translate' to 'mapkey'.Stephen Blott
2016-10-09Add translate command for key mappings.Stephen Blott
Under *Custom key mappings* (on the options page), this implements: translate x y Whenever the users types `x` in normal mode or in visual mode, the `x` is replaced by `y`. For example: map ç l (which apparently would be helpful on Brazilian keyboards). Issues: - Do we want yet another hack like this? This would be documented only on the wiki. - If we allowed `translate <c-c> <c-[>` (and extended `isEscape()` to use the translation), then we'd get the `exitMode` command for free (#2253). - Alternatively, instead of adding a new "command" called `translate`, we could overload the existing `map` command. Since these are single-key mappings, there's no ambiguity. (Although, I guess there's a risk some user has junk in their key mappings and would be taken by surprise). Inspired by isssue posted by @vhoyer (#2305). Fixes #2305.
2016-10-09Remove description from registry entry for key-state mapping.Stephen Blott
We do not need the registryEntry's decription in the content scripts, so remove it (saving a marginal amount of memory and time).
2016-10-08Refactor (and fix) key-parsing regexp.Stephen Blott
Fixes #2299. Also, separate this regexp out into its constituent parts, because it is becoming too different to read.
2016-10-02Tweak logging.Stephen Blott
2016-10-02Better regexp (to match legacy behaviour for '<c->>'.Stephen Blott
2016-10-02Single quotes are clearer here.Stephen Blott
2016-10-02Rename normalizeKey to parseKeySequence.Stephen Blott
The new name better describes which the function does.
2016-10-02Add comment giving example key parsing.Stephen Blott
2016-10-02Rework key-sequence parsing.Stephen Blott
This reworks the parsing of key sequences like `<c-a-Z>x`: Advantages over the status quo: - Parses key sequences in one only place (previously two), - Removes two hideous regular expression. - Admits multi-modifier bindings (like `<c-a-Z>`). - Adds more (and better) tests. - (And it should be easier to maintain.) Replaces #2210 (this also simplifies key parsing substantially).
2016-09-24Tweak #2269 (toggleMuteTab).Stephen Blott
2016-09-23New feature/command: Mute/unmute tab.Tobias Gläßer
2016-08-18support mapping <backspace>gdh1995
Chrome stop using <backspace> to go back, but some still wants this feature. This should fix #2207 and #2214.
2016-05-15Handle <space> in the same way as other special keys.Stephen Blott
2016-04-26Help dialog; consistent ordering of commands.Stephen Blott
It reads weird on the helpd dialog if we don't put the full-page and half-page commands in a similar order.
2016-04-26Help dialog; re-order and tweak command descriptions.Stephen Blott
- Re-order commands such that we keep like with like, and have the more important commands nearer the top. - Re-word some command descriptions such that we use the same words for the the same thing consistently. - Move "View Source" to the "Miscellaneous" category. - Make some commands "advanced commands".
2016-04-17Make showHelp a top-frame command.Stephen Blott
Replaces #2037.
2016-04-17Make showHelp not a background command.Stephen Blott
2016-03-26Simplify expression.Stephen Blott
2016-03-26Move command to correct spot.Stephen Blott
This command (LinkHints.activateModeToCopyLinkUrl) has been in the wrong spot for quite some time. This just moves it to be with the other link-hints commands.
2016-03-26passCountToCommand isn't needed.Stephen Blott
We pass the count to *all* front-end commands. All of the commands which don't use a count, just ignore it.
2016-03-26Pass count to find commands.Stephen Blott
With this change, now *every* front-end command either accepts a count argument, or or it doesn't accept a count at all.
2016-03-26Fix inappropriate variable name.Stephen Blott
"description" is the first element here, not all elements. So "descriptor" is a better name.
2016-03-26Uniform treatment of request for all background commands.Stephen Blott
2016-03-17Logging; move logMessage to BgUtils."Stephen Blott
2016-03-09Fix mainFrame command...Stephen Blott
Oversight from #2022.
2016-03-05Generalise topFrame commands.Stephen Blott
This generalises the mechanism by which commands are always run in the tab's main/top frame. Currently, that's just the Vomnibar. This is a precursor to moving other UI components to the main/top frame. It should be fairly trivial to move the help page to the main frame. The HUD might be trickier. Mention: @mrmr1993.
2016-03-05Simplify command-registry generation.Stephen Blott
If we just use the name `background` instead of `isBackgroundCommand`, then we can simplify the building of registry entries. This is preparitory to adding a new registryEntry field: topFrame; initially just for the Vomnibar, but thereafter for other UI components.
2016-03-05Key bindings; document Commands.generateKeyStateMapping().Stephen Blott
2016-03-05Key bindings; and one more tiny tweak.Stephen Blott
2016-03-05Key bindings; move Vomnibar commands back to content scripts.Stephen Blott
2016-03-05Key bindings; small tweaks...Stephen Blott
- simplify pass key condition - don't keep key-parsing Regexp in memory - we should reset the key state when the pass keys change
2016-03-05Key bindings; tweaks.Stephen Blott
2016-03-05Key bindings; and yet more minor tweaks.Stephen Blott
2016-03-05Key bindings; minor tweaks.Stephen Blott
2016-03-05Key bindings; reinstate keyToCommandRegistry.Stephen Blott
... We need it for the help page.
2016-03-05Key bindings; simplify Commands initialization.Stephen Blott
2016-03-05Key bindings; more tweaks and fixes.Stephen Blott
- There's no need to keep `@keyToCommandRegistry`; it's regenerated whenever it's needed.
2016-03-05Key bindings; handle overlapping bindingsStephen Blott
With: map g something map gg somethingElse The mapping for "g" always takes priority, regardless of the order in which they're encountered in `@keyToCommandRegistry`.
2016-03-05Key bindings; tweaks and fixes.Stephen Blott
2016-03-05Key bindings; rewire vomnibar (fix minor error).Stephen Blott