Update app.js

This commit is contained in:
Justin 2022-06-12 00:19:01 +08:00 committed by GitHub
parent 5708986095
commit 72368a201f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -754,10 +754,13 @@ var allFeaturesLimit = [
var createLi = false;
// function addingItems() {
allFeaturesTextAddBtn.map((value, index) => {
if (value !== null) {
value.addEventListener("click", () => {
if (value == messagesTextAddBtn) {
if ((value == messagesTextAddBtn) && (createLi === true)) {
// custom message
let messageName = document.getElementById("inputText13").value;
let scrollSpeed1 = document.getElementById("inputScrollSpeed13").value;
@ -801,6 +804,7 @@ allFeaturesTextAddBtn.map((value, index) => {
// getCustomMsg
// ? localStorage.setItem("customMsg", JSON.stringify(newValues))
// : localStorage.setItem("customMsg", JSON.stringify([values]));
var tag = document.createElement("li");
var msg = "You've reached the maximum limit of items to add for this feature";
@ -814,8 +818,9 @@ allFeaturesTextAddBtn.map((value, index) => {
allFeatures[index].appendChild(tag);
changeVarValue();
addEventOnFeaturesList();
}
}
createLi = false;
}}
} else {
var msg = "You've reached the maximum limit of items to add for this feature";
@ -825,25 +830,20 @@ allFeaturesTextAddBtn.map((value, index) => {
}
else{
if (createLi === true) {
var tag = document.createElement("li");
tag.innerHTML = allFeaturesText[index].value;
allFeatures[index].appendChild(tag);
changeVarValue();
addEventOnFeaturesList();
createLi = false;
}
}
});
}});
}
});
var startButton = document.getElementById("start-btn");
// start the display
startButton.addEventListener("click", () => {
fetch("/start", {
method: "PUT",
});
});
var brightnessButton = document.getElementById("brightness-btn");
// start the display
brightnessButton.addEventListener("click", () => {