Toggle Regex Script Checkboxes

Added a checkbox to each Regex Script listed under Saved Scripts to easily enable/disable. It can be cumbersome having to load Regex Editor for each script when disabling/enabling multiple Regex Scripts.
This commit is contained in:
LammyShark
2023-10-25 22:48:19 -04:00
parent 339dcaf506
commit 234baf6276
3 changed files with 16 additions and 0 deletions

View File

@@ -76,6 +76,14 @@ async function loadRegexScripts() {
const scriptHtml = scriptTemplate.clone();
scriptHtml.attr('id', uuidv4());
scriptHtml.find('.regex_script_name').text(script.scriptName);
scriptHtml.find('.disable_regex').prop("checked", script.disabled ?? false)
.each(function() {
$(this).closest('.checkbox').find('span').toggle(this.checked);
})
.on('click', function() {
script.disabled = !script.disabled;
$(this).closest('.checkbox').find('span').toggle(this.checked);
});
scriptHtml.find('.edit_existing_regex').on('click', async function() {
await onRegexEditorOpenClick(scriptHtml.attr("id"));
});