fix: phpWGOpenWindow was not working because of popup blocker in IE and FF if

the image was not in the cache

git-svn-id: http://piwigo.org/svn/trunk@1611 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2006-11-17 04:20:07 +00:00
parent 31e312028c
commit 57ee203e29
+15 -20
View File
@@ -1,6 +1,6 @@
function SelectAll( formulaire )
{
len = formulaire.elements.length;
var len = formulaire.elements.length;
var i=0;
for( i = 0; i < len; i++)
{
@@ -14,7 +14,7 @@ for( i = 0; i < len; i++)
function DeselectAll( formulaire )
{
len = formulaire.elements.length;
var len = formulaire.elements.length;
var i=0;
for( i = 0; i < len; i++)
{
@@ -28,7 +28,7 @@ for( i = 0; i < len; i++)
function Inverser( formulaire )
{
len = formulaire.elements.length;
var len = formulaire.elements.length;
var i=0;
for( i=0; i<len; i++)
{
@@ -40,32 +40,27 @@ for( i=0; i<len; i++)
}
}
function verifieAndOpen()
function phpWGOpenWindow(theURL,winName,features)
{
var ok=1;
if (!img.complete)
img = new Image();
img.src = theURL;
if (img.complete)
{
// sometime the image loading is not complete
// especially with KHTML and Opera
setTimeout("verifieAndOpen()",200)
var width=img.width +40;
var height=img.height +40;
}
else
{
/* give more space for scrollbars (10 for FF, 40 for IE) */
width=img.width +40;
height=img.height +40;
window.open(owURL,owName,owFeatures + ',width=' + width + ',height=' + height);
var width=640;
var height=480;
img.onload = resizeWindowToFit;
}
newWin = window.open(theURL,winName,features+',left=2,top=1,width=' + width + ',height=' + height);
}
function phpWGOpenWindow(theURL,winName,features)
function resizeWindowToFit()
{
img = new Image()
img.src = theURL;
owURL=theURL;
owName=winName;
owFeatures=features;
verifieAndOpen();
newWin.resizeTo( img.width+50, img.height+100);
}
function popuphelp(url)