MCPcopy
hub / github.com/xcanwin/KeepChatGPT / setToggleChecked

Function setToggleChecked

KeepChatGPT.user.js:1001–1011  ·  view source on GitHub ↗
(menuId, checked = false)

Source from the content-addressed store, hash-verified

999
1000 // 设置统一的开关视觉状态,避免节点不存在时抛出错误。
1001 const setToggleChecked = function (menuId, checked = false) {
1002 const ncheck = $(`#${menuId} .checkbutton`);
1003 if (!ncheck) {
1004 return;
1005 }
1006 if (checked) {
1007 ncheck.classList.add("checked");
1008 } else {
1009 ncheck.classList.remove("checked");
1010 }
1011 };
1012
1013 const normalizeKcgHue = function (value) {
1014 const parsed = parseInt(value);

Callers 1

setUserOptionsFunction · 0.85

Calls 2

$Function · 0.85
addMethod · 0.80

Tested by

no test coverage detected