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 45-51 KOHA.LocalCover = { Link Here
45
                        }
45
                        }
46
                        $(mydiv).children('.no-image').remove();
46
                        $(mydiv).children('.no-image').remove();
47
                    }
47
                    }
48
                })
48
                });
49
        });
50
    },
51
    LoadResultsCovers: function(){
52
        $("div [id^=local-thumbnail]").each(function(i) {
53
            var mydiv = this;
54
            var message = document.createElement("span");
55
            $(message).attr("class","no-image thumbnail");
56
            $(message).html(NO_LOCAL_JACKET);
57
            $(mydiv).append(message);
58
            var img = $("<img />");
59
            img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"));
60
            img.load(function () {
61
                    if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) {
62
                        //IE HACK
63
                        try {
64
                            var otherCovers = $(mydiv).closest('td').find('img');
65
                            var nbCovers = otherCovers.length;
66
                            if(nbCovers > 0){
67
                                var badCovers = 0;
68
                                otherCovers.each(function(){
69
                                    if(this.naturalWidth <= 1){
70
                                        $(this).parent().remove();
71
                                        badCovers++;
72
                                    }
73
                                });
74
                                if(badCovers < nbCovers){
75
                                    $(mydiv).parent().remove();
76
                                }
77
                            }
78
                        }
79
                        catch(err){
80
                        }
81
                    } else {
82
                        $(mydiv).append(img);
83
                        $(mydiv).children('.no-image').remove();
84
                    }
85
                });
49
        });
86
        });
50
    }
87
    }
51
};
88
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +2 lines)
Lines 175-183 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 %]
178
    [% IF LocalCoverImages %]
179
        KOHA.LocalCover.GetCoverFromBibnumber(true);
179
        KOHA.LocalCover.GetCoverFromBibnumber(true);
180
        [% END %]
180
    [% END %]
181
    });
181
    });
182
182
183
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
183
     [% 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