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 1554-1559 Link Here
1554
            }
1554
            }
1555
        [% END # /IF OpacHighlightedWords %]
1555
        [% END # /IF OpacHighlightedWords %]
1556
1556
1557
        function verify_images() {
1558
            // Loop over each container in the template which contains covers
1559
            $(".cover-slider").each(function( index ){
1560
                var lightbox_descriptions = [];
1561
                $(this).find(".cover-image").each( function( index ){
1562
                    var div = $(this);
1563
                    // Find the image in the container
1564
                    var img = div.find("img")[0];
1565
                    if( img && $(img).length > 0 ){
1566
                        var description = "";
1567
                        if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1568
                            // No image loaded in the container. Remove the slide
1569
                            div.remove();
1570
                        } else {
1571
                            // All slides start hidden. If this is the first one, show it.
1572
                            if( index == 0 ){
1573
                                div.show();
1574
                            }
1575
                            // Check if Amazon image is present
1576
                            if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1577
                                w = img.width;
1578
                                h = img.height;
1579
                                if ((w == 1) || (h == 1)) {
1580
                                    // Amazon returned single-pixel placeholder
1581
                                    // Remove the container
1582
                                    div.remove();
1583
                                } else {
1584
                                    lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1585
                                }
1586
                            } else if( div.attr("id") == "custom-coverimg" ){
1587
                                if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1588
                                    // No image was loaded via the CustomCoverImages system preference
1589
                                    // Remove the container
1590
                                    div.remove();
1591
                                } else {
1592
                                    lightbox_descriptions.push("Custom cover image");
1593
                                }
1594
                            } else if( div.attr("id") == "syndetics-coverimg" ){
1595
                                lightbox_descriptions.push("Image from Syndetics")
1596
                            } else if( div.attr("id") == "googlejacket-coverimg" ){
1597
                                lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1598
                            } else if( div.attr("id") == "openlibrary-coverimg" ){
1599
                                lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1600
                            } else if( div.attr("id") == "coce-coverimg" ){
1601
                                // Identify which service's image is being loaded by Coce
1602
                                var coce_description;
1603
                                if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1604
                                    coce_description = ("Coce image from Amazon.com");
1605
                                } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1606
                                    coce_description = _("Coce image from Google Books");
1607
                                } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1608
                                    coce_description = _("Coce image from Open Library");
1609
                                }
1610
                                div.find(".hint").html(coce_description);
1611
                                lightbox_descriptions.push(coce_description);
1612
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1613
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1614
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1615
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1616
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1617
                                lightbox_descriptions.push(_("Local cover image"));
1618
                            } else {
1619
                                lightbox_descriptions.push(_("Cover image source unknown"));
1620
                            }
1621
                        }
1622
                    } else {
1623
                        div.remove();
1624
                    }
1625
                });
1626
1627
                // Lightbox for cover images
1628
                Chocolat(this.querySelectorAll('.cover-image a'), {
1629
                    description: function(){
1630
                        return lightbox_descriptions[this.settings.currentImageIndex];
1631
                    }
1632
                });
1633
1634
            });
1635
1636
            $(".cover-slider").each(function(){
1637
                var coverSlide = this;
1638
                var coverImages = $(this).find(".cover-image");
1639
                if( coverImages.length > 1 ){
1640
                    coverImages.each(function( index ){
1641
                        // If more that one image is present, add a navigation link
1642
                        // for activating the slide
1643
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1644
                        if( index == 0 ){
1645
                            // Set the first navigation link as active
1646
                            $(covernav).addClass("nav-active");
1647
                        }
1648
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
1649
                        $(coverSlide).append( covernav );
1650
                    });
1651
                }
1652
1653
                if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1654
                    $(coverSlide).remove();
1655
                } else {
1656
                    $(coverSlide).addClass("cover-slides");
1657
                }
1658
            });
1659
1660
            $(".cover-slider").on("click",".cover-nav", function(e){
1661
                e.preventDefault();
1662
                var cover_slider = $(this).parent();
1663
                // Adding click handler for cover image navigation links
1664
                var num = $(this).data("num");
1665
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
1666
                $(this).addClass("nav-active");
1667
                $(cover_slider).find(".cover-image").hide();
1668
                $(cover_slider).find(".cover-image").eq( num ).show();
1669
            });
1670
1671
            $("#editions img").each(function(i){
1672
                if ( this.src.indexOf('amazon.com') >= 0 ) {
1673
                    w = this.width;
1674
                    h = this.height;
1675
                    if ((w == 1) || (h == 1)) {
1676
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1677
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1678
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1679
                    }
1680
                }
1681
            });
1682
        } /* /verify_images */
1683
1684
        $(window).load(function() {
1685
            verify_images();
1686
        });
1687
1557
        $(document).ready(function() {
1688
        $(document).ready(function() {
1558
1689
1559
            [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
1690
            [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
Lines 1695-1828 Link Here
1695
                KOHA.OpenLibrary.GetCoverFromIsbn();
1826
                KOHA.OpenLibrary.GetCoverFromIsbn();
1696
            [% END %]
1827
            [% END %]
1697
1828
1698
        function verify_images() {
1699
            // Loop over each container in the template which contains covers
1700
            $(".cover-slider").each(function(){
1701
                var lightbox_descriptions = [];
1702
                $(this).find(".cover-image").each( function( index ){
1703
                    var div = $(this);
1704
                    // Find the image in the container
1705
                    var img = div.find("img")[0];
1706
                    if( $(img).length > 0 ){
1707
                        var description = "";
1708
                        if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1709
                            // No image loaded in the container. Remove the slide
1710
                            div.remove();
1711
                        } else {
1712
                            // All slides start hidden. If this is the first one, show it.
1713
                            if( index == 0 ){
1714
                                div.show();
1715
                            }
1716
                            // Check if Amazon image is present
1717
                            if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1718
                                w = img.width;
1719
                                h = img.height;
1720
                                if ((w == 1) || (h == 1)) {
1721
                                    // Amazon returned single-pixel placeholder
1722
                                    // Remove the container
1723
                                    div.remove();
1724
                                } else {
1725
                                    lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1726
                                }
1727
                            } else if( div.attr("id") == "custom-coverimg" ){
1728
                                if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1729
                                    // No image was loaded via the CustomCoverImages system preference
1730
                                    // Remove the container
1731
                                    div.remove();
1732
                                } else {
1733
                                    lightbox_descriptions.push("Custom cover image");
1734
                                }
1735
                            } else if( div.attr("id") == "syndetics-coverimg" ){
1736
                                lightbox_descriptions.push("Image from Syndetics")
1737
                            } else if( div.attr("id") == "googlejacket-coverimg" ){
1738
                                lightbox_descriptions.push(_("Image from Google Jacket (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1739
                            } else if( div.attr("id") == "openlibrary-coverimg" ){
1740
                                lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1741
                            } else if( div.attr("id") == "coce-coverimg" ){
1742
                                // Identify which service's image is being loaded by Coce
1743
                                var coce_description;
1744
                                if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1745
                                    coce_description = ("Coce image from Amazon.com");
1746
                                } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1747
                                    coce_description = _("Coce image from Google Books");
1748
                                } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1749
                                    coce_description = _("Coce image from Open Library");
1750
                                }
1751
                                div.find(".hint").html(coce_description);
1752
                                lightbox_descriptions.push(coce_description);
1753
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1754
                                lightbox_descriptions.push(_("Image from Baker Taylor"));
1755
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1756
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1757
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1758
                                lightbox_descriptions.push(_("Local cover image"));
1759
                            } else {
1760
                                lightbox_descriptins.push(_("Cover image source unknown"));
1761
                            }
1762
                        }
1763
                    }
1764
                });
1765
1766
                // Lightbox for cover images
1767
                Chocolat(this.querySelectorAll('.cover-image a'), {
1768
                    description: function(){
1769
                        return lightbox_descriptions[this.settings.currentImageIndex];
1770
                    }
1771
                });
1772
1773
            });
1774
1775
            $(".cover-slider").each(function(){
1776
                var coverSlide = this;
1777
                var coverImages = $(this).find(".cover-image");
1778
                if( coverImages.length > 1 ){
1779
                    coverImages.each(function( index ){
1780
                        // If more that one image is present, add a navigation link
1781
                        // for activating the slide
1782
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1783
                        if( index == 0 ){
1784
                            // Set the first navigation link as active
1785
                            $(covernav).addClass("nav-active");
1786
                        }
1787
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
1788
                        $(coverSlide).append( covernav );
1789
                    });
1790
                }
1791
1792
                if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1793
                    $(coverSlide).remove();
1794
                } else {
1795
                    $(coverSlide).addClass("cover-slides");
1796
                }
1797
            });
1798
1799
            $(".cover-slider").on("click",".cover-nav", function(e){
1800
                e.preventDefault();
1801
                var cover_slider = $(this).parent();
1802
                // Adding click handler for cover image navigation links
1803
                var num = $(this).data("num");
1804
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
1805
                $(this).addClass("nav-active");
1806
                $(cover_slider).find(".cover-image").hide();
1807
                $(cover_slider).find(".cover-image").eq( num ).show();
1808
            });
1809
1810
            $("#editions img").each(function(i){
1811
                if ( this.src.indexOf('amazon.com') >= 0 ) {
1812
                    w = this.width;
1813
                    h = this.height;
1814
                    if ((w == 1) || (h == 1)) {
1815
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1816
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1817
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1818
                    }
1819
                }
1820
            });
1821
        }
1822
1823
        $(window).load(function() {
1824
            verify_images();
1825
        });
1826
            [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1829
            [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1827
                novSelect.loadContentForQuery(
1830
                novSelect.loadContentForQuery(
1828
                    {
1831
                    {
(-)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