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 150-156 $('#sort_by').change(function() { Link Here
150
        [% END %]
150
        [% END %]
151
    [% END %]
151
    [% END %]
152
152
153
[% IF LocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
153
[% IF LocalCoverImages %]KOHA.LocalCover.LoadResultsCovers();[% END %]
154
154
155
});
155
});
156
156
Lines 443-454 var holdForPatron = function () { Link Here
443
                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
443
                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
444
                            [% IF ( AmazonCoverImages || LocalCoverImages ) %]
444
                            [% IF ( AmazonCoverImages || LocalCoverImages ) %]
445
                                <td>
445
                                <td>
446
                                    [% IF ( LocalCoverImages ) %]
446
                                    [% IF ( LocalCoverImages) %]
447
                                        <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
447
                                        <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
448
                                        <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>
449
                                        </a>
448
                                    [% END %]
450
                                    [% END %]
449
                                    [% IF ( AmazonCoverImages ) %]
451
                                    [% IF ( AmazonCoverImages ) %]
450
                                        <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
452
                                        [% IF ( SEARCH_RESULT.normalized_isbn ) %]
451
                                            <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" />
453
                                            <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
454
                                            <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />
455
                                        [% ELSIF ( !LocalCoverImages ) %]
456
                                            <a class="p1 no-amazon-cover" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
457
                                            <img src="https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />
458
                                        [% END %]
452
                                        </a>
459
                                        </a>
453
                                    [% END %]
460
                                    [% END %]
454
                                </td>
461
                                </td>
455
- 

Return to bug 11982