Skip to content

Commit

Permalink
支持CloseWatcher返回事件
Browse files Browse the repository at this point in the history
  • Loading branch information
qinlili23333 committed Dec 12, 2023
1 parent 6f58cbb commit 54f666c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ <H3>去全部歌单里添加一些吧</H3>
document.getElementById("floatMenu").style.transform = "scale(1,1)";
await sleep(295);
document.getElementById("floatMenu").style.overflowY = "auto";
if (window.CloseWatcher) {
let MenuBack = new CloseWatcher();
MenuBack.onclose = () => {
lastClickMenu = lastClick;
hideMenu();
};
}
};
const hideMenu = async () => {
document.getElementById("floatMenu").style.transform = "scale(0.1, 0.1)";
Expand Down Expand Up @@ -797,6 +804,12 @@ <H3>去全部歌单里添加一些吧</H3>
document.getElementById("loading").style.display = loading ? "block" : "none";
document.getElementById("tips").innerText = text;
};
const setTempStatus = (text, time) => {
document.getElementById("loading").style.display = "none";
let currentText = document.getElementById("tips").innerText;
setTimeout(() => { document.getElementById("tips").innerText = currentText }, time);
document.getElementById("tips").innerText = text;
}
let player = document.getElementById("player");
(async () => {
if (window.codecBoost && window.wasmPlayer) {
Expand Down Expand Up @@ -1105,6 +1118,12 @@ <H3>去全部歌单里添加一些吧</H3>
audioFilesModule.style.transform = "scale(1,1)";
await sleep(200);
audioFolderModule.style.display = "none";
if (window.CloseWatcher) {
let FolderBack = new CloseWatcher();
FolderBack.onclose = () => {
switchListDisplay(0);
};
}
break;
};
}
Expand Down Expand Up @@ -1602,6 +1621,16 @@ <H3>去全部歌单里添加一些吧</H3>
};
setStatus("就绪");
document.title = "545在线";
if (window.CloseWatcher) {
const createWatcher = () => {
let WindowBack = new CloseWatcher();
WindowBack.onclose = () => {
setTempStatus("2秒内再按一次返回退出", 2000);
setTimeout(createWatcher, 2000);
};
}
createWatcher();
}
if (!window.wasmPlayer && !window.codecBoost && window.self === window.top) {
recoverPlay();
}
Expand Down

0 comments on commit 54f666c

Please sign in to comment.