修改边栏逻辑 添加超时

This commit is contained in:
woohoo 2021-11-05 16:55:05 +08:00
parent 27b273aef7
commit 2eba35a3a5

View File

@ -197,16 +197,16 @@
*/ */
let sidebarTimeOut=60; // 60秒后取消定时 let sidebarTimeOut=60; // 60秒后取消定时
const sidebarInterval = setInterval(() => { const sidebarInterval = setInterval(() => {
if ($('div[class^="sidebar"]').length === 0) {
sidebarTimeOut--; sidebarTimeOut--;
if (sidebarTimeOut<0){ if (sidebarTimeOut < 0) {
clearInterval(sidebarInterval); clearInterval(sidebarInterval);
}
return; return;
} }
if ($('div[class^="sidebar"]').length === 0)
return;
// 边栏块标题 // 边栏块标题
$('h2[class^="header"]')[0].firstChild.nodeValue = '信息'; $('h2[class^="header"]')[0].firstChild.nodeValue = '信息';
$('h2[class^="header"]')[1].firstChild.nodeValue = '区域'; // todo 当前文字替换会触发torn js bug $('h2[class^="header"]')[1].firstChild.nodeValue = '区域'; // todo 当前文字替换会触发torntools bug
$('h2[class^="header"]')[2].firstChild.nodeValue = '列表'; $('h2[class^="header"]')[2].firstChild.nodeValue = '列表';
// 边栏人物名字 // 边栏人物名字
$('span[class^="menu-name"]')[0].firstChild.nodeValue = '名字:'; $('span[class^="menu-name"]')[0].firstChild.nodeValue = '名字:';