From 54ada7d0697e01987a0ac6db494e8516bc8c58fe Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 4 Oct 2013 16:13:20 +1300 Subject: [PATCH] Bug 10944: fix mixed content warnings for covers on staff client This switches the URLs used to access Amazon's cover images to the SSL image server, preventing warnings when using this on a secure site. To test: * Enable Amazon images in the sysprefs, all other cover images off. * Do a search in the staff client. Using firebug or similar, inspect the images that indicate both "no image found" and the covers. * Are they all https, and showing correctly? Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Galen Charlton --- .../prog/en/modules/catalogue/detail.tt | 14 +++++++------- .../prog/en/modules/catalogue/results.tt | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 73dc87c8d8..b041bbfab8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -30,7 +30,7 @@ // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html function verify_images() { $("#bookcoverimg img").each(function(i){ - if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0)) { + if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { w = this.width; h = this.height; if ((w == 1) || (h == 1)) { @@ -43,13 +43,13 @@ function verify_images() { } }); $("#editions img").each(function(i){ - if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0)) { + if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { w = this.width; h = this.height; if ((w == 1) || (h == 1)) { - this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; + this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; } else if ((this.complete != null) && (!this.complete)) { - this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; + this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; } } }); @@ -347,7 +347,7 @@ function verify_images() { [% IF ( holdcount ) %]Holds: [% holdcount %][% ELSE %][% END %] [% IF ( AmazonCoverImages ) %]
- [% END %] + [% END %] [% ELSE %]

[% title |html %]

@@ -411,7 +411,7 @@ function verify_images() {
[% IF ( AmazonCoverImages ) %]
-
[% END %] +[% END %]
    @@ -900,7 +900,7 @@ function verify_images() { [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]

    Editions

    -[% FOREACH XISBN IN XISBNS %][% IF ( AmazonCoverImages ) %][% END %] +[% FOREACH XISBN IN XISBNS %][% IF ( AmazonCoverImages ) %][% END %] [% UNLESS ( item_level_itypes ) %][% END %] -- 2.39.5
    [% IF ( noItemTypeImages ) %][% XISBN.description %][% ELSE %][% XISBN.description %][% END %][% XISBN.title |html %] by [% XISBN.author %] ©[% XISBN.copyrightdate %] [% IF ( XISBN.publishercode ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index ff02a0a856..ca911ef787 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -19,9 +19,9 @@ function verify_images() { w = this.width; h = this.height; if ((w == 1) || (h == 1)) { - this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; + this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; } else if ((this.complete != null) && (!this.complete)) { - this.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; + this.src = 'https://images-na.ssl-images-amazon.com/images/G/01/x-site/icons/no-img-sm.gif'; } } }); @@ -447,7 +447,7 @@ var holdForPatron = function () { [% END %] [% IF ( AmazonCoverImages ) %] - + [% END %]