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

- Added functionaility to opac-results-grouped page

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This commit is contained in:
Martin Renvoize 2013-11-19 12:07:59 +00:00 committed by Tomas Cohen Arazi
parent 500369d807
commit dce2a6362c
2 changed files with 11 additions and 3 deletions

View File

@ -349,8 +349,12 @@ function highlightOff() {
function highlightOn() {
var x;
for (x in q_array) {
q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
$("td").highlight(q_array[x]);
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 ( (q_array[x].length > 0) && ($.inArray(q_array[x], myStopwords) == -1) ) {
$("td").highlight(q_array[x]);
}
}
$(".highlight_toggle").toggle();
}

View File

@ -84,7 +84,11 @@ function highlightOn() {
var x;
for (x in q_array) {
q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
$("td").highlight(q_array[x]);
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) ) {
$("td").highlight(q_array[x]);
}
}
$(".highlight_toggle").toggle();
}