Lines 166-173
Link Here
|
166 |
|
166 |
|
167 |
[% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] |
167 |
[% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] |
168 |
</div> |
168 |
</div> |
169 |
<div class="col-xs-3" id="bookcoverimg"> |
169 |
<div class="col-xs-3 bookcoverimg"> |
170 |
<div id="cover-slides"> |
170 |
<div id="biblio-cover-slider" class="cover-slider"> |
171 |
[% IF ( LocalCoverImages ) %] |
171 |
[% IF ( LocalCoverImages ) %] |
172 |
[% IF localimages.count %] |
172 |
[% IF localimages.count %] |
173 |
[% FOREACH image IN localimages %] |
173 |
[% FOREACH image IN localimages %] |
Lines 219-226
Link Here
|
219 |
<div class="hint">Custom cover image</div> |
219 |
<div class="hint">Custom cover image</div> |
220 |
</div> |
220 |
</div> |
221 |
[% END %] |
221 |
[% END %] |
222 |
</div> <!-- /#cover-slides --> |
222 |
</div> <!-- /.cover-slider --> |
223 |
</div> <!-- /#bookcoverimg.col-xs-3 --> |
223 |
</div> <!-- /.bookcoverimg.col-xs-3 --> |
224 |
[% ELSE %] |
224 |
[% ELSE %] |
225 |
</div> <!-- /.col-xs-* --> |
225 |
</div> <!-- /.col-xs-* --> |
226 |
[% END # /IF ( AmazonCoverImages, etc ) %] |
226 |
[% END # /IF ( AmazonCoverImages, etc ) %] |
Lines 326-336
Link Here
|
326 |
[% END %] |
326 |
[% END %] |
327 |
[% IF ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
327 |
[% IF ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %] |
328 |
<td class="cover"> |
328 |
<td class="cover"> |
329 |
[% IF item.imagenumber %] |
329 |
<div class="bookcoverimg"> |
330 |
<a href="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% item.itemnumber | uri %]&imagenumber=[% item.imagenumber | uri %]"> |
330 |
<div class="cover-slider"> |
331 |
<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1amp;imagenumber=[% item.imagenumber | uri %]" /> |
331 |
[% FOREACH image IN item.cover_images %] |
332 |
</a> |
332 |
<div class="cover-image local-coverimg"> |
333 |
[% END %] |
333 |
<a href="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% image.itemnumber | uri %]&imagenumber=[% image.imagenumber | uri %]"> |
|
|
334 |
<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" /> |
335 |
</a> |
336 |
</div> |
337 |
[% END %] |
338 |
</div> |
339 |
</div> |
334 |
</td> |
340 |
</td> |
335 |
[% END %] |
341 |
[% END %] |
336 |
|
342 |
|
Lines 986-1056
Note that permanent location is a code, and location may be an authval.
Link Here
|
986 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
992 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
987 |
function verify_images() { |
993 |
function verify_images() { |
988 |
// Loop over each container in the template which contains covers |
994 |
// Loop over each container in the template which contains covers |
989 |
$(".cover-image").each( function( index ){ |
995 |
$(".cover-slider").each(function(){ |
990 |
var div = $(this); |
996 |
$(this).find(".cover-image").each( function( index ){ |
991 |
// Find the image in the container |
997 |
var div = $(this); |
992 |
var img = div.find("img")[0]; |
998 |
// Find the image in the container |
993 |
if( $(img).length > 0 ){ |
999 |
var img = div.find("img")[0]; |
994 |
if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){ |
1000 |
if( $(img).length > 0 ){ |
995 |
// No image loaded in the container. Remove the slide |
1001 |
if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){ |
996 |
div.remove(); |
1002 |
// No image loaded in the container. Remove the slide |
997 |
} else { |
1003 |
div.remove(); |
998 |
// All slides start hidden. If this is the first one, show it. |
1004 |
} else { |
999 |
if( index == 0 ){ |
1005 |
// All slides start hidden. If this is the first one, show it. |
1000 |
div.show(); |
1006 |
if( index == 0 ){ |
1001 |
} |
1007 |
div.show(); |
1002 |
// Check if Amazon image is present |
|
|
1003 |
if ( div.attr("id") == "amazon-bookcoverimg" ) { |
1004 |
w = img.width; |
1005 |
h = img.height; |
1006 |
if ((w == 1) || (h == 1)) { |
1007 |
// Amazon returned single-pixel placeholder |
1008 |
// Remove the container |
1009 |
div.remove(); |
1010 |
} |
1008 |
} |
1011 |
} |
1009 |
// Check if Amazon image is present |
1012 |
if( div.attr("id") == "custom-img" ){ |
1010 |
if ( div.attr("id") == "amazon-bookcoverimg" ) { |
1013 |
if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { |
1011 |
w = img.width; |
1014 |
// No image was loaded via the CustomCoverImages system preference |
1012 |
h = img.height; |
1015 |
// Remove the container |
1013 |
if ((w == 1) || (h == 1)) { |
1016 |
div.remove(); |
1014 |
// Amazon returned single-pixel placeholder |
|
|
1015 |
// Remove the container |
1016 |
div.remove(); |
1017 |
} |
1017 |
} |
1018 |
} |
1018 |
} |
1019 |
if( div.attr("id") == "custom-img" ){ |
1019 |
if( div.attr("id") == "coce-coverimg" ){ |
1020 |
if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { |
1020 |
// Identify which service's image is being loaded by Coce |
1021 |
// No image was loaded via the CustomCoverImages system preference |
1021 |
if( $(img).attr("src").indexOf('amazon.com') >= 0 ){ |
1022 |
// Remove the container |
1022 |
div.find(".hint").html(_("Coce image from Amazon.com")); |
1023 |
div.remove(); |
1023 |
} else if( $(img).attr("src").indexOf('google.com') >= 0 ){ |
1024 |
} |
1024 |
div.find(".hint").html(_("Coce image from Google Books")); |
1025 |
} |
1025 |
} else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){ |
1026 |
if( div.attr("id") == "coce-coverimg" ){ |
1026 |
div.find(".hint").html(_("Coce image from Open Library")); |
1027 |
// Identify which service's image is being loaded by Coce |
|
|
1028 |
if( $(img).attr("src").indexOf('amazon.com') >= 0 ){ |
1029 |
div.find(".hint").html(_("Coce image from Amazon.com")); |
1030 |
} else if( $(img).attr("src").indexOf('google.com') >= 0 ){ |
1031 |
div.find(".hint").html(_("Coce image from Google Books")); |
1032 |
} else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){ |
1033 |
div.find(".hint").html(_("Coce image from Open Library")); |
1034 |
} |
1027 |
} |
1035 |
} |
1028 |
} |
1036 |
} |
1029 |
} |
1037 |
} |
1030 |
} |
1038 |
}); |
1031 |
}); |
1039 |
}); |
1032 |
|
1040 |
|
1033 |
var coverSlides = $(".cover-image"); |
1041 |
$(".cover-slider").each(function(){ |
1034 |
if( coverSlides.length > 1 ){ |
1042 |
var coverSlide = this; |
1035 |
coverSlides.each(function( index ){ |
1043 |
var coverImages = $(this).find(".cover-image"); |
1036 |
// If more that one slide is present, add a navigation link |
1044 |
if( coverImages.length > 1 ){ |
1037 |
// for activating the slide |
1045 |
coverImages.each(function( index ){ |
1038 |
var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>"); |
1046 |
// If more that one image is present, add a navigation link |
1039 |
if( index == 0 ){ |
1047 |
// for activating the slide |
1040 |
// Set the first navigation link as active |
1048 |
var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>"); |
1041 |
$(covernav).addClass("nav-active"); |
1049 |
if( index == 0 ){ |
1042 |
} |
1050 |
// Set the first navigation link as active |
1043 |
$(covernav).html("<i class=\"fa fa-circle\"></i>"); |
1051 |
$(covernav).addClass("nav-active"); |
1044 |
$("#cover-slides").append( covernav ); |
1052 |
} |
1045 |
|
1053 |
$(covernav).html("<i class=\"fa fa-circle\"></i>"); |
1046 |
}); |
1054 |
$(coverSlide).append( covernav ); |
1047 |
} |
1055 |
}); |
|
|
1056 |
} |
1048 |
|
1057 |
|
1049 |
if( $(".cover-image:visible").length < 1 ){ |
1058 |
if( $(coverSlide).find(".cover-image:visible").length < 1 ){ |
1050 |
$("#cover-slides").remove(); |
1059 |
$(coverSlide).remove(); |
1051 |
} else { |
1060 |
} else { |
1052 |
$("#cover-slides").addClass("cover-slides"); |
1061 |
$(coverSlide).addClass("cover-slides"); |
1053 |
} |
1062 |
} |
|
|
1063 |
}); |
1054 |
|
1064 |
|
1055 |
$("#editions img").each(function(i){ |
1065 |
$("#editions img").each(function(i){ |
1056 |
if ( this.src.indexOf('amazon.com') >= 0 ) { |
1066 |
if ( this.src.indexOf('amazon.com') >= 0 ) { |
Lines 1223-1236
Note that permanent location is a code, and location may be an authval.
Link Here
|
1223 |
link = $(this).attr("href"); |
1233 |
link = $(this).attr("href"); |
1224 |
openWindow(link,"Print spine label",400,400); |
1234 |
openWindow(link,"Print spine label",400,400); |
1225 |
}); |
1235 |
}); |
1226 |
$("#cover-slides").on("click",".cover-nav", function(e){ |
1236 |
$(".cover-slider").on("click",".cover-nav", function(e){ |
1227 |
e.preventDefault(); |
1237 |
e.preventDefault(); |
|
|
1238 |
var cover_slider = $(this).parent(); |
1228 |
// Adding click handler for cover image navigation links |
1239 |
// Adding click handler for cover image navigation links |
1229 |
var num = $(this).data("num"); |
1240 |
var num = $(this).data("num"); |
1230 |
$(".cover-nav").removeClass("nav-active"); |
1241 |
$(cover_slider).find(".cover-nav").removeClass("nav-active"); |
1231 |
$(this).addClass("nav-active"); |
1242 |
$(this).addClass("nav-active"); |
1232 |
$(".cover-image").hide(); |
1243 |
$(cover_slider).find(".cover-image").hide(); |
1233 |
$(".cover-image").eq( num ).show(); |
1244 |
$(cover_slider).find(".cover-image").eq( num ).show(); |
1234 |
}); |
1245 |
}); |
1235 |
}); |
1246 |
}); |
1236 |
|
1247 |
|