aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/commands.coffee
AgeCommit message (Collapse)Author
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
2016-03-05Key bindings; rewire vomnibar.Stephen Blott
2016-03-05Key bindings; remove legacy code.Stephen Blott
2016-03-05Key bindings; initial partially-functioning version.Stephen Blott
2016-02-28Fix defualt command "options".Stephen Blott
The default (for when no options are provided) is of the wrong type. This works as is, but should really be fixed -- as here.
2016-02-28Pass to count to scroll commands.Stephen Blott
Currently, `10j` keeping `j` held down scrolls quickly for a time then reduces back the regular hold-`j` scroll speed. Therefore, the user cannot use a count to influence the smooth-scrolling scroll speed. This PR fixes that by passing the count to the scroll functions. Consequently, we adjust the actual scroll amount (which affects the scroll speed) rather than calling the scroll commands several times (which doesn't).
2016-02-21Include count command option in repeat limit.Stephen Blott
We need to multiply by `count=N` *before* checking `repeatLimit`. Tweaks #2001.
2016-02-21Merge branch 'rework-duplicateTab'Stephen Blott
Conflicts: background_scripts/commands.coffee
2016-02-21Merge pull request #2006 from smblott-github/fix-removeTabStephen Blott
Fix `<count>removeTab`.
2016-02-21Rework count command option initialisation.Stephen Blott
Previously: map J scrollDown count=NotANumber would break the command completely. Fixes an error introduced in #2001.
2016-02-20Rework the `duplicateTab` implementation...Stephen Blott
Specifically, avoid reliance on `chrome.tabs.onSelectionChanged`. If we merge this and #2006, then we can delete all of the `chrome.tabs.onSelectionChanged` code.
2016-02-20Fix bug in #2001.Stephen Blott
We were incorrectly setting `options.count` to `NaN` if there was no command option.
2016-02-20Fix `<count>removeTab`.Stephen Blott
There's a nasty little bug in `removeTab` when you remove more tabs than there are in the window (and there is a second window): - all of the tabs in the currently-focused window are removed - then, later (so, time passes), when you change tab in the other window, we begin removing tabs again! The source of the bug is our reliance on `chrome.tabs.onSelectionChanged`, which doesn't first when removing the last tab in a window (and there is another window). Regardless, the previous semantics of `<count>removeTab` was questionable. It was preactically impossible to predict which tabs would removed. This picks the current tab, then those to the right of the current tab, then those to the left.
2016-02-20Merge pull request #2003 from smblott-github/count-for-new-windowStephen Blott
Make `moveToNewWindow` accept a count.
2016-02-20Simplify command-option parsing.Stephen Blott
2016-02-20moveToNewWindow accepts a count.Stephen Blott
This make `moveToNewWindow` accept a count. For example, `3W` to move three tabs to (the same) new window. The tabs chosen are the current tab, then those to the right of the current tab, and then those to the left of the current tab. `999W` moves *all* tabs to a new window. It's not clear why you would want to do that. An alternative would be to leave the last tab behind.
2016-02-20Add `count` command option.Stephen Blott
Examples: map j scrollDown count=10 map q removeTab count=999
2016-02-20Refactor command-option parsing.Stephen Blott
When we introduced command options (for mapping keys to custom-search engines), the parsing was done in the Vomnibar code. This moves the parsing to `commands.coffee`, which is where it should always have been. This is a preliminary step with a view to adding a new `count` command option.
2016-02-18PassNextKey; exclude single-character mappings.Stephen Blott
Consider: map q passNextKey This works fine in normal mode. However, in insert mode, when the user types "q" they expect "q" to be input. Any other behaviour would be pretty weird. Here, we filter out such mappings before the front end sees them. So, with: map q passNextKey map <c-]> passNextKey both mappings work in normal mode, but only the second works in insert mode. This is probably the behaviour likely to cause least user confusion.
2016-02-18PassNextKey; allow multiple mappings.Stephen Blott
This allows: map a passNextKey map b passNextKey (Previously, we only picked up the first mapping.)