mirror of
https://github.com/9001/copyparty.git
synced 2026-06-19 04:32: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"] {
|
||||
width: 100%;
|
||||
}
|
||||
input[type="text"].invalid {
|
||||
border-color: var(--err-b1);
|
||||
}
|
||||
#rui #rn_n_d,
|
||||
#rui #rn_n_s,
|
||||
#shui td.exs input[type="text"] {
|
||||
|
|
|
|||
|
|
@ -1275,18 +1275,27 @@ ebi('op_cfg').innerHTML = (
|
|||
})();
|
||||
|
||||
// accent color
|
||||
function parseColor (strColor) {
|
||||
const s = new Option().style;
|
||||
s.color = strColor;
|
||||
return s.color !== '' ? s.color : '';
|
||||
}
|
||||
|
||||
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;
|
||||
accent = this.value;
|
||||
accent = validcolor;
|
||||
swrite('accent', accent);
|
||||
var a = accent || '#fc0';
|
||||
console.log('accent color set to: ' + a);
|
||||
document.documentElement.style.setProperty('--a', a);
|
||||
}
|
||||
var accent = ebi('accent').value = sread('accent') || '';
|
||||
if(accent)
|
||||
document.documentElement.style.setProperty('--a', accent);
|
||||
var accent = ebi('accent').value = sread('accent');
|
||||
if(accent){
|
||||
document.documentElement.style.setProperty('--a', parseColor(accent));
|
||||
}
|
||||
|
||||
// navpane
|
||||
ebi('tree').innerHTML = (
|
||||
|
|
|
|||
Loading…
Reference in a new issue