|
Lines 549-557
Link Here
|
| 549 |
[% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li> |
549 |
[% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li> |
| 550 |
[% END %] |
550 |
[% END %] |
| 551 |
|
551 |
|
| 552 |
[% IF ( IDreamBooksReviews ) %] |
|
|
| 553 |
<li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li> |
| 554 |
[% END %] |
| 555 |
</ul> |
552 |
</ul> |
| 556 |
|
553 |
|
| 557 |
[% IF ( serialcollection ) %] |
554 |
[% IF ( serialcollection ) %] |
|
Lines 973-984
Link Here
|
| 973 |
</div><!-- / #images --> |
970 |
</div><!-- / #images --> |
| 974 |
[% END # / IF OPACLocalCoverImages && localimages.size %] |
971 |
[% END # / IF OPACLocalCoverImages && localimages.size %] |
| 975 |
|
972 |
|
| 976 |
[% IF ( IDreamBooksReviews ) %] |
|
|
| 977 |
<div id="idb_critic_reviews"> |
| 978 |
<div id="idb_review_snippets"></div> |
| 979 |
<span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span> |
| 980 |
</div> |
| 981 |
[% END %] |
| 982 |
</div> <!-- / #bibliodescriptions --> |
973 |
</div> <!-- / #bibliodescriptions --> |
| 983 |
|
974 |
|
| 984 |
[% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %] |
975 |
[% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %] |
|
Lines 1682-1740
Link Here
|
| 1682 |
|
1673 |
|
| 1683 |
[% END # / IF ( OpacStarRatings != 'disable' )%] |
1674 |
[% END # / IF ( OpacStarRatings != 'disable' )%] |
| 1684 |
|
1675 |
|
| 1685 |
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %] |
|
|
| 1686 |
var isbn = $(".isbn:last").text().split(" ")[1]; |
| 1687 |
if (isbn) { |
| 1688 |
isbn = isbn.replace(/\W*$/, ''); |
| 1689 |
isbn = isbn.replace(/-/, ''); |
| 1690 |
|
| 1691 |
if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) { |
| 1692 |
// Use Microsoft XDR for IE version 8 or above |
| 1693 |
var xdr = new XDomainRequest(); |
| 1694 |
xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); |
| 1695 |
xdr.onload = function() { |
| 1696 |
json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; |
| 1697 |
eval(json); // json is now a regular JSON object |
| 1698 |
parseIDBJSON(json); // parse using same function as for jQuery's success event |
| 1699 |
} |
| 1700 |
xdr.send(); |
| 1701 |
} else { |
| 1702 |
$.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ |
| 1703 |
parseIDBJSON(json); |
| 1704 |
}); |
| 1705 |
} |
| 1706 |
} |
| 1707 |
[% END # / IDreamBooksReviews || IDreamBooksReadometer%] |
| 1708 |
|
| 1709 |
}); |
1676 |
}); |
| 1710 |
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %] |
|
|
| 1711 |
function parseIDBJSON( json ) { |
| 1712 |
if(json.total_results > 0 && json.book.rating > 0){ |
| 1713 |
var isbn = $(".isbn:last").text().split(" ")[1]; |
| 1714 |
isbn = isbn.replace(/\W+/g, ''); |
| 1715 |
|
| 1716 |
[% IF ( IDreamBooksReadometer ) %] |
| 1717 |
$(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="https://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+_(" by ")+json.book.author+'" title="'+_("Rating based on reviews of ")+json.book.title+'"></a>'); |
| 1718 |
[% END %] |
| 1719 |
|
| 1720 |
[% IF ( IDreamBooksReviews ) %] |
| 1721 |
//build new tab for critic reviews |
| 1722 |
$("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count)); |
| 1723 |
|
| 1724 |
//append happy-sad cloud review |
| 1725 |
|
| 1726 |
$("#catalogue_detail_biblio").append("<span class='idreambookssummary results_summary'><a href='"+json.book.detail_link+"'><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+"%</a> <a href='http://www.idreambooks.com/'>"+_("rating based on reviews at iDreamBooks.com")+"</a></span>"); |
| 1727 |
|
| 1728 |
//insert data into Book reviews tab |
| 1729 |
$.each(json.book.critic_reviews, function(){ |
| 1730 |
$("#idb_review_snippets").append("<div class='review'><div><a href='"+this.review_link+"'>"+this.source+"</a></div><div>\"..."+this.snippet+"...\"</div><div>"+_("Review date: ")+this.review_date+"</div><div><a class='reviewlink' href='"+json.book.detail_link+"'>"+_("Review result: ")+this.pos_or_neg+" <img src='"+this.smiley_or_sad_small+"' alt='"+_("iDreamBooks.com rating")+"' title='"+this.pos_or_neg+"' /></a></div></div>"); |
| 1731 |
}); |
| 1732 |
$("#seemoreidb").attr('href', json.book.detail_link); |
| 1733 |
$("#tab_idb_critic_reviews").show(); |
| 1734 |
[% END %] |
| 1735 |
} |
| 1736 |
} |
| 1737 |
[% END # / IF IDreamBooksReviews || IDreamBooksReadometer %] |
| 1738 |
|
1677 |
|
| 1739 |
$(document).ready(function() { |
1678 |
$(document).ready(function() { |
| 1740 |
if( OPACPopupAuthorsSearch == "1" ){ |
1679 |
if( OPACPopupAuthorsSearch == "1" ){ |