function highlightOn() {
var x;
for (x in q_array) {
- $(".title").highlight(q_array[x]);
- $(".author").highlight(q_array[x]);
- $(".results_summary").highlight(q_array[x]);
+ if ( q_array[x].length > 0 ) {
+ $(".title").highlight(q_array[x]);
+ $(".author").highlight(q_array[x]);
+ $(".results_summary").highlight(q_array[x]);
+ }
}
$(".highlight_toggle").toggle();
}
$(document).ready(function(){
[% IF ( OpacHighlightedWords ) %]
$('a.title').each(function() {
- $(this).attr('href', $(this).attr('href') + '&query_desc=[% query_desc | url %]');
+ $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]");
+ });
+ [% END %]
+
+ [% IF ( IDreamBooksResults ) %]
+ $('.idbresult').each(function() {
+ var isbn = $(this).children('a').text().replace(/\s*/,'');
+ var element = this;
+
+ if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) {
+ // Use Microsoft XDR for IE version 8 or above
+ var xdr = new XDomainRequest();
+ xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e");
+ xdr.onload = function() {
+ json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... };
+ eval(json); // json is now a regular JSON object
+ if(json.total_results > 0 && json.book.rating > 0){
+ $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%");
+ $(element).show();
+ } else {
+ $(element).remove();
+ }
+ }
+ xdr.send();
+ } else {
+ $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){
+ if(json.total_results > 0 && json.book.rating > 0){
+ $(element).children('a').html("<img src='"+json.book.to_read_or_not_small+"' alt='"+json.book.title+" by "+json.book.author+"' title='Rating based on reviews of "+json.book.title+"'>"+json.book.rating+"%");
+ $(element).show();
+ } else {
+ $(element).remove();
+ }
+ });
+ }
});
[% END %]
$("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear all")+"<\/a>");
$("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select all")+"<\/a>");
[% IF ( opacbookbag ) %]$("span.addto").html(param1);[% ELSE %][% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]$("span.addto").html(param1);[% END %][% END %][% END %]
-[% IF ( opacbookbag ) %]
+[% IF ( opacbookbag || virtualshelves ) %]
[% IF ( virtualshelves ) %]
$("#addto").change(function(){
cartList();
} else if($("#addto").find("option:selected").attr("value") == "newlist"){
[% IF ( loggedinusername ) %]if (vShelfAdd()) {
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
- }[% ELSE %] alert(_('You must be logged in to create or add to lists')); [% END %]
+ }[% ELSE %] alert(_("You must be logged in to create or add to lists")); [% END %]
return false;
} else if($("#addto").find("option:selected").attr("value") == "morelists"){
[% IF ( loggedinusername ) %]if (vShelfAdd()) {
Dopop('/cgi-bin/koha/opac-addbybiblionumber.pl?' + vShelfAdd());
- }[% ELSE %] alert(_('You must be logged in to create or add to lists')); [% END %]
+ }[% ELSE %] alert(_("You must be logged in to create or add to lists")); [% END %]
return false;
}
if($("#addto").find("option:selected").attr("value") == "addtocart" || $("#addto").attr("class") == "addtocart"){
[% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
- $('#didyoumean').load('/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring | uri %]',
+[% IF ( DidYouMean ) %]
+ $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]",
function() {
- $('.searchsuggestion').parent().parent().css({
- 'border-color': '#F4ECBE',
- 'background-color': '#FFFBEA'});
- } );
+ $(".searchsuggestion").parent().parent().css({
+ "border-color": "#F4ECBE",
+ "background-color": "#FFFBEA"
+ });
+ });
+[% END %]
+
});
//]]>
<div class="yui-b">
<div id="userresults" class="container">
[% IF ( DidYouMean ) %]
- <div id='didyoumean'>Not what you expected? Check for <a href='/cgi-bin/koha/svc/suggestion?render=standalone&q=[% querystring | uri %]'>suggestions</a></div>
+ <div id="didyoumean">Not what you expected? Check for <a href="/cgi-bin/koha/svc/suggestion?render=standalone&q=[% querystring |uri %]">suggestions</a></div>
[% END %]
<div id="top-pages">[% INCLUDE 'page-numbers.inc' %]</div>
[% IF ( koha_spsuggest ) %]
[% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
<span class="available"><strong>Copies available:</strong>
[% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
+ [% IF available_items_loo.this_branch %]<span class="highlight-row-results">[% ELSE %]<span>[% END %]
[% IF ( singleBranchMode ) %]
[% available_items_loo.location %]
[% ELSE %]
[% IF ( available_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/opac-search.pl?q=callnum:[% available_items_loo.itemcallnumber |url %]">[% available_items_loo.itemcallnumber %]</a>][% END %]
[% END %]
([% available_items_loo.count %]),
+ </span>
[% END %]
</span>
[% ELSE %]
[% END %]
[% END %]
- <input type="hidden" name='biblionumber' value="[% SEARCH_RESULT.biblionumber %]" />
- <input type="hidden" name='loggedinuser' value="[% loggedinuser %]" />
+ <input type="hidden" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" />
+ <input type="hidden" name="loggedinuser" value="[% loggedinuser %]" />
[% IF ( SEARCH_RESULT.rating_total ) > 0 %]
<span id="rating_total_[% SEARCH_RESULT.biblionumber %]"> ([% SEARCH_RESULT.rating_total %] votes)</span>
[% IF ( loggedinusername ) %]
<a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
<span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
- <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label>
+ <label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s), separated by a comma:</label>
<input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
<input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
<a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
</td><td>
<a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
[% IF ( OPACLocalCoverImages ) %]<span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
- [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
+ [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<span title="[% SEARCH_RESULT.biblionumber %]" id="amazon-thumbnail[% loop.count %]"><img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" /></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
[% IF ( SyndeticsEnabled ) %]
[% IF ( SyndeticsCoverImages ) %]
[% IF SEARCH_RESULT.normalized_isbn %]
[% IF ( using_https ) %]
- <img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" />
+ <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" /></span>
[% ELSE %]
- <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" />
+ <span title="[% SEARCH_RESULT.biblionumber %]" id="syndetics-thumbnail[% loop.count %]"><img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% SEARCH_RESULT.normalized_upc %]&oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" class="thumbnail" /></span>
[% END %]
[% ELSE %]
<span class="no-image">No cover image available</span>
[% IF OpenLibraryCovers %][% IF SEARCH_RESULT.normalized_isbn %]<span style="block" title="[% SEARCH_RESULT.biblionumber %]" class="[% SEARCH_RESULT.normalized_isbn %]" id="openlibrary-thumbnail[% loop.count %]"></span>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
</a>
[% IF ( BakerTaylorEnabled ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% SEARCH_RESULT.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% SEARCH_RESULT.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
+ [% IF ( IDreamBooksResults ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<div class="idbresult" style="display: none;">
+ [% IF ( IDreamBooksReviews ) %]
+ <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]#idb_critic_reviews">
+ [% ELSE %]
+ <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
+ [% END %]
+ [% SEARCH_RESULT.normalized_isbn %]</a></div>
+ [% END %][% END %]
</td>
</tr>
[% END %]