Bugzilla – Attachment 32748 Details for
Bug 11982
Show local cover images in the biblio details page in the intranet.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11982 - Images now display properly in the details section.
PASSED-QA-Bug-11982---Images-now-display-properly-.patch (text/plain), 7.71 KB, created by
Katrin Fischer
on 2014-10-25 20:35:08 UTC
(
hide
)
Description:
[PASSED QA] Bug 11982 - Images now display properly in the details section.
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-10-25 20:35:08 UTC
Size:
7.71 KB
patch
obsolete
>From 76535efc2f8019b085a7f0f27bc85f158a202def Mon Sep 17 00:00:00 2001 >From: mbeaulieu <mbeaulieu@inlibro.com> >Date: Fri, 8 Aug 2014 09:49:53 -0400 >Subject: [PATCH] [PASSED QA] Bug 11982 - Images now display properly in the > details section. > >If the a cover image exists, it will be displayed on the details page. >Nothing is displayed of there is no cover available. > modified: koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js > modified: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >Works as described, passes tests and QA script. >Checked Amazon covers and local covers display correctly >in staff on results and detail pages. >--- > koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js | 5 +- > .../prog/en/modules/catalogue/detail.tt | 58 +++++++++++++--------- > 2 files changed, 36 insertions(+), 27 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >index 8688cc9..f728d85 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js >@@ -27,11 +27,10 @@ KOHA.LocalCover = { > var img = $("<img />").attr('src', > '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) > .load(function () { >- if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { >+ if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) { > //IE HACK > try { >- $(mydiv).append(img); >- $(mydiv).children('.no-image').remove(); >+ $(mydiv).remove(); > } > catch(err){ > } >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 35edc85..6adad36 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -28,19 +28,22 @@ > //<![CDATA[ > // 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) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { >- w = this.width; >- h = this.height; >- if ((w == 1) || (h == 1)) { >- $("#bookcoverimg").remove(); >- $(".yui-gb").attr("class","yui-g"); >- } else if ((this.complete != null) && (!this.complete)) { >- $("#bookcoverimg").remove(); >- $(".yui-gb").attr("class","yui-g"); >+ $("#bookcoverimg").each(function(i){ >+ $(this).find('img').each(function(i){ >+ 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)) { >+ $("#amazon-bookcoverimg").remove(); >+ $(".yui-gb").attr("class","yui-g"); >+ } else if ((this.complete != null) && (!this.complete)) { >+ $("#amazon-bookcoverimg").remove(); >+ $(".yui-gb").attr("class","yui-g"); >+ } > } >- } > }); >+ if( $(this).find('img').length < 1 ) $(this).remove(); >+ }); > $("#editions img").each(function(i){ > 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; >@@ -180,9 +183,9 @@ function verify_images() { > [% END %] > }); > >- [% IF ( AmazonCoverImages ) %]$(window).load(function() { >+ [% IF ( AmazonCoverImages || LocalCoverImages )%]$(window).load(function() { > verify_images(); >- });[% END %] >+ });[% END %] > //]]> > </script> > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >@@ -369,17 +372,21 @@ function verify_images() { > <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span> > [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %] > >- [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %] >+ [% IF ( AmazonCoverImages || LocalCoverImages ) %] > </div><div class="yui-u" id="bookcoverimg"> >- [% IF ( LocalCoverImages ) %]<div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %] >- [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div id="bookcoverimg"> >- <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"> >+ [% IF ( LocalCoverImages ) %] >+ <div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div> >+ [% END %] >+ [% IF ( AmazonCoverImages ) %] >+ <div id="amazon-bookcoverimg"> >+ <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"> > [% IF ( using_https ) %] >- <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /> >+ <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /> > [% ELSE %] >- <img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /> >+ <img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /> > [% END %] >- </a></div>[% END %][% END %] >+ </a></div> >+ [% END %] > [% END %] > [% ELSE %] > >@@ -443,10 +450,13 @@ function verify_images() { > </ul> > </div> > >- [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %] >+ [% IF ( AmazonCoverImages || LocalCoverImages ) %] > <div class="yui-u" id="bookcoverimg"> >- [% IF ( LocalCoverImages ) %]<div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %] >- [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div id="bookcoverimg"> >+ [% IF ( LocalCoverImages ) %] >+ <div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div> >+ [% END %] >+ [% IF ( AmazonCoverImages ) %] >+ <div id="amazon-bookcoverimg"> > <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"> > [% IF ( using_https ) %] > <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /> >@@ -455,7 +465,7 @@ function verify_images() { > [% END %] > </a> > </div> >- [% END %][% END %] >+ [% END %] > </div> > [% END %] > >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11982
:
26514
|
26515
|
30625
|
30626
|
30627
|
30689
|
30690
|
32636
|
32637
|
32638
|
32746
|
32747
|
32748
|
34813
|
34815
|
34816
|
36626
|
36627
|
36852
|
36853
|
36854
|
114729