Merge pull request #1288 from LammyShark/staging

Toggle Regex Script Checkboxes
This commit is contained in:
Cohee
2023-11-05 23:18:23 +02:00
committed by GitHub
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"));
});