save video mode

This commit is contained in:
Devaev Maxim
2021-07-01 09:22:18 +03:00
parent 2995ca4909
commit 4fe20641da
2 changed files with 27 additions and 6 deletions

View File

@@ -160,6 +160,15 @@ export var tools = new function() {
el.checked = (el.value === value);
}
};
this.radioClickValue = function(name, value) {
for (let el of $$$(`input[type="radio"][name="${name}"]`)) {
if (el.value === value) {
el.click();
return;
}
}
};
this.progressSetValue = function(el, title, percent) {
el.setAttribute("data-label", title);
@@ -242,6 +251,16 @@ export var tools = new function() {
this.info("Browser:", this.browser);
this.https = (location.protocol === "https:");
this.storage = new function() {
return {
"get": function(key, default_value) {
let value = window.localStorage.getItem(key);
return (value !== null ? value : default_value);
},
"set": (key, value) => window.localStorage.setItem(key, value),
};
};
};
export var $ = (id) => document.getElementById(id);