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 629-635 th { Link Here
629
    }
629
    }
630
630
631
    img {
631
    img {
632
        margin: 0 1em 1em 0;
632
        margin: 1em;
633
    }
633
    }
634
}
634
}
635
635
Lines 640-648 th { Link Here
640
}
640
}
641
641
642
#biblio-cover-slider {
642
#biblio-cover-slider {
643
    background-color: #fff;
643
    border: 1px solid #b9d8d9;
644
    border: 1px solid #b9d8d9;
644
    border-radius: 3px;
645
    border-radius: 3px;
645
    margin: 5px;
646
    margin: 0 1em .5em 0;
646
    padding: 10px 5px 5px 5px;
647
    padding: 10px 5px 5px 5px;
647
    min-height: 175px;
648
    min-height: 175px;
648
}
649
}
Lines 651-657 th { Link Here
651
    background: #FFF url("../img/spinner-small.gif") center center no-repeat;
652
    background: #FFF url("../img/spinner-small.gif") center center no-repeat;
652
653
653
    .hint {
654
    .hint {
654
        font-size: 90%;
655
        font-size: 80%;
655
        padding: .5em 0;
656
        padding: .5em 0;
656
    }
657
    }
657
658
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-5 lines)
Lines 205-215 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
205
        var query_cgi = "[% query_cgi | html %]";
205
        var query_cgi = "[% query_cgi | html %]";
206
    [% END %]
206
    [% END %]
207
207
208
    [% IF ( OPACAmazonCoverImages || SyndeticsCoverImages ) %]
209
        $(window).load(function() {
210
            verify_images();
211
         });
212
    [% END %]
213
    $(".print-large").on("click",function(){
208
    $(".print-large").on("click",function(){
214
        window.print();
209
        window.print();
215
        return false;
210
        return false;
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-129 / +132 lines)
Lines 129-135 Link Here
129
                                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
129
                                            <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | url %][% bt_id | uri %]" />
130
                                        </a>
130
                                        </a>
131
                                    [% END %]
131
                                    [% END %]
132
                                    <div class="hint">Image from BakerTaylor</div>
132
                                    <div class="hint">Image from Baker &amp; Taylor</div>
133
                                </div>
133
                                </div>
134
                            [% END %]
134
                            [% END %]
135
135
Lines 1388-1393 Link Here
1388
            }
1388
            }
1389
        [% END # /IF OpacHighlightedWords %]
1389
        [% END # /IF OpacHighlightedWords %]
1390
1390
1391
        function verify_images() {
1392
            // Loop over each container in the template which contains covers
1393
            $(".cover-slider").each(function( index ){
1394
                var lightbox_descriptions = [];
1395
                $(this).find(".cover-image").each( function( index ){
1396
                    var div = $(this);
1397
                    // Find the image in the container
1398
                    var img = div.find("img")[0];
1399
                    if( img && $(img).length > 0 ){
1400
                        var description = "";
1401
                        if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1402
                            // No image loaded in the container. Remove the slide
1403
                            div.remove();
1404
                        } else {
1405
                            // All slides start hidden. If this is the first one, show it.
1406
                            if( index == 0 ){
1407
                                div.show();
1408
                            }
1409
                            // Check if Amazon image is present
1410
                            if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1411
                                w = img.width;
1412
                                h = img.height;
1413
                                if ((w == 1) || (h == 1)) {
1414
                                    // Amazon returned single-pixel placeholder
1415
                                    // Remove the container
1416
                                    div.remove();
1417
                                } else {
1418
                                    lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1419
                                }
1420
                            } else if( div.attr("id") == "custom-coverimg" ){
1421
                                if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1422
                                    // No image was loaded via the CustomCoverImages system preference
1423
                                    // Remove the container
1424
                                    div.remove();
1425
                                } else {
1426
                                    lightbox_descriptions.push("Custom cover image");
1427
                                }
1428
                            } else if( div.attr("id") == "syndetics-coverimg" ){
1429
                                lightbox_descriptions.push("Image from Syndetics")
1430
                            } else if( div.attr("id") == "googlejacket-coverimg" ){
1431
                                lightbox_descriptions.push(_("Image from Google Books (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1432
                            } else if( div.attr("id") == "openlibrary-coverimg" ){
1433
                                lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1434
                            } else if( div.attr("id") == "coce-coverimg" ){
1435
                                // Identify which service's image is being loaded by Coce
1436
                                var coce_description;
1437
                                if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1438
                                    coce_description = ("Coce image from Amazon.com");
1439
                                } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1440
                                    coce_description = _("Coce image from Google Books");
1441
                                } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1442
                                    coce_description = _("Coce image from Open Library");
1443
                                }
1444
                                div.find(".hint").html(coce_description);
1445
                                lightbox_descriptions.push(coce_description);
1446
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1447
                                lightbox_descriptions.push(_("Image from Baker &amp; Taylor"));
1448
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1449
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1450
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1451
                                lightbox_descriptions.push(_("Local cover image"));
1452
                            } else {
1453
                                lightbox_descriptions.push(_("Cover image source unknown"));
1454
                            }
1455
                        }
1456
                    } else {
1457
                        div.remove();
1458
                    }
1459
                });
1460
1461
                // Lightbox for cover images
1462
                Chocolat(this.querySelectorAll('.cover-image a'), {
1463
                    description: function(){
1464
                        return lightbox_descriptions[this.settings.currentImageIndex];
1465
                    }
1466
                });
1467
1468
            });
1469
1470
            $(".cover-slider").each(function(){
1471
                var coverSlide = this;
1472
                var coverImages = $(this).find(".cover-image");
1473
                if( coverImages.length > 1 ){
1474
                    coverImages.each(function( index ){
1475
                        // If more that one image is present, add a navigation link
1476
                        // for activating the slide
1477
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1478
                        if( index == 0 ){
1479
                            // Set the first navigation link as active
1480
                            $(covernav).addClass("nav-active");
1481
                        }
1482
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
1483
                        $(coverSlide).append( covernav );
1484
                    });
1485
                }
1486
1487
                if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1488
                    $(coverSlide).remove();
1489
                } else {
1490
                    $(coverSlide).addClass("cover-slides");
1491
                }
1492
            });
1493
1494
            $(".cover-slider").on("click",".cover-nav", function(e){
1495
                e.preventDefault();
1496
                var cover_slider = $(this).parent();
1497
                // Adding click handler for cover image navigation links
1498
                var num = $(this).data("num");
1499
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
1500
                $(this).addClass("nav-active");
1501
                $(cover_slider).find(".cover-image").hide();
1502
                $(cover_slider).find(".cover-image").eq( num ).show();
1503
            });
1504
1505
            $("#editions img").each(function(i){
1506
                if ( this.src.indexOf('amazon.com') >= 0 ) {
1507
                    w = this.width;
1508
                    h = this.height;
1509
                    if ((w == 1) || (h == 1)) {
1510
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1511
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1512
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1513
                    }
1514
                }
1515
            });
1516
        } /* /verify_images */
1517
1518
        $(window).load(function() {
1519
            verify_images();
1520
        });
1521
1391
        $(document).ready(function() {
1522
        $(document).ready(function() {
1392
1523
1393
            [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
1524
            [% IF ( Koha.Preference('OPACDetailQRCode') ) %]
Lines 1529-1662 Link Here
1529
                KOHA.OpenLibrary.GetCoverFromIsbn();
1660
                KOHA.OpenLibrary.GetCoverFromIsbn();
1530
            [% END %]
1661
            [% END %]
1531
1662
1532
        function verify_images() {
1533
            // Loop over each container in the template which contains covers
1534
            $(".cover-slider").each(function(){
1535
                var lightbox_descriptions = [];
1536
                $(this).find(".cover-image").each( function( index ){
1537
                    var div = $(this);
1538
                    // Find the image in the container
1539
                    var img = div.find("img")[0];
1540
                    if( $(img).length > 0 ){
1541
                        var description = "";
1542
                        if( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ){
1543
                            // No image loaded in the container. Remove the slide
1544
                            div.remove();
1545
                        } else {
1546
                            // All slides start hidden. If this is the first one, show it.
1547
                            if( index == 0 ){
1548
                                div.show();
1549
                            }
1550
                            // Check if Amazon image is present
1551
                            if ( div.attr("id") == "amazon-bookcoverimg"  ) {
1552
                                w = img.width;
1553
                                h = img.height;
1554
                                if ((w == 1) || (h == 1)) {
1555
                                    // Amazon returned single-pixel placeholder
1556
                                    // Remove the container
1557
                                    div.remove();
1558
                                } else {
1559
                                    lightbox_descriptions.push(_("Amazon cover image (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1560
                                }
1561
                            } else if( div.attr("id") == "custom-coverimg" ){
1562
                                if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) {
1563
                                    // No image was loaded via the CustomCoverImages system preference
1564
                                    // Remove the container
1565
                                    div.remove();
1566
                                } else {
1567
                                    lightbox_descriptions.push("Custom cover image");
1568
                                }
1569
                            } else if( div.attr("id") == "syndetics-coverimg" ){
1570
                                lightbox_descriptions.push("Image from Syndetics")
1571
                            } else if( div.attr("id") == "googlejacket-coverimg" ){
1572
                                lightbox_descriptions.push(_("Image from Google Jacket (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1573
                            } else if( div.attr("id") == "openlibrary-coverimg" ){
1574
                                lightbox_descriptions.push(_("Image from OpenLibrary (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1575
                            } else if( div.attr("id") == "coce-coverimg" ){
1576
                                // Identify which service's image is being loaded by Coce
1577
                                var coce_description;
1578
                                if( $(img).attr("src").indexOf('amazon.com') >= 0 ){
1579
                                    coce_description = ("Coce image from Amazon.com");
1580
                                } else if( $(img).attr("src").indexOf('google.com') >= 0 ){
1581
                                    coce_description = _("Coce image from Google Books");
1582
                                } else if( $(img).attr("src").indexOf('openlibrary.org') >= 0 ){
1583
                                    coce_description = _("Coce image from Open Library");
1584
                                }
1585
                                div.find(".hint").html(coce_description);
1586
                                lightbox_descriptions.push(coce_description);
1587
                            } else if ( div.attr("id") == "bakertaylor-coverimg" ){
1588
                                lightbox_descriptions.push(_("Image from Baker Taylor"));
1589
                            } else if ( div.attr("id") == "adlibris-coverimg" ){
1590
                                lightbox_descriptions.push(_("Image from Adlibris (<a href='%s'>see the original image</a>)").format($(img).data('link')));
1591
                            } else if ( div.attr("class") == "cover-image local-coverimg" ) {
1592
                                lightbox_descriptions.push(_("Local cover image"));
1593
                            } else {
1594
                                lightbox_descriptins.push(_("Cover image source unknown"));
1595
                            }
1596
                        }
1597
                    }
1598
                });
1599
1600
                // Lightbox for cover images
1601
                Chocolat(this.querySelectorAll('.cover-image a'), {
1602
                    description: function(){
1603
                        return lightbox_descriptions[this.settings.currentImageIndex];
1604
                    }
1605
                });
1606
1607
            });
1608
1609
            $(".cover-slider").each(function(){
1610
                var coverSlide = this;
1611
                var coverImages = $(this).find(".cover-image");
1612
                if( coverImages.length > 1 ){
1613
                    coverImages.each(function( index ){
1614
                        // If more that one image is present, add a navigation link
1615
                        // for activating the slide
1616
                        var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>");
1617
                        if( index == 0 ){
1618
                            // Set the first navigation link as active
1619
                            $(covernav).addClass("nav-active");
1620
                        }
1621
                        $(covernav).html("<i class=\"fa fa-circle\"></i>");
1622
                        $(coverSlide).append( covernav );
1623
                    });
1624
                }
1625
1626
                if( $(coverSlide).find(".cover-image:visible").length < 1 ){
1627
                    $(coverSlide).remove();
1628
                } else {
1629
                    $(coverSlide).addClass("cover-slides");
1630
                }
1631
            });
1632
1633
            $(".cover-slider").on("click",".cover-nav", function(e){
1634
                e.preventDefault();
1635
                var cover_slider = $(this).parent();
1636
                // Adding click handler for cover image navigation links
1637
                var num = $(this).data("num");
1638
                $(cover_slider).find(".cover-nav").removeClass("nav-active");
1639
                $(this).addClass("nav-active");
1640
                $(cover_slider).find(".cover-image").hide();
1641
                $(cover_slider).find(".cover-image").eq( num ).show();
1642
            });
1643
1644
            $("#editions img").each(function(i){
1645
                if ( this.src.indexOf('amazon.com') >= 0 ) {
1646
                    w = this.width;
1647
                    h = this.height;
1648
                    if ((w == 1) || (h == 1)) {
1649
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1650
                    } else if ( (this.complete != null) && (!this.complete) || this.naturalHeight == 0 ) {
1651
                        this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
1652
                    }
1653
                }
1654
            });
1655
        }
1656
1657
        $(window).load(function() {
1658
            verify_images();
1659
        });
1660
            [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1663
            [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %]
1661
                novSelect.loadContentForQuery(
1664
                novSelect.loadContentForQuery(
1662
                    {
1665
                    {
(-)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