Ticket #3661: 3661_debug.patch
File 3661_debug.patch, 1.9 KB (added by , 14 years ago) |
---|
-
_source/core/scriptloader.js
53 53 */ 54 54 load : function( scriptUrl, callback, scope, noCheck ) 55 55 { 56 console.log( 'load ' + scriptUrl ); 56 57 var isString = ( typeof scriptUrl == 'string' ); 57 58 58 59 if ( isString ) … … 84 85 85 86 var checkLoaded = function( url, success ) 86 87 { 87 ( success ? completed : failed ).push( url );88 ( success ? completed : failed ).push( url ); 88 89 89 90 if ( --scriptCount <= 0 ) 90 91 doCallback( success ); 92 console.log( 'checkLoaded ' + url ); 91 93 }; 92 94 93 95 var onLoad = function( url, success ) 94 96 { 97 console.log( 'onLoad ' + url ); 95 98 // Mark this script as loaded. 96 99 uniqueScripts[ url ] = 1; 97 100 … … 102 105 // Check all callbacks waiting for this file. 103 106 for ( var i = 0 ; i < waitingInfo.length ; i++ ) 104 107 waitingInfo[ i ]( url, success ); 108 109 console.log( 'finished onLoad ' + url ); 105 110 }; 106 111 107 112 var loadScript = function( url ) … … 121 126 122 127 // Create the <script> element. 123 128 var script = new CKEDITOR.dom.element( 'script' ); 129 124 130 script.setAttributes( { 125 131 type : 'text/javascript', 126 132 src : url } ); … … 147 153 script.$.onload = function() 148 154 { 149 155 onLoad( url, true ); 156 // Some browsers, such as Safari, may call the onLoad function 157 // immediately. Which will break the loading sequence. (#3661) 158 // setTimeout( function() { onLoad( url, true ); }, 0 ); 150 159 }; 151 160 152 161 // FIXME: Opera and Safari will not fire onerror. … … 167 176 168 177 for ( var i = 0 ; i < scriptCount ; i++ ) 169 178 { 179 console.log( 'loadScript ' + scriptUrl[ i ] ); 170 180 loadScript( scriptUrl[ i ] ); 181 console.log( 'finished loadScript ' + scriptUrl[ i ] ); 171 182 } 172 183 }, 173 184