From 09b822ffe02a2451b500411e6448554e301c6667 Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Fri, 4 Oct 2013 16:13:20 +1300 Subject: [PATCH] Bug 10944 - 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 --- .../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 d5a006b..ac76bcc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -27,7 +27,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)) { @@ -40,13 +40,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'; } } }); @@ -246,7 +246,7 @@ function verify_images() { [% IF ( holdcount ) %]Holds: [% holdcount %][% ELSE %][% END %] [% IF ( AmazonCoverImages ) %]
- [% END %] + [% END %] [% ELSE %]

[% title |html %]

@@ -310,7 +310,7 @@ function verify_images() {
[% IF ( AmazonCoverImages ) %]
-
[% END %] +[% END %]
    @@ -706,7 +706,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 %] [% END %]
    [% 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 520e6d2..70e053e 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'; } } }); @@ -441,7 +441,7 @@ var holdForPatron = function () { - + -- 1.7.2.5