Ticket #1919: 1919_pre.patch
File 1919_pre.patch, 7.0 KB (added by , 16 years ago) |
---|
-
editor/filemanager/browser/default/browser.html
27 27 <link href="browser.css" type="text/css" rel="stylesheet"> 28 28 <script type="text/javascript" src="js/fckxml.js"></script> 29 29 <script language="javascript"> 30 // Automatically detect the correct document.domain (#1919). 31 (function() 32 { 33 var d = document.domain ; 30 34 35 while ( true ) 36 { 37 // Test if we can access a parent property. 38 try 39 { 40 var test = window.opener.document.domain ; 41 break ; 42 } 43 catch( e ) {} 44 45 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 46 d = d.replace( /.*?(?:\.|$)/, '' ) ; 47 48 if ( d.length == 0 ) 49 break ; // It was not able to detect the domain. 50 51 try 52 { 53 document.domain = d ; 54 } 55 catch (e) 56 { 57 break ; 58 } 59 } 60 })() ; 61 31 62 function GetUrlParam( paramName ) 32 63 { 33 64 var oRegex = new RegExp( '[\?&]' + paramName + '=([^&]+)', 'i' ) ; -
editor/filemanager/browser/default/frmactualfolder.html
25 25 <head> 26 26 <link href="browser.css" type="text/css" rel="stylesheet"> 27 27 <script type="text/javascript"> 28 // Automatically detect the correct document.domain (#1919). 29 (function() 30 { 31 var d = document.domain ; 28 32 33 while ( true ) 34 { 35 // Test if we can access a parent property. 36 try 37 { 38 var test = window.top.opener.document.domain ; 39 break ; 40 } 41 catch( e ) {} 42 43 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 44 d = d.replace( /.*?(?:\.|$)/, '' ) ; 45 46 if ( d.length == 0 ) 47 break ; // It was not able to detect the domain. 48 49 try 50 { 51 document.domain = d ; 52 } 53 catch (e) 54 { 55 break ; 56 } 57 } 58 })() ; 59 29 60 function OnResize() 30 61 { 31 62 divName.style.width = "1px" ; -
editor/filemanager/browser/default/js/common.js
22 22 * File Browser dialog window. 23 23 */ 24 24 25 // Automatically detect the correct document.domain (#1919). 26 (function() 27 { 28 var d = document.domain ; 29 30 while ( true ) 31 { 32 // Test if we can access a parent property. 33 try 34 { 35 var test = window.top.opener.document.domain ; 36 break ; 37 } 38 catch( e ) {} 39 40 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 41 d = d.replace( /.*?(?:\.|$)/, '' ) ; 42 43 if ( d.length == 0 ) 44 break ; // It was not able to detect the domain. 45 46 try 47 { 48 document.domain = d ; 49 } 50 catch (e) 51 { 52 break ; 53 } 54 } 55 })() ; 56 25 57 function AddSelectOption( selectElement, optionText, optionValue ) 26 58 { 27 59 var oOption = document.createElement("OPTION") ; -
editor/filemanager/connectors/perl/commands.pl
169 169 170 170 local($sErrorNumber, $sFileUrl, $sFileName, $customMsg) = @_; 171 171 172 print "Content-type: text/html\n\n"; 173 print '<script type="text/javascript">'; 172 print <<EOF 173 Content-type: text/html 174 175 <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 })() ; 207 208 EOF 174 209 print 'window.parent.OnUploadCompleted(' . $sErrorNumber . ',"' . JS_cnv($sFileUrl) . '","' . JS_cnv($sFileName) . '","' . JS_cnv($customMsg) . '") ;'; 175 210 print '</script>'; 176 211 exit ; -
editor/filemanager/connectors/php/io.php
277 277 // This is the function that sends the results of the uploading process. 278 278 function SendUploadResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' ) 279 279 { 280 echo '<script type="text/javascript">' ; 280 echo <<<EOF 281 <script type="text/javascript"> 282 (function() 283 { 284 var d = document.domain ; 285 286 while ( true ) 287 { 288 // Test if we can access a parent property. 289 try 290 { 291 var test = window.top.opener.document.domain ; 292 break ; 293 } 294 catch( e ) {} 295 296 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 297 d = d.replace( /.*?(?:\.|$)/, '' ) ; 298 299 if ( d.length == 0 ) 300 break ; // It was not able to detect the domain. 301 302 try 303 { 304 document.domain = d ; 305 } 306 catch (e) 307 { 308 break ; 309 } 310 } 311 })() ; 312 313 EOF; 281 314 $rpl = array( '\\' => '\\\\', '"' => '\\"' ) ; 282 315 echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . strtr( $fileUrl, $rpl ) . '","' . strtr( $fileName, $rpl ) . '", "' . strtr( $customMsg, $rpl ) . '") ;' ; 283 316 echo '</script>' ; -
editor/filemanager/connectors/py/fckoutput.py
102 102 self.setHttpHeaders("text/html") 103 103 "This is the function that sends the results of the uploading process" 104 104 return """<script type="text/javascript"> 105 (function() 106 { 107 var d = document.domain ; 108 109 while ( true ) 110 { 111 // Test if we can access a parent property. 112 try 113 { 114 var test = window.top.opener.document.domain ; 115 break ; 116 } 117 catch( e ) {} 118 119 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 120 d = d.replace( /.*?(?:\.|$)/, '' ) ; 121 122 if ( d.length == 0 ) 123 break ; // It was not able to detect the domain. 124 125 try 126 { 127 document.domain = d ; 128 } 129 catch (e) 130 { 131 break ; 132 } 133 } 134 })() ; 135 105 136 window.parent.OnUploadCompleted(%(errorNumber)s,"%(fileUrl)s","%(fileName)s","%(customMsg)s"); 106 137 </script>""" % { 107 138 'errorNumber': errorNo,