diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2022-04-03 16:20:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-03 16:20:55 -0400 |
commit | f61690ea2c4b5142c470dbe288446afadae11dbc (patch) | |
tree | 46c6cfc0b6b1c86a33164c50ee59bb3462b25df6 /ext/js/data/options-util.js | |
parent | 3150da92fed5cfb61b015ebc5ff11ab66d688b7f (diff) |
Theme updates (#2105)
* Change siteColor to siteTheme
* Fix potential null exception
* Simplify
* Update display theme assignment
* Add a data-browser-theme attribute
* Add "browser" option for theme
* Create ThemeController
* Add theme-controller.js to relevant pages
* Use ThemeController
* Simplify
* Fix 'light' being used instead of 'default'
* Update the settings values to more accurately reflect their usage
* Change default site theme in display.js
* Remove async
* Restore async for consistency
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r-- | ext/js/data/options-util.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 1a7f661f..3422b773 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -466,7 +466,8 @@ class OptionsUtil { {async: false, update: this._updateVersion14.bind(this)}, {async: false, update: this._updateVersion15.bind(this)}, {async: false, update: this._updateVersion16.bind(this)}, - {async: false, update: this._updateVersion17.bind(this)} + {async: false, update: this._updateVersion17.bind(this)}, + {async: false, update: this._updateVersion18.bind(this)} ]; if (typeof targetVersion === 'number' && targetVersion < result.length) { result.splice(targetVersion); @@ -924,4 +925,22 @@ class OptionsUtil { } return options; } + + _updateVersion18(options) { + // Version 18 changes: + // general.popupTheme's 'default' value changed to 'light' + // general.popupOuterTheme's 'default' value changed to 'light' + // general.popupOuterTheme's 'auto' value changed to 'site' + for (const profile of options.profiles) { + const {general} = profile.options; + if (general.popupTheme === 'default') { + general.popupTheme = 'light'; + } + switch (general.popupOuterTheme) { + case 'default': general.popupOuterTheme = 'light'; break; + case 'auto': general.popupOuterTheme = 'site'; break; + } + } + return options; + } } |