From 03bc15c42dd6f9d64525a1f03027a6a908026635 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 30 Oct 2023 19:03:35 +0000 Subject: [PATCH] Bug 35192: Highlight search terms in the OPAC Title notes tab Test plan: 1. Create a biblio record with the word 'Fish' in the title (245$a) and the summary (520$a) 2. Set 'OpacHighlightedWords' system preference to 'Highlight' 3. Submit an OPAC search with the search term of 'Fish'. Click on the biblio created in #1 4. Notice 'Fish' in the title is highlighted, as is the Summary. Scroll down to the Holdings table. Click on 'Title notes' and notice 'Fish' is not highlighted in the 'Title notes' 5. Apply patch and restart services 6. Refresh the biblio page. Click on the 'Title notes' tab again 7. Notice 'Fish' is highlighted in the 'Title notes' tab 8. Right click, click 'Inspect element'. Confirm there are no JavaScript errors in the console. Sponsored-by: Catalyst IT, New Zealand --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 1 + 1 file changed, 1 insertion(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index c62cda27266..543a3d68503 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1482,6 +1482,7 @@ q_array[x] = q_array[x].toLowerCase(); var myStopwords = "[% Koha.Preference('NotHighlightedWords') | html %]".toLowerCase().split('|'); if( $.inArray(q_array[x], myStopwords) == -1 ) { + $("#descriptions").highlight(q_array[x]); $(".title").highlight(q_array[x]); $(".author").highlight(q_array[x]); $(".results_summary").highlight(q_array[x]); -- 2.20.1