[Koha-cvs] koha/koha-tmpl/intranet-tmpl/npl/en/includes co... [dev_week]
Owen Leonard
oleonard at athenscounty.lib.oh.us
Mon Oct 9 15:42:30 CEST 2006
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Owen Leonard <oleonard> 06/10/09 13:42:30
Modified files:
koha-tmpl/intranet-tmpl/npl/en/includes: common.js.inc
Log message:
Need to handle missing image script differently for Amazon images, patron images, and all others. First draft of these changes.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/includes/common.js.inc?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.1.2.3&r2=1.1.2.1.2.4
Patches:
Index: common.js.inc
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/includes/Attic/common.js.inc,v
retrieving revision 1.1.2.1.2.3
retrieving revision 1.1.2.1.2.4
diff -u -b -r1.1.2.1.2.3 -r1.1.2.1.2.4
--- common.js.inc 4 Oct 2006 19:24:15 -0000 1.1.2.1.2.3
+++ common.js.inc 9 Oct 2006 13:42:30 -0000 1.1.2.1.2.4
@@ -67,6 +67,22 @@
}
}
+// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
+function verifyAmazonImages() {
+ for (var i = 0; i < document.images.length; i++) {
+ img = document.images[i];
+ if ((img.src.indexOf('images.amazon.com') >= 0) || (img.src.indexOf('g-images.amazon.com') >=0)) {
+ w = img.width;
+ h = img.height;
+ if ((w == 1) || (h == 1)) {
+ img.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
+ } else if ((img.complete != null) && (!img.complete)) {
+ img.src = 'http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif';
+ }
+ }
+ }
+}
+
function mainfocus() {
if(document.forms['mainform']){
document.forms['mainform'].elements[0].focus();
@@ -84,7 +100,7 @@
}
}
- addLoadEvent(verify_images);
+ addLoadEvent(verifyAmazonImages);
addLoadEvent(mainfocus);
addLoadEvent(preparehelp);
</script>
\ No newline at end of file
More information about the Koha-cvs
mailing list