diff options
| -rw-r--r-- | background_scripts/main.coffee | 5 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 13 |
2 files changed, 6 insertions, 12 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index c392f967..5c10b9ae 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -90,8 +90,6 @@ root.addExcludedUrl = (url) -> chrome.tabs.query({ windowId: chrome.windows.WINDOW_ID_CURRENT, active: true }, (tabs) -> updateActiveState(tabs[0].id)) -getShowAdvancedCommands = (request) -> Settings.get("helpDialog_showAdvancedCommands") - saveHelpDialogSettings = (request) -> Settings.set("helpDialog_showAdvancedCommands", request.showAdvancedCommands) @@ -110,8 +108,6 @@ root.helpDialogHtml = (showUnboundCommands, showCommandNames, customTitle) -> showUnboundCommands, showCommandNames)) dialogHtml = dialogHtml.replace("{{version}}", currentVersion) dialogHtml = dialogHtml.replace("{{title}}", customTitle || "Help") - dialogHtml = dialogHtml.replace("{{showAdvancedCommands}}", - Settings.get("helpDialog_showAdvancedCommands")) dialogHtml # @@ -543,7 +539,6 @@ portHandlers = sendRequestHandlers = getCompletionKeys: getCompletionKeysRequest, getCurrentTabUrl: getCurrentTabUrl, - getShowAdvancedCommands: getShowAdvancedCommands, openUrlInNewTab: openUrlInNewTab, openUrlInCurrentTab: openUrlInCurrentTab, openOptionsPageInNewTab: openOptionsPageInNewTab, diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 4577be8c..ab3b1fbf 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -43,7 +43,7 @@ settings = values: {} loadedValues: 0 valuesToLoad: ["scrollStepSize", "linkHintCharacters", "filterLinkHints", "hideHud", "previousPatterns", - "nextPatterns", "findModeRawQuery", "userDefinedLinkHintCss"] + "nextPatterns", "findModeRawQuery", "userDefinedLinkHintCss", "helpDialog_showAdvancedCommands"] isLoaded: false eventListeners: {} @@ -886,24 +886,23 @@ window.showHelpDialog = (html, fid) -> VimiumHelpDialog = # This setting is pulled out of local storage. It's false by default. - getShowAdvancedCommands: (callback) -> - chrome.extension.sendRequest({ handler: "getShowAdvancedCommands"}, callback) + getShowAdvancedCommands: -> settings.get("helpDialog_showAdvancedCommands") init: () -> this.dialogElement = document.getElementById("vimiumHelpDialog") this.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].addEventListener("click", VimiumHelpDialog.toggleAdvancedCommands, false) this.dialogElement.style.maxHeight = window.innerHeight - 80 - this.getShowAdvancedCommands(this.showAdvancedCommands) + this.showAdvancedCommands(this.getShowAdvancedCommands()) # # Advanced commands are hidden by default so they don't overwhelm new and casual users. # toggleAdvancedCommands: (event) -> event.preventDefault() - VimiumHelpDialog.getShowAdvancedCommands((value) -> - VimiumHelpDialog.showAdvancedCommands(!value) - chrome.extension.sendRequest({ handler: "saveHelpDialogSettings", showAdvancedCommands: !value })) + showAdvanced = VimiumHelpDialog.getShowAdvancedCommands() + VimiumHelpDialog.showAdvancedCommands(!showAdvanced) + settings.set("helpDialog_showAdvancedCommands", !showAdvanced) showAdvancedCommands: (visible) -> VimiumHelpDialog.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].innerHTML = |
