Merge branch '0_15' into blending-styles

This commit is contained in:
Blaz Kristan
2024-06-30 10:45:54 +02:00
26 changed files with 512 additions and 97 deletions

View File

@@ -588,7 +588,7 @@ function loadFXData(callback = null)
fxdata = [];
if (!retry) {
retry = true;
setTimeout(loadFXData, 500); // retry
setTimeout(()=>{loadFXData(loadFX);}, 500); // retry
}
showToast(e, true);
})
@@ -1713,9 +1713,7 @@ function requestJson(command=null)
fetch(getURL('/json/si'), {
method: type,
headers: {
"Content-type": "application/json; charset=UTF-8"
},
headers: {"Content-Type": "application/json; charset=UTF-8"},
body: req
})
.then(res => {
@@ -2698,7 +2696,9 @@ function setBalance(b)
function rmtTgl(ip,i) {
event.preventDefault();
event.stopPropagation();
fetch(`http://${ip}/win&T=2`, {method: 'get'})
fetch(`http://${ip}/win&T=2`, {
method: 'get'
})
.then((r)=>{
return r.text();
})
@@ -2790,21 +2790,23 @@ function loadPalettesData(callback = null)
function getPalettesData(page, callback)
{
fetch(getURL(`/json/palx?page=${page}`), {
method: 'get',
headers: {
"Content-type": "application/json; charset=UTF-8"
}
method: 'get'
})
.then(res => {
if (!res.ok) showErrorToast();
return res.json();
})
.then(json => {
retry = false;
palettesData = Object.assign({}, palettesData, json.p);
if (page < json.m) setTimeout(()=>{ getPalettesData(page + 1, callback); }, 50);
if (page < json.m) setTimeout(()=>{ getPalettesData(page + 1, callback); }, 75);
else callback();
})
.catch((error)=>{
if (!retry) {
retry = true;
setTimeout(()=>{getPalettesData(page,callback);}, 500); // retry
}
showToast(error, true);
});
}
@@ -2841,7 +2843,8 @@ function search(field, listId = null) {
if (gId("filters").querySelectorAll("input[type=checkbox]:checked").length) return;
// filter list items but leave (Default & Solid) always visible
gId(listId).querySelectorAll('.lstI').forEach((listItem,i)=>{
const listItems = gId("fxlist").querySelectorAll('.lstI');
listItems.forEach((listItem,i)=>{
if (listId!=='pcont' && i===0) return;
const listItemName = listItem.querySelector('.lstIname').innerText.toUpperCase();
const searchIndex = listItemName.indexOf(field.value.toUpperCase());
@@ -3064,7 +3067,7 @@ function size()
function togglePcMode(fromB = false)
{
let ap = (fromB && !lastinfo) || (lastinfo && lastinfo.wifi && lastinfo.witi.ap);
let ap = (fromB && !lastinfo) || (lastinfo && lastinfo.wifi && lastinfo.wifi.ap);
if (fromB) {
pcModeA = !pcModeA;
localStorage.setItem('pcm', pcModeA);