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