Lines 52-62
function verify_images() {
Link Here
|
52 |
}); |
52 |
}); |
53 |
} |
53 |
} |
54 |
|
54 |
|
55 |
$(document).ready(function() { |
55 |
function removeLocalImage(imagenumber) { |
|
|
56 |
|
57 |
$.ajax({ |
58 |
url: "/cgi-bin/koha/svc/cover_images?action=delete&biblionumber=" + [% biblionumber %] + "&imagenumber=" + imagenumber, |
59 |
success: function(data) { |
60 |
$(data).each( function(i) { |
61 |
if ( this.deleted == 1 ) { |
62 |
$('#imagenumber-' + this.imagenumber).remove(); |
63 |
} |
64 |
}); |
65 |
} |
66 |
}); |
67 |
|
68 |
} |
69 |
|
70 |
$(document).ready(function() { |
56 |
$('#bibliodetails').tabs(); |
71 |
$('#bibliodetails').tabs(); |
57 |
$('#search-form').focus(); |
72 |
$('#search-form').focus(); |
|
|
73 |
$('.thumbnails > li > a > span').click(function() { |
74 |
var result = confirm(_("Are you sure you want to delete this cover image?")); |
75 |
|
76 |
if ( result == true ) { |
77 |
var imagenumber = $(this).parent().parent().attr('id').split('-')[1]; |
78 |
removeLocalImage(imagenumber); |
79 |
} |
80 |
|
81 |
return false; |
82 |
}); |
83 |
}); |
58 |
|
84 |
|
59 |
}); |
|
|
60 |
[% IF ( AmazonCoverImages ) %]$(window).load(function() { |
85 |
[% IF ( AmazonCoverImages ) %]$(window).load(function() { |
61 |
verify_images(); |
86 |
verify_images(); |
62 |
});[% END %] |
87 |
});[% END %] |
Lines 693-707
function verify_images() {
Link Here
|
693 |
[% IF ( LocalCoverImages ) %] |
718 |
[% IF ( LocalCoverImages ) %] |
694 |
<div id="images"> |
719 |
<div id="images"> |
695 |
[% IF ( localimages.0 ) %] |
720 |
[% IF ( localimages.0 ) %] |
696 |
<p>Click on an image to view it in the image viewer</p> |
721 |
<p>Click on an image to view it in the image viewer</p> |
|
|
722 |
<ul class="thumbnails"> |
697 |
[% FOREACH image IN localimages %] |
723 |
[% FOREACH image IN localimages %] |
698 |
[% IF image %] |
724 |
[% IF image %] |
699 |
<a class="localimage" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber %]&imagenumber=[% image %]"><img alt="" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image %]" /></a> |
725 |
<li id="imagenumber-[% image %]"> |
700 |
[% END %] |
726 |
<a class="thumbnail" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber %]&imagenumber=[% image %]"> |
|
|
727 |
<img alt="" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image %]" /> |
728 |
<span class="remove">×</span> |
729 |
</a> |
730 |
</li> |
731 |
[% END %] |
701 |
[% END %] |
732 |
[% END %] |
|
|
733 |
</ul> |
702 |
[% ELSE %] |
734 |
[% ELSE %] |
703 |
[% IF ( CAN_user_tools_upload_local_cover_images ) %] |
735 |
[% IF ( CAN_user_tools_upload_local_cover_images ) %] |
704 |
<p>No images have been uploaded for this bibliographic record yet. Please <a href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image'>upload</a> one.</p> |
736 |
<p>No images have been uploaded for this bibliographic record yet. Please <a href='/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image'>upload</a> one.</p> |
705 |
[% END %] |
737 |
[% END %] |
706 |
[% END %] |
738 |
[% END %] |
707 |
</div> |
739 |
</div> |