mirror of
https://github.com/9001/copyparty.git
synced 2026-06-20 21:22:26 -06:00
accent color input parsing
This commit is contained in:
parent
ee7b700b61
commit
9299d19498
|
|
@ -2148,6 +2148,9 @@ html.y #tree.nowrap .ntree a+a:hover {
|
||||||
#rui td input[type="text"] {
|
#rui td input[type="text"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
input[type="text"].invalid {
|
||||||
|
border-color: var(--err-b1);
|
||||||
|
}
|
||||||
#rui #rn_n_d,
|
#rui #rn_n_d,
|
||||||
#rui #rn_n_s,
|
#rui #rn_n_s,
|
||||||
#shui td.exs input[type="text"] {
|
#shui td.exs input[type="text"] {
|
||||||
|
|
|
||||||
|
|
@ -1275,18 +1275,27 @@ ebi('op_cfg').innerHTML = (
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// accent color
|
// accent color
|
||||||
|
function parseColor (strColor) {
|
||||||
|
const s = new Option().style;
|
||||||
|
s.color = strColor;
|
||||||
|
return s.color !== '' ? s.color : '';
|
||||||
|
}
|
||||||
|
|
||||||
ebi('accent').oninput = function () {
|
ebi('accent').oninput = function () {
|
||||||
if(this.value == accent)
|
var validcolor = parseColor(this.value);
|
||||||
|
clmod(ebi('accent'), 'invalid', this.value.length != 0 && validcolor.length == 0);
|
||||||
|
if(validcolor == accent)
|
||||||
return;
|
return;
|
||||||
accent = this.value;
|
accent = validcolor;
|
||||||
swrite('accent', accent);
|
swrite('accent', accent);
|
||||||
var a = accent || '#fc0';
|
var a = accent || '#fc0';
|
||||||
console.log('accent color set to: ' + a);
|
console.log('accent color set to: ' + a);
|
||||||
document.documentElement.style.setProperty('--a', a);
|
document.documentElement.style.setProperty('--a', a);
|
||||||
}
|
}
|
||||||
var accent = ebi('accent').value = sread('accent') || '';
|
var accent = ebi('accent').value = sread('accent');
|
||||||
if(accent)
|
if(accent){
|
||||||
document.documentElement.style.setProperty('--a', accent);
|
document.documentElement.style.setProperty('--a', parseColor(accent));
|
||||||
|
}
|
||||||
|
|
||||||
// navpane
|
// navpane
|
||||||
ebi('tree').innerHTML = (
|
ebi('tree').innerHTML = (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue