Show
Ignore:
Timestamp:
2008-02-25 10:37:10 (9 months ago)
Author:
martinkou
Message:

Fixed #1898 : Fixed the issue where floating dialogs cannot be opened in IE under domain relaxation mode.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/fckdialog.html

    r1609 r1611  
    2828                <meta name="robots" content="noindex, nofollow" /> 
    2929                <script type="text/javascript"> 
     30// Domain relaxation logic. 
     31(function() 
     32{ 
     33        var d = document.domain ; 
     34 
     35        while ( true ) 
     36        { 
     37                // Test if we can access a parent property. 
     38                try 
     39                { 
     40                        var parentDomain = ( Args().TopWindow || E ).document.domain ; 
     41 
     42                        if ( document.domain != parentDomain ) 
     43                                document.domain = parentDomain ; 
     44 
     45                        break ; 
     46                } 
     47                catch( e ) {} 
     48 
     49                // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
     50                d = d.replace( /.*?(?:\.|$)/, '' ) ; 
     51 
     52                if ( d.length == 0 ) 
     53                        break ;         // It was not able to detect the domain. 
     54 
     55                document.domain = d ; 
     56        } 
     57})() ; 
    3058 
    3159var E = frameElement._DialogArguments.Editor ; 
     
    4270        return dialog ? dialog._ParentDialog : frameElement._ParentDialog ; 
    4371} 
    44  
    45 // Domain relaxation logic. 
    46 (function() 
    47 { 
    48         var d = document.domain ; 
    49  
    50         while ( true ) 
    51         { 
    52                 // Test if we can access a parent property. 
    53                 try 
    54                 { 
    55                         var parentDomain = ( Args().TopWindow || E ).document.domain ; 
    56  
    57                         if ( document.domain != parentDomain ) 
    58                                 document.domain = parentDomain ; 
    59  
    60                         break ; 
    61                 } 
    62                 catch( e ) {} 
    63  
    64                 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
    65                 d = d.replace( /.*?(?:\.|$)/, '' ) ; 
    66  
    67                 if ( d.length == 0 ) 
    68                         break ;         // It was not able to detect the domain. 
    69  
    70                 document.domain = d ; 
    71         } 
    72 })() ; 
    7372 
    7473var FCK                         = E.FCK ;