Bugzilla – Attachment 20119 Details for
Bug 10686
Fielded searches confuse highlighter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10686: Remove fields from searches for highlighting
Bug-10686-Remove-fields-from-searches-for-highligh.patch (text/plain), 2.59 KB, created by
Jared Camins-Esakov
on 2013-08-06 01:02:07 UTC
(
hide
)
Description:
Bug 10686: Remove fields from searches for highlighting
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2013-08-06 01:02:07 UTC
Size:
2.59 KB
patch
obsolete
>From 2dc03bfa48fa058e9cfcbad7c995690c0e9c1807 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Mon, 5 Aug 2013 20:56:48 -0400 >Subject: [PATCH] Bug 10686: Remove fields from searches for highlighting > >If you do a fielded search like au:smith, "Smith" will not get >highlighted on the results page because the Javascript is looking for >the exact string "au:smith." > >To test: >1) Turn on OpacHighlightedWords. >2) Do a simple keyword search. >3) Confirm that the word is highlighted on the results and details page. >4) Do a fielded search by entering au:smith (or whatever). >5) Confirm that the word is highlighted on the results and details page. >6) Sign off. >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 1 + > .../prog/en/modules/opac-results-grouped.tt | 1 + > .../opac-tmpl/prog/en/modules/opac-results.tt | 1 + > 3 files changed, 3 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 9226dec..6f45872 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -58,6 +58,7 @@ > function highlightOn() { > var x; > for (x in q_array) { >+ q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1"); > $(".title").highlight(q_array[x]); > $(".author").highlight(q_array[x]); > $(".results_summary").highlight(q_array[x]); >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt >index d6b4c11..141a733 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt >@@ -83,6 +83,7 @@ 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]); > } > $(".highlight_toggle").toggle(); >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >index 0df0322..e1ef451 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >@@ -98,6 +98,7 @@ function highlightOff() { > 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 ) { > $(".title").highlight(q_array[x]); > $(".author").highlight(q_array[x]); >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10686
:
20119
|
20192
|
20404