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

Function menu_switch

V2ex-Enhanced.user.js:58–67  ·  view source on GitHub ↗
(menu_status, Name, Tips)

Source from the content-addressed store, hash-verified

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

Callers 1

registerMenuCommandFunction · 0.70

Calls 1

registerMenuCommandFunction · 0.70

Tested by

no test coverage detected