Merge pull request #1288 from LammyShark/staging
Toggle Regex Script Checkboxes
This commit is contained in:
commit
5e88edf22d
|
@ -76,6 +76,14 @@ async function loadRegexScripts() {
|
||||||
const scriptHtml = scriptTemplate.clone();
|
const scriptHtml = scriptTemplate.clone();
|
||||||
scriptHtml.attr('id', uuidv4());
|
scriptHtml.attr('id', uuidv4());
|
||||||
scriptHtml.find('.regex_script_name').text(script.scriptName);
|
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() {
|
scriptHtml.find('.edit_existing_regex').on('click', async function() {
|
||||||
await onRegexEditorOpenClick(scriptHtml.attr("id"));
|
await onRegexEditorOpenClick(scriptHtml.attr("id"));
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
<span class="drag-handle menu-handle">☰</span>
|
<span class="drag-handle menu-handle">☰</span>
|
||||||
<div class="regex_script_name flexGrow overflow-hidden"></div>
|
<div class="regex_script_name flexGrow overflow-hidden"></div>
|
||||||
<div class="flex-container flexnowrap">
|
<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">
|
<div class="edit_existing_regex menu_button">
|
||||||
<i class="fa-solid fa-pencil"></i>
|
<i class="fa-solid fa-pencil"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.regex_settings .checkbox {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.regex-script-container {
|
.regex-script-container {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
Loading…
Reference in New Issue