Allow playlist as end preset in playlist.

Playlist chaining.
This commit is contained in:
Blaz Kristan 2021-10-06 19:12:30 +02:00
parent 9f230ae339
commit 02fcccc8c7
3 changed files with 613 additions and 613 deletions

View File

@ -557,7 +557,6 @@ function populatePresets(fromls)
let i = is[a]; let i = is[a];
if (expanded[i+100]) expand(i+100, true); if (expanded[i+100]) expand(i+100, true);
} }
makePlSel(arr);
} else { presetError(true); } } else { presetError(true); }
updatePA(true); updatePA(true);
populateQL(); populateQL();
@ -1359,14 +1358,15 @@ var plJson = {"0":{
"end": 0 "end": 0
}}; }};
function makePlSel(incPl=false) {
var plSelContent = ""; var plSelContent = "";
function makePlSel(arr) { var arr = Object.entries(pJson);
plSelContent = "";
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
var n = arr[i][1].n ? arr[i][1].n : "Preset " + arr[i][0]; var n = arr[i][1].n ? arr[i][1].n : "Preset " + arr[i][0];
if (arr[i][1].playlist && arr[i][1].playlist.ps) continue; //remove playlists, sub-playlists not yet supported if (!incPl && arr[i][1].playlist && arr[i][1].playlist.ps) continue; //remove playlists, sub-playlists not yet supported
plSelContent += `<option value=${arr[i][0]}>${n}</option>` plSelContent += `<option value=${arr[i][0]}>${n}</option>`
} }
return plSelContent;
} }
function refreshPlE(p) { function refreshPlE(p) {
@ -1452,7 +1452,7 @@ function makeP(i,pl) {
<div class="sel">End preset:<br> <div class="sel">End preset:<br>
<select class="sel sel-ple" id="pl${i}selEnd" onchange="plR(${i})" data-val=${plJson[i].end?plJson[i].end:0}> <select class="sel sel-ple" id="pl${i}selEnd" onchange="plR(${i})" data-val=${plJson[i].end?plJson[i].end:0}>
<option value=0>None</option> <option value=0>None</option>
${plSelContent} ${makePlSel(true)}
</select></div> </select></div>
</div> </div>
<div class="c"><button class="btn btn-p" onclick="testPl(${i}, this)"><i class='icons btn-icon'>&#xe139;</i>Test</button></div>`; <div class="c"><button class="btn btn-p" onclick="testPl(${i}, this)"><i class='icons btn-icon'>&#xe139;</i>Test</button></div>`;
@ -1513,7 +1513,7 @@ function makePlEntry(p,i) {
<tr> <tr>
<td width="80%" colspan=2> <td width="80%" colspan=2>
<select class="sel sel-pl" onchange="plePs(${p},${i},this)" data-val="${plJson[p].ps[i]}" data-index="${i}"> <select class="sel sel-pl" onchange="plePs(${p},${i},this)" data-val="${plJson[p].ps[i]}" data-index="${i}">
${plSelContent} ${makePlSel()}
</select> </select>
</td> </td>
<td class="c"><button class="btn btn-pl-add" onclick="addPl(${p},${i})"><i class="icons btn-icon">&#xe18a;</i></button></td> <td class="c"><button class="btn btn-pl-add" onclick="addPl(${p},${i})"><i class="icons btn-icon">&#xe18a;</i></button></td>

View File

@ -9,7 +9,7 @@
// Autogenerated from wled00/data/simple.htm, do not edit!! // Autogenerated from wled00/data/simple.htm, do not edit!!
const uint16_t PAGE_simple_L = 28898; const uint16_t PAGE_simple_L = 28898;
const uint8_t PAGE_simple[] PROGMEM = { const uint8_t PAGE_simple[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0a, 0xe4, 0xbd, 0x69, 0x7b, 0xda, 0xc8, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xe4, 0xbd, 0x69, 0x7b, 0xda, 0xc8,
0xb6, 0x30, 0xfa, 0x3d, 0xbf, 0x82, 0x28, 0xbd, 0xd3, 0x28, 0x88, 0x79, 0x88, 0x0d, 0x51, 0x7c, 0xb6, 0x30, 0xfa, 0x3d, 0xbf, 0x82, 0x28, 0xbd, 0xd3, 0x28, 0x88, 0x79, 0x88, 0x0d, 0x51, 0x7c,
0x04, 0x06, 0x8f, 0x78, 0x00, 0x63, 0xc7, 0x71, 0x7b, 0xef, 0x57, 0x08, 0x21, 0x64, 0x0b, 0x09, 0x04, 0x06, 0x8f, 0x78, 0x00, 0x63, 0xc7, 0x71, 0x7b, 0xef, 0x57, 0x08, 0x21, 0x64, 0x0b, 0x09,
0x4b, 0x62, 0xb2, 0xcd, 0xfd, 0xed, 0x77, 0xad, 0xaa, 0xd2, 0x04, 0xc2, 0x76, 0xef, 0xb3, 0xcf, 0x4b, 0x62, 0xb2, 0xcd, 0xfd, 0xed, 0x77, 0xad, 0xaa, 0xd2, 0x04, 0xc2, 0x76, 0xef, 0xb3, 0xcf,

File diff suppressed because it is too large Load Diff