Lines 892-943
$(document).ready(function(){
Link Here
|
892 |
$("#highlight_toggle_off").show().click(function() {highlightOff();}); |
892 |
$("#highlight_toggle_off").show().click(function() {highlightOff();}); |
893 |
[% END %] |
893 |
[% END %] |
894 |
[% IF ( OverDriveEnabled ) %] |
894 |
[% IF ( OverDriveEnabled ) %] |
895 |
var $overdrive_results = $( '<div id="overdrive-results">' + _( 'Searching OverDrive...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); |
895 |
var $overdrive_results = $( '<div id="overdrive-results">' + MSG_SEARCHING.format('OverDrive') + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); |
896 |
$( '#numresults' ) .append( ' ' ) |
896 |
$( '#numresults' ) .append( ' ' ) |
897 |
.append( $overdrive_results ); |
897 |
.append( $overdrive_results ); |
898 |
KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) { |
898 |
KOHA.OverDrive.Search( "[% OverDriveLibraryID %]", querystring, 1, 0, function( data ) { |
899 |
if ( data.error ) { |
899 |
if ( data.error ) { |
900 |
$overdrive_results.html( _( 'Error searching OverDrive collection' ) ); |
900 |
$overdrive_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OverDrive') ); |
901 |
return; |
901 |
return; |
902 |
} |
902 |
} |
903 |
|
903 |
|
904 |
if ( data.totalItems ) { |
904 |
if ( data.totalItems ) { |
905 |
$overdrive_results.html( _( 'Found' ) + ' <a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + ' ' + _( 'results' ) + '</a> ' + _( 'in OverDrive collection' ) ); |
905 |
$overdrive_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="/cgi-bin/koha/opac-overdrive-search.pl?q=' + escape( querystring ) + '">' + data.totalItems + '</a>', 'OverDrive') ); |
906 |
} else { |
906 |
} else { |
907 |
$overdrive_results.remove(); |
907 |
$overdrive_results.remove(); |
908 |
} |
908 |
} |
909 |
} ); |
909 |
} ); |
910 |
[% END %] |
910 |
[% END %] |
911 |
[% IF ( RecordedBooksEnabled ) %] |
911 |
[% IF ( RecordedBooksEnabled ) %] |
912 |
var $recordedbooks_results = $( '<div id="recordedbooks-results">' + _( "Searching RecordedBooks..." ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); |
912 |
var $recordedbooks_results = $( '<div id="recordedbooks-results">' + MSG_SEARCHING.format('RecordedBooks') + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); |
913 |
$( '#numresults' ) .append( ' ' ) |
913 |
$( '#numresults' ) .append( ' ' ) |
914 |
.append( $recordedbooks_results ); |
914 |
.append( $recordedbooks_results ); |
915 |
KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) { |
915 |
KOHA.RecordedBooks.search( querystring, [% OPACnumSearchResults || "null" %], null, function( data ) { |
916 |
if ( data.error ) { |
916 |
if ( data.error ) { |
917 |
$recordedbooks_results.html( _( "Error searching RecordedBooks collection: %s" ).format( data.error ) ); |
917 |
$recordedbooks_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('RecordedBooks') + ': ' + data.error); |
918 |
return; |
918 |
return; |
919 |
} |
919 |
} |
920 |
|
920 |
|
921 |
// data.total can be either 42 or "60+" |
921 |
// data.total can be either 42 or "60+" |
922 |
if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) { |
922 |
if ( typeof(data.total) === 'string' && data.total.charAt(0) > 0 || typeof(data.total) === 'number' && data.total > 0 ) { |
923 |
$recordedbooks_results.html( _( "Found %s results in RecordedBooks collection" ).format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>') ); |
923 |
$recordedbooks_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="/cgi-bin/koha/opac-recordedbooks-search.pl?q=' + escape( querystring ) + '">' + data.total + '</a>', 'RecordedBooks') ); |
924 |
} else { |
924 |
} else { |
925 |
$recordedbooks_results.remove(); |
925 |
$recordedbooks_results.remove(); |
926 |
} |
926 |
} |
927 |
} ); |
927 |
} ); |
928 |
[% END %] |
928 |
[% END %] |
929 |
[% IF ( OpenLibrarySearch ) %] |
929 |
[% IF ( OpenLibrarySearch ) %] |
930 |
var $openlibrary_results = $( '<div id="openlibrary-results">' + _( 'Searching Open Library...' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); |
930 |
var $openlibrary_results = $( '<div id="openlibrary-results">' + MSG_SEARCHING.format('OpenLibrary' ) + ' <img class="throbber" src="[% interface %]/lib/jquery/plugins/themes/classic/throbber.gif" /></div>' ); |
931 |
$( '#numresults' ) .append( ' ' ) |
931 |
$( '#numresults' ) .append( ' ' ) |
932 |
.append( $openlibrary_results ); |
932 |
.append( $openlibrary_results ); |
933 |
KOHA.OpenLibrary.search( querystring, null, function( data ) { |
933 |
KOHA.OpenLibrary.search( querystring, null, function( data ) { |
934 |
if ( data.error ) { |
934 |
if ( data.error ) { |
935 |
$openlibrary_results.html( _( 'Error searching OpenLibrary collection' ) ); |
935 |
$openlibrary_results.html( MSG_ERROR_SEARCHING_COLLECTION.format('OpenLibrary') ); |
936 |
return; |
936 |
return; |
937 |
} |
937 |
} |
938 |
|
938 |
|
939 |
if ( data.numFound > 0 ) { |
939 |
if ( data.numFound > 0 ) { |
940 |
$openlibrary_results.html( _( 'Found' ) + ' <a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + ' ' + _( 'results' ) + '</a> ' + _( 'in OpenLibrary collection' ) ); |
940 |
$openlibrary_results.html( MSG_RESULTS_FOUND_IN_COLLECTION.format('<a href="' + KOHA.OpenLibrary.searchUrl(querystring) + '" target="openlibrary">' + data.numFound + '</a>', 'OpenLibrary') ); |
941 |
} else { |
941 |
} else { |
942 |
$openlibrary_results.remove(); |
942 |
$openlibrary_results.remove(); |
943 |
} |
943 |
} |
944 |
- |
|
|