|
From: <luc...@us...> - 2013-09-15 17:49:07
|
Revision: 12058
http://sourceforge.net/p/xoops/svn/12058
Author: luciorota
Date: 2013-09-15 17:49:03 +0000 (Sun, 15 Sep 2013)
Log Message:
-----------
Modified Paths:
--------------
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.js
XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.php
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.js
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.js 2013-09-15 17:01:32 UTC (rev 12057)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.js 2013-09-15 17:49:03 UTC (rev 12058)
@@ -1,10 +1,10 @@
-function imageResize (img, maxWidth)
+function resizeImage (img, maxWidth)
{
if (img.width > maxWidth && maxWidth > 0) img.width = maxWidth;
}
-function imageLoad(img)
+function loadImage(img)
{
tempImage = new Image();
img = encodeURI(img);
@@ -15,13 +15,13 @@
function imageIsLoaded(img)
{
if ( (tempImage.width != 0) && (tempImage.height != 0) ) {
- imageShow(img);
+ showImage(img);
} else {
- intervallo = setTimeout("imageIsLoaded('\"+img+\"')", 20);
+ t = setTimeout("imageIsLoaded('\"+img+\"')", 20);
}
}
-function imageShow(img)
+function showImage(img)
{
imageWidth = tempImage.width;
imageHeight = tempImage.height;
Modified: XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.php
===================================================================
--- XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.php 2013-09-15 17:01:32 UTC (rev 12057)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.php 2013-09-15 17:49:03 UTC (rev 12058)
@@ -53,9 +53,9 @@
'type' => 'text/javascript'));
}
$ts->replacements[] = "<img src='\\5' class='\\2' alt='"._MSC_RESIZED_IMAGE . "' border='0' onload=\"JavaScript:if(this.width>\\4)this.width=\\4\" />";
- $ts->replacements[] = "<img src='\\3' class='\\2' alt='"._MSC_RESIZED_IMAGE . "' border='0'" . ($config['resize'] ? "onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>";
+ $ts->replacements[] = "<img src='\\3' class='\\2' alt='"._MSC_RESIZED_IMAGE . "' border='0'" . ($config['resize'] ? "onload=\"javascript:resizeImage(this, " . $config['max_width'] . ")\"" : "") . "/>";
$ts->replacements[] = "<img src='\\3' alt='"._MSC_RESIZED_IMAGE . "' border='0' onload=\"JavaScript:if(this.width>\\2)this.width=\\2\" /><br />";
- $ts->replacements[] = "<img src='\\1' alt='"._MSC_RESIZED_IMAGE . "' border='0'" . ($config['resize'] ? " onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>";
+ $ts->replacements[] = "<img src='\\1' alt='"._MSC_RESIZED_IMAGE . "' border='0'" . ($config['resize'] ? " onload=\"javascript:resizeImage(this, " . $config['max_width'] . ")\"" : "") . "/>";
} elseif (!empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) {
if (!$jsLoaded) {
@@ -63,14 +63,15 @@
$GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array(
'type' => 'text/javascript'));
}
- $ts->replacements[] = "<a href='javascript:imageLoad(\"\\5\");'><img src='\\5' class='\\2' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' onload=\"JavaScript:if(this.width>\\4)this.width=\\4\" /></a>";
- $ts->replacements[] = "<a href='javascript:imageLoad(\"\\3\");'><img src='\\3' class='\\2' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' " . ($config['resize'] ? "onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/></a>";
- $ts->replacements[] = "<a href='javascript:imageLoad(\"\\3\");'><img src='\\3' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' onload=\"JavaScript:if(this.width>\\2)this.width=\\2\" /></a><br />";
- $ts->replacements[] = "<a href='javascript:imageLoad(\"\\1\");'><img src='\\1' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' title='"._MSC_CLICK_TO_OPEN_IMAGE . "'" . ($config['resize'] ? " onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/></a>";} else {
+ $ts->replacements[] = "<a href='javascript:loadImage(\"\\5\");'><img src='\\5' class='\\2' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' onload=\"JavaScript:if(this.width>\\4)this.width=\\4\" /></a>";
+ $ts->replacements[] = "<a href='javascript:loadImage(\"\\3\");'><img src='\\3' class='\\2' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' " . ($config['resize'] ? "onload=\"javascript:resizeImage(this, " . $config['max_width'] . ")\"" : "") . "/></a>";
+ $ts->replacements[] = "<a href='javascript:loadImage(\"\\3\");'><img src='\\3' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' onload=\"JavaScript:if(this.width>\\2)this.width=\\2\" /></a><br />";
+ $ts->replacements[] = "<a href='javascript:loadImage(\"\\1\");'><img src='\\1' alt='"._MSC_CLICK_TO_OPEN_IMAGE . "' border='0' title='"._MSC_CLICK_TO_OPEN_IMAGE . "'" . ($config['resize'] ? " onload=\"javascript:resizeImage(this, " . $config['max_width'] . ")\"" : "") . "/></a>";
+ } else {
$ts->replacements[] = "<img src='\\5' class='\\2' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' onload=\"JavaScript:if(this.width>\\4) this.width=\\4\" />";
- $ts->replacements[] = "<img src='\\3' class='\\2' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' " . ($config['resize'] ? "onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>";
+ $ts->replacements[] = "<img src='\\3' class='\\2' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' " . ($config['resize'] ? "onload=\"javascript:resizeImage(this, " . $config['max_width'] . ")\"" : "") . "/>";
$ts->replacements[] = "<img src='\\3' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' onload=\"JavaScript:if(this.width>\\2) this.width=\\2\" />";
- $ts->replacements[] = "<img src='\\1' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' " . ($config['resize'] ? " onload=\"javascript:imageResize(this, " . $config['max_width'] . ")\"" : "") . "/>";
+ $ts->replacements[] = "<img src='\\1' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' " . ($config['resize'] ? " onload=\"javascript:resizeImage(this, " . $config['max_width'] . ")\"" : "") . "/>";
}
$ts->replacements[] = '<img src="' . XOOPS_URL . '/image.php?id=\\4" class="\\2" title="\\5" />';
$ts->replacements[] = '<img src="' . XOOPS_URL . '/image.php?id=\\2" title="\\3" />';
|