Bugzilla – Attachment 120850 Details for
Bug 27882
Move external search results links out of page heading
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27882: Move external search results links out of page heading
Bug-27882-Move-external-search-results-links-out-o.patch (text/plain), 4.06 KB, created by
Lucas Gass (lukeg)
on 2021-05-11 16:57:37 UTC
(
hide
)
Description:
Bug 27882: Move external search results links out of page heading
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2021-05-11 16:57:37 UTC
Size:
4.06 KB
patch
obsolete
>From d1d540ae522e0cd3790a67e8c59446f4ecf2f327 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 5 Mar 2021 15:19:40 +0000 >Subject: [PATCH] Bug 27882: Move external search results links out of page > heading > >This patch modifies the JavaScript which adds search result information >to the OPAC search results page which is returned from OverDrive, >Recorded Books, or Open Library. The information now displays below the >page heading instead of inside it. > >To test you must have OpenLibrarySearch enabled, OverDrive-related >preferences populated (OverDriveClientKey, OverDriveClientSecret, >OverDriveLibraryID), or RecordedBooks preferences (RecordedBooksClientSecret, >RecordedBooksDomain, RecordedBooksLibraryID). > >This patch was written with OverDrive and Open Library results active. > >- Apply the patch and perform a search in the OPAC catalog. >- On the search results page you should see results for your external > services appear below the page heading ("You search returned..."), > e.g. > > "Found 20257 results in the library's OpenLibrary collection" > "Found 337 results in the library's OverDrive collection" > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 361103afea..cc22a13e57 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -921,8 +921,7 @@ > [% END # /IF OpacHighlightedWords %] > [% IF ( OverDriveEnabled ) %] > var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); >- $( '#numresults' ) .append( ' ' ) >- .append( $overdrive_results ); >+ $( '#numresults' ) .after( $overdrive_results ); > //Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes > //as the overdrive API treats double quotes as a search term and returns extra results > od_querystring = querystring.replace(/(?:^|\W)([\w-]+)(,[\w-]+)*([:=])/g,' '); >@@ -943,8 +942,7 @@ > [% END # /IF OverDriveEnabled %] > [% IF ( RecordedBooksEnabled ) %] > var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); >- $( '#numresults' ) .append( ' ' ) >- .append( $recordedbooks_results ); >+ $( '#numresults' ) .after( $recordedbooks_results ); > KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" | html %], null, function( data ) { > if ( data.error ) { > $recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks') + ': ' + data.error); >@@ -961,8 +959,7 @@ > [% END # /IF RecordedBooksEnabled %] > [% IF ( OpenLibrarySearch ) %] > var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); >- $( '#numresults' ) .append( ' ' ) >- .append( $openlibrary_results ); >+ $( '#numresults' ) .after( $openlibrary_results ); > KOHA.OpenLibrary.search( querystring, null, function( data ) { > if ( data.error ) { > $openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') ); >-- >2.11.0
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 27882
:
117863
|
120850
|
120913