diff -r d189ee25cf9d -r 3533d4323edc emailuis/emailui/data/html/email.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/emailui/data/html/email.js Wed Sep 01 12:28:57 2010 +0100 @@ -0,0 +1,49 @@ +// Original image sources are stored in this array +var originalImageSources = new Array(); + +// Number of images hidden (or replaced with our placeholder image) +var hiddenCount = 0; + +// Replace image sources with our placeholder (if the autoloading is disabled) +function hideImages(frameId) { + if (parent.header_frame.g_autoLoadImages == 0) { + var doc = document.getElementById(frameId).contentDocument; + if (!doc) { + doc = document.frames[frameId].document; + } + for (i = 0; i < doc.images.length; i++) { + var image = doc.images[i]; + originalImageSources.push(image.src); + if (image.src.length > 0) { + doc.images[i].src = "../hidden.png"; + hiddenCount++; + } + } + if (hiddenCount == 0) { + parent.header_frame.hideDisplayImagesButton(); + } else { + parent.header_frame.showDisplayImagesButton(); + } + } else { + parent.header_frame.updateHeader(); + } + requestLoadImages(); +} + +// Restore original images sources +function restoreImages(frameId) { + if (parent.header_frame.g_autoLoadImages == 0) { + var doc = document.getElementById(frameId).contentDocument; + if (!doc) { + doc = document.frames[frameId].document; + } + for (i = 0; i < originalImageSources.length; i++) { + doc.images[i].src = originalImageSources[i]; + } + } +} + +// Causes application to reload images +function requestLoadImages() { + location.href = "cmail://loadImages/"; +}