From ec83a4c4c82688f8cebe6b24444bf75bc4692de5 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 29 Jul 2020 10:56:37 +0000 Subject: [PATCH] Bug 25639: (alternate) make query strings global variables --- koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 6 ++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index 9c4649ea88..07169d9dc3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -189,6 +189,12 @@ $.widget.bridge('uitooltip', $.ui.tooltip); var MSG_OVERDRIVE_DOWNLOAD_AS = _( "Download as: " ); var MSG_OVERDRIVE_CANNOT_CHECKOUT = _("Item cannot be checked out. There are no available formats"); [% END %] + [% IF (query_desc) %] + var query_desc = "[% query_desc | html %]"; + var querystring = "[% querystring | html %]"; + var query_cgi = "[% query_cgi | html %]"; + [% END %] + [% IF ( OPACAmazonCoverImages || SyndeticsCoverImages ) %] $(window).load(function() { verify_images(); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 3fd522cf62..fd5091dd27 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -880,8 +880,6 @@ $(document).ready(function(){ [% END %] [% IF ( query_desc ) %] - var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; - var querystring = "[% querystring |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; [% IF ( OpacHighlightedWords ) %] q_array = query_desc.split(" "); // ensure that we don't have "" at the end of the array, which can -- 2.11.0