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

(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (-14 / +21 lines)
Lines 734-750 th { Link Here
734
    }
734
    }
735
}
735
}
736
736
737
#biblio-cover-slider {
738
    background-color: #FFF;
739
    border: 1px solid #B9D8D9;
740
    border-radius: 3px;
741
    margin: 0 1em .5em 0;
742
    min-height: 175px;
743
    padding: 10px 5px 5px 5px;
744
}
745
746
.cover-slider {
737
.cover-slider {
747
    background: #FFF url( "../images/spinner-small.gif" ) center center no-repeat;
738
    background: #FFF url( "../images/spinner-small.gif" ) center center no-repeat;
739
    margin: 0 1em .5em 0;
740
    min-height: 175px;
741
    min-width: 100px;
742
    padding: 10px 15px 5px 5px;
748
743
749
    .hint {
744
    .hint {
750
        font-size: 80%;
745
        font-size: 80%;
Lines 761-773 th { Link Here
761
    }
756
    }
762
}
757
}
763
758
759
.covercol {
760
    .cover-slider {
761
        background: transparent none;
762
        margin: 0;
763
        padding: 5px;
764
    }
765
}
766
764
.cover-image {
767
.cover-image {
765
    display: none;
768
    display: none;
766
767
    img {
768
        height: auto;
769
        max-width: 100%;
770
    }
771
}
769
}
772
770
773
.custom_cover_image {
771
.custom_cover_image {
Lines 2957-2962 $star-selected: #EDB867; Link Here
2957
    .chocolat-bottom {
2955
    .chocolat-bottom {
2958
        background: rgba( 0, 0, 0, .7 );
2956
        background: rgba( 0, 0, 0, .7 );
2959
    }
2957
    }
2958
2959
    .chocolat-description {
2960
        a:link,
2961
        a:visited,
2962
        a:hover,
2963
        a:active {
2964
            color: desaturate( lighten( $base-theme-color, 40 ), 30 )
2965
        }
2966
    }
2960
}
2967
}
2961
2968
2962
@import "responsive";
2969
@import "responsive";
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/cover-images.inc (+90 lines)
Line 0 Link Here
1
<div class="bookcover">
2
3
    <div class="cover-slider cover-slides" data-biblionumber="[% SEARCH_RESULT.biblionumber | html %]" data-title="[% SEARCH_RESULT.title | html %]" data-isbn="[% SEARCH_RESULT.normalized_isbn | html %]">
4
        [% IF ( OPACLocalCoverImages ) %]
5
            [% IF localimages.count %]
6
                [% FOREACH image IN localimages %]
7
                    <div class="cover-image local-coverimg">
8
                        <a href="/cgi-bin/koha/opac-image.pl?imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
9
                            <img src="/cgi-bin/koha/opac-image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" />
10
                        </a>
11
                        <div class="hint">Local cover image</div>
12
                    </div>
13
                [% END %]
14
            [% END %]
15
        [% END %]
16
17
        [% IF ( OPACAmazonCoverImages && SEARCH_RESULT.normalized_isbn) %]
18
            <div class="cover-image amazon-coverimg">
19
                <a href="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | uri %].01.LZZZZZZZ.jpg" title="Amazon cover image">
20
                    <img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | uri %].01.MZZZZZZZ.jpg" alt="Amazon cover image" data-link="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% SEARCH_RESULT.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"/>
21
                </a>
22
                <div class="hint">Image from Amazon.com</div>
23
            </div>
24
        [% END %]
25
26
        [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
27
            [% IF ( content_identifier_exists ) %]
28
                <div class="cover-image syndetics-coverimg">
29
                    <a href="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | uri %]/[% SyndeticsCoverImageSize | uri %].GIF&amp;client=[% SyndeticsClientCode | uri %]&amp;type=xw10&amp;upc=[% normalized_upc | uri %]&amp;oclc=[% normalized_oclc | uri %]" title="Syndetics cover image">
30
                        <img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | uri %]/[% SyndeticsCoverImageSize | uri %].GIF&amp;client=[% SyndeticsClientCode | uri %]&amp;type=xw10&amp;upc=[% normalized_upc | uri %]&amp;oclc=[% normalized_oclc | uri %]" alt="Syndetics cover image" />
31
                    </a>
32
                    <div class="hint">Image from Syndetics</div>
33
                </div>
34
            [% END %]
35
        [% END %]
36
37
        [% IF ( GoogleJackets ) %]
38
            <div class="cover-image googlejacket-coverimg">
39
                <div title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="gbs-thumbnail-preview" data-use-data-link="1"></div>
40
                <div class="hint">Image from Google Jackets</div>
41
            </div>
42
        [% END %]
43
44
        [% IF ( Koha.Preference('OPACCoce') && Koha.Preference('CoceProviders') && SEARCH_RESULT.normalized_isbn ) %]
45
            [% coce_id = normalized_ean || SEARCH_RESULT.normalized_isbn %]
46
            <div class="cover-image coce-coverimg">
47
                [% IF ( coce_id ) %]
48
                    <a title="Image from Coce" class="[% coce_id | html %]" id="coce-thumbnail-preview"></a>
49
                [% END %]
50
                <div class="hint">Image from Coce</div>
51
            </div>
52
        [% END %]
53
54
        [% IF OpenLibraryCovers %]
55
            <div class="cover-image openlibrary-coverimg">
56
                <div title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="openlibrary-thumbnail-preview" data-use-data-link="1"></div>
57
                <div class="hint">Image from OpenLibrary</div>
58
            </div>
59
        [% END %]
60
61
        [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
62
        [% IF ( BakerTaylorEnabled && bt_id ) %]
63
            <div class="cover-image bakertaylor-coverimg">
64
                [% IF BakerTaylorBookstoreURL %]
65
                    <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
66
                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
67
                    </a>
68
                [% ELSE %]
69
                    <a href="[% BakerTaylorImageURL | url %][% bt_id | uri%]">
70
                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
71
                    </a>
72
                [% END %]
73
                <div class="hint">Image from Baker &amp; Taylor</div>
74
            </div>
75
        [% END %]
76
77
        [% IF Koha.Preference('OPACCustomCoverImages') && Koha.Preference('CustomCoverImagesURL') %]
78
            [% SET custom_cover_image_url = biblio.custom_cover_image_url %]
79
            [% IF custom_cover_image_url %]
80
                <div class="cover-image custom-coverimg">
81
                    <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" title="Custom cover image">
82
                        <img id="custom-img" alt="Custom cover image" src="[% custom_cover_image_url | url %]" />
83
                    </a>
84
                    <div class="hint">Custom cover image</div>
85
                </div>
86
            [% END %]
87
        [% END %]
88
    </div> <!-- /.cover-slider -->
89
90
</div><!-- / .bookcover -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-2 / +1 lines)
Lines 1653-1659 Link Here
1653
                window.setTimeout(function(){wait_for_images(cb);}, 100);
1653
                window.setTimeout(function(){wait_for_images(cb);}, 100);
1654
            } else {
1654
            } else {
1655
                if (counter_wait >= 50 ) {
1655
                if (counter_wait >= 50 ) {
1656
                    console.log("Could not retrieve the images")
1657
                }
1656
                }
1658
                cb();
1657
                cb();
1659
            }
1658
            }
Lines 1827-1833 Link Here
1827
            [% END %]
1826
            [% END %]
1828
1827
1829
            [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1828
            [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
1830
                KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]', $('#biblio-cover-slider') );
1829
                KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]', $('.cover-slider') );
1831
            [% END %]
1830
            [% END %]
1832
1831
1833
            [% IF OpenLibraryCovers %]
1832
            [% IF OpenLibraryCovers %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-83 / +175 lines)
Lines 25-33 Link Here
25
&rsaquo;
25
&rsaquo;
26
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog
26
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog
27
</title>
27
</title>
28
[% INCLUDE 'doc-head-close.inc' %]
29
28
30
<link rel="alternate" type="application/rss+xml" title="[% LibraryName | html %] Search RSS feed" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss" />
29
<link rel="alternate" type="application/rss+xml" title="[% LibraryName | html %] Search RSS feed" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&amp;count=[% countrss |uri %]&amp;sort_by=acqdate_dsc&amp;format=rss" />
30
[% Asset.css("lib/Chocolat/css/chocolat.css") | $raw %]
31
[% INCLUDE 'doc-head-close.inc' %]
31
</head>
32
</head>
32
[% BLOCK cssinclude %][% END %]
33
[% BLOCK cssinclude %][% END %]
33
[% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
34
[% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %]
Lines 329-335 Link Here
329
                                                    [% END %]
330
                                                    [% END %]
330
                                                </td>
331
                                                </td>
331
                                            [% END %]
332
                                            [% END %]
332
333
                                            <td class="covercol">
334
                                                [% INCLUDE 'cover-images.inc' %]
335
                                            </td>
333
                                            [% # Cell 4: Search result details and controls %]
336
                                            [% # Cell 4: Search result details and controls %]
334
                                            <td class="bibliocol">
337
                                            <td class="bibliocol">
335
                                                [% IF ( SEARCH_RESULT.title ) %]
338
                                                [% IF ( SEARCH_RESULT.title ) %]
Lines 337-423 Link Here
337
                                                [% ELSE %]
340
                                                [% ELSE %]
338
                                                    [% img_title = SEARCH_RESULT.biblionumber %]
341
                                                    [% img_title = SEARCH_RESULT.biblionumber %]
339
                                                [% END %]
342
                                                [% END %]
340
                                                <div class="coverimages cover-slides itemtype_[% SEARCH_RESULT.itemtype | html %]" data-isbn="[% To.json(SEARCH_RESULT.normalized_isbn) | $raw %]" data-imgtitle="[% img_title | html %]">
341
                                                    <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | uri %]">
342
343
                                                        [% IF ( OPACLocalCoverImages ) %]
344
                                                            <span title="[% img_title | html %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span>
345
                                                        [% END %]
346
343
347
                                                        [% IF ( OPACAmazonCoverImages ) %]
348
                                                            [% IF ( SEARCH_RESULT.normalized_isbn ) %]
349
                                                                    <span title="[% img_title | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span>
350
                                                            [% ELSE %]
351
                                                                <span class="no-image">No cover image available</span>
352
                                                            [% END %]
353
                                                        [% END %]
354
355
                                                        [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %]
356
                                                            [% IF ( SEARCH_RESULT.normalized_isbn || SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_oclc ) %]
357
                                                                    <span title="[% img_title | html %]" id="syndetics-thumbnail[% loop.count | html %]"><img src="https://secure.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn | html %]/[% SyndeticsCoverImageSize | uri %].GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc | html %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc | html %]" alt="" class="item-thumbnail" /></span>
358
                                                            [% ELSE %]
359
                                                                <span class="no-image">No cover image available</span>
360
                                                            [% END %]
361
                                                        [% END %]
362
363
                                                        [% IF ( GoogleJackets ) %]
364
                                                            [% IF ( SEARCH_RESULT.normalized_isbn ) %]
365
                                                                <span title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="gbs-thumbnail[% loop.count | html %]"></span>
366
                                                            [% ELSE %]
367
                                                                <span class="no-image">No cover image available</span>
368
                                                            [% END %]
369
                                                        [% END %]
370
371
                                                        [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
372
                                                          [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn | html %]
373
                                                          [% IF ( coce_id ) %]
374
                                                            <span title="[% img_title | html %]" class="[% coce_id | html %]" id="coce-thumbnail[% loop.count | html %]"></span>
375
                                                          [% ELSE %]
376
                                                            <span class="no-image">No cover image available</span>
377
                                                          [% END %]
378
                                                        [% END %]
379
380
                                                        [% IF OpenLibraryCovers %]
381
                                                            [% IF SEARCH_RESULT.normalized_isbn %]
382
                                                                <span title="[% img_title | html %]" class="[% SEARCH_RESULT.normalized_isbn | html %]" id="openlibrary-thumbnail[% loop.count | html %]"></span>
383
                                                            [% ELSE %]
384
                                                                <span class="no-image">No cover image available</span>
385
                                                            [% END %]
386
                                                        [% END %]
387
388
                                                        [% IF ( BakerTaylorEnabled && !BakerTaylorBookstoreURL ) %]
389
                                                            [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
390
                                                            [% IF ( bt_id ) %]
391
                                                                <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
392
                                                            [% ELSE %]
393
                                                                <span class="no-image">No cover image available</span>
394
                                                            [% END %]
395
                                                        [% END %]
396
                                                    </a>
397
398
                                                    [% IF ( BakerTaylorEnabled && BakerTaylorBookstoreURL ) %]
399
                                                        [% bt_id = ( SEARCH_RESULT.normalized_upc || SEARCH_RESULT.normalized_isbn ) %]
400
                                                        [% IF ( bt_id ) %]
401
                                                            <a href="https://[% BakerTaylorBookstoreURL | url %][% bt_id | url %]">
402
                                                                <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" />
403
                                                            </a>
404
                                                        [% ELSE %]
405
                                                            <span class="no-image">No cover image available</span>
406
                                                        [% END %]
407
                                                    [% END %]
408
409
                                                    [% IF Koha.Preference('OPACCustomCoverImages') AND Koha.Preference('CustomCoverImagesURL') %]
410
                                                        [% SET custom_cover_image_url = SEARCH_RESULT.biblio_object.custom_cover_image_url %]
411
                                                        [% IF custom_cover_image_url %]
412
                                                            [% IF ( OPACURLOpenInNewWindow ) %]
413
                                                                <a class="custom_cover_image" href="[% custom_cover_image_url | url %]" target="_blank" rel="noreferrer"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
414
                                                            [% ELSE %]
415
                                                                <a class="custom_cover_image" href="[% custom_cover_image_url | url %]"><img alt="Cover image" src="[% custom_cover_image_url | url %]" /></a>
416
                                                            [% END %]
417
                                                        [% END %]
418
                                                    [% END %]
419
420
                                                </div>
421
                                                [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
344
                                                [% IF ( COinSinOPACResults && SEARCH_RESULT.coins ) %]
422
                                                    <!-- COinS / Openurl -->
345
                                                    <!-- COinS / Openurl -->
423
                                                    <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
346
                                                    <span class="Z3988" title="[% SEARCH_RESULT.coins | html %]"></span>
Lines 578-583 Link Here
578
    [% IF OpenLibraryCovers || OpenLibrarySearch %]
501
    [% IF OpenLibraryCovers || OpenLibrarySearch %]
579
        [% Asset.js("js/openlibrary.js") | $raw %]
502
        [% Asset.js("js/openlibrary.js") | $raw %]
580
    [% END %]
503
    [% END %]
504
    [% Asset.js("lib/Chocolat/js/chocolat.js") | $raw %]
581
    [% CoverImagePlugins | $raw %]
505
    [% CoverImagePlugins | $raw %]
582
    <script>
506
    <script>
583
        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %]
507
        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACHoldRequests' ) == 1 ) %]
Lines 688-693 Link Here
688
            }
612
            }
689
        [% END # /IF OpacHighlightedWords %]
613
        [% END # /IF OpacHighlightedWords %]
690
614
615
        function verify_cover_images() {
616
            // Loop over each container in the template which contains covers
617
            $(".cover-slider").each(function( index ){
618
                let biblionumber = $(this).data("biblionumber");
619
                let booktitle = $(this).data("title");
620
                var lightbox_descriptions = [];
621
                $(this).find(".cover-image").each( function( index ){
622
                    var div = $(this);
623
                    // Find the image in the container
624
                    var img = div.find("img")[0];
625
                    if( img && $(img).length > 0 ){
626
                        // All slides start hidden. If this is the first one, show it.
627
                        // Check if Amazon image is present
628
                        if ( div.hasClass("amazon-coverimg") ) {
629
                            let w = img.width;
630
                            let h = img.height;
631
                            if ((w == 1) || (h == 1)) {
632
                                // Amazon returned single-pixel placeholder
633
                                // Remove the container
634
                                div.remove();
635
                            } else {
636
                                lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
637
                            }
638
                        } else if( div.hasClass("custom-coverimg") ){
639
640
                            if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
641
                                // No image was loaded via the CustomCoverImages system preference
642
                                // Remove the container
643
                                div.remove();
644
                            } else {
645
                                lightbox_descriptions.push(_("Custom cover image"));
646
                            }
647
                        } else if( div.hasClass("syndetics-coverimg") ){
648
                            lightbox_descriptions.push(_("Image from Syndetics"))
649
                        } else if( div.hasClass("googlejacket-coverimg" ) ){
650
                            if( img.naturalHeight  ){
651
                                lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link')));
652
                            }
653
                        } else if( div.hasClass("openlibrary-coverimg") ){
654
                            lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
655
                        } else if( div.hasClass("coce-coverimg" ) ){
656
                            // Identify which service's image is being loaded by Coce
657
                            var coce_description;
658
                            let src = $(img).attr("src");
659
                            if( src.indexOf('amazon.com') >= 0 ){
660
                                coce_description = _("Coce image from Amazon.com");
661
                            } else if( src.indexOf('google.com') >= 0 ){
662
                                coce_description = _("Coce image from Google Books");
663
                            } else if( src.indexOf('openlibrary.org') >= 0 ){
664
                                coce_description = _("Coce image from Open Library");
665
                            }
666
                            div.find(".hint").html(coce_description);
667
                            lightbox_descriptions.push(coce_description);
668
                        } else if ( div.hasClass("bakertaylor-coverimg" ) ){
669
                            lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
670
                        } else if ( div.hasClass("cover-image local-coverimg" ) ){
671
                            lightbox_descriptions.push(_("Local cover image"));
672
                        } else {
673
                            lightbox_descriptions.push(_("Cover image source unknown"));
674
                        }
675
                    } else {
676
                        div.remove();
677
                    }
678
                });
679
680
                // Lightbox for cover images
681
                Chocolat(this.querySelectorAll('.cover-image a'), {
682
                    description: function(){
683
                        return lightbox_descriptions[this.settings.currentImageIndex];
684
                    }
685
                });
686
687
            });
688
689
            $(".cover-slider").each(function(){
690
                var coverSlide = this;
691
                var coverImages = $(this).find(".cover-image");
692
                if( coverImages.length > 1 ){
693
                    coverImages.each(function( index ){
694
                        // If more that one image is present, add a navigation link
695
                        // for activating the slide
696
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
697
                        if( index == 0 ){
698
                            // Set the first navigation link as active
699
                            $(covernav).addClass("nav-active");
700
                        }
701
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
702
                        $(coverSlide).append( covernav );
703
                    });
704
                }
705
706
                $(coverSlide).find(".cover-image").eq(0).show();
707
708
                // if( $(coverSlide).find(".cover-image").length < 1 ){
709
                //     $(coverSlide).remove();
710
                // } else {
711
                    // This is a suboptimal workaround; we should do this via load, but
712
                    // the image code is scattered all over now. We come here now after
713
                    // window load and wait_for_images (so load completed).
714
                    var check_complete = 1;
715
                    $(coverSlide).find("img").each( function() {
716
                        if( !this.complete || this.naturalHeight == 0 ) check_complete = 0;
717
                    });
718
                    if( check_complete ) $(coverSlide).removeClass('cover-slides');
719
                // }
720
            });
721
722
            $(".cover-slider").on("click",".cover-nav", function(e){
723
                e.preventDefault();
724
                var cover_slider = $(this).parent();
725
                // Adding click handler for cover image navigation links
726
                var num = $(this).data("num");
727
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
728
                $(this).addClass("nav-active");
729
                $(cover_slider).find(".cover-image").hide();
730
                $(cover_slider).find(".cover-image").eq( num ).show();
731
            });
732
733
            $("#editions img").each(function(i){
734
                if ( this.src.indexOf('amazon.com') >= 0 ) {
735
                    let w = this.width;
736
                    let h = this.height;
737
                    if ((w == 1) || (h == 1)) {
738
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
739
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
740
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
741
                    }
742
                }
743
            });
744
        } /* /verify_images */
745
746
747
        let counter_wait = 0;
748
        function wait_for_images(cb){
749
750
            var loaded = 1;
751
            counter_wait++;
752
753
            [% IF GoogleJackets %]
754
                if ( loaded ) {
755
                    loaded = KOHA.Google.done;
756
                }
757
            [% END %]
758
759
            [% IF OpenLibraryCovers %]
760
                if ( loaded ) {
761
                    loaded = KOHA.OpenLibrary.done;
762
                }
763
            [% END %]
764
765
            [% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
766
                if ( loaded ) {
767
                    loaded = KOHA.coce.done;
768
                }
769
            [% END %]
770
771
            if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds
772
                window.setTimeout(function(){wait_for_images(cb);}, 100);
773
            } else {
774
                if (counter_wait >= 50 ) {
775
                }
776
                cb();
777
            }
778
        }
779
780
        $(window).load(function() {
781
            wait_for_images(verify_cover_images);
782
        });
783
691
        $(document).ready(function(){
784
        $(document).ready(function(){
692
785
693
            $(".moretoggle").click(function(e){
786
            $(".moretoggle").click(function(e){
694
- 

Return to bug 26933