|
Lines 136-171
Link Here
|
| 136 |
[% END %] |
136 |
[% END %] |
| 137 |
|
137 |
|
| 138 |
[% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] |
138 |
[% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce || (Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL')) ) %] |
| 139 |
</div><div class="col-xs-3" id="bookcoverimg"> |
139 |
</div> |
| 140 |
[% IF ( LocalCoverImages ) %] |
140 |
<div class="col-xs-3" id="bookcoverimg"> |
| 141 |
<div title="[% biblionumber |url %]" class="[% biblionumber | html %]" id="local-thumbnail-preview"></div> |
141 |
<div id="cover-slides"> |
| 142 |
[% END %] |
142 |
[% IF ( LocalCoverImages ) %] |
| 143 |
[% IF ( AdlibrisEnabled && normalized_isbn ) %] |
143 |
[% IF ( localimages.0 ) %] |
| 144 |
<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> |
144 |
[% FOREACH image IN localimages %] |
| 145 |
[% END %] |
145 |
[% IF image %] |
| 146 |
[% IF ( AmazonCoverImages && normalized_isbn) %] |
146 |
<div class="cover-image local-coverimg"> |
| 147 |
<div id="amazon-bookcoverimg"> |
147 |
<a href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | uri %]&imagenumber=[% image | uri %]"> |
| 148 |
<a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"> |
148 |
<img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image | uri %]" alt="Local cover image" /> |
| 149 |
<img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="" /> |
149 |
</a> |
| 150 |
</a></div> |
150 |
<div class="hint">Local cover image</div> |
| 151 |
[% END %] |
151 |
</div> |
| 152 |
[% IF ( IntranetCoce && CoceProviders ) %] |
152 |
[% END %] |
| 153 |
[% coce_id = normalized_ean || normalized_isbn %] |
153 |
[% END %] |
| 154 |
<a class="p1" href="/cgi-bin/koha/catalogue/[% DetailPage | html %]?biblionumber=[% biblionumber | url %]"> |
154 |
[% END %] |
| 155 |
[% IF ( coce_id ) %] |
155 |
[% END %] |
| 156 |
<span style="block" title="[% biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></span> |
|
|
| 157 |
[% ELSE %] |
| 158 |
<span class="no-image">No cover image available</span> |
| 159 |
[% END %] |
| 160 |
</a> |
| 161 |
[% END %] |
| 162 |
|
156 |
|
| 163 |
[% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] |
157 |
[% IF ( AdlibrisEnabled && normalized_isbn ) %] |
| 164 |
<a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]"><img alt="Cover image" src="[% biblio.custom_cover_image_url | url %]" /></a> |
158 |
<div class="cover-image" id="adlibris-coverimg"> |
| 165 |
[% END %] |
159 |
<a href="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]"> |
| 166 |
[% END %] |
160 |
<img src="[% AdlibrisURL | url %]?isbn=[% normalized_isbn | uri %]" class="adlibris-cover-big" alt="Adlibris cover image" /> |
|
|
161 |
</a> |
| 162 |
<div class="hint">Image from Adlibris</div> |
| 163 |
</div> |
| 164 |
[% END %] |
| 165 |
[% IF ( AmazonCoverImages && normalized_isbn) %] |
| 166 |
<div class="cover-image" id="amazon-bookcoverimg"> |
| 167 |
<a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"> |
| 168 |
<img src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn | html %].01.MZZZZZZZ.jpg" alt="Amazon cover image" /> |
| 169 |
</a> |
| 170 |
<div class="hint">Image from Amazon.com</div> |
| 171 |
</div> |
| 172 |
[% END %] |
| 173 |
[% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %] |
| 174 |
[% coce_id = normalized_ean || normalized_isbn %] |
| 175 |
<div class="cover-image" id="coce-coverimg"> |
| 176 |
[% IF ( coce_id ) %] |
| 177 |
<span title="[% biblionumber | url %]" class="[% coce_id | html %]" id="coce-thumbnail-preview"></span> |
| 178 |
[% ELSE %] |
| 179 |
<span class="no-image">No cover image available</span> |
| 180 |
[% END %] |
| 181 |
<div class="hint">Image from Coce</div> |
| 182 |
</div> |
| 183 |
[% END %] |
| 167 |
|
184 |
|
| 168 |
</div> |
185 |
[% IF Koha.Preference('CustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %] |
|
|
186 |
<div class="cover-image" id="custom-coverimg"> |
| 187 |
<a class="custom_cover_image" href="[% biblio.custom_cover_image_url | url %]"> |
| 188 |
<img id="custom-img" alt="Custom cover image" src="[% biblio.custom_cover_image_url | url %]" /> |
| 189 |
</a> |
| 190 |
<div class="hint">Custom cover image</div> |
| 191 |
</div> |
| 192 |
[% END %] |
| 193 |
</div> |
| 194 |
</div> <!-- /#bookcoverimg --> |
| 195 |
[% END %] |
| 169 |
</div> |
196 |
</div> |
| 170 |
<div id="bibliodetails" class="toptabs"> |
197 |
<div id="bibliodetails" class="toptabs"> |
| 171 |
|
198 |
|
|
Lines 825-854
Note that permanent location is a code, and location may be an authval.
Link Here
|
| 825 |
var theme = "[% theme | html %]"; |
852 |
var theme = "[% theme | html %]"; |
| 826 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
853 |
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html |
| 827 |
function verify_images() { |
854 |
function verify_images() { |
| 828 |
$("#bookcoverimg").each(function(i){ |
855 |
// Loop over each container in the template which contains covers |
| 829 |
$(this).find('img').each(function(i){ |
856 |
var coverSlidess = $(".cover-image"); |
| 830 |
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'))) { |
857 |
coverSlidess.each( function( index ){ |
| 831 |
w = this.width; |
858 |
var div = $(this); |
| 832 |
h = this.height; |
859 |
// Find the image in the container |
| 833 |
if ((w == 1) || (h == 1)) { |
860 |
var img = div.find("img")[0]; |
| 834 |
$("#amazon-bookcoverimg").remove(); |
861 |
if( $(img).length > 0 ){ |
| 835 |
} else if ((this.complete != null) && (!this.complete)) { |
862 |
if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){ |
| 836 |
$("#amazon-bookcoverimg").remove(); |
863 |
// No image loaded in the container. Remove the slide |
|
|
864 |
div.remove(); |
| 865 |
} else { |
| 866 |
// All slides start hidden. If this is the first one, show it. |
| 867 |
if( index == 0 ){ |
| 868 |
div.show(); |
| 869 |
} |
| 870 |
// Check if Amazon image is present |
| 871 |
if ( div.attr("id") == "amazon-bookcoverimg" ) { |
| 872 |
w = img.width; |
| 873 |
h = img.height; |
| 874 |
if ((w == 1) || (h == 1)) { |
| 875 |
// Amazon returned single-pixel placeholder |
| 876 |
// Remove the container |
| 877 |
div.remove(); |
| 878 |
} |
| 879 |
} |
| 880 |
if( div.attr("id") == "custom-img" ){ |
| 881 |
if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { |
| 882 |
// No image was loaded via the CustomCoverImages system preference |
| 883 |
// Remove the container |
| 884 |
div.remove(); |
| 885 |
} |
| 886 |
} |
| 887 |
if( div.attr("id") == "coce-coverimg" ){ |
| 888 |
// Identify which service's image is being loaded by Coce |
| 889 |
if( $(img).attr("src").indexOf('amazon.com') >= 0 ){ |
| 890 |
div.find(".hint").html(_("Coce image from Amazon.com")); |
| 891 |
} else if( $(img).attr("src").indexOf('google.com') >= 0 ){ |
| 892 |
div.find(".hint").html(_("Coce image from Google Books")); |
| 893 |
} else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){ |
| 894 |
div.find(".hint").html(_("Coce image from Open Library")); |
| 895 |
} |
| 896 |
} |
| 897 |
// If more that one slide is present, add a navigation link |
| 898 |
// for activating the slide |
| 899 |
if( coverSlidess.length > 1 ){ |
| 900 |
var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>"); |
| 901 |
if( index == 0 ){ |
| 902 |
// Set the first navigation link as active |
| 903 |
$(covernav).addClass("nav-active"); |
| 904 |
} |
| 905 |
$(covernav).html("<i class=\"fa fa-circle\"></i>"); |
| 906 |
$("#cover-slides").append( covernav ); |
| 837 |
} |
907 |
} |
| 838 |
} |
908 |
} |
| 839 |
}); |
|
|
| 840 |
if( $(this).find('img').length < 1 ){ |
| 841 |
$(this).remove(); |
| 842 |
$("#catalogue_detail_biblio").attr("class","col-xs-12"); |
| 843 |
} |
909 |
} |
| 844 |
}); |
910 |
}); |
|
|
911 |
|
| 845 |
$("#editions img").each(function(i){ |
912 |
$("#editions img").each(function(i){ |
| 846 |
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'))) { |
913 |
if ( this.src.indexOf('amazon.com') >= 0 ) { |
| 847 |
w = this.width; |
914 |
w = this.width; |
| 848 |
h = this.height; |
915 |
h = this.height; |
| 849 |
if ((w == 1) || (h == 1)) { |
916 |
if ((w == 1) || (h == 1)) { |
| 850 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
917 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
| 851 |
} else if ((this.complete != null) && (!this.complete)) { |
918 |
} else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) { |
| 852 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
919 |
this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; |
| 853 |
} |
920 |
} |
| 854 |
} |
921 |
} |
|
Lines 981-990
Note that permanent location is a code, and location may be an authval.
Link Here
|
| 981 |
|
1048 |
|
| 982 |
return false; |
1049 |
return false; |
| 983 |
}); |
1050 |
}); |
| 984 |
[%# inject no images message %] |
|
|
| 985 |
[% IF LocalCoverImages %] |
| 986 |
KOHA.LocalCover.GetCoverFromBibnumber(true); |
| 987 |
[% END %] |
| 988 |
[% IF ( IntranetCoce && CoceProviders ) %] |
1051 |
[% IF ( IntranetCoce && CoceProviders ) %] |
| 989 |
KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]'); |
1052 |
KOHA.coce.getURL('[% CoceHost | html %]', '[% CoceProviders | html %]'); |
| 990 |
[% END %] |
1053 |
[% END %] |
|
Lines 1017-1027
Note that permanent location is a code, and location may be an authval.
Link Here
|
| 1017 |
link = $(this).attr("href"); |
1080 |
link = $(this).attr("href"); |
| 1018 |
openWindow(link,"Print spine label",400,400); |
1081 |
openWindow(link,"Print spine label",400,400); |
| 1019 |
}); |
1082 |
}); |
|
|
1083 |
$("#cover-slides").on("click",".cover-nav", function(){ |
| 1084 |
// Adding click handler for cover image navigation links |
| 1085 |
var num = $(this).data("num"); |
| 1086 |
$(".cover-nav").removeClass("nav-active"); |
| 1087 |
$(this).addClass("nav-active"); |
| 1088 |
$(".cover-image").hide(); |
| 1089 |
$(".cover-image").eq( num ).show(); |
| 1090 |
}); |
| 1020 |
}); |
1091 |
}); |
| 1021 |
|
1092 |
|
| 1022 |
[% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() { |
1093 |
$(window).load(function() { |
| 1023 |
verify_images(); |
1094 |
verify_images(); |
| 1024 |
});[% END %] |
1095 |
}); |
| 1025 |
</script> |
1096 |
</script> |
| 1026 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] |
1097 |
[% IF ( Koha.Preference('NovelistSelectStaffEnabled') && Koha.Preference('NovelistSelectStaffProfile') && ( normalized_isbn || normalized_upc ) ) %] |
| 1027 |
<script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> |
1098 |
<script src="https://imageserver.ebscohost.com/novelistselect/ns2init.js"></script> |