mirror of
https://github.com/9001/copyparty.git
synced 2026-06-22 05:53:29 -06:00
fix tcolor link to accent color
This commit is contained in:
parent
04151dc7c9
commit
37f393d8e4
|
|
@ -296,7 +296,6 @@
|
|||
CGV = {{ cgv|tojson }},
|
||||
TS = "{{ ts }}",
|
||||
dtheme = "{{ dtheme }}",
|
||||
tcolor = "#{{ tcolor }}"
|
||||
lang = "{{ lang }}",
|
||||
dfavico = "{{ favico }}",
|
||||
have_tags_idx = {{ have_tags_idx }},
|
||||
|
|
|
|||
|
|
@ -1480,21 +1480,6 @@ if(sread('cfg_lgcy') == 'true')
|
|||
ebi('reloc_cfg').click();
|
||||
|
||||
// accent color
|
||||
function parseColor (strColor) {
|
||||
var s = new Option().style;
|
||||
s.color = strColor;
|
||||
return s.color !== '' ? s.color : '';
|
||||
}
|
||||
function setColor (color) {
|
||||
accent = color;
|
||||
swrite('accent', accent);
|
||||
var a = accent || '';
|
||||
console.log('accent color set to: ' + a);
|
||||
document.documentElement.style.setProperty('--a', a);
|
||||
pbar.drawbuf();
|
||||
pbar.drawpos();
|
||||
vbar.draw();
|
||||
}
|
||||
ebi('accent').oninput = ebi('accent_picker').oninput = function () {
|
||||
var validcolor = parseColor(this.value);
|
||||
console.log(this.value);
|
||||
|
|
@ -1516,14 +1501,6 @@ ebi('accent').oninput = ebi('accent_picker').oninput = function () {
|
|||
setColor(validcolor);
|
||||
}, 100);
|
||||
}
|
||||
var accent = sread('accent');
|
||||
if(!accent || accent.length <= 3)
|
||||
accent = window.tcolor;
|
||||
if(accent && accent.length > 3){
|
||||
console.log('read accent color from settings: ' + accent);
|
||||
document.documentElement.style.setProperty('--a', parseColor(accent));
|
||||
ebi('accent').value = ebi('accent_picker').value = accent;
|
||||
}
|
||||
|
||||
// corner radius
|
||||
ebi('radius').oninput = function () {
|
||||
|
|
|
|||
|
|
@ -2346,6 +2346,35 @@ function cprop(name) {
|
|||
return getComputedStyle(document.documentElement).getPropertyValue(name);
|
||||
}
|
||||
|
||||
// read accent / theme color
|
||||
function parseColor (strColor) {
|
||||
var s = new Option().style;
|
||||
s.color = strColor;
|
||||
return s.color !== '' ? s.color : '';
|
||||
}
|
||||
function setColor (color) {
|
||||
accent = color;
|
||||
swrite('accent', accent);
|
||||
var a = accent || '';
|
||||
console.log('accent color set to: ' + a);
|
||||
document.documentElement.style.setProperty('--a', a);
|
||||
pbar.drawbuf();
|
||||
pbar.drawpos();
|
||||
vbar.draw();
|
||||
}
|
||||
var accent = sread('accent');
|
||||
var tcolor = QS('meta[name=theme-color]');
|
||||
if(tcolor)
|
||||
tcolor = tcolor.content;
|
||||
if((!accent || accent.length <= 3) && tcolor != "#333333")
|
||||
accent = tcolor;
|
||||
var thing = QS('meta[name=theme-color]');
|
||||
if(accent && accent.length > 3){
|
||||
console.log('read accent color from settings: ' + accent);
|
||||
document.documentElement.style.setProperty('--a', parseColor(accent));
|
||||
if(ebi('accent'))
|
||||
ebi('accent').value = ebi('accent_picker').value = accent;
|
||||
}
|
||||
|
||||
function bchrome() {
|
||||
var v, o = QS('meta[name=theme-color]');
|
||||
|
|
|
|||
Loading…
Reference in a new issue