Show
Ignore:
Timestamp:
2008-03-25 08:57:35 (7 months ago)
Author:
wwalc
Message:

Fix for #1919 (file browser & relaxation mode issue)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/connectors/lasso/connector.lasso

    r1655 r1791  
    204204                Set the HTML response. 
    205205                */ 
    206                 if($uploadResult == '0' || $uploadResult == '201'); 
    207                                 $__html_reply__ = '\ 
     206                $__html_reply__ = '\ 
    208207<script type="text/javascript"> 
    209         window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\'); 
     208(function() 
     209{ 
     210        var d = document.domain ; 
     211 
     212        while ( true ) 
     213        { 
     214                // Test if we can access a parent property. 
     215                try 
     216                { 
     217                        var test = window.top.opener.document.domain ; 
     218                        break ; 
     219                } 
     220                catch( e ) {} 
     221 
     222                // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
     223                d = d.replace( /.*?(?:\\.|$)/, "" ) ; 
     224 
     225                if ( d.length == 0 ) 
     226                        break ;         // It was not able to detect the domain. 
     227 
     228                try 
     229                { 
     230                        document.domain = d ; 
     231                } 
     232                catch (e) 
     233                { 
     234                        break ; 
     235                } 
     236        } 
     237})() ; 
     238'; 
     239                                if($uploadResult == '0' || $uploadResult == '201'); 
     240                                $__html_reply__ = $__html_reply__ + '\ 
     241        window.parent.OnUploadCompleted(' + $uploadResult + ',\'' + $NewFilePath + '\',\'' + $NewFilePath->split('/')->last + '\'); 
    210242</script> 
    211243                                '; 
    212                 else; 
    213                                 $__html_reply__ = '\ 
    214 <script type="text/javascript"> 
    215         window.parent.frames[\'frmUpload\'].OnUploadCompleted(' + $uploadResult + '); 
     244                                else; 
     245                                $__html_reply__ = $__html_reply__ + '\ 
     246        window.parent.OnUploadCompleted(' + $uploadResult + '); 
    216247</script> 
    217248                                ';