View | Details | Raw Unified | Return to bug 11982
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js (-1 / +38 lines)
Lines 46-52 KOHA.LocalCover = { Link Here
46
                        }
46
                        }
47
                        $(mydiv).children('.no-image').remove();
47
                        $(mydiv).children('.no-image').remove();
48
                    }
48
                    }
49
                })
49
                });
50
        });
51
    },
52
    LoadResultsCovers: function(){
53
        $("div [id^=local-thumbnail]").each(function(i) {
54
            var mydiv = this;
55
            var message = document.createElement("span");
56
            $(message).attr("class","no-image thumbnail");
57
            $(message).html(NO_LOCAL_JACKET);
58
            $(mydiv).append(message);
59
            var img = $("<img />");
60
            img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"));
61
            img.load(function () {
62
                    if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) {
63
                        //IE HACK
64
                        try {
65
                            var otherCovers = $(mydiv).closest('td').find('img');
66
                            var nbCovers = otherCovers.length;
67
                            if(nbCovers > 0){
68
                                var badCovers = 0;
69
                                otherCovers.each(function(){
70
                                    if(this.naturalWidth <= 1){
71
                                        $(this).parent().remove();
72
                                        badCovers++;
73
                                    }
74
                                });
75
                                if(badCovers < nbCovers){
76
                                    $(mydiv).parent().remove();
77
                                }
78
                            }
79
                        }
80
                        catch(err){
81
                        }
82
                    } else {
83
                        $(mydiv).append(img);
84
                        $(mydiv).children('.no-image').remove();
85
                    }
86
                });
50
        });
87
        });
51
    }
88
    }
52
};
89
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +3 lines)
Lines 175-180 function verify_images() { Link Here
175
    [% IF ( LocalCoverImages && ! localimages.0 ) %]
175
    [% IF ( LocalCoverImages && ! localimages.0 ) %]
176
        showNoImageMessage();
176
        showNoImageMessage();
177
    [% END %]
177
    [% END %]
178
    [% IF LocalCoverImages %]
179
        KOHA.LocalCover.GetCoverFromBibnumber(true);
180
    [% END %]
178
        $("body").on("click",".previewMARC", function(e){
181
        $("body").on("click",".previewMARC", function(e){
179
            e.preventDefault();
182
            e.preventDefault();
180
            var page = $(this).attr("href");
183
            var page = $(this).attr("href");
Lines 184-192 function verify_images() { Link Here
184
        $("#marcPreview").on("hidden", function(){
187
        $("#marcPreview").on("hidden", function(){
185
            $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
188
            $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
186
        });
189
        });
187
        [% IF LocalCoverImages %]
188
        KOHA.LocalCover.GetCoverFromBibnumber(true);
189
        [% END %]
190
    });
190
    });
191
191
192
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
192
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-5 / +11 lines)
Lines 151-157 $('#sort_by').change(function() { Link Here
151
        [% END %]
151
        [% END %]
152
    [% END %]
152
    [% END %]
153
153
154
[% IF LocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
154
[% IF LocalCoverImages %]KOHA.LocalCover.LoadResultsCovers();[% END %]
155
155
156
});
156
});
157
157
Lines 446-457 var holdForPatron = function () { Link Here
446
                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
446
                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
447
                            [% IF ( AmazonCoverImages || LocalCoverImages ) %]
447
                            [% IF ( AmazonCoverImages || LocalCoverImages ) %]
448
                                <td>
448
                                <td>
449
                                    [% IF ( LocalCoverImages ) %]
449
                                    [% IF ( LocalCoverImages) %]
450
                                        <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
450
                                        <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
451
                                        <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
452
                                        </a>
451
                                    [% END %]
453
                                    [% END %]
452
                                    [% IF ( AmazonCoverImages ) %]
454
                                    [% IF ( AmazonCoverImages ) %]
453
                                        <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
455
                                        [% IF ( SEARCH_RESULT.normalized_isbn ) %]
454
                                            <img src="[% IF ( SEARCH_RESULT.normalized_isbn ) %]https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg[% ELSE %]https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif[% END %]" alt="" class="thumbnail" />
456
                                            <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
457
                                            <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
458
                                        [% ELSIF ( !LocalCoverImages ) %]
459
                                            <a class="p1 no-amazon-cover" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
460
                                            <img src="https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />
461
                                        [% END %]
455
                                        </a>
462
                                        </a>
456
                                    [% END %]
463
                                    [% END %]
457
                                </td>
464
                                </td>
458
- 

Return to bug 11982