mirror of
https://github.com/wled/WLED.git
synced 2025-07-22 02:06:32 +00:00
add Webpage shortcuts, resolves #2362
This commit is contained in:
parent
ff10130176
commit
d2984e9e16
@ -272,6 +272,7 @@ function onLoad()
|
|||||||
|
|
||||||
selectSlot(0);
|
selectSlot(0);
|
||||||
updateTablinks(0);
|
updateTablinks(0);
|
||||||
|
handleLocationHash();
|
||||||
cpick.on("input:end", () => {setColor(1);});
|
cpick.on("input:end", () => {setColor(1);});
|
||||||
cpick.on("color:change", () => {updatePSliders()});
|
cpick.on("color:change", () => {updatePSliders()});
|
||||||
pmtLS = localStorage.getItem('wledPmt');
|
pmtLS = localStorage.getItem('wledPmt');
|
||||||
@ -314,6 +315,21 @@ function openTab(tabI, force = false)
|
|||||||
_C.classList.toggle('smooth', false);
|
_C.classList.toggle('smooth', false);
|
||||||
_C.style.setProperty('--i', iSlide);
|
_C.style.setProperty('--i', iSlide);
|
||||||
updateTablinks(tabI);
|
updateTablinks(tabI);
|
||||||
|
switch (tabI) {
|
||||||
|
case 0: window.location.hash = "Colors"; break;
|
||||||
|
case 1: window.location.hash = "Effects"; break;
|
||||||
|
case 2: window.location.hash = "Segments"; break;
|
||||||
|
case 3: window.location.hash = "Presets"; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleLocationHash() {
|
||||||
|
switch (window.location.hash) {
|
||||||
|
case "#Colors": openTab(0); break;
|
||||||
|
case "#Effects": openTab(1); break;
|
||||||
|
case "#Segments": openTab(2); break;
|
||||||
|
case "#Presets": openTab(3); break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var timeout;
|
var timeout;
|
||||||
@ -3212,6 +3228,7 @@ size();
|
|||||||
_C.style.setProperty('--n', N);
|
_C.style.setProperty('--n', N);
|
||||||
|
|
||||||
window.addEventListener('resize', size, true);
|
window.addEventListener('resize', size, true);
|
||||||
|
window.addEventListener('hashchange', handleLocationHash);
|
||||||
|
|
||||||
_C.addEventListener('mousedown', lock, false);
|
_C.addEventListener('mousedown', lock, false);
|
||||||
_C.addEventListener('touchstart', lock, false);
|
_C.addEventListener('touchstart', lock, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user