Bug 6149: Follow-up [bootstrap] - Stopwords for Result Highlighting
[koha-ffzg.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-results.tt
index b5b5252..0c4b607 100644 (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]);