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