Show
Ignore:
Timestamp:
2008-06-24 12:06:29 (7 months ago)
Author:
martinkou
Message:

Merged all changes in trunk up to r2121.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/features/new_samples/editor/filemanager/connectors/perl/commands.pl

    r1791 r2123  
    170170        local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_; 
    171171 
     172        # Minified version of the document.domain automatic fix script (#1919). 
     173        # The original script can be found at _dev/domain_fix_template.js 
     174        # Note: in Perl replace \ with \\ and $ with \$ 
    172175        print <<EOF; 
    173176Content-type: text/html 
    174177 
    175178<script type="text/javascript"> 
    176 // Automatically detect the correct document.domain (#1919). 
    177 (function() 
    178 { 
    179         var d = document.domain ; 
    180  
    181         while ( true ) 
    182         { 
    183                 // Test if we can access a parent property. 
    184                 try 
    185                 { 
    186                         var test = window.top.opener.document.domain ; 
    187                         break ; 
    188                 } 
    189                 catch( e ) {} 
    190  
    191                 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 
    192                 d = d.replace( /.*?(?:\\.|\$)/, '' ) ; 
    193  
    194                 if ( d.length == 0 ) 
    195                         break ;         // It was not able to detect the domain. 
    196  
    197                 try 
    198                 { 
    199                         document.domain = d ; 
    200                 } 
    201                 catch (e) 
    202                 { 
    203                         break ; 
    204                 } 
    205         } 
    206 })() ; 
     179(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\\.|\$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})(); 
    207180 
    208181EOF