From 643f3007928e0022d0ca6f39ee4079c881f8979a Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Wed, 30 Nov 2022 19:34:32 +0100 Subject: [PATCH] Playlist creation bugfix (preset 0 selected). --- wled00/data/index.js | 19 +- wled00/html_ui.h | 2270 +++++++++++++++++++++--------------------- wled00/wled.h | 2 +- 3 files changed, 1144 insertions(+), 1147 deletions(-) diff --git a/wled00/data/index.js b/wled00/data/index.js index 93881c08..c8bb7df1 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -17,6 +17,7 @@ var d = document; var palettesData; var fxdata = []; var pJson = {}, eJson = {}, lJson = {}; +var plJson = {}; // array of playlists var pN = "", pI = 0, pNum = 0; var pmt = 1, pmtLS = 0, pmtLast = 0; var lastinfo = {}; @@ -1698,15 +1699,6 @@ function resetUtil() + '
Add segment
'; } -var plJson = {"0":{ - "ps": [0], - "dur": [100], - "transition": [-1], // to be inited to default transition dur - "repeat": 0, - "r": false, - "end": 0 -}}; - function makePlSel(el, incPl=false) { var plSelContent = ""; delete pJson["0"]; // remove filler preset @@ -1787,6 +1779,14 @@ function plR(p) { function makeP(i,pl) { var content = ""; if (pl) { + if (i===0) plJson[0] = { + ps: [1], + dur: [100], + transition: [tr], + repeat: 0, + r: false, + end: 0 + }; var rep = plJson[i].repeat ? plJson[i].repeat : 0; content = `