mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-15 16:19:30 -07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e87290ed5e | ||
|
|
f4f3720793 | ||
|
|
535b1072d8 | ||
|
|
6d4ec8b958 | ||
|
|
5d0f41f207 |
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@@ -18,4 +18,8 @@
|
||||
"**/compiled.css": true,
|
||||
"**/*.min.js": true,
|
||||
},
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
}
|
||||
}
|
||||
2
dist/index.html
vendored
2
dist/index.html
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.css
vendored
2
dist/resources/ws.min.css
vendored
File diff suppressed because one or more lines are too long
2
dist/resources/ws.min.js
vendored
2
dist/resources/ws.min.js
vendored
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ws4kp",
|
||||
"version": "5.11.0",
|
||||
"version": "5.11.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ws4kp",
|
||||
"version": "5.11.0",
|
||||
"version": "5.11.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"del": "^6.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ws4kp",
|
||||
"version": "5.11.0",
|
||||
"version": "5.11.2",
|
||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { parseQueryString } from '../share.mjs';
|
||||
|
||||
const SETTINGS_KEY = 'Settings';
|
||||
|
||||
class Setting {
|
||||
@@ -8,11 +10,19 @@ class Setting {
|
||||
this.defaultValue = defaultValue;
|
||||
this.myValue = defaultValue;
|
||||
this.type = type;
|
||||
this.sticky = sticky;
|
||||
// a default blank change function is provided
|
||||
this.changeAction = changeAction ?? (() => {});
|
||||
this.changeAction = changeAction ?? (() => { });
|
||||
|
||||
// get value from url
|
||||
const urlValue = parseQueryString()?.[`settings-${shortName}-checkbox`];
|
||||
let urlState;
|
||||
if (urlValue !== undefined) {
|
||||
urlState = urlValue === 'true';
|
||||
}
|
||||
|
||||
// get existing value if present
|
||||
const storedValue = this.getFromLocalStorage();
|
||||
const storedValue = urlState ?? this.getFromLocalStorage();
|
||||
if (sticky && storedValue !== null) {
|
||||
this.myValue = storedValue;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
},
|
||||
"files.exclude": {},
|
||||
"files.eol": "\n",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": "explicit"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user