MCPcopy Create free account
hub / github.com/XIU2/UserScript / menu_toggle

Function menu_toggle

DarkMode.user.js:302–316  ·  view source on GitHub ↗
(menu_status, Name)

Source from the content-addressed store, hash-verified

300
301 // 切换暗黑模式
302 function menu_toggle(menu_status, Name) {
303 menu_status = parseInt(menu_status)
304 if (menu_status >= 3){
305 menu_status = 1;
306 } else {
307 menu_status += 1;
308 }
309 GM_setValue(`${Name}`, menu_status);
310 registerMenuCommand(); // 重新注册脚本菜单
311 if (document.getElementById('XIU2DarkMode')) {
312 document.getElementById('XIU2DarkMode').remove(); // 即时修改样式
313 addStyle();
314 }
315 //location.reload(); // 刷新网页
316 };
317
318
319 // 菜单开关

Callers 1

registerMenuCommandFunction · 0.70

Calls 2

registerMenuCommandFunction · 0.70
addStyleFunction · 0.70

Tested by

no test coverage detected