MCPcopy Create free account
hub / github.com/error311/FileRise / wireIgnoreRegexPresetButton

Function wireIgnoreRegexPresetButton

public/js/adminPanel.js:872–904  ·  view source on GitHub ↗
(scope = document)

Source from the content-addressed store, hash-verified

870}
871
872function wireIgnoreRegexPresetButton(scope = document) {
873 const btn = scope.querySelector('#ignoreRegexSnapshotsPreset');
874 const input = scope.querySelector('#ignoreRegex');
875 if (!btn || !input || btn.__wired) return;
876
877 btn.__wired = true;
878
879 const preset = '(^|/)(@?snapshots?)(/|$)';
880
881 btn.addEventListener('click', (e) => {
882 e.preventDefault();
883 if (input.disabled) return;
884
885 const current = String(input.value || '');
886 const hasPreset = current
887 .replace(/\r\n/g, '\n')
888 .split('\n')
889 .some(line => line.trim() === preset);
890 if (hasPreset) {
891 input.focus();
892 return;
893 }
894
895 if (current.trim() === '') {
896 input.value = preset;
897 } else {
898 const suffix = current.endsWith('\n') ? '' : '\n';
899 input.value = current + suffix + preset;
900 }
901
902 input.focus();
903 });
904}
905
906function renderAdminEncryptionSection({ config, dark }) {
907 const host = document.getElementById("encryptionContent");

Callers 1

openAdminPanelFunction · 0.85

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected