Cleaning up indentations (sorry but my OCD is strong).

This commit is contained in:
Blaz Kristan 2021-11-27 11:50:18 +01:00
parent 624993fc89
commit 9f3e66fff0
2 changed files with 997 additions and 1004 deletions

View File

@ -191,8 +191,7 @@ function onLoad() {
if (window.location.protocol == "file:") { if (window.location.protocol == "file:") {
loc = true; loc = true;
locip = localStorage.getItem('locIp'); locip = localStorage.getItem('locIp');
if (!locip) if (!locip) {
{
locip = prompt("File Mode. Please enter WLED IP!"); locip = prompt("File Mode. Please enter WLED IP!");
localStorage.setItem('locIp', locip); localStorage.setItem('locIp', locip);
} }
@ -310,8 +309,7 @@ function inforow(key, val, unit = "")
function getLowestUnusedP() function getLowestUnusedP()
{ {
var l = 1; var l = 1;
for (var key in pJson) for (var key in pJson) {
{
if (key == l) l++; if (key == l) l++;
} }
if (l > 250) l = 250; if (l > 250) l = 250;
@ -445,8 +443,7 @@ function populateQL()
cn += `<p class="labels">Quick load</p>`; cn += `<p class="labels">Quick load</p>`;
var it = 0; var it = 0;
for (var key of (pQL||[])) for (var key of (pQL||[])) {
{
cn += `<button class="xxs btn psts" id="p${key[0]}qlb" onclick="setPreset(${key[0]});">${key[1]}</button>`; cn += `<button class="xxs btn psts" id="p${key[0]}qlb" onclick="setPreset(${key[0]});">${key[1]}</button>`;
it++; it++;
if (it > 4) { if (it > 4) {
@ -518,8 +515,7 @@ function populateInfo(i)
else if (pwr > 0) {pwr = 50 * Math.round(pwr/50); pwru = pwr + " mA";} else if (pwr > 0) {pwr = 50 * Math.round(pwr/50); pwru = pwr + " mA";}
var urows=""; var urows="";
if (i.u) { if (i.u) {
for (const [k, val] of Object.entries(i.u)) for (const [k, val] of Object.entries(i.u)) {
{
if (val[1]) { if (val[1]) {
urows += inforow(k,val[0],val[1]); urows += inforow(k,val[0],val[1]);
} else { } else {
@ -858,7 +854,6 @@ function updateTrail(e)
function updateBubble(e) function updateBubble(e)
{ {
var bubble = e.target.parentNode.getElementsByTagName('output')[0]; var bubble = e.target.parentNode.getElementsByTagName('output')[0];
if (bubble) { if (bubble) {
bubble.innerHTML = e.target.value; bubble.innerHTML = e.target.value;
} }
@ -1361,9 +1356,9 @@ function makeP(i,pl) {
var content = ""; var content = "";
if (pl) { if (pl) {
var rep = plJson[i].repeat ? plJson[i].repeat : 0; var rep = plJson[i].repeat ? plJson[i].repeat : 0;
content = ` content = `<div class="first c">Playlist Entries</div>
<div class="first c">Playlist Entries</div> <div id="ple${i}"></div>
<div id="ple${i}"></div><label class="check revchkl"> <label class="check revchkl">
Shuffle Shuffle
<input type="checkbox" id="pl${i}rtgl" onchange="plR(${i})" ${plJson[i].r?"checked":""}> <input type="checkbox" id="pl${i}rtgl" onchange="plR(${i})" ${plJson[i].r?"checked":""}>
<span class="checkmark schk"></span> <span class="checkmark schk"></span>
@ -1394,8 +1389,7 @@ function makeP(i,pl) {
<span class="checkmark schk"></span> <span class="checkmark schk"></span>
</label>`; </label>`;
return ` return `<input type="text" class="ptxt noslide" id="p${i}txt" autocomplete="off" maxlength=32 value="${(i>0)?pName(i):""}" placeholder="Enter name..."/><br>
<input type="text" class="ptxt noslide" id="p${i}txt" autocomplete="off" maxlength=32 value="${(i>0)?pName(i):""}" placeholder="Enter name..."/><br>
<div class="c">Quick load label: <input type="text" class="qltxt noslide" maxlength=2 value="${qlName(i)}" id="p${i}ql" autocomplete="off"/></div> <div class="c">Quick load label: <input type="text" class="qltxt noslide" maxlength=2 value="${qlName(i)}" id="p${i}ql" autocomplete="off"/></div>
<div class="h">(leave empty for no Quick load button)</div> <div class="h">(leave empty for no Quick load button)</div>
<div ${pl&&i==0?"style='display:none'":""}> <div ${pl&&i==0?"style='display:none'":""}>

File diff suppressed because it is too large Load Diff