diff options
| author | Stephen Blott | 2016-04-17 14:12:46 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-17 14:15:08 +0100 |
| commit | 10982f57bbbbe802ecc59173ce8a60582f8b34ff (patch) | |
| tree | 88676dd3d2c6e540347fb83a2419472f73c370aa /background_scripts | |
| parent | 27385e81debd5fcd9000c718d73e296d6723e83a (diff) | |
| download | vimium-10982f57bbbbe802ecc59173ce8a60582f8b34ff.tar.bz2 | |
Make showHelp not a background command.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/commands.coffee | 2 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 2d901b15..30ea6c39 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -295,7 +295,7 @@ defaultKeyMappings = # If the noRepeat and repeatLimit options are both specified, then noRepeat takes precedence. commandDescriptions = # Navigating the current page - showHelp: ["Show help", { background: true, noRepeat: true }] + showHelp: ["Show help", { noRepeat: true }] scrollDown: ["Scroll down"] scrollUp: ["Scroll up"] scrollLeft: ["Scroll left"] diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 5c6e8e19..4aa2fc41 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -82,8 +82,7 @@ chrome.webNavigation.onHistoryStateUpdated.addListener onURLChange # history.pus chrome.webNavigation.onReferenceFragmentUpdated.addListener onURLChange # Hash changed. # Retrieves the help dialog HTML template from a file, and populates it with the latest keybindings. -# This is called by options.coffee. -root.helpDialogHtml = (showUnboundCommands, showCommandNames, customTitle) -> +getHelpDialogHtml = ({showUnboundCommands, showCommandNames, customTitle}) -> commandsToKey = {} for own key of Commands.keyToCommandRegistry command = Commands.keyToCommandRegistry[key].command @@ -209,8 +208,6 @@ BackgroundCommands = openCopiedUrlInCurrentTab: (request) -> TabOperations.openUrlInCurrentTab extend request, url: Clipboard.paste() openCopiedUrlInNewTab: (request) -> @createTab extend request, url: Clipboard.paste() togglePinTab: ({tab}) -> chrome.tabs.update tab.id, {pinned: !tab.pinned} - showHelp: ({tab, frameId}) -> - chrome.tabs.sendMessage tab.id, {name: "toggleHelpDialog", dialogHtml: helpDialogHtml(), frameId} moveTabLeft: moveTab moveTabRight: moveTab nextFrame: ({count, frameId, tabId}) -> @@ -402,6 +399,7 @@ portHandlers = sendRequestHandlers = runBackgroundCommand: (request) -> BackgroundCommands[request.registryEntry.command] request + getHelpDialogHtml: getHelpDialogHtml # getCurrentTabUrl is used by the content scripts to get their full URL, because window.location cannot help # with Chrome-specific URLs like "view-source:http:..". getCurrentTabUrl: ({tab}) -> tab.url |
