|
From: <luc...@us...> - 2013-09-15 17:01:37
|
Revision: 12057
http://sourceforge.net/p/xoops/svn/12057
Author: luciorota
Date: 2013-09-15 17:01:32 +0000 (Sun, 15 Sep 2013)
Log Message:
-----------
why italiano? here english is better ;-)
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 15:55:49 UTC (rev 12056)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.js 2013-09-15 17:01:32 UTC (rev 12057)
@@ -1,37 +1,35 @@
function imageResize (img, maxWidth)
{
- if (img.width > maxWidth && maxWidth > 0) img.width = maxWidth;
+ if (img.width > maxWidth && maxWidth > 0) img.width = maxWidth;
}
-function CaricaFoto(img)
+function imageLoad(img)
{
- foto1= new Image();
+ tempImage = new Image();
img = encodeURI(img);
- foto1.src = (img);
- Controlla(img);
+ tempImage.src = (img);
+ imageIsLoaded(img);
}
-function Controlla(img)
+function imageIsLoaded(img)
{
- if ( (foto1.width != 0) && (foto1.height != 0) ) {
- viewFoto(img);
- } else {
- funzione = "Controlla('\"+img+\"')";
- intervallo = setTimeout(funzione, 20);
- }
+ if ( (tempImage.width != 0) && (tempImage.height != 0) ) {
+ imageShow(img);
+ } else {
+ intervallo = setTimeout("imageIsLoaded('\"+img+\"')", 20);
+ }
}
-function viewFoto(img)
+function imageShow(img)
{
- largh = foto1.width;
- altez = foto1.height;
- stringa = "width=" + largh + ",height=" + altez;
- finestra = window.open ('','', stringa);
- finestra.document.write ("<html><body leftmargin=0 topmargin=0>");
- finestra.document.write ("<a href='javascript:this.close()'><img border=0 src=");
- finestra.document.write (img);
- finestra.document.write ("></a></body></html>");
- finestra.document.close();
- return false;
+ imageWidth = tempImage.width;
+ imageHeight = tempImage.height;
+ imagePopup = window.open ('','', "width=" + imageWidth + ",height=" + imageHeight);
+ imagePopup.document.write ("<html><body leftmargin=0 topmargin=0>");
+ imagePopup.document.write ("<a href='javascript:this.close()'><img border=0 src=");
+ imagePopup.document.write (img);
+ imagePopup.document.write ("></a></body></html>");
+ imagePopup.document.close();
+ return false;
}
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 15:55:49 UTC (rev 12056)
+++ XoopsCore/branches/2.5.x/2.5.7/htdocs/class/textsanitizer/image/image.php 2013-09-15 17:01:32 UTC (rev 12057)
@@ -46,7 +46,7 @@
$ts->replacements[] = '<a href="' . XOOPS_URL . '/image.php?id=\\2" rel="external" title="\\3">\\3</a>';
} else {
- if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) {
+ if (!empty($config['resize']) && empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) {
if (!$jsLoaded) {
$jsLoaded = true;
$GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array(
@@ -57,18 +57,16 @@
$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'] . ")\"" : "") . "/>";
- } elseif
-
- (!empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) {
+ } elseif (!empty($config['clickable']) && !empty($config['max_width']) && !empty($GLOBALS['xoTheme'])) {
if (!$jsLoaded) {
$jsLoaded = true;
$GLOBALS['xoTheme']->addScript('/class/textsanitizer/image/image.js', array(
'type' => 'text/javascript'));
}
- $ts->replacements[] = "<a href='javascript:CaricaFoto(\"\\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:CaricaFoto(\"\\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:CaricaFoto(\"\\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:CaricaFoto(\"\\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: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[] = "<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' border='0' alt='"._MSC_ORIGINAL_IMAGE ."' onload=\"JavaScript:if(this.width>\\2) this.width=\\2\" />";
|