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

(-)a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss (-3 / +4 lines)
Lines 619-625 th { Link Here
619
    }
619
    }
620
620
621
    img {
621
    img {
622
        margin: 0 1em 1em 0;
622
        margin: 1em;
623
    }
623
    }
624
}
624
}
625
625
Lines 630-638 th { Link Here
630
}
630
}
631
631
632
#biblio-cover-slider {
632
#biblio-cover-slider {
633
    background-color: #fff;
633
    border: 1px solid #b9d8d9;
634
    border: 1px solid #b9d8d9;
634
    border-radius: 3px;
635
    border-radius: 3px;
635
    margin: 5px;
636
    margin: 0 1em .5em 0;
636
    padding: 10px 5px 5px 5px;
637
    padding: 10px 5px 5px 5px;
637
    min-height: 175px;
638
    min-height: 175px;
638
}
639
}
Lines 641-647 th { Link Here
641
    background: #FFF url("../img/spinner-small.gif") center center no-repeat;
642
    background: #FFF url("../img/spinner-small.gif") center center no-repeat;
642
643
643
    .hint {
644
    .hint {
644
        font-size: 90%;
645
        font-size: 80%;
645
        padding: .5em 0;
646
        padding: .5em 0;
646
    }
647
    }
647
648
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-5 lines)
Lines 214-224 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
214
        var query_cgi = "[% query_cgi | html %]";
214
        var query_cgi = "[% query_cgi | html %]";
215
    [% END %]
215
    [% END %]
216
216
217
    [% IF ( OPACAmazonCoverImages || SyndeticsCoverImages ) %]
218
        $(window).load(function() {
219
            verify_images();
220
         });
221
    [% END %]
222
    $(".print-large").on("click",function(){
217
    $(".print-large").on("click",function(){
223
        window.print();
218
        window.print();
224
        return false;
219
        return false;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-129 / +132 lines)
Lines 140-146 Link Here
140
                                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
140
                                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
141
                                        </a>
141
                                        </a>
142
                                    [% END %]
142
                                    [% END %]
143
                                    <div class="hint">Image from BakerTaylor</div>
143
                                    <div class="hint">Image from Baker &amp; Taylor</div>
144
                                </div>
144
                                </div>
145
                            [% END %]
145
                            [% END %]
146
146
Lines 1548-1553 Link Here
1548
            }
1548
            }
1549
        [% END # /IF OpacHighlightedWords %]
1549
        [% END # /IF OpacHighlightedWords %]
1550
1550
1551
        function verify_images() {
1552
            // Loop over each container in the template which contains covers
1553
            $(".cover-slider").each(function( index ){
1554
                var lightbox_descriptions = [];
1555
                $(this).find(".cover-image").each( function( index ){
1556
                    var div = $(this);
1557
                    // Find the image in the container
1558
                    var img = div.find("img")[0];
1559
                    if( img && $(img).length > 0 ){
1560
                        var description = "";
1561
                        if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1562
                            // No image loaded in the container. Remove the slide
1563
                            div.remove();
1564
                        } else {
1565
                            // All slides start hidden. If this is the first one, show it.
1566
                            if( index == 0 ){
1567
                                div.show();
1568
                            }
1569
                            // Check if Amazon image is present
1570
                            if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1571
                                w = img.width;
1572
                                h = img.height;
1573
                                if ((w == 1) || (h == 1)) {
1574
                                    // Amazon returned single-pixel placeholder
1575
                                    // Remove the container
1576
                                    div.remove();
1577
                                } else {
1578
                                    lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1579
                                }
1580
                            } else if( div.attr("id") == "custom-coverimg" ){
1581
                                if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1582
                                    // No image was loaded via the CustomCoverImages system preference
1583
                                    // Remove the container
1584
                                    div.remove();
1585
                                } else {
1586
                                    lightbox_descriptions.push("Custom cover image");
1587
                                }
1588
                            } else if( div.attr("id") == "syndetics-coverimg" ){
1589
                                lightbox_descriptions.push("Image from Syndetics")
1590
                            } else if( div.attr("id") == "googlejacket-coverimg" ){
1591
                                lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1592
                            } else if( div.attr("id") == "openlibrary-coverimg" ){
1593
                                lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1594
                            } else if( div.attr("id") == "coce-coverimg" ){
1595
                                // Identify which service's image is being loaded by Coce
1596
                                var coce_description;
1597
                                if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1598
                                    coce_description = ("Coce image from Amazon.com");
1599
                                } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1600
                                    coce_description = _("Coce image from Google Books");
1601
                                } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1602
                                    coce_description = _("Coce image from Open Library");
1603
                                }
1604
                                div.find(".hint").html(coce_description);
1605
                                lightbox_descriptions.push(coce_description);
1606
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1607
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1608
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1609
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1610
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1611
                                lightbox_descriptions.push(_("Local cover image"));
1612
                            } else {
1613
                                lightbox_descriptions.push(_("Cover image source unknown"));
1614
                            }
1615
                        }
1616
                    } else {
1617
                        div.remove();
1618
                    }
1619
                });
1620
1621
                // Lightbox for cover images
1622
                Chocolat(this.querySelectorAll('.cover-image a'), {
1623
                    description: function(){
1624
                        return lightbox_descriptions[this.settings.currentImageIndex];
1625
                    }
1626
                });
1627
1628
            });
1629
1630
            $(".cover-slider").each(function(){
1631
                var coverSlide = this;
1632
                var coverImages = $(this).find(".cover-image");
1633
                if( coverImages.length > 1 ){
1634
                    coverImages.each(function( index ){
1635
                        // If more that one image is present, add a navigation link
1636
                        // for activating the slide
1637
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1638
                        if( index == 0 ){
1639
                            // Set the first navigation link as active
1640
                            $(covernav).addClass("nav-active");
1641
                        }
1642
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
1643
                        $(coverSlide).append( covernav );
1644
                    });
1645
                }
1646
1647
                if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1648
                    $(coverSlide).remove();
1649
                } else {
1650
                    $(coverSlide).addClass("cover-slides");
1651
                }
1652
            });
1653
1654
            $(".cover-slider").on("click",".cover-nav", function(e){
1655
                e.preventDefault();
1656
                var cover_slider = $(this).parent();
1657
                // Adding click handler for cover image navigation links
1658
                var num = $(this).data("num");
1659
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
1660
                $(this).addClass("nav-active");
1661
                $(cover_slider).find(".cover-image").hide();
1662
                $(cover_slider).find(".cover-image").eq( num ).show();
1663
            });
1664
1665
            $("#editions img").each(function(i){
1666
                if ( this.src.indexOf('amazon.com') >= 0 ) {
1667
                    w = this.width;
1668
                    h = this.height;
1669
                    if ((w == 1) || (h == 1)) {
1670
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1671
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1672
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1673
                    }
1674
                }
1675
            });
1676
        } /* /verify_images */
1677
1678
        $(window).load(function() {
1679
            verify_images();
1680
        });
1681
1551
        $(document).ready(function() {
1682
        $(document).ready(function() {
1552
1683
1553
            [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
1684
            [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
Lines 1689-1822 Link Here
1689
                KOHA.OpenLibrary.GetCoverFromIsbn();
1820
                KOHA.OpenLibrary.GetCoverFromIsbn();
1690
            [% END %]
1821
            [% END %]
1691
1822
1692
        function verify_images() {
1693
            // Loop over each container in the template which contains covers
1694
            $(".cover-slider").each(function(){
1695
                var lightbox_descriptions = [];
1696
                $(this).find(".cover-image").each( function( index ){
1697
                    var div = $(this);
1698
                    // Find the image in the container
1699
                    var img = div.find("img")[0];
1700
                    if( $(img).length > 0 ){
1701
                        var description = "";
1702
                        if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1703
                            // No image loaded in the container. Remove the slide
1704
                            div.remove();
1705
                        } else {
1706
                            // All slides start hidden. If this is the first one, show it.
1707
                            if( index == 0 ){
1708
                                div.show();
1709
                            }
1710
                            // Check if Amazon image is present
1711
                            if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1712
                                w = img.width;
1713
                                h = img.height;
1714
                                if ((w == 1) || (h == 1)) {
1715
                                    // Amazon returned single-pixel placeholder
1716
                                    // Remove the container
1717
                                    div.remove();
1718
                                } else {
1719
                                    lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1720
                                }
1721
                            } else if( div.attr("id") == "custom-coverimg" ){
1722
                                if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1723
                                    // No image was loaded via the CustomCoverImages system preference
1724
                                    // Remove the container
1725
                                    div.remove();
1726
                                } else {
1727
                                    lightbox_descriptions.push("Custom cover image");
1728
                                }
1729
                            } else if( div.attr("id") == "syndetics-coverimg" ){
1730
                                lightbox_descriptions.push("Image from Syndetics")
1731
                            } else if( div.attr("id") == "googlejacket-coverimg" ){
1732
                                lightbox_descriptions.push(_("Image from Google Jacket (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1733
                            } else if( div.attr("id") == "openlibrary-coverimg" ){
1734
                                lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1735
                            } else if( div.attr("id") == "coce-coverimg" ){
1736
                                // Identify which service's image is being loaded by Coce
1737
                                var coce_description;
1738
                                if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1739
                                    coce_description = ("Coce image from Amazon.com");
1740
                                } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1741
                                    coce_description = _("Coce image from Google Books");
1742
                                } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1743
                                    coce_description = _("Coce image from Open Library");
1744
                                }
1745
                                div.find(".hint").html(coce_description);
1746
                                lightbox_descriptions.push(coce_description);
1747
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1748
                                lightbox_descriptions.push(_("Image from Baker Taylor"));
1749
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1750
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1751
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1752
                                lightbox_descriptions.push(_("Local cover image"));
1753
                            } else {
1754
                                lightbox_descriptins.push(_("Cover image source unknown"));
1755
                            }
1756
                        }
1757
                    }
1758
                });
1759
1760
                // Lightbox for cover images
1761
                Chocolat(this.querySelectorAll('.cover-image a'), {
1762
                    description: function(){
1763
                        return lightbox_descriptions[this.settings.currentImageIndex];
1764
                    }
1765
                });
1766
1767
            });
1768
1769
            $(".cover-slider").each(function(){
1770
                var coverSlide = this;
1771
                var coverImages = $(this).find(".cover-image");
1772
                if( coverImages.length > 1 ){
1773
                    coverImages.each(function( index ){
1774
                        // If more that one image is present, add a navigation link
1775
                        // for activating the slide
1776
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1777
                        if( index == 0 ){
1778
                            // Set the first navigation link as active
1779
                            $(covernav).addClass("nav-active");
1780
                        }
1781
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
1782
                        $(coverSlide).append( covernav );
1783
                    });
1784
                }
1785
1786
                if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1787
                    $(coverSlide).remove();
1788
                } else {
1789
                    $(coverSlide).addClass("cover-slides");
1790
                }
1791
            });
1792
1793
            $(".cover-slider").on("click",".cover-nav", function(e){
1794
                e.preventDefault();
1795
                var cover_slider = $(this).parent();
1796
                // Adding click handler for cover image navigation links
1797
                var num = $(this).data("num");
1798
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
1799
                $(this).addClass("nav-active");
1800
                $(cover_slider).find(".cover-image").hide();
1801
                $(cover_slider).find(".cover-image").eq( num ).show();
1802
            });
1803
1804
            $("#editions img").each(function(i){
1805
                if ( this.src.indexOf('amazon.com') >= 0 ) {
1806
                    w = this.width;
1807
                    h = this.height;
1808
                    if ((w == 1) || (h == 1)) {
1809
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1810
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1811
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1812
                    }
1813
                }
1814
            });
1815
        }
1816
1817
        $(window).load(function() {
1818
            verify_images();
1819
        });
1820
            [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1823
            [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1821
                novSelect.loadContentForQuery(
1824
                novSelect.loadContentForQuery(
1822
                    {
1825
                    {
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js (-2 / +2 lines)
Lines 22-28 KOHA.LocalCover = { Link Here
22
            var mydiv = this;
22
            var mydiv = this;
23
            var message = document.createElement("span");
23
            var message = document.createElement("span");
24
            $(message).attr("class","no-image");
24
            $(message).attr("class","no-image");
25
            $(message).html(NO_LOCAL_JACKET);
25
            $(message).html( __("No cover image available") );
26
            $(mydiv).parent().find('.no-image').remove();
26
            $(mydiv).parent().find('.no-image').remove();
27
            $(mydiv).append(message);
27
            $(mydiv).append(message);
28
            var img = $("<img />").attr('src',
28
            var img = $("<img />").attr('src',
Lines 51-57 KOHA.LocalCover = { Link Here
51
            var imagenumber  = $(mydiv).data("imagenumber");
51
            var imagenumber  = $(mydiv).data("imagenumber");
52
            var biblionumber = $(mydiv).data("biblionumber");
52
            var biblionumber = $(mydiv).data("biblionumber");
53
            $(message).attr("class","no-image");
53
            $(message).attr("class","no-image");
54
            $(message).html(NO_LOCAL_JACKET);
54
            $(message).html( __("No cover image available") );
55
            $(mydiv).parent().find('.no-image').remove();
55
            $(mydiv).parent().find('.no-image').remove();
56
            $(mydiv).append(message);
56
            $(mydiv).append(message);
57
            var img = $("<img />").attr('src',
57
            var img = $("<img />").attr('src',
(-)a/koha-tmpl/opac-tmpl/lib/Chocolat/css/chocolat.css (-1 / +39 lines)
Lines 228-230 body.chocolat-open > .chocolat-image-wrapper { Link Here
228
    opacity: 0;
228
    opacity: 0;
229
}
229
}
230
*/
230
*/
231
- 
231
232
/* Local chnages for Koha */
233
.chocolat-wrapper {
234
    z-index: 1035;
235
}
236
237
.chocolat-wrapper .chocolat-left {
238
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-arrow-left-circle-fill' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.5 7.5a.5.5 0 0 1 0 1H5.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L5.707 7.5H11.5z' style='fill:%2377b50f;fill-opacity:1' /%3E%3C/svg%3E") 50% 50% no-repeat;
239
    background-size: 35px;
240
}
241
242
.chocolat-wrapper .chocolat-right {
243
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-arrow-right-circle-fill' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z' style='fill:%2377b50f;fill-opacity:1' /%3E%3C/svg%3E") 50% 50% no-repeat;
244
    background-size: 35px;
245
}
246
247
.chocolat-wrapper .chocolat-close {
248
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-x-circle-fill' viewBox='0 0 16 16'%3E%3Cpath d='M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z' style='fill:%2377b50f;fill-opacity:1' /%3E%3C/svg%3E") 50% 50% no-repeat;
249
    background-size: 35px;
250
}
251
252
.chocolat-wrapper .chocolat-bottom {
253
    background: rgba(0, 0, 0, 0.8);
254
}
255
256
.chocolat-wrapper .chocolat-bottom a {
257
    color: #FFF;
258
    text-decoration: underline;
259
}
260
261
.chocolat-wrapper .chocolat-fullscreen {
262
    width: 40px;
263
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='currentColor' class='bi bi-arrow-down-left-square' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' d='M14.357 3.656a.692.692 0 00-.691-.692H2.263a.692.692 0 00-.691.692v8.303c0 .382.31.692.691.692h11.403c.382 0 .691-.31.691-.692zm-13.477 0c0-.764.62-1.383 1.383-1.383h11.403c.764 0 1.383.62 1.383 1.383v8.303c0 .764-.62 1.383-1.383 1.383H2.263C1.5 13.342.88 12.723.88 11.96z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' d='M14.357 8.151a.692.692 0 00-.691-.692h-5.88a.692.692 0 00-.69.692v3.808c0 .382.309.692.69.692h5.88c.382 0 .691-.31.691-.692zm-7.954 0c0-.764.62-1.384 1.384-1.384h5.879c.764 0 1.383.62 1.383 1.384v3.808c0 .764-.62 1.383-1.383 1.383h-5.88c-.763 0-1.383-.619-1.383-1.383z' fill='%23fff'/%3E%3C/svg%3E");
264
    background-position: 50% 50%;
265
    background-repeat: no-repeat;
266
    background-size: 25px;
267
}
268
269
/* End local changes for Koha */

Return to bug 28180