From b72a0d0653a2f5bade544bde15df9a8795107f36 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 4 Dec 2007 15:00:07 -0600 Subject: [PATCH] Changes to image-load check (used for patron images and amazon book covers) to tweak when the script checked for loaded images (now window.load() instead of document.ready()) Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .../intranet-tmpl/prog/en/js/staff-global.js | 14 ++++++++++++++ .../prog/en/modules/circ/circulation.tmpl | 14 -------------- .../prog/en/modules/members/boraccount.tmpl | 7 +++++++ .../prog/en/modules/members/mancredit.tmpl | 7 +++++++ .../prog/en/modules/members/maninvoice.tmpl | 7 +++++++ .../prog/en/modules/members/member-flags.tmpl | 7 +++++++ .../en/modules/members/member-password.tmpl | 7 +++++++ .../prog/en/modules/members/moremember.tmpl | 19 ++++++------------- .../prog/en/modules/members/pay.tmpl | 7 +++++++ .../prog/en/modules/members/readingrec.tmpl | 7 +++++++ .../prog/en/includes/doc-head-close.inc | 2 +- 11 files changed, 70 insertions(+), 28 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index 9983c04dbc..9e359e9854 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -16,3 +16,17 @@ function _(s) { return s } // dummy function for gettext }); +// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html +function verify_patron_images() { + for (var i = 0; i < document.images.length; i++) { + img = document.images[i]; + if ((img.src.indexOf('patronimages') >= 0)) { + w = img.width; + h = img.height; + if ((w == 0) && (h == 0) || ((img.complete != null) && (!img.complete))) { + img.src = '/intranet-tmpl/prog/img/patron-blank.png'; + } + } + } +} + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index 68b6127bfd..7a9582333c 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -12,20 +12,6 @@ verify_patron_images(); }); //]]> - -// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html -function verify_patron_images() { - for (var i = 0; i < document.images.length; i++) { - img = document.images[i]; - if ((img.src.indexOf('patronimages') >= 0)) { - w = img.width; - h = img.height; - if ((w == 0) && (h == 0) || ((img.complete != null) && (!img.complete))) { - img.src = '/intranet-tmpl/prog/img/patron-blank.png'; - } - } - } -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl index 7bc0c1bd4d..d1fe0e1bc2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl @@ -1,6 +1,13 @@ Koha › Patrons › Account for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl index 469d8c204a..ea084d8725 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl @@ -1,6 +1,13 @@ Koha › Borrowers › Create Manual Credit + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl index 070ecbed9d..895692bd4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl @@ -1,6 +1,13 @@ Koha › Borrowers › Create Manual Invoice + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tmpl index 01c8117756..957945b1f7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tmpl @@ -1,6 +1,13 @@ Koha › Patrons › Set Privileges for <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --> + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tmpl index 54835deb3a..2124a8aaaf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tmpl @@ -1,6 +1,13 @@ Koha › Patrons › <!-- TMPL_IF NAME="newpassword" -->Password Updated <!-- TMPL_ELSE -->Update Password for <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --><!-- /TMPL_IF --> + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl index ffa1990d9f..9ee6ebe7b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl @@ -2,20 +2,13 @@ Koha › Patrons › <!-- TMPL_IF NAME="unknowuser" -->Patron does not exist<!-- TMPL_ELSE -->Patron Details for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> (<!-- TMPL_VAR NAME="cardnumber" -->)<!-- /TMPL_IF --> + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl index e0d0366b70..f175da6c52 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl @@ -1,6 +1,13 @@ Koha › Patrons › Pay Fines for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl index 9c4284b273..24f921c410 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl @@ -1,6 +1,13 @@ Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> + diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index 016b438e20..6fe79274b0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -24,7 +24,7 @@ var MSG_NRECORDS_IN_BASKET = _("already in the bag"); var MSG_NO_RECORD_SELECTED = _("No item was selected"); var MSG_NO_RECORD_ADDED = _("No item was added to your book bag"); - $(document).ready(function() { + $(window).load(function() { verify_images(); }); //]]> -- 2.39.5