elements: remove deprecated stuff

This commit is contained in:
wukko 2023-12-26 01:10:40 +06:00
parent cc47f9fd8a
commit 210ac86e3f

View file

@ -179,14 +179,6 @@ export function settingsCategory(obj) {
export function footerButtons(obj) {
let items = ``
for (let i = 0; i < obj.length; i++) {
switch (obj[i]["type"]) {
case "toggle":
items += `<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="toggle('${obj[i]["name"]}')" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>`;
break;
case "action":
items += `<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="${obj[i]["action"]}()" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>`;
break;
case "popup":
let buttonName = obj[i]["context"] ? `${obj[i]["name"]}-${obj[i]["context"]}` : obj[i]["name"],
context = obj[i]["context"] ? `, '${obj[i]["context"]}'` : '',
buttonName2,
@ -197,14 +189,12 @@ export function footerButtons(obj) {
context2 = obj[i + 1]["context"] ? `, '${obj[i + 1]["context"]}'` : '';
}
items += `
<div class="footer-pair">
items +=
`<div class="footer-pair">
<button id="${buttonName}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1${context})" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>
${obj[i + 1] ? `<button id="${buttonName2}-footer" class="switch footer-button" onclick="popup('${obj[i + 1]["name"]}', 1${context2})" aria-label="${obj[i + 1]["aria"]}">${obj[i + 1]["text"]}</button>` : ''}
</div>`;
i++;
break;
}
}
return `
<div id="footer-buttons">${items}</div>`