View | Details | Raw Unified | Return to bug 11982
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js (-3 / +2 lines)
Lines 28-38 KOHA.LocalCover = { Link Here
28
            var img = $("<img />").attr('src',
28
            var img = $("<img />").attr('src',
29
                '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
29
                '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
30
                .load(function () {
30
                .load(function () {
31
                    if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
31
                    if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) {
32
                        //IE HACK
32
                        //IE HACK
33
                        try {
33
                        try {
34
                            $(mydiv).append(img);
34
                            $(mydiv).remove();
35
                            $(mydiv).children('.no-image').remove();
36
                        }
35
                        }
37
                        catch(err){
36
                        catch(err){
38
                        }
37
                        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-22 / +32 lines)
Lines 28-46 Link Here
28
//<![CDATA[
28
//<![CDATA[
29
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
29
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
30
function verify_images() {
30
function verify_images() {
31
    $("#bookcoverimg img").each(function(i){
31
    $("#bookcoverimg").each(function(i){
32
        $(this).find('img').each(function(i){
32
           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'))) {
33
           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'))) {
33
            w = this.width;
34
                w = this.width;
34
            h = this.height;
35
                h = this.height;
35
            if ((w == 1) || (h == 1)) {
36
                if ((w == 1) || (h == 1)) {
36
                $("#bookcoverimg").remove();
37
                    $("#amazon-bookcoverimg").remove();
37
                $(".yui-gb").attr("class","yui-g");
38
                    $(".yui-gb").attr("class","yui-g");
38
            } else if ((this.complete != null) && (!this.complete)) {
39
                } else if ((this.complete != null) && (!this.complete)) {
39
                $("#bookcoverimg").remove();
40
                    $("#amazon-bookcoverimg").remove();
40
                $(".yui-gb").attr("class","yui-g");
41
                    $(".yui-gb").attr("class","yui-g");
42
                }
41
            }
43
            }
42
        }
43
        });
44
        });
45
        if( $(this).find('img').length < 1 ) $(this).remove();
46
    });
44
	$("#editions img").each(function(i){
47
	$("#editions img").each(function(i){
45
           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'))) {
48
           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'))) {
46
            w = this.width;
49
            w = this.width;
Lines 189-195 function verify_images() { Link Here
189
        });
192
        });
190
    });
193
    });
191
194
192
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
195
     [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
193
        verify_images();
196
        verify_images();
194
     });[% END %]
197
     });[% END %]
195
//]]>
198
//]]>
Lines 376-392 function verify_images() { Link Here
376
        <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 %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
379
        <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 %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
377
        [% 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 %]
380
        [% 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 %]
378
381
379
        [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %]
382
        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
380
        </div><div class="yui-u" id="bookcoverimg">
383
        </div><div class="yui-u" id="bookcoverimg">
381
        [% IF ( LocalCoverImages ) %]<div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %]
384
        [% IF ( LocalCoverImages ) %]
382
        [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div id="bookcoverimg">
385
            <div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>
383
        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link">
386
        [% END %]
387
        [% IF ( AmazonCoverImages ) %]
388
            <div id="amazon-bookcoverimg">
389
            <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link">
384
            [% IF ( using_https ) %]
390
            [% IF ( using_https ) %]
385
            <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" />
391
                <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" />
386
            [% ELSE %]
392
            [% ELSE %]
387
            <img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" />
393
                <img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" />
388
            [% END %]
394
            [% END %]
389
        </a></div>[% END %][% END %]
395
        </a></div>
396
        [% END %]
390
        [% END %]
397
        [% END %]
391
    [% ELSE %]
398
    [% ELSE %]
392
399
Lines 450-459 function verify_images() { Link Here
450
        </ul>
457
        </ul>
451
        </div>
458
        </div>
452
       
459
       
453
    [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %]
460
    [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
454
        <div class="yui-u" id="bookcoverimg">
461
        <div class="yui-u" id="bookcoverimg">
455
        [% IF ( LocalCoverImages ) %]<div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %]
462
        [% IF ( LocalCoverImages ) %]
456
        [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div id="bookcoverimg">
463
            <div title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>
464
        [% END %]
465
        [% IF ( AmazonCoverImages ) %]
466
            <div id="amazon-bookcoverimg">
457
            <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link">
467
            <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link">
458
            [% IF ( using_https ) %]
468
            [% IF ( using_https ) %]
459
            <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" />
469
            <img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" />
Lines 462-468 function verify_images() { Link Here
462
            [% END %]
472
            [% END %]
463
            </a>
473
            </a>
464
        </div>
474
        </div>
465
        [% END %][% END %]
475
        [% END %]
466
        </div>
476
        </div>
467
    [% END %]
477
    [% END %]
468
        
478
        
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-2 / +1 lines)
Lines 16-22 var q_array = new Array(); // will hold search terms, if present Link Here
16
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
16
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
17
function verify_images() {
17
function verify_images() {
18
    $("img").each(function(i){
18
    $("img").each(function(i){
19
        if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0)) {
19
        if ((this.src.indexOf('images-amazon.com') >= 0) || (this.src.indexOf('images.amazon.com') >=0)) {
20
            w = this.width;
20
            w = this.width;
21
            h = this.height;
21
            h = this.height;
22
            if ((w == 1) || (h == 1)) {
22
            if ((w == 1) || (h == 1)) {
23
- 

Return to bug 11982