Lines 138-173
Link Here
|
138 |
[% END %] |
138 |
[% END %] |
139 |
|
139 |
|
140 |
[% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] |
140 |
[% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] |
141 |
</div><div class="col-xs-3" id="bookcoverimg"> |
141 |
</div> |
142 |
[% IF ( LocalCoverImages ) %] |
142 |
<div class="col-xs-3" id="bookcoverimg"> |
143 |
<div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div> |
143 |
<div id="cover-slides"> |
144 |
[% END %] |
144 |
[% IF ( LocalCoverImages ) %] |
145 |
[% IF ( AdlibrisEnabled && normalized_isbn ) %] |
145 |
[% IF ( localimages.0 ) %] |
146 |
<a href="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]"><img src="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]" class="adlibris-cover-big" alt="Adlibris cover image" /></a> |
146 |
[% FOREACH image IN localimages %] |
147 |
[% END %] |
147 |
[% IF image %] |
148 |
[% IF ( AmazonCoverImages && normalized_isbn) %] |
148 |
<div class="cover-image local-coverimg"> |
149 |
<div id="amazon-bookcoverimg"> |
149 |
<a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image | uri %]"> |
150 |
<a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"> |
150 |
<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image | uri %]" alt="Local cover image" /> |
151 |
<img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" /> |
151 |
</a> |
152 |
</a></div> |
152 |
<div class="hint">Local cover image</div> |
153 |
[% END %] |
153 |
</div> |
154 |
[% IF ( IntranetCoce && CoceProviders ) %] |
154 |
[% END %] |
155 |
[% coce_id = normalized_ean || normalized_isbn %] |
155 |
[% END %] |
156 |
<a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% biblionumber | url %]"> |
156 |
[% END %] |
157 |
[% IF ( coce_id ) %] |
157 |
[% END %] |
158 |
<span style="block" title="[% biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></span> |
|
|
159 |
[% ELSE %] |
160 |
<span class="no-image">No cover image available</span> |
161 |
[% END %] |
162 |
</a> |
163 |
[% END %] |
164 |
|
158 |
|
165 |
[% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] |
159 |
[% IF ( AdlibrisEnabled && normalized_isbn ) %] |
166 |
<a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]"><img alt="Cover image" src="[% biblio.custom_cover_image_url | url %]" /></a> |
160 |
<div class="cover-image" id="adlibris-coverimg"> |
167 |
[% END %] |
161 |
<a href="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]"> |
168 |
[% END %] |
162 |
<img src="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]" class="adlibris-cover-big" alt="Adlibris cover image" /> |
|
|
163 |
</a> |
164 |
<div class="hint">Image from Adlibris</div> |
165 |
</div> |
166 |
[% END %] |
167 |
[% IF ( AmazonCoverImages && normalized_isbn) %] |
168 |
<div class="cover-image" id="amazon-bookcoverimg"> |
169 |
<a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"> |
170 |
<img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="Amazon cover image" /> |
171 |
</a> |
172 |
<div class="hint">Image from Amazon.com</div> |
173 |
</div> |
174 |
[% END %] |
175 |
[% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %] |
176 |
[% coce_id = normalized_ean || normalized_isbn %] |
177 |
<div class="cover-image" id="coce-coverimg"> |
178 |
[% IF ( coce_id ) %] |
179 |
<span title="[% biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></span> |
180 |
[% ELSE %] |
181 |
<span class="no-image">No cover image available</span> |
182 |
[% END %] |
183 |
<div class="hint">Image from Coce</div> |
184 |
</div> |
185 |
[% END %] |
169 |
|
186 |
|
170 |
</div> |
187 |
[% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] |
|
|
188 |
<div class="cover-image" id="custom-coverimg"> |
189 |
<a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]"> |
190 |
<img id="custom-img" alt="Custom cover image" src="[% biblio.custom_cover_image_url | url %]" /> |
191 |
</a> |
192 |
<div class="hint">Custom cover image</div> |
193 |
</div> |
194 |
[% END %] |
195 |
</div> |
196 |
</div> <!-- /#bookcoverimg --> |
197 |
[% END %] |
171 |
</div> |
198 |
</div> |
172 |
<div id="bibliodetails" class="toptabs"> |
199 |
<div id="bibliodetails" class="toptabs"> |
173 |
|
200 |
|
Lines 908-937
Note that permanent location is a code, and location may be an authval.
Link Here
|
908 |
var theme = "[% theme | html %]"; |
935 |
var theme = "[% theme | html %]"; |
909 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
936 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
910 |
function verify_images() { |
937 |
function verify_images() { |
911 |
$("#bookcoverimg").each(function(i){ |
938 |
// Loop over each container in the template which contains covers |
912 |
$(this).find('img').each(function(i){ |
939 |
var coverSlides = $(".cover-image"); |
913 |
if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { |
940 |
coverSlides.each( function( index ){ |
914 |
w = this.width; |
941 |
var div = $(this); |
915 |
h = this.height; |
942 |
// Find the image in the container |
916 |
if ((w == 1) || (h == 1)) { |
943 |
var img = div.find("img")[0]; |
917 |
$("#amazon-bookcoverimg").remove(); |
944 |
if( $(img).length > 0 ){ |
918 |
} else if ((this.complete != null) && (!this.complete)) { |
945 |
if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){ |
919 |
$("#amazon-bookcoverimg").remove(); |
946 |
// No image loaded in the container. Remove the slide |
|
|
947 |
div.remove(); |
948 |
} else { |
949 |
// All slides start hidden. If this is the first one, show it. |
950 |
if( index == 0 ){ |
951 |
div.show(); |
952 |
} |
953 |
// Check if Amazon image is present |
954 |
if ( div.attr("id") == "amazon-bookcoverimg" ) { |
955 |
w = img.width; |
956 |
h = img.height; |
957 |
if ((w == 1) || (h == 1)) { |
958 |
// Amazon returned single-pixel placeholder |
959 |
// Remove the container |
960 |
div.remove(); |
961 |
} |
962 |
} |
963 |
if( div.attr("id") == "custom-img" ){ |
964 |
if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { |
965 |
// No image was loaded via the CustomCoverImages system preference |
966 |
// Remove the container |
967 |
div.remove(); |
968 |
} |
969 |
} |
970 |
if( div.attr("id") == "coce-coverimg" ){ |
971 |
// Identify which service's image is being loaded by Coce |
972 |
if( $(img).attr("src").indexOf('amazon.com') >= 0 ){ |
973 |
div.find(".hint").html(_("Coce image from Amazon.com")); |
974 |
} else if( $(img).attr("src").indexOf('google.com') >= 0 ){ |
975 |
div.find(".hint").html(_("Coce image from Google Books")); |
976 |
} else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){ |
977 |
div.find(".hint").html(_("Coce image from Open Library")); |
978 |
} |
979 |
} |
980 |
// If more that one slide is present, add a navigation link |
981 |
// for activating the slide |
982 |
if( coverSlides.length > 1 ){ |
983 |
var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>"); |
984 |
if( index == 0 ){ |
985 |
// Set the first navigation link as active |
986 |
$(covernav).addClass("nav-active"); |
987 |
} |
988 |
$(covernav).html("<i class=\"fa fa-circle\"></i>"); |
989 |
$("#cover-slides").append( covernav ); |
920 |
} |
990 |
} |
921 |
} |
991 |
} |
922 |
}); |
|
|
923 |
if( $(this).find('img').length < 1 ){ |
924 |
$(this).remove(); |
925 |
$("#catalogue_detail_biblio").attr("class","col-xs-12"); |
926 |
} |
992 |
} |
927 |
}); |
993 |
}); |
|
|
994 |
if( $(".cover-image:visible").length < 1 ){ |
995 |
$("#cover-slides").remove(); |
996 |
} |
997 |
|
928 |
$("#editions img").each(function(i){ |
998 |
$("#editions img").each(function(i){ |
929 |
if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { |
999 |
if ( this.src.indexOf('amazon.com') >= 0 ) { |
930 |
w = this.width; |
1000 |
w = this.width; |
931 |
h = this.height; |
1001 |
h = this.height; |
932 |
if ((w == 1) || (h == 1)) { |
1002 |
if ((w == 1) || (h == 1)) { |
933 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
1003 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
934 |
} else if ((this.complete != null) && (!this.complete)) { |
1004 |
} else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) { |
935 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
1005 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
936 |
} |
1006 |
} |
937 |
} |
1007 |
} |
Lines 1064-1073
Note that permanent location is a code, and location may be an authval.
Link Here
|
1064 |
|
1134 |
|
1065 |
return false; |
1135 |
return false; |
1066 |
}); |
1136 |
}); |
1067 |
[%# inject no images message %] |
|
|
1068 |
[% IF LocalCoverImages %] |
1069 |
KOHA.LocalCover.GetCoverFromBibnumber(true); |
1070 |
[% END %] |
1071 |
[% IF ( IntranetCoce && CoceProviders ) %] |
1137 |
[% IF ( IntranetCoce && CoceProviders ) %] |
1072 |
KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]'); |
1138 |
KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]'); |
1073 |
[% END %] |
1139 |
[% END %] |
Lines 1100-1110
Note that permanent location is a code, and location may be an authval.
Link Here
|
1100 |
link = $(this).attr("href"); |
1166 |
link = $(this).attr("href"); |
1101 |
openWindow(link,"Print spine label",400,400); |
1167 |
openWindow(link,"Print spine label",400,400); |
1102 |
}); |
1168 |
}); |
|
|
1169 |
$("#cover-slides").on("click",".cover-nav", function(){ |
1170 |
// Adding click handler for cover image navigation links |
1171 |
var num = $(this).data("num"); |
1172 |
$(".cover-nav").removeClass("nav-active"); |
1173 |
$(this).addClass("nav-active"); |
1174 |
$(".cover-image").hide(); |
1175 |
$(".cover-image").eq( num ).show(); |
1176 |
}); |
1103 |
}); |
1177 |
}); |
1104 |
|
1178 |
|
1105 |
[% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() { |
1179 |
$(window).load(function() { |
1106 |
verify_images(); |
1180 |
verify_images(); |
1107 |
});[% END %] |
1181 |
}); |
1108 |
</script> |
1182 |
</script> |
1109 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] |
1183 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] |
1110 |
<script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> |
1184 |
<script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> |