mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-17 17: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,
|
"**/compiled.css": true,
|
||||||
"**/*.min.js": 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",
|
"name": "ws4kp",
|
||||||
"version": "5.11.0",
|
"version": "5.11.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "5.11.0",
|
"version": "5.11.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ws4kp",
|
"name": "ws4kp",
|
||||||
"version": "5.11.0",
|
"version": "5.11.2",
|
||||||
"description": "Welcome to the WeatherStar 4000+ project page!",
|
"description": "Welcome to the WeatherStar 4000+ project page!",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { parseQueryString } from '../share.mjs';
|
||||||
|
|
||||||
const SETTINGS_KEY = 'Settings';
|
const SETTINGS_KEY = 'Settings';
|
||||||
|
|
||||||
class Setting {
|
class Setting {
|
||||||
@@ -8,11 +10,19 @@ class Setting {
|
|||||||
this.defaultValue = defaultValue;
|
this.defaultValue = defaultValue;
|
||||||
this.myValue = defaultValue;
|
this.myValue = defaultValue;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
this.sticky = sticky;
|
||||||
// a default blank change function is provided
|
// 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
|
// get existing value if present
|
||||||
const storedValue = this.getFromLocalStorage();
|
const storedValue = urlState ?? this.getFromLocalStorage();
|
||||||
if (sticky && storedValue !== null) {
|
if (sticky && storedValue !== null) {
|
||||||
this.myValue = storedValue;
|
this.myValue = storedValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
},
|
},
|
||||||
"files.exclude": {},
|
"files.exclude": {},
|
||||||
"files.eol": "\n",
|
"files.eol": "\n",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.eslint": "explicit"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user