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

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

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/filemanager/browser/default/browser.html

    r1736 r1791  
    2929                <script type="text/javascript" src="js/fckxml.js"></script> 
    3030                <script language="javascript"> 
     31// Automatically detect the correct document.domain (#1919). 
     32(function() 
     33{ 
     34        var d = document.domain ; 
     35 
     36        while ( true ) 
     37        { 
     38                // Test if we can access a parent property. 
     39                try 
     40                { 
     41                        var test = window.opener.document.domain ; 
     42                        break ; 
     43                } 
     44                catch( e ) {} 
     45 
     46                // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
     47                d = d.replace( /.*?(?:\.|$)/, '' ) ; 
     48 
     49                if ( d.length == 0 ) 
     50                        break ;         // It was not able to detect the domain. 
     51 
     52                try 
     53                { 
     54                        document.domain = d ; 
     55                } 
     56                catch (e) 
     57                { 
     58                        break ; 
     59                } 
     60        } 
     61})() ; 
    3162 
    3263function GetUrlParam( paramName )