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 <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
5a541da6ce
commit
b72a0d0653
11 changed files with 70 additions and 28 deletions
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- TMPL_INCLUDE NAME="calendar.inc" -->
|
||||
</head>
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Patrons › Account for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Borrowers › Create Manual Credit</title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Borrowers › Create Manual Invoice</title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Patrons › Set Privileges for <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Patrons › <!-- TMPL_IF NAME="newpassword" -->Password Updated <!-- TMPL_ELSE -->Update Password for <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --><!-- /TMPL_IF --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -2,20 +2,13 @@
|
|||
<title>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 --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
// 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';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body onload="verify_patron_images();">
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Koha › Patrons › Pay Fines for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.inc" -->
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
|
||||
<title>Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></title>
|
||||
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
|
||||
<script type="text/JavaScript" language="JavaScript">
|
||||
//<![CDATA[
|
||||
$(window).load(function() {
|
||||
verify_patron_images();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- TMPL_INCLUDE NAME="header.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");
|
||||
<!-- TMPL_IF NAME="AmazonContent" -->$(document).ready(function() {
|
||||
<!-- TMPL_IF NAME="AmazonContent" -->$(window).load(function() {
|
||||
verify_images();
|
||||
});<!-- /TMPL_IF -->
|
||||
//]]>
|
||||
|
|
Loading…
Reference in a new issue