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

Function menu_switch

Zhiyoo-Enhanced.user.js:57–66  ·  view source on GitHub ↗
(menu_status, Name, Tips)

Source from the content-addressed store, hash-verified

55
56 // 菜单开关
57 function menu_switch(menu_status, Name, Tips) {
58 if (menu_status == 'true'){
59 GM_setValue(`${Name}`, false);
60 GM_notification({text: `已关闭 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
61 }else{
62 GM_setValue(`${Name}`, true);
63 GM_notification({text: `已开启 [${Tips}] 功能\n(点击刷新网页后生效)`, timeout: 3500, onclick: function(){location.reload();}});
64 }
65 registerMenuCommand(); // 重新注册脚本菜单
66 };
67
68 // 返回菜单值
69 function menu_value(menuName) {

Callers 1

registerMenuCommandFunction · 0.70

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected