open releases in new tab

This commit is contained in:
Woody 2020-09-06 17:13:08 +02:00
parent 2f2bebe506
commit 6e3940c8eb
4 changed files with 1620 additions and 1625 deletions

View File

@ -33,7 +33,7 @@
<body> <body>
<h2>WLED Software Update</h2>Installed version: ##VERSION##<br>Download the latest binary: <a <h2>WLED Software Update</h2>Installed version: ##VERSION##<br>Download the latest binary: <a
href="https://github.com/Aircoookie/WLED/releases"><img href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img
src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square"></a><br> src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square"></a><br>
<form method='POST' action='/update' enctype='multipart/form-data'><input type='file' class="bt" name='update' <form method='POST' action='/update' enctype='multipart/form-data'><input type='file' class="bt" name='update'
required><br><input type='submit' class="bt" value='Update!'></form><button type="button" class="bt" required><br><input type='submit' class="bt" value='Update!'></form><button type="button" class="bt"

View File

@ -41,7 +41,7 @@ const char PAGE_update[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta cont
.bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%} .bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}
</style></head><body><h2>WLED Software Update</h2>Installed version: 0.10.2<br> </style></head><body><h2>WLED Software Update</h2>Installed version: 0.10.2<br>
Download the latest binary: <a Download the latest binary: <a
href="https://github.com/Aircoookie/WLED/releases"><img href="https://github.com/Aircoookie/WLED/releases" target="_blank"><img
src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square"> src="https://img.shields.io/github/release/Aircoookie/WLED.svg?style=flat-square">
</a><br><form method="POST" action="/update" enctype="multipart/form-data"> </a><br><form method="POST" action="/update" enctype="multipart/form-data">
<input type="file" class="bt" name="update" required><br><input type="submit" <input type="file" class="bt" name="update" required><br><input type="submit"

View File

@ -167,163 +167,163 @@ const char PAGE_settings_dmx[] PROGMEM = R"=====()=====";
// Autogenerated from wled00/data/settings_ui.htm, do not edit!! // Autogenerated from wled00/data/settings_ui.htm, do not edit!!
const char PAGE_settings_ui[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" const char PAGE_settings_ui[] PROGMEM = R"=====(<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport"
content="width=500"><title>UI Settings</title><script>var d = document; content="width=500"><title>UI Settings</title><script>var d = document;
var initial_ds, initial_st; var initial_ds, initial_st;
var sett = null; var sett = null;
var l = { var l = {
"comp":{ "comp":{
"labels":"Show button labels", "labels":"Show button labels",
"colors":{ "colors":{
"LABEL":"Color selection methods", "LABEL":"Color selection methods",
"picker": "Color Wheel", "picker": "Color Wheel",
"rgb": "RGB sliders", "rgb": "RGB sliders",
"quick": "Quick color selectors", "quick": "Quick color selectors",
"hex": "HEX color input" "hex": "HEX color input"
}, },
"pcmbot": "Show bottom tab bar in PC mode" "pcmbot": "Show bottom tab bar in PC mode"
}, },
"theme":{ "theme":{
"alpha": { "alpha": {
"bg":"Background opacity", "bg":"Background opacity",
"tab":"Button opacity" "tab":"Button opacity"
}, },
"bg":{ "bg":{
"url":"BG image URL" "url":"BG image URL"
}, },
"color":{ "color":{
"bg":"BG HEX color" "bg":"BG HEX color"
} }
} }
};
function gId(s)
{
return d.getElementById(s);
}
function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item));
}
function set(path, obj, val) {
var tar = obj;
var pList = path.split('_');
var len = pList.length;
for(var i = 0; i < len-1; i++) {
var elem = pList[i];
if( !tar[elem] ) tar[elem] = {}
tar = tar[elem];
}
}; tar[pList[len-1]] = val;
function gId(s) }
{
return d.getElementById(s);
}
function isObject(item) {
return (item && typeof item === 'object' && !Array.isArray(item));
}
function set(path, obj, val) {
var tar = obj;
var pList = path.split('_');
var len = pList.length;
for(var i = 0; i < len-1; i++) {
var elem = pList[i];
if( !tar[elem] ) tar[elem] = {}
tar = tar[elem];
}
tar[pList[len-1]] = val; function addRec(s, path = "", label = null)
} {
var str = "";
for (i in s)
{
var fk = path + (path?'_':'') + i;
if (isObject(s[i])) {
if (label && label[i] && label[i]["LABEL"]) str += `<h3>${label[i]["LABEL"]}</h3>`;
str += addRec(s[i], fk, label? label[i] : null);
} else {
var lb = fk;
if (label && label[i]) lb = label[i];
else if (s[i+'LABEL']) lb = s[i+'LABEL'];
if (i.indexOf('LABEL') > 0) continue;
var t = typeof s[i];
if (gId(fk)) { //already exists
if(t === 'boolean')
{
gId(fk).checked = s[i];
} else {
gId(fk).value = s[i];
}
if (gId(fk).previousElementSibling.matches('.l')) {
gId(fk).previousElementSibling.innerHTML = lb;
}
} else {
if(t === 'boolean')
{
str += `${lb}: <input class="agi cb" type="checkbox" id=${fk} ${s[i]?"checked":""}><br>`;
} else if (t === 'number')
{
str += `${lb}: <input class="agi" type="number" id=${fk} value=${s[i]}><br>`;
} else if (t === 'string')
{
str += `${lb}:<br><input class="agi" id=${fk} value=${s[i]}><br>`;
}
}
}
}
return str;
}
function addRec(s, path = "", label = null) function genForm(s) {
{ var str = "";
var str = ""; str = addRec(s,"",l);
for (i in s)
{ gId('gen').innerHTML = str;
var fk = path + (path?'_':'') + i; }
if (isObject(s[i])) { function GetLS()
if (label && label[i] && label[i]["LABEL"]) str += `<h3>${label[i]["LABEL"]}</h3>`; {
str += addRec(s[i], fk, label? label[i] : null); sett = localStorage.getItem('wledUiCfg');
} else { if (!sett) gId('lserr').style.display = "inline";
var lb = fk; try {
if (label && label[i]) lb = label[i]; sett = JSON.parse(sett);
else if (s[i+'LABEL']) lb = s[i+'LABEL']; } catch (e) {
if (i.indexOf('LABEL') > 0) continue; sett = {};
var t = typeof s[i]; gId('lserr').style.display = "inline";
if (gId(fk)) { //already exists gId('lserr').innerHTML = "&#9888; Settings JSON parsing failed. (" + e + ")";
if(t === 'boolean') }
{ genForm(sett);
gId(fk).checked = s[i]; gId('dm').checked = (gId('theme_base').value === 'light');
} else { }
gId(fk).value = s[i];
} function SetLS()
if (gId(fk).previousElementSibling.matches('.l')) { {
gId(fk).previousElementSibling.innerHTML = lb; var l = d.querySelectorAll('.agi');
} for (var i = 0; i < l.length; i++) {
} else { var e = l[i];
if(t === 'boolean') var val = e.classList.contains('cb') ? e.checked : e.value;
{ set(e.id, sett, val);
str += `${lb}: <input class="agi cb" type="checkbox" id=${fk} ${s[i]?"checked":""}><br>`; console.log(`${e.id} set to ${val}`);
} else if (t === 'number') }
{ try {
str += `${lb}: <input class="agi" type="number" id=${fk} value=${s[i]}><br>`; localStorage.setItem('wledUiCfg', JSON.stringify(sett));
} else if (t === 'string') gId('lssuc').style.display = "inline";
{ } catch (e) {
str += `${lb}:<br><input class="agi" id=${fk} value=${s[i]}><br>`; gId('lssuc').style.display = "none";
} gId('lserr').style.display = "inline";
} gId('lserr').innerHTML = "&#9888; Settings JSON saving failed. (" + e + ")";
} }
} }
return str;
} function Save() {
SetLS();
function genForm(s) { if (d.Sf.DS.value != initial_ds || d.Sf.ST.checked != initial_st) d.Sf.submit();
var str = ""; }
str = addRec(s,"",l);
function S()
gId('gen').innerHTML = str; {
} GetV();
function GetLS() initial_ds = d.Sf.DS.value;
{ initial_st = d.Sf.ST.checked;
sett = localStorage.getItem('wledUiCfg'); GetLS();
if (!sett) gId('lserr').style.display = "inline"; }
try { function H()
sett = JSON.parse(sett); {
} catch (e) { window.open("https://github.com/Aircoookie/WLED/wiki/Settings#user-interface-settings");
sett = {}; }
gId('lserr').style.display = "inline"; function B()
gId('lserr').innerHTML = "&#9888; Settings JSON parsing failed. (" + e + ")"; {
} window.open("/settings","_self");
genForm(sett); }
gId('dm').checked = (gId('theme_base').value === 'light'); function UI()
} {
gId('idonthateyou').style.display = (gId('dm').checked) ? 'inline':'none';
function SetLS() var f = gId('theme_base');
{ if (f) f.value = (gId('dm').checked) ? 'light':'dark';
var l = d.querySelectorAll('.agi'); }
for (var i = 0; i < l.length; i++) { function GetV() {var d=document;
var e = l[i];
var val = e.classList.contains('cb') ? e.checked : e.value;
set(e.id, sett, val);
console.log(`${e.id} set to ${val}`);
}
try {
localStorage.setItem('wledUiCfg', JSON.stringify(sett));
gId('lssuc').style.display = "inline";
} catch (e) {
gId('lssuc').style.display = "none";
gId('lserr').style.display = "inline";
gId('lserr').innerHTML = "&#9888; Settings JSON saving failed. (" + e + ")";
}
}
function Save() {
SetLS();
if (d.Sf.DS.value != initial_ds || d.Sf.ST.checked != initial_st) d.Sf.submit();
}
function S()
{
GetV();
initial_ds = d.Sf.DS.value;
initial_st = d.Sf.ST.checked;
GetLS();
}
function H()
{
window.open("https://github.com/Aircoookie/WLED/wiki/Settings#user-interface-settings");
}
function B()
{
window.open("/settings","_self");
}
function UI()
{
gId('idonthateyou').style.display = (gId('dm').checked) ? 'inline':'none';
var f = gId('theme_base');
if (f) f.value = (gId('dm').checked) ? 'light':'dark';
}
function GetV() {var d=document;
%CSS%%SCSS%</head><body onload="S()"> %CSS%%SCSS%</head><body onload="S()">
<form id="form_s" name="Sf" method="post"><div <form id="form_s" name="Sf" method="post"><div
style="position:sticky;top:0;background-color:#222"><div class="helpB"><button style="position:sticky;top:0;background-color:#222"><div class="helpB"><button

File diff suppressed because it is too large Load Diff