|
Lines 46-67
KOHA.Google = {
Link Here
|
| 46 |
for (id in booksInfo) { |
46 |
for (id in booksInfo) { |
| 47 |
var book = booksInfo[id]; |
47 |
var book = booksInfo[id]; |
| 48 |
$("[id^=gbs-thumbnail]."+book.bib_key).each(function() { |
48 |
$("[id^=gbs-thumbnail]."+book.bib_key).each(function() { |
| 49 |
var a = document.createElement("a"); |
|
|
| 50 |
a.href = book.info_url; |
| 51 |
if (typeof(book.thumbnail_url) != "undefined") { |
49 |
if (typeof(book.thumbnail_url) != "undefined") { |
| 52 |
var img = document.createElement("img"); |
50 |
if ( $(this).data('use-data-link') ) { |
| 53 |
img.src = book.thumbnail_url; |
51 |
var a = document.createElement("a"); |
| 54 |
$(this).empty().append(img); |
52 |
a.href = book.thumbnail_url; |
| 55 |
var re = /^gbs-thumbnail-preview/; |
53 |
var img = document.createElement("img"); |
| 56 |
if ( re.exec($(this).attr("id")) ) { |
54 |
img.src = book.thumbnail_url; |
| 57 |
$(this).append( |
55 |
img.setAttribute('data-link', book.info_url); |
| 58 |
'<div class="google-books-preview">' + |
56 |
a.append(img) |
| 59 |
'<a '+target+'href="' + |
57 |
$(this).empty().append(a); |
| 60 |
book.info_url + |
58 |
} else { |
| 61 |
'"><img src="' + |
59 |
var img = document.createElement("img"); |
| 62 |
'https://books.google.com/intl/en/googlebooks/images/gbs_preview_sticker1.gif' + |
60 |
img.src = book.thumbnail_url; |
| 63 |
'"></a></div>' |
61 |
$(this).empty().append(img); |
| 64 |
); |
62 |
var re = /^gbs-thumbnail-preview/; |
|
|
63 |
if ( re.exec($(this).attr("id")) ) { |
| 64 |
$(this).append( |
| 65 |
'<div class="google-books-preview">' + |
| 66 |
'<a '+target+'href="' + |
| 67 |
book.info_url + |
| 68 |
'"><img src="' + |
| 69 |
'https://books.google.com/intl/en/googlebooks/images/gbs_preview_sticker1.gif' + |
| 70 |
'"></a></div>' |
| 71 |
); |
| 72 |
} |
| 65 |
} |
73 |
} |
| 66 |
} else { |
74 |
} else { |
| 67 |
var message = document.createElement("span"); |
75 |
var message = document.createElement("span"); |
| 68 |
- |
|
|