regex bulkedit select all button add

8cf30fd51901f7f4aaf31957eb3a3347d1f6ffe3

I <16441743+imesha10@users.noreply.github.com>

Signed
2 files changed, +20 -0Ignore whitespace
public/scripts/extensions/regex/dropdown.html+3 -0
@@ -28,6 +28,9 @@
28 </label>28 </label>
29 </div>29 </div>
30 <div class="regex_bulk_operations flex-container justifyCenter">30 <div class="regex_bulk_operations flex-container justifyCenter">
31 <div id="bulk_select_all_toggle" class="menu_button menu_button_icon" title="Toggle Select All">
32 <i class="fa-solid fa-check-double"></i>
33 </div>
31 <div id="bulk_enable_regex" class="menu_button menu_button_icon">34 <div id="bulk_enable_regex" class="menu_button menu_button_icon">
32 <i class="fa-solid fa-toggle-on"></i>35 <i class="fa-solid fa-toggle-on"></i>
33 <small data-i18n="Enable">Enable</small>36 <small data-i18n="Enable">Enable</small>
public/scripts/extensions/regex/index.js+17 -0
@@ -614,6 +614,23 @@ jQuery(async () => {
614 return scripts.filter(script => selectedIds.includes(script.id));614 return scripts.filter(script => selectedIds.includes(script.id));
615 }615 }
616616
617 $('#bulk_select_all_toggle').on('click', async function () {
618 const checkboxes = $('#regex_container .regex_bulk_checkbox');
619 if (checkboxes.length === 0) {
620 return;
621 }
622
623 const allAreChecked = checkboxes.length === checkboxes.filter(':checked').length;
624 const newState = !allAreChecked; // true if we just checked all, false if we just unchecked all
625
626 checkboxes.prop('checked', newState);
627
628 const icon = $(this).find('i');
629 // Toggle the icon shapes
630 icon.toggleClass('fa-check-double', !newState); // Add 'fa-square-check' when deselected
631 icon.toggleClass('fa-minus', newState); // Add 'fa-square-minus' when selected
632 });
633
617 $('#bulk_enable_regex').on('click', async function () {634 $('#bulk_enable_regex').on('click', async function () {
618 const scripts = getSelectedScripts().filter(script => script.disabled);635 const scripts = getSelectedScripts().filter(script => script.disabled);
619 if (scripts.length === 0) {636 if (scripts.length === 0) {