From f99d66114b207f6269324a2fd9e61f1ea289e508 Mon Sep 17 00:00:00 2001 From: rdrew Date: Tue, 2 Jun 2026 11:36:04 -0300 Subject: [PATCH] Feature: Captured theme changes from test server --- js/preserve-advanced-search.js | 69 +++++++++++++++++++++++ olivesnews-preserve-advanced-search.patch | 29 ++++++++++ olivesnews.libraries.yml | 8 +++ olivesnews.theme | 1 + 4 files changed, 107 insertions(+) create mode 100644 js/preserve-advanced-search.js create mode 100644 olivesnews-preserve-advanced-search.patch diff --git a/js/preserve-advanced-search.js b/js/preserve-advanced-search.js new file mode 100644 index 0000000..41dc943 --- /dev/null +++ b/js/preserve-advanced-search.js @@ -0,0 +1,69 @@ +(function ($, Drupal, once) { + 'use strict'; + + Drupal.behaviors.preserveAdvancedSearchParams = { + attach: function (context, settings) { + + console.log('preserve-advanced-search.js loaded'); + + // Extract a[] params from the current page URL + const rawSearch = window.location.search; + const aParams = rawSearch + .substring(1) + .split('&') + .filter(part => part.startsWith('a%5B') || part.startsWith('a[')) + .join('&'); + + console.log('[AdvSearch] aParams found:', aParams); + + // Nothing to preserve — bail out + if (!aParams) return; + + // Target the