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 697-711
function verify_images() {
Link Here
|
697 |
[% IF ( LocalCoverImages ) %] |
722 |
[% IF ( LocalCoverImages ) %] |
698 |
<div id="images"> |
723 |
<div id="images"> |
699 |
[% IF ( localimages.0 ) %] |
724 |
[% IF ( localimages.0 ) %] |
700 |
<p>Click on an image to view it in the image viewer</p> |
725 |
<p>Click on an image to view it in the image viewer</p> |
|
|
726 |
<ul class="thumbnails"> |
701 |
[% FOREACH image IN localimages %] |
727 |
[% FOREACH image IN localimages %] |
702 |
[% IF image %] |
728 |
[% IF image %] |
703 |
<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> |
729 |
<li id="imagenumber-[% image %]"> |
704 |
[% END %] |
730 |
<a class="thumbnail" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber %]&imagenumber=[% image %]"> |
|
|
731 |
<img alt="" src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&imagenumber=[% image %]" /> |
732 |
<span class="remove">×</span> |
733 |
</a> |
734 |
</li> |
735 |
[% END %] |
705 |
[% END %] |
736 |
[% END %] |
|
|
737 |
</ul> |
706 |
[% ELSE %] |
738 |
[% ELSE %] |
707 |
[% IF ( CAN_user_tools_upload_local_cover_images ) %] |
739 |
[% IF ( CAN_user_tools_upload_local_cover_images ) %] |
708 |
<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> |
740 |
<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> |
709 |
[% END %] |
741 |
[% END %] |
710 |
[% END %] |
742 |
[% END %] |
711 |
</div> |
743 |
</div> |