From ffc49d3057daee2354fb77d939fffc0cf77ff2e1 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 12 Feb 2015 10:52:56 +0000 Subject: Grab back focus... - add new option "GrabBackFocus" - use chrome.storage.sync.get() to get option value - avoid race conditions on load - fix tests --- background_scripts/settings.coffee | 1 + 1 file changed, 1 insertion(+) (limited to 'background_scripts') diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index f43bd4bc..4342aa26 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -73,6 +73,7 @@ root.Settings = Settings = linkHintNumbers: "0123456789" filterLinkHints: false hideHud: false + grabBackfocus: false userDefinedLinkHintCss: """ div > .vimiumHintMarker { -- cgit v1.2.3 From 358f1ebfddacf75c02bb3a2e8993bab6d2fe28d8 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 13 Feb 2015 06:53:51 +0000 Subject: Tweaks for grab-back-focus. - Fix incorrect camel case in option name. - Better text on options page. - Loud comments re. using option directly from chrome.storage.sync. --- background_scripts/settings.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index 4342aa26..a60f2e09 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -73,7 +73,6 @@ root.Settings = Settings = linkHintNumbers: "0123456789" filterLinkHints: false hideHud: false - grabBackfocus: false userDefinedLinkHintCss: """ div > .vimiumHintMarker { @@ -117,6 +116,10 @@ root.Settings = Settings = settingsVersion: Utils.getCurrentVersion() + # NOTE. This setting is accessed directly via chrome.storage.sync in the front end. There, we assume that + # the default value is false. + grabBackFocus: false + # We use settingsVersion to coordinate any necessary schema changes. if Utils.compareVersions("1.42", Settings.get("settingsVersion")) != -1 -- cgit v1.2.3 From 05f229201a05101ab4947bd436ec02d8864392f9 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 14 Feb 2015 12:19:22 +0000 Subject: Grab back focus: use settings.addEventListener "load". Doh! I didn't know this existed. --- background_scripts/settings.coffee | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index a60f2e09..3528e8a9 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -113,13 +113,10 @@ root.Settings = Settings = # put in an example search engine searchEngines: "w: http://www.wikipedia.org/w/index.php?title=Special:Search&search=%s wikipedia" newTabUrl: "chrome://newtab" + grabBackFocus: false settingsVersion: Utils.getCurrentVersion() - # NOTE. This setting is accessed directly via chrome.storage.sync in the front end. There, we assume that - # the default value is false. - grabBackFocus: false - # We use settingsVersion to coordinate any necessary schema changes. if Utils.compareVersions("1.42", Settings.get("settingsVersion")) != -1 -- cgit v1.2.3