Sha256: 8059c66cdb22d75b0dce11de3ad1f40881f0be2fd3c9fdb62236efbc6fc8204e
Contents?: true
Size: 1.19 KB
Versions: 16
Compression:
Stored size: 1.19 KB
Contents
<script type="text/javascript"> function openbd_make_thumbnail_link( book, element_id ) { var link = ''; var thumbnail = book.summary.cover; if (thumbnail) { var link = '<img src="' + thumbnail + '" alt="' + book.summary.title + '" class="book_jacket" />'; } var thumb_element = document.getElementById( element_id ); if (thumb_element) { thumb_element.innerHTML = link; } } function openbd_addTheCover( isbn, element_id ) { var url = "https://api.openbd.jp/v1/get?isbn=" + isbn; $.getJSON( url, function (books) { var link = ''; for (i in books) { var book = books[i]; if (book) { openbd_make_thumbnail_link(book, element_id); } } var thumb_element = document.getElementById( element_id ); if (thumb_element.innerHTML === "") { <% if @library_group.settings[:book_jacket_unknown_resource] %> thumb_element.innerHTML = '<%= @library_group.settings[:book_jacket_unknown_resource] %>'; <% else %> thumb_element.innerHTML = '<%= image_tag("unknown_resource.png", size: "100x100", alt: "No Image", class: "book_jacket") %>'; <% end %> } }); } </script>
Version data entries
16 entries across 16 versions & 1 rubygems