From 76622cd99cf671531cfa21c5d6243f3e4e185116 Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Mon, 29 Oct 2012 17:56:32 -0400 Subject: Convert strings to numbers when saving options page. This avoids the need to continually re-parse the strings each time we load the option value. --- background_scripts/settings.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'background_scripts/settings.coffee') diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index fc78d48f..2eb7c1d6 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -21,7 +21,7 @@ root.Settings = Settings = # options/options.(coffee|html) only handle booleans and strings; therefore # all defaults must be booleans or strings defaults: - scrollStepSize: "60" + scrollStepSize: 60 linkHintCharacters: "sadfjklewcmpgh" linkHintNumbers: "0123456789" filterLinkHints: false @@ -62,6 +62,9 @@ root.Settings = Settings = # default/fall back search engine searchUrl: "http://www.google.com/search?q=" -# Initialization code. -# We use this parameter to coordinate any necessary schema changes. + settingsVersion: Utils.getCurrentVersion() + +# We use settingsVersion to coordinate any necessary schema changes. +if Utils.compareVersions("1.41", Settings.get("settingsVersion")) != -1 + Settings.set("scrollStepSize", parseFloat Settings.get("scrollStepSize")) Settings.set("settingsVersion", Utils.getCurrentVersion()) -- cgit v1.2.3