Merge remote-tracking branch 'origin/ac_main' into mdev
This commit is contained in:
@@ -287,15 +287,15 @@
|
||||
</div>
|
||||
<div id="fxopt" class="option fade">
|
||||
<label id="opt0" class="check ochkl hide"><i class="icons"></i><span class="tooltiptext" id="optLabel0">Check 1</span>
|
||||
<input type="checkbox" onchange="setOption(1, this.checked)">
|
||||
<input id="checkO1" type="checkbox" onchange="setOption(1, this.checked)">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label id="opt1" class="check ochkl hide"><i class="icons"></i><span class="tooltiptext" id="optLabel1">Check 2</span>
|
||||
<input type="checkbox" onchange="setOption(2, this.checked)">
|
||||
<input id="checkO2" type="checkbox" onchange="setOption(2, this.checked)">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
<label id="opt2" class="check ochkl hide"><i class="icons"></i><span class="tooltiptext" id="optLabel2">Check 3</span>
|
||||
<input type="checkbox" onchange="setOption(3, this.checked)">
|
||||
<input id="checkO3" type="checkbox" onchange="setOption(3, this.checked)">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@@ -1349,6 +1349,9 @@ function readState(s,command=false)
|
||||
gId('sliderC1').value = i.c1 ? i.c1 : 0;
|
||||
gId('sliderC2').value = i.c2 ? i.c2 : 0;
|
||||
gId('sliderC3').value = i.c3 ? i.c3 : 0;
|
||||
gId('checkO1').checked = !(!i.o1);
|
||||
gId('checkO2').checked = !(!i.o2);
|
||||
gId('checkO3').checked = !(!i.o3);
|
||||
|
||||
if (s.error && s.error != 0) {
|
||||
var errstr = "";
|
||||
@@ -2042,7 +2045,7 @@ function setSeg(s)
|
||||
var startY = parseInt(sY.value);
|
||||
var stopY = parseInt(eY.value);
|
||||
if (startY<sY.min || startY>sY.max) {sY.value=sY.min; return;} // prevent out of bounds
|
||||
if (stopY<eY.min || stop>eY.max) {eY.value=eY.max; return;} // prevent out of bounds
|
||||
if (stopY<eY.min || stopY>eY.max) {eY.value=eY.max; return;} // prevent out of bounds
|
||||
obj.seg.startY = startY;
|
||||
obj.seg.stopY = (cfg.comp.seglen?startY:0)+stopY;
|
||||
}
|
||||
@@ -2216,12 +2219,12 @@ function setPreset(i)
|
||||
{
|
||||
var obj = {"ps":i};
|
||||
if (pJson && pJson[i] && (!pJson[i].win || pJson[i].win.indexOf("Please") <= 0)) {
|
||||
// we will send complete preset content as to avoid delay introduced by
|
||||
// async nature of applyPreset(). json.cpp has to decide wether to call applyPreset()
|
||||
// or not (by looking at the JSON content, if "ps" only)
|
||||
// we will send the complete preset content as to avoid delay introduced by
|
||||
// async nature of applyPreset() and having to read the preset from file system.
|
||||
obj = {"pd":i}; // use "pd" instead of "ps" to indicate that we are sending the preset content directly
|
||||
Object.assign(obj, pJson[i]);
|
||||
delete obj.ql; // no need for quick load
|
||||
delete obj.n; // no need for name
|
||||
delete obj.ql; // no need for quick load
|
||||
delete obj.n; // no need for name
|
||||
}
|
||||
if (isPlaylist(i)) obj.on = true; // force on
|
||||
showToast("Loading preset " + pName(i) +" (" + i + ")");
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
}
|
||||
};
|
||||
function gId(s) { return d.getElementById(s); }
|
||||
function toggle(el) { gId(el).classList.toggle("hide"); gId('No'+el).classList.toggle("hide"); }
|
||||
function isObject(item) {
|
||||
return (item && typeof item === 'object' && !Array.isArray(item));
|
||||
}
|
||||
@@ -247,7 +248,10 @@
|
||||
<h2>Web Setup</h2>
|
||||
Server description: <input type="text" name="DS" maxlength="32"><br>
|
||||
Sync button toggles both send and receive: <input type="checkbox" name="ST"><br>
|
||||
Enable simplified UI: <input type="checkbox" name="SU"><br>
|
||||
<div id="NoSimple" class="hide">
|
||||
<em style="color:#fa0;">This firmware build does not include simplified UI support.<br></em>
|
||||
</div>
|
||||
<div id="Simple">Enable simplified UI: <input type="checkbox" name="SU"><br></div>
|
||||
<i>The following UI customization settings are unique both to the WLED device and this browser.<br>
|
||||
You will need to set them again if using a different browser, device or WLED IP address.<br>
|
||||
Refresh the main UI to apply changes.</i><br>
|
||||
|
||||
@@ -106,8 +106,9 @@
|
||||
}
|
||||
//WLEDMM util function
|
||||
function initCap(s) {
|
||||
if (typeof s !== 'string') return ''
|
||||
return s.charAt(0).toUpperCase() + s.slice(1)
|
||||
if (typeof s !== 'string') return '';
|
||||
// https://www.freecodecamp.org/news/how-to-capitalize-words-in-javascript/
|
||||
return s.replace(/[\W_]/g,' ').replace(/(^\w{1})|(\s+\w{1})/g, l=>l.toUpperCase()); // replace - and _ with space, capitalize every 1st letter
|
||||
}
|
||||
function addField(k,f,o,a=false) { //key, field, (sub)object, isArray
|
||||
if (isO(o)) {
|
||||
|
||||
Reference in New Issue
Block a user