Lines 814-820
Link Here
|
814 |
}); |
814 |
}); |
815 |
[% END # /IF OpacHighlightedWords %] |
815 |
[% END # /IF OpacHighlightedWords %] |
816 |
[% IF ( OverDriveEnabled ) %] |
816 |
[% IF ( OverDriveEnabled ) %] |
817 |
var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); |
817 |
var $overdrive_results = $( '<div id="overdrive-results">' + _("Searching %s...").format('OverDrive') + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); |
818 |
$( '#numresults' ) .after( $overdrive_results ); |
818 |
$( '#numresults' ) .after( $overdrive_results ); |
819 |
//Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes |
819 |
//Clean querystring, first we remove CCL entities, then decode HTML entities, then swap double quotes for single quotes |
820 |
//as the overdrive API treats double quotes as a search term and returns extra results |
820 |
//as the overdrive API treats double quotes as a search term and returns extra results |
Lines 823-850
Link Here
|
823 |
od_querystring = od_querystring.replace(/\"/g,"'"); |
823 |
od_querystring = od_querystring.replace(/\"/g,"'"); |
824 |
KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", od_querystring, 1, 0, function( data ) { |
824 |
KOHA.OverDrive.Search( "[% Koha.Preference('OverDriveLibraryID') | html %]", od_querystring, 1, 0, function( data ) { |
825 |
if ( data.error ) { |
825 |
if ( data.error ) { |
826 |
$overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') ); |
826 |
$overdrive_results.html( _("Error searching %s collection").format('OverDrive') ); |
827 |
return; |
827 |
return; |
828 |
} |
828 |
} |
829 |
|
829 |
|
830 |
if ( data.totalItems ) { |
830 |
if ( data.totalItems ) { |
831 |
$overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.totalItems, 'OverDrive') + '</a>' ); |
831 |
$overdrive_results.html( '<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + encodeURIComponent( od_querystring ) + '">' + _("Found %s results in the library's %s collection").format(data.totalItems, 'OverDrive') + '</a>' ); |
832 |
} else { |
832 |
} else { |
833 |
$overdrive_results.remove(); |
833 |
$overdrive_results.remove(); |
834 |
} |
834 |
} |
835 |
} ); |
835 |
} ); |
836 |
[% END # /IF OverDriveEnabled %] |
836 |
[% END # /IF OverDriveEnabled %] |
837 |
[% IF ( OpenLibrarySearch ) %] |
837 |
[% IF ( OpenLibrarySearch ) %] |
838 |
var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); |
838 |
var $openlibrary_results = $( '<div id="openlibrary-results">' + _("Searching %s...").format('OpenLibrary' ) + ' <img class="throbber" src="[% interface | html %]/[% theme | html %]/images/spinner-small.gif" /></div>' ); |
839 |
$( '#numresults' ) .after( $openlibrary_results ); |
839 |
$( '#numresults' ) .after( $openlibrary_results ); |
840 |
KOHA.OpenLibrary.search( querystring, null, function( data ) { |
840 |
KOHA.OpenLibrary.search( querystring, null, function( data ) { |
841 |
if ( data.error ) { |
841 |
if ( data.error ) { |
842 |
$openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') ); |
842 |
$openlibrary_results.html( _("Error searching %s collection").format('OpenLibrary') ); |
843 |
return; |
843 |
return; |
844 |
} |
844 |
} |
845 |
|
845 |
|
846 |
if ( data.numFound > 0 ) { |
846 |
if ( data.numFound > 0 ) { |
847 |
$openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + MSG_RESULTS_FOUND_IN_COLLECTION.format(data.numFound, 'OpenLibrary') + '</a>' ); |
847 |
$openlibrary_results.html( '<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + _("Found %s results in the library's %s collection").format(data.numFound, 'OpenLibrary') + '</a>' ); |
848 |
} else { |
848 |
} else { |
849 |
$openlibrary_results.remove(); |
849 |
$openlibrary_results.remove(); |
850 |
} |
850 |
} |
851 |
- |
|
|