From aa449f514543bbfd74ba6cef6b23afae8dd8705b Mon Sep 17 00:00:00 2001 From: djanelle-mit Date: Tue, 9 Jun 2026 11:45:01 -0400 Subject: [PATCH 1/5] Add USE search box toggle and form to search widget --- .../class-multisearch-widget.php | 65 ++++++++++++++----- .../mitlib-multisearch-widget.css | 57 ++++++++++++++++ .../templates/tab-all-use.php | 39 +++++++++++ 3 files changed, 146 insertions(+), 15 deletions(-) create mode 100644 web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php diff --git a/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php b/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php index e3873dd2..4bdda903 100644 --- a/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php +++ b/web/app/plugins/mitlib-multisearch-widget/class-multisearch-widget.php @@ -45,6 +45,9 @@ public function widget( $args, $instance ) { $articles_tab_name = 'Articles + chapters'; $more_template = 'templates/tab-more-alma.php'; } + if ( 'use' == $instance['targets'] ) { + $all_template = 'templates/tab-all-use.php'; + } // Strip initial arguments. $args = null; @@ -84,27 +87,44 @@ public function widget( $args, $instance ) { include( 'templates/form_nojs.html' ); echo ''; echo '
'; - echo '

Search the MIT libraries

- '; + + // Render the individual tab panes + echo '
'; + include( $all_template ); + echo '
'; + echo '
'; + include( $books_template ); + echo '
'; + echo '
'; + include( $articles_template ); + echo '
'; + echo '
'; + include( $more_template ); + echo '
'; + + }; + + if ( $instance['targets'] == 'use' ) { + + echo '
'; + include( $all_template ); + echo '
'; + + }; + if ( $instance['banner_text'] ) { $allowed = array( 'a' => array( @@ -186,6 +206,21 @@ class="widefat" Alma and Primo +
  • + +
  • All panel

    +
    + +
    +
    + +
    +
    + +
    +
    +
    + From b7da68aa5ca8170f97e3a554834f643d9c60d6d9 Mon Sep 17 00:00:00 2001 From: djanelle-mit Date: Tue, 9 Jun 2026 15:14:02 -0400 Subject: [PATCH 2/5] Updating url to search USE --- .../plugins/mitlib-multisearch-widget/templates/tab-all-use.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php b/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php index 168a587f..f5ebce56 100644 --- a/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php +++ b/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php @@ -10,7 +10,7 @@

    All panel

    From 935b87c99532df4386584178d931949bc532af9c Mon Sep 17 00:00:00 2001 From: djanelle-mit Date: Tue, 23 Jun 2026 08:53:00 -0400 Subject: [PATCH 3/5] Fix use template comment --- .../plugins/mitlib-multisearch-widget/templates/tab-all-use.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php b/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php index f5ebce56..91153526 100644 --- a/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php +++ b/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php @@ -1,6 +1,6 @@ Date: Tue, 23 Jun 2026 08:58:53 -0400 Subject: [PATCH 4/5] Responsive fix for links under search box --- .../mitlib-multisearch-widget.css | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.css b/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.css index 4f68f6b9..f8d85907 100644 --- a/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.css +++ b/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.css @@ -276,51 +276,58 @@ font-size: 0.8rem; color: #ccc; justify-content: space-between; + padding-top: 4px; - a:link { - color: #000; + @media only screen and (max-width: 650px) { + flex-direction: column; + gap: 8px; } + } + + a:link { + color: #000; + } - .nls-toggle { + .nls-toggle { - a { - line-height: 1.3; - } + a { + line-height: 1.3; + } - .toggle { - margin-right: 8px; - } + .toggle { + margin-right: 8px; + } - .toggle::before { - background-color: #333; - color: #fff; - font-size: 0.6rem; - font-weight: 500; - letter-spacing: 0.08em; - padding: 3px 6px; - border-radius: 4px; - display: inline-block; - margin-right: 6px; - position: relative; - top: -1px; - } + .toggle::before { + background-color: #333; + color: #fff; + font-size: 0.6rem; + font-weight: 500; + letter-spacing: 0.08em; + padding: 3px 6px; + border-radius: 4px; + display: inline-block; + margin-right: 6px; + position: relative; + top: -1px; + } - .toggle.off::before { - content: "OFF"; - } + .toggle.off::before { + content: "OFF"; + } - .toggle.on::before { - background-color: #CC00CC; - content: "ON"; - } + .toggle.on::before { + background-color: #CC00CC; + content: "ON"; + } - .learn-more { - color: #666; - } + .learn-more { + color: #666; + } - .learn-more:hover { - color: #000; - } + .learn-more:hover { + color: #000; + } } } \ No newline at end of file From ca8cafadfccdf2ddfa22a6d1a0cad858bcca7166 Mon Sep 17 00:00:00 2001 From: djanelle-mit Date: Tue, 23 Jun 2026 09:53:49 -0400 Subject: [PATCH 5/5] Fix javascript bug from lack of tabs --- .../mitlib-multisearch-widget.js | 33 +++++++++++-------- .../templates/tab-all-use.php | 1 - 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.js b/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.js index eb3c8c8e..842647d8 100644 --- a/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.js +++ b/web/app/plugins/mitlib-multisearch-widget/mitlib-multisearch-widget.js @@ -28,20 +28,25 @@ jQuery( document ).ready(function() { // If javascript is present, we disable the nojs class. $tabs.removeClass("nojs"); - // Call Responsive Tabs plugin. - $tabs.responsiveTabs({ - rotate: false, - startCollapsed: false, - collapsible: false, - setHash: true - }); - - - $( '#search_tabs_nav a' ).click( function(e) { - $( '#search_tabs_nav a' ).removeAttr( "aria-expanded" ); - $( '#search_tabs_nav a .current' ).remove(); - $(this).attr( "aria-expanded", "true" ).prepend( "Current: " ); - }); + // Check if this is the USE form and does not need tabs. + if ( $('#search-all').hasClass("use") ) { + // add r-tabs class to force styling of the form to be consistent with the other tabs. + $tabs.addClass("r-tabs"); + } else { + // Call Responsive Tabs plugin. + $tabs.responsiveTabs({ + rotate: false, + startCollapsed: false, + collapsible: false, + setHash: true + }); + + $( '#search_tabs_nav a' ).click( function(e) { + $( '#search_tabs_nav a' ).removeAttr( "aria-expanded" ); + $( '#search_tabs_nav a .current' ).remove(); + $(this).attr( "aria-expanded", "true" ).prepend( "Current: " ); + }); + } // prevent submission until text field is not empty preventSearch( '#searchinput-bento', '.search-bento .button-search'); diff --git a/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php b/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php index 91153526..ba80a7f1 100644 --- a/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php +++ b/web/app/plugins/mitlib-multisearch-widget/templates/tab-all-use.php @@ -7,7 +7,6 @@ */ ?> -

    All panel