Bug 6149: Follow-up [bootstrap] - Stopwords for Result Highlighting

- Added functionality to new bootstrap theme

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This commit is contained in:
Martin Renvoize 2013-10-28 12:12:30 +00:00 committed by Tomas Cohen Arazi
parent 9e686e023f
commit 500369d807
2 changed files with 10 additions and 4 deletions

View file

@ -1345,10 +1345,14 @@
var x;
for (x in q_array) {
q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
q_array[x] = q_array[x].toLowerCase();
var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
if( $.inArray(q_array[x], myStopwords) == -1 ) {
$(".title").highlight(q_array[x]);
$(".author").highlight(q_array[x]);
$(".results_summary").highlight(q_array[x]);
}
}
$(".highlight_toggle").toggle();
}
[% END %]

View file

@ -652,7 +652,9 @@ function highlightOn() {
var x;
for (x in q_array) {
q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
if ( q_array[x].length > 0 ) {
q_array[x] = q_array[x].toLowerCase();
var myStopwords = "[% Koha.Preference('HighlightedStopWords') %]".toLowerCase().split('|');
if ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
$(".title").highlight(q_array[x]);
$(".author").highlight(q_array[x]);
$(".results_summary").highlight(q_array[x]);