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:
parent
339dcaf506
commit
234baf6276
|
@ -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"));
|
||||
});
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
<span class="drag-handle menu-handle">☰</span>
|
||||
<div class="regex_script_name flexGrow overflow-hidden"></div>
|
||||
<div class="flex-container flexnowrap">
|
||||
<label class="checkbox flex-container">
|
||||
<span data-i18n="Disabled">Disabled</span>
|
||||
<input id="disabled" type="checkbox" name="disabled" class="disable_regex" />
|
||||
</label>
|
||||
<div class="edit_existing_regex menu_button">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</div>
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
flex-direction: row;
|
||||
}
|
||||
|
||||
.regex_settings .checkbox {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.regex-script-container {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
|
Loading…
Reference in New Issue