From a036d2dac281b2528c2087b08839e118e3f449ae Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Wed, 9 Feb 2011 23:06:41 -0800 Subject: Preserve the "show advanced commands" setting after you close the vimium help dialog. --- background_page.html | 9 ++++++++- helpDialog.html | 21 ++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/background_page.html b/background_page.html index 77150244..ee12a77d 100644 --- a/background_page.html +++ b/background_page.html @@ -79,7 +79,8 @@ upgradeNotificationClosed: upgradeNotificationClosed, updateScrollPosition: handleUpdateScrollPosition, copyToClipboard: copyToClipboard, - isEnabledForUrl: isEnabledForUrl + isEnabledForUrl: isEnabledForUrl, + saveHelpDialogSettings: saveHelpDialogSettings }; // Event handlers @@ -151,6 +152,10 @@ return { isEnabledForUrl: isEnabled }; } + function saveHelpDialogSettings(request) { + localStorage["helpDialog_showAdvancedCommands"] = request.showAdvancedCommands; + } + /* * Returns the previously saved zoom level for the current tab, or the default zoom level */ @@ -186,6 +191,8 @@ showUnboundCommands, showCommandNames)); dialogHtml = dialogHtml.replace("{{version}}", currentVersion); dialogHtml = dialogHtml.replace("{{title}}", customTitle || "Help"); + dialogHtml = dialogHtml.replace("{{showAdvancedCommands}}", + localStorage["helpDialog_showAdvancedCommands"] == "true"); return dialogHtml; } diff --git a/helpDialog.html b/helpDialog.html index c21c8b7b..ae78d149 100644 --- a/helpDialog.html +++ b/helpDialog.html @@ -132,10 +132,14 @@