// ==UserScript== // @name Deku Deals - Better Filter Menu // @namespace NooScripts // @match https://www.dekudeals.com/* // @grant none // @version 1.1 // @author NooScripts // @description Adds buttons to each search filter group to collapse them for easier viewing // @license MIT // @require https://code.jquery.com/jquery-3.6.0.min.js // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Function to collapse or expand all card-bodies function toggleAllCardBodies(collapseAll) { $('.search-facet').each(function() { var $searchFacet = $(this); var $cardBodies = $searchFacet.find('.card-body'); $cardBodies.each(function() { var $thisCardBody = $(this); $thisCardBody.toggleClass('collapsed', collapseAll); if (collapseAll) { $thisCardBody.css('display', 'none'); } else { $thisCardBody.css('display', ''); } }); }); $('#toggle-button-all').text(collapseAll ? 'Expand All' : 'Collapse All'); } // Find the first .search-facet element var $firstSearchFacet = $('.search-facet').first(); // Add Collapse All button above the first .search-facet var $collapseAllButton = $('