Koha/koha-tmpl/intranet-tmpl/prog/en/includes
Andreas Roussos f98e4faee2 Bug 29578: Upgrade the jQuery highlighter plugin
Under certain conditions, the jQuery term highlighter
can break and in the process make the "Highlight" /
"Unhighlight" button disappear altogether. This affects
catalog searches in both the OPAC and the Staff Client,
with UNIMARC-based instances affected the most as the
"Highlight" / "Unhighlight" button disappears if you
perform a specific OPAC search (see Test plan below).

This patch fixes that by upgrading the highlighter
plugin to its latest version for both the OPAC and
the Staff interface. Then, the changes from commit
2e4b574074 (Bug 5844) are applied to the plugin code.
Also, Koha uses "term" instead of "highlight" as the
class name for the <span> highlighting elements, so
the plugin code is modified for that aspect, too.
Finally, the plugin file is renamed to reflect the
version change (v3 -> v5) and all references to the
old filename in the Template files are updated.

Test plan:

0) In a UNIMARC instance, catalogue two books using
   the titles given below (Title subfield = 200$a):

   Book 1: Συλλογής των εν επιτομή τοῖς πάλαι γεωγραφηθέντων
   Book 2: Επιτομή της ιστορίας των Βαλκανικών Πολέμων (1912-1913)

1) OpacHighlightedWords and StaffHighlightedWords
   should both be set to "Highlight".

2) Search the OPAC for "επιτομή των" (without the
   quotes). In the results page, notice that:

   a) You get an Uncaught DOMException error in the
      web browswer's JavaScript Console (press F12):
      "Failed to execute 'splitText' on 'Text': The
      offset 3 is larger than the Text node's length."
   b) the "Highlight" / "Unhighlight" button vanishes
   c) some search terms matches are not highlighted
      (for example "των" in the 2nd Book)

3) Repeat the same search in the Staff interface.
   In the results page, notice that:

   a) You get an Uncaught DOMException error in the
      web browswer's JavaScript Console (press F12):
      "Failed to execute 'splitText' on 'Text': The
      offset 3 is larger than the Text node's length."
   b) Even though some terms are highlighted, the
      button still says "Highlight"
   c) some search terms matches are not highlighted
      (for example "των" in the 2nd Book)

4) Apply this patch.

5) Repeat the searches (you may have to press CTRL-F5
   to reload the JavaScript code). This time the
   "Highlight" / "Unhighlight" button is displayed
   in the OPAC, and all your search terms should be
   highlighted in yellow. Toggling the highlight
   should cause no problems, and there shouldn't be
   any errors logged in your browser's Console.

Signed-off-by: Christian Nelson <christian.nelson@uwasa.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bee56606a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-08-29 20:35:35 -10:00
..
background_jobs Bug 32970: (follow-up) Move include to specific job file 2023-05-16 10:17:11 -03:00
catalogue Bug 33070: Remove use of can_edit_items 2023-03-17 09:59:02 -03:00
csv_headers Bug 28327: Unify CSV delimiter special behavior for tabulation 2022-08-19 15:53:12 -03:00
mana Bug 30952: Undo change to Home breadcrumb for remaining templates 2022-10-12 16:00:50 -03:00
modals Bug 31028: (follow-up) Consistently style help-block 2023-03-06 11:23:17 -03:00
str Bug 34354: Fix progess typo 2023-08-17 09:56:31 -10:00
virtualshelves/merge Bug 32097: Consistent classes for primary buttons: Lists 2022-11-10 10:27:17 -03:00
about-team.inc Bug 29602: Surround strings with span tag 2022-04-19 21:25:51 -10:00
accounts.inc Bug 26403: (QA follow-up) Add missing debit and credit types to includes 2023-05-10 15:26:15 -03:00
acquisitions-add-to-basket.inc Bug 34002: Check for stage_marc_import permssion 2023-07-18 07:02:36 +01:00
acquisitions-menu.inc Bug 33663: Don't hide Suggestions link in side navigation when suggestion preference is disabled 2023-05-23 16:53:57 -03:00
acquisitions-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
acquisitions-toolbar.inc Bug 28082: Add acquisitions toolbar to vendors on vendor search page 2022-05-10 15:17:17 -10:00
additional-fields-display.inc
additional-fields-entry.inc Bug 11844: (follow-up) Fix terminology: biblio should be bibliographic record 2023-05-16 12:58:38 +02:00
admin-icon-selection.inc Bug 33158: (follow-up) Fix for QA test failure 2023-05-16 15:17:31 -03:00
admin-items-search-field-form.inc Bug 32213: Reindent item search fields templates 2022-11-29 09:05:15 -03:00
admin-menu.inc Bug 34345: 'Circulation and fine rules' vs 'Circulation and fines rules' 2023-08-29 11:33:52 -10:00
adv-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
auth-finder-search.inc Bug 29434: add UNIMARC relationship codes for authorities 2022-08-09 07:42:21 -03:00
auth-two-factor.inc Bug 34028: Fix manual entry for two factor authentication 2023-06-26 14:56:48 +02:00
authorities-search-results.inc Bug 29602: Surround strings with span tag 2022-04-19 21:25:51 -10:00
authorities-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
authorities-toolbar.inc Bug 28542: Move new authority from Z39.50/SRU to a button 2021-06-21 10:10:01 +02:00
authorities.inc
authorities_js.inc Bug 34343: Update style of fixed footer navbar in Z39.50 searches 2023-08-17 10:22:58 -10:00
authority-detail-modal.inc Bug 29965: Preview MARC in authority search results 2022-02-23 22:05:33 -10:00
av-build-dropbox.inc Bug 30603: Display Sort1 and Sort2 as free text if no AV exists 2022-05-10 23:09:09 -10:00
biblio-title-head.inc
biblio-title.inc Bug 33946: (QA follow-up) Add spans and classes for styling and translatability 2023-07-18 12:33:55 +01:00
biblio-view-menu.inc Bug 32005: Cleanup indenting 2022-11-10 09:21:50 -03:00
blocked-fines.inc Bug 30487: Convert checkout and patron details page tabs to Bootstrap 2022-10-17 08:06:34 -03:00
blocking_errors.inc Bug 34469: Block editing for received order lines 2023-08-17 09:38:27 -10:00
branch-selector.inc
budget_planning.inc Bug 30629: fix <span> in title of some pages 2022-06-01 16:28:28 -03:00
budgets-active-currency.inc
budgets-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
budgets-admin-toolbar.inc
calendar.inc Bug 19249: Fix date inputs on patron quick add form 2023-05-05 09:13:25 -03:00
cat-menu.inc Bug 31028: Add ability to report concerns from the staff interface 2023-03-06 11:23:17 -03:00
cat-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
cat-toolbar.inc Bug 31028: Add ability to report concerns from the staff interface 2023-03-06 11:23:17 -03:00
catalog-strings.inc Bug 9565: (follow-up) Deleting a biblio should alert/fail if there are existent subscriptions 2021-12-10 21:15:30 -10:00
cataloging-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
catalogue-search-box.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
cateditor-ui.inc Bug 32253: Load all CodeMirror lines initially when using advanced editor 2023-05-05 09:13:38 -03:00
cateditor-widgets-marc21.inc Bug 32321: Pre-populate material type for 006 in advanced cataloging editor 2023-01-27 15:14:47 -03:00
category-out-of-age-limit.inc
chart.inc
checkin-search-box.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
checkin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
checkouts-table-footer.inc Bug 30718: Fix time display 2022-08-19 08:26:38 -03:00
checkouts-table.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
circ-menu.inc Bug 33038: Add classes to patroncategorycode for easier customization 2023-04-17 09:39:44 -03:00
circ-nav.inc Bug 30624: Add loggedinlibrary permission and DB update 2023-03-13 15:22:59 -03:00
circ-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
cities-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
clubs-table.inc Bug 29602: (follow-up) Surround strings with span tag 2022-04-19 21:25:51 -10:00
columns_settings.inc Bug 31994: DataTable next button does not work when using data in the HTML 2023-04-06 10:03:15 -03:00
contracts-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
country-list.inc
csrf-token.inc Bug 30524: (QA follow-up) Only generate CSRF token if it will be used 2023-07-28 09:12:39 -10:00
currencies-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
datatables.inc Bug 8179: (follow-up) Fix currency change and remove datatables select 2023-05-15 08:53:52 -03:00
date-format.inc
delimiter_text.inc Bug 27486: Rename system preference delimiter to CSVDelimiter 2021-01-29 09:03:45 +01:00
desks-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
doc-head-close-receipt.inc
doc-head-close.inc Bug 8179: Remove ref to select.dataTables.min.css 2023-05-16 09:59:08 +02:00
doc-head-open.inc Bug 30543: Decouple DumpSearchQueryTemplate from other tempalte dump preferences 2022-08-09 08:44:14 -03:00
empty_line.inc
erm-search.inc Bug 33064: Add a licenses option to the searchbar 2023-05-10 15:26:21 -03:00
facets.inc Bug 33140: Use facet label value for mouseover text on facet removal link 2023-08-17 10:18:43 -10:00
filter-orders.inc Bug 31991: Restore style of sidebar forms 2022-10-27 09:41:39 -03:00
form-blocks.inc
format_price.inc Bug 33028: (follow-up) Add unformat_price js function 2023-08-07 20:04:15 -10:00
greybox.inc
guided-reports-view.inc Bug 28454: Add Koha version number to database schema link in reports 2021-09-29 12:47:33 +02:00
header.inc Bug 34288: Allow access to the cataloguing module with tools permission 2023-07-19 08:32:47 +01:00
holds_table.inc Bug 25856: Add suspend class to tr's of suspended holds 2023-03-17 09:59:03 -03:00
home-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
html_helpers.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
i18n.inc Bug 26816: Chomp whitespace around i18n strings 2020-11-02 11:03:09 +01:00
ill-availability-table.inc
ill-list-table-strings.inc Bug 22440: New ILL requests table 2023-05-05 09:13:41 -03:00
ill-list-table.inc Bug 33786: ILL requests table id 2023-06-09 12:04:39 -03:00
ill-toolbar.inc
installer-doc-head-close.inc Bug 30011: Update links to jQueryUI assets, remove datepicker references, etc. 2022-04-08 15:49:16 +02:00
installer-intranet-bottom.inc Bug 29155: Update links to jQuery and jQuery Migrate files 2022-04-25 10:00:22 -10:00
installer-strings.inc
intranet-bottom.inc
intranetstylesheet.inc
job_progress.inc Bug 34364: Fix progress bar progress update 2023-08-21 20:26:30 -10:00
js-biblio-format.inc Bug 33873: Improve check for inexistant biblio object 2023-06-09 12:04:44 -03:00
js-date-format.inc Bug 30310: Fix date_to_rfc3339 2023-01-31 10:19:46 -03:00
js-patron-format-address.inc Bug 26967: Correctly format patron address in autocomplete 2023-04-21 10:36:26 -03:00
js-patron-format.inc Bug 33504: Update patron_to_html to deal with null 2023-05-05 09:13:20 -03:00
js-patron-get-age.inc Bug 30059: Deal with timezones 2022-03-24 14:22:10 -10:00
js_includes.inc Bug 29578: Upgrade the jQuery highlighter plugin 2023-08-29 20:35:35 -10:00
keyboard_shortcuts.inc
labels-toolbar.inc
langmenu-staff-top.inc
last-borrower.inc Bug 30952: Staff interface redesign (header) 2022-10-12 15:58:16 -03:00
letters-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
member-alt-address-style.inc Bug 30603: Fix other occurrences 2022-05-10 23:09:09 -10:00
member-alt-contact-style.inc Bug 29213: Fix typo ol in member-alt-contact-style.inc 2021-10-15 11:34:26 +02:00
member-display-address-style.inc Bug 21794: (QA follow-up) Separate city and country with a comma 2021-09-09 10:59:38 +02:00
member-display-alt-address-style.inc Bug 21794: (QA follow-up) Separate city and country with a comma 2021-09-09 10:59:38 +02:00
member-main-address-style.inc Bug 30603: Fix other occurrences 2022-05-10 23:09:09 -10:00
member-search-box.inc Bug 34094: Use DefaultPatronSearchMethod consistently 2023-07-17 16:04:31 +01:00
members-toolbar.inc Bug 31713: (follow-up) Display print option for any outstanding 2022-11-03 10:05:10 -03:00
merge-record.inc Bug 33181: Use template wrapper for tabs on record merge pages 2023-04-14 15:39:40 -03:00
messaging-preference-form.inc Bug 32492: (follow-up) Add missing HTML filters 2023-03-06 14:45:23 -03:00
modal-claims.inc Bug 33613: Use prop() to evaluate checkbox 2023-05-09 10:58:05 -03:00
noadd-warnings.inc
onboarding_messages.inc
page-numbers.inc
password_check.inc
patron-age.inc Bug 27717: Display date of birth even if the patron is under 1 2021-03-05 13:38:58 +01:00
patron-article-requests.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
patron-detail-tabs.inc Bug 33528: (RMaint follow-up) Restore original wording for maintanence 2023-07-17 13:36:55 +01:00
patron-restrictions-tab.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
patron-return-claims.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
patron-search-box.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
patron-search-header.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
patron-search.inc Bug 34233: Move select2 include out of patron-search.inc 2023-07-18 10:46:29 +01:00
patron-title.inc Bug 33266: Fix missing space in patron title 2023-03-20 09:39:52 -03:00
patron-toolbar.inc Bug 31421: Add a limited option to template plugin 2022-10-27 09:42:57 -03:00
patron_messages.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
patroncards-errors.inc Bug 28576: Update the maximum size of an image. 2022-02-14 21:41:38 -10:00
patroncards-toolbar.inc
patronfields.inc Bug 32770: Restore phone 2023-02-22 15:05:24 -03:00
patrons-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
permissions.inc Bug 33859: Use the phrase 'Identity providers' instead of 'Authentication providers' 2023-06-09 11:22:07 -03:00
popup-bottom.inc
pos-menu.inc Bug 27583: Proposed terminology changes 2021-07-26 12:46:32 +02:00
prefs-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
prefs-menu.inc Bug 33634: Correct anchors in system preference submenu 2023-05-05 09:13:26 -03:00
recalls.inc Bug 34010: Template corrections to recall pages 2023-07-17 13:44:22 +01:00
relatives-issues-table.inc Bug 33528: Use template wrapper for tabs: Patron details page 2023-07-17 12:04:17 +01:00
renew-search-box.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
renew_results.inc
renew_strings.inc Bug 31735: Avoid re-fetcing objects from database by passing them directly instead of ids to various subroutines 2023-05-12 12:40:21 -03:00
reports-menu.inc Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
reports-toolbar.inc Bug 33808: Add aria-labels in reports-toolbar.inc 2023-07-18 12:47:58 +01:00
resort_form.inc
restriction-types.inc Bug 33551: (QA follow-up) Fix TT filters 2023-05-05 10:18:41 -03:00
rotating-collections-toolbar.inc
search_indexes.inc Bug 34493: Fix indenting in search_indexes.inc 2023-08-17 09:49:48 -10:00
select2.inc
serial-status.inc Bug 32752: Add new status Circulating, Out for binding, and Bound to includes 2023-05-15 18:24:08 -03:00
serials-advsearch.inc Bug 32771: Standardize structure around action fieldsets in serials 2023-03-31 12:30:37 +02:00
serials-menu.inc Bug 28719: Change somes links in the serials page to avoid them leading to nothing 2021-08-16 09:56:37 +02:00
serials-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
serials-toolbar.inc
shortcut.inc Bug 30952: Staff interface redesign (header) 2022-10-12 15:58:16 -03:00
slip-print.inc Bug 27282: fix all occurrences 2021-04-21 10:51:29 +02:00
stockrotation-toolbar.inc
sub-header.inc Bug 30952: Staff interface redesign (header) 2022-10-12 15:58:16 -03:00
subscriptions-search.inc Bug 32771: Standardize structure around action fieldsets in serials 2023-03-31 12:30:37 +02:00
subtype_limits.inc Bug 22605: (QA follow-up) Make Braille search option stick 2022-03-24 14:22:10 -10:00
subtypes_unimarc.inc
suggestions-add-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
tools-item-action.inc Bug 28290: Don't send subfields to 'as_string' if none to send 2022-09-07 13:50:21 -07:00
tools-menu.inc Bug 31417: Update and reference cat-menu.inc 2022-10-18 10:28:34 -03:00
tools-nomatch-action.inc
tools-overlay-action.inc
transaction_types.inc Bug 30733: Move all semicolons inside the translatable strings 2022-06-17 10:16:40 -03:00
transfer_reasons.inc Bug 29602: Surround strings with span tag 2022-04-19 21:25:51 -10:00
validator-strings.inc Bug 34169: Use jQuery validator plugin to validate amounts 2023-08-07 20:05:46 -10:00
vendor-menu.inc
virtualshelves-toolbar.inc
waiting_holds.inc Bug 33223: Replace 'first_valid' with 'notice' for email addresses 2023-05-16 15:17:35 -03:00
wrapper-staff-tool-plugin.inc Bug 31339: Add staff wrapper template include for tool plugins 2023-07-19 09:28:34 +01:00
wysiwyg-systempreferences.inc Bug 26949: Upgrade TinyMCE in the staff interface from 5.0.16 to 5.9.2 2021-10-05 10:58:13 +02:00
xslt-handler.inc Bug 29602: Surround strings with span tag 2022-04-19 21:25:51 -10:00
z3950-admin-search.inc Bug 32683: Convert header search tabs to Bootstrap 2023-03-10 12:04:08 -03:00
z3950_search.inc