From: Marcel de Rooy Date: Wed, 27 Jun 2012 12:34:24 +0000 (+0200) Subject: 7161 Followup for indentation openlibrary.js X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=deb444401ae9daaa256b41775b70834b5b7327ba;hp=12e6aedf54c38a4ebc9314c7cad115e4257cd650;p=koha.git 7161 Followup for indentation openlibrary.js Only whitespace changes to fix indentation after tab removal. Signed-off-by: Paul Poulain --- diff --git a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js b/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js index afac4d335a..e5b9d2835c 100644 --- a/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js +++ b/koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js @@ -30,42 +30,37 @@ KOHA.OpenLibrary = { "&callback=KOHA.OpenLibrary.olCallBack&jscmd=data"); scriptElement.setAttribute("type", "text/javascript"); document.documentElement.firstChild.appendChild(scriptElement); - }, - - /** * Add cover pages
' + 'Preview
' - ); - } else { - img.src = book.cover.small; - $(this).append(img); + for (id in booksInfo) { + var book = booksInfo[id]; + var isbn = id.substring(5); + $("."+isbn).each(function() { + var is_opacdetail = /openlibrary-thumbnail-preview/.exec($(this).attr("id")); + var a = document.createElement("a"); + a.href = booksInfo.url; + if (book.cover) { + var img = document.createElement("img"); + if (is_opacdetail) { + img.src = book.cover.medium; + $(this).append(img); + $(this).append('
' + 'Preview
'); + } else { + img.src = book.cover.small; + $(this).append(img); + } + } else { + var message = document.createElement("span"); + $(message).attr("class","no-image"); + $(message).html(NO_OL_JACKET); + $(this).append(message); + } + }); } - } else { - var message = document.createElement("span"); - $(message).attr("class","no-image"); - $(message).html(NO_OL_JACKET); - $(this).append(message); - } - }); - } - } + } };