MCPcopy Create free account
hub / github.com/cfwuya1/sublink-worker-admin / applyPredefinedRulesFunction

Function applyPredefinedRulesFunction

src/htmlBuilder.js:378–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376`;
377
378const applyPredefinedRulesFunction = () => `
379 function applyPredefinedRules() {
380 const select = document.getElementById('predefinedRules');
381 if (!select) return;
382 const predefinedRules = select.value;
383 const checkboxes = document.querySelectorAll('.rule-checkbox');
384 checkboxes.forEach(checkbox => { checkbox.checked = false; });
385 if (predefinedRules === 'custom') return;
386 const rulesToApply = ${JSON.stringify(PREDEFINED_RULE_SETS)};
387 rulesToApply[predefinedRules].forEach(rule => {
388 const checkbox = document.getElementById(rule);
389 if (checkbox) checkbox.checked = true;
390 });
391 }
392`;
393
394const submitFormFunction = () => `
395 async function submitForm(event) {

Callers 1

generateScriptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected