|
Lines 181-187
$(function () {
Link Here
|
| 181 |
}); |
181 |
}); |
| 182 |
// ----------------------------------------------------- |
182 |
// ----------------------------------------------------- |
| 183 |
[% END %] |
183 |
[% END %] |
|
|
184 |
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %] |
| 185 |
var isbn = $(".isbn:last").text().split(" ")[1]; |
| 186 |
if (isbn) { |
| 187 |
isbn = isbn.replace(/\W*$/, ''); |
| 188 |
|
| 189 |
if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) { |
| 190 |
// Use Microsoft XDR for IE version 8 or above |
| 191 |
var xdr = new XDomainRequest(); |
| 192 |
xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); |
| 193 |
xdr.onload = function() { |
| 194 |
json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; |
| 195 |
eval(json); // json is now a regular JSON object |
| 196 |
parseIDBJSON(json); // parse using same function as for jQuery's success event |
| 197 |
} |
| 198 |
xdr.send(); |
| 199 |
} else { |
| 200 |
$.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ |
| 201 |
parseIDBJSON(json); |
| 202 |
}); |
| 203 |
} |
| 204 |
} |
| 205 |
|
| 206 |
[% END %] |
| 184 |
}); |
207 |
}); |
|
|
208 |
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %] |
| 209 |
function parseIDBJSON( json ) { |
| 210 |
if(json.total_results > 0 && json.book.rating > 0){ |
| 211 |
var isbn = $(".isbn:last").text().split(" ")[1]; |
| 212 |
|
| 213 |
[% IF ( IDreamBooksReadometer ) %] |
| 214 |
$(".title").append('<a href="'+json.book.detail_link+'" id="idreambooksreadometer"><img src="http://idreambooks.com/remotereadometer/'+isbn+'.jpg" alt="'+json.book.title+' by '+json.book.author+'" title="Rating based on reviews of '+json.book.title+'"></a>'); |
| 215 |
[% END %] |
| 216 |
|
| 217 |
|
| 218 |
[% IF ( IDreamBooksReviews ) %] |
| 219 |
//build new tab for critic reviews |
| 220 |
$("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count)); |
| 221 |
|
| 222 |
//append happy-sad cloud review |
| 223 |
|
| 224 |
$("#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>"); |
| 225 |
|
| 226 |
//insert data into Book reviews tab |
| 227 |
$.each(json.book.critic_reviews, function(){ |
| 228 |
$("#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>"); |
| 229 |
}); |
| 230 |
$("#seemoreidb").attr('href', json.book.detail_link); |
| 231 |
$("#tab_idb_critic_reviews").show(); |
| 232 |
[% END %] |
| 233 |
|
| 234 |
} |
| 235 |
|
| 236 |
} |
| 237 |
[% END %] |
| 185 |
|
238 |
|
| 186 |
[% IF ( OpacBrowseResults && busc ) %] |
239 |
[% IF ( OpacBrowseResults && busc ) %] |
| 187 |
var timeoutRFW; |
240 |
var timeoutRFW; |
|
Lines 724-729
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
| 724 |
<li id="tab_html5media"><a href="#html5media">Play media</a></li> |
777 |
<li id="tab_html5media"><a href="#html5media">Play media</a></li> |
| 725 |
[% END %][% END %] |
778 |
[% END %][% END %] |
| 726 |
|
779 |
|
|
|
780 |
[% IF ( IDreamBooksReviews ) %] |
| 781 |
<li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li> |
| 782 |
[% END %] |
| 727 |
</ul> |
783 |
</ul> |
| 728 |
|
784 |
|
| 729 |
[% IF ( serialcollection ) %] |
785 |
[% IF ( serialcollection ) %] |
|
Lines 1083-1088
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
| 1083 |
</div> |
1139 |
</div> |
| 1084 |
[% END %] |
1140 |
[% END %] |
| 1085 |
|
1141 |
|
|
|
1142 |
[% IF ( IDreamBooksReviews ) %] |
| 1143 |
<div id="idb_critic_reviews"> |
| 1144 |
<div id="idb_review_snippets"> |
| 1145 |
</div> |
| 1146 |
<span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span> |
| 1147 |
</div> |
| 1148 |
[% END %] |
| 1149 |
|
| 1086 |
|
1150 |
|
| 1087 |
</div> |
1151 |
</div> |
| 1088 |
[% IF ( NovelistSelectProfile ) %][% IF ( NovelistSelectView == 'below' ) %] |
1152 |
[% IF ( NovelistSelectProfile ) %][% IF ( NovelistSelectView == 'below' ) %] |
|
Lines 1102-1107
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
| 1102 |
<div id="BW_videos"></div> |
1166 |
<div id="BW_videos"></div> |
| 1103 |
[% END %] |
1167 |
[% END %] |
| 1104 |
|
1168 |
|
|
|
1169 |
|
| 1105 |
</div> |
1170 |
</div> |
| 1106 |
|
1171 |
|
| 1107 |
|
1172 |
|