regex bulkedit select all button add

8cf30fd51901f7f4aaf31957eb3a3347d1f6ffe3

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

Signed
2 files changed, +20 -0Showing whitespace changes
public/scripts/extensions/regex/dropdown.html+3 -0
@@ -28,6 +28,9 @@
2828 </label>
2929 </div>
3030 <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>
3134 <div id="bulk_enable_regex" class="menu_button menu_button_icon">
3235 <i class="fa-solid fa-toggle-on"></i>
3336 <small data-i18n="Enable">Enable</small>
public/scripts/extensions/regex/index.js+17 -0
@@ -614,6 +614,23 @@ jQuery(async () => {
614614 return scripts.filter(script => selectedIds.includes(script.id));
615615 }
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+
617634 $('#bulk_enable_regex').on('click', async function () {
618635 const scripts = getSelectedScripts().filter(script => script.disabled);
619636 if (scripts.length === 0) {