diff options
author | Andrew Webster <awebster@arcx.com> | 2018-01-25 15:23:08 -0500 |
---|---|---|
committer | Andrew Webster <awebster@arcx.com> | 2018-02-13 10:22:21 -0500 |
commit | e0750f9b2c1495473fdcbb2f22dd97961803bc81 (patch) | |
tree | bc4fac6974d6d17a97a5de9b2f0d216632a5173b /karma.conf.js | |
parent | 37b4d13db81e0e80e117c07b86ff98714c7b6b1a (diff) | |
download | novnc-e0750f9b2c1495473fdcbb2f22dd97961803bc81.tar.gz |
Use localstorage only to initialize settings map
This only reads from localstorage in order to initialize the settings
map. After initializaton, reads will return the value from the map.
When writing a value, the settings map and the local storage
are updated, unless the setting is a default value or derived from
the query string.
This has a few advantages:
1. Saved settings will not be overridden by settings specified in
the query string. This means a setting could be temporarily changed
using the query string, but once removed from the query string, the
setting would return back to what the user selected.
2. Default values will not be saved. If a user has always used
the default value for a setting, then they can move to a new version
with different defaults without clearing localstorage.
3. Changes made to localstorage in a session running in a different
window will not affect the settings in the current window (until
the page is refreshed).
Regarding eraseSetting:
It is possible that another tab could change the value, leading
to an unexpected value change in the tab that deletes. However,
this function is currently unused, so this will be evaluted if
and when it used.
Diffstat (limited to 'karma.conf.js')
-rw-r--r-- | karma.conf.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/karma.conf.js b/karma.conf.js index 10bf372..5b9da9f 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -62,6 +62,7 @@ module.exports = function(config) { { pattern: 'vendor/sinon.js', included: false }, { pattern: 'node_modules/sinon-chai/lib/sinon-chai.js', included: false }, { pattern: 'app/localization.js', included: false }, + { pattern: 'app/webutil.js', included: false }, { pattern: 'core/**/*.js', included: false }, { pattern: 'vendor/pako/**/*.js', included: false }, { pattern: 'tests/test.*.js', included: false }, @@ -92,6 +93,7 @@ module.exports = function(config) { // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { 'app/localization.js': ['babel'], + 'app/webutil.js': ['babel'], 'core/**/*.js': ['babel'], 'tests/test.*.js': ['babel'], 'tests/fake.*.js': ['babel'], |