Lines 160-166
$(function () {
Link Here
|
160 |
}); |
160 |
}); |
161 |
// ----------------------------------------------------- |
161 |
// ----------------------------------------------------- |
162 |
[% END %] |
162 |
[% END %] |
|
|
163 |
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %] |
164 |
var isbn = $(".isbn:last").text().split(" ")[1]; |
165 |
if (isbn) { |
166 |
isbn = isbn.replace(/\W*$/, ''); |
167 |
|
168 |
if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) { |
169 |
// Use Microsoft XDR for IE version 8 or above |
170 |
var xdr = new XDomainRequest(); |
171 |
xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); |
172 |
xdr.onload = function() { |
173 |
json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; |
174 |
eval(json); // json is now a regular JSON object |
175 |
parseIDBJSON(json); // parse using same function as for jQuery's success event |
176 |
} |
177 |
xdr.send(); |
178 |
} else { |
179 |
$.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ |
180 |
parseIDBJSON(json); |
181 |
}); |
182 |
} |
183 |
} |
184 |
|
185 |
[% END %] |
163 |
}); |
186 |
}); |
|
|
187 |
[% IF ( IDreamBooksReviews || IDreamBooksReadometer ) %] |
188 |
function parseIDBJSON( json ) { |
189 |
if(json.total_results > 0 && json.book.rating > 0){ |
190 |
var isbn = $(".isbn:last").text().split(" ")[1]; |
191 |
|
192 |
[% IF ( IDreamBooksReadometer ) %] |
193 |
$(".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>'); |
194 |
[% END %] |
195 |
|
196 |
|
197 |
[% IF ( IDreamBooksReviews ) %] |
198 |
//build new tab for critic reviews |
199 |
$("#tab_idb_critic_reviews a").text($("#tab_idb_critic_reviews a").text().replace('XXX', json.book.review_count)); |
200 |
|
201 |
//append happy-sad cloud review |
202 |
|
203 |
$("#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>"); |
204 |
|
205 |
//insert data into Book reviews tab |
206 |
$.each(json.book.critic_reviews, function(){ |
207 |
$("#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>"); |
208 |
}); |
209 |
$("#seemoreidb").attr('href', json.book.detail_link); |
210 |
$("#tab_idb_critic_reviews").show(); |
211 |
[% END %] |
212 |
|
213 |
} |
214 |
|
215 |
} |
216 |
[% END %] |
164 |
|
217 |
|
165 |
[% IF ( OpacBrowseResults && busc ) %] |
218 |
[% IF ( OpacBrowseResults && busc ) %] |
166 |
var timeoutRFW; |
219 |
var timeoutRFW; |
Lines 708-713
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
708 |
[% IF ( OPACLocalCoverImages ) %][% IF ( localimages ) %] |
761 |
[% IF ( OPACLocalCoverImages ) %][% IF ( localimages ) %] |
709 |
<li id="tab_images"><a href="#images">Images</a></li> |
762 |
<li id="tab_images"><a href="#images">Images</a></li> |
710 |
[% END %][% END %] |
763 |
[% END %][% END %] |
|
|
764 |
[% IF ( IDreamBooksReviews ) %] |
765 |
<li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li> |
766 |
[% END %] |
711 |
</ul> |
767 |
</ul> |
712 |
|
768 |
|
713 |
[% IF ( serialcollection ) %] |
769 |
[% IF ( serialcollection ) %] |
Lines 1153-1158
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
1153 |
</div> |
1209 |
</div> |
1154 |
[% END %] |
1210 |
[% END %] |
1155 |
|
1211 |
|
|
|
1212 |
[% IF ( IDreamBooksReviews ) %] |
1213 |
<div id="idb_critic_reviews"> |
1214 |
<div id="idb_review_snippets"> |
1215 |
</div> |
1216 |
<span><a id="seemoreidb">More book reviews at iDreamBooks.com</a></span> |
1217 |
</div> |
1218 |
[% END %] |
1219 |
|
1156 |
|
1220 |
|
1157 |
</div> |
1221 |
</div> |
1158 |
[% IF ( NovelistSelectProfile ) %][% IF ( NovelistSelectView == 'below' ) %] |
1222 |
[% IF ( NovelistSelectProfile ) %][% IF ( NovelistSelectView == 'below' ) %] |
Lines 1172-1177
YAHOO.util.Event.onContentReady("furtherm", function () {
Link Here
|
1172 |
<div id="BW_videos"></div> |
1236 |
<div id="BW_videos"></div> |
1173 |
[% END %] |
1237 |
[% END %] |
1174 |
|
1238 |
|
|
|
1239 |
|
1175 |
</div> |
1240 |
</div> |
1176 |
|
1241 |
|
1177 |
|
1242 |
|