Bug 23777: Use To.json in preferences.tt

Test plan:
Search for "foo bar" (with double quotes) in the sysprefs

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-12 08:55:30 +01:00 committed by Martin Renvoize
parent a55d9ff0ba
commit 348d84ea7f
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,5 @@
[% USE raw %]
[% USE To %]
[% USE Asset %]
[% USE Koha %]
[% SET footerjs = 1 %]
@ -196,7 +197,7 @@
});
// This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
var to_highlight = "[% To.json( searchfield ) | $raw %]";
var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
var MSG_NOTHING_TO_SAVE = _("Nothing to save");
var MSG_SAVING = _("Saving...");