Ticket #3905: 3905_3.patch
File 3905_3.patch, 4.8 KB (added by , 15 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
242 242 var isCustomDomain = CKEDITOR.env.isCustomDomain(); 243 243 244 244 // Creates the iframe that holds the editable document. 245 var createIFrame = function( )245 var createIFrame = function( data ) 246 246 { 247 247 if ( iframe ) 248 248 iframe.remove(); … … 250 250 fieldset.remove(); 251 251 252 252 frameLoaded = 0; 253 // The document domain must be set within the src254 // attribute;255 // Defer the script execution until iframe256 // has been added to main window, this is needed for some257 // browsers which will begin to load the frame content258 // prior to it's presentation in DOM.(#3894)259 var src = 'void( '260 + ( CKEDITOR.env.gecko ? 'setTimeout' : '' ) + '( function(){' +261 'document.open();' +262 ( CKEDITOR.env.ie && isCustomDomain ? 'document.domain="' + document.domain + '";' : '' ) +263 'document.write( window.parent[ "_cke_htmlToLoad_' + editor.name + '" ] );' +264 'document.close();' +265 'window.parent[ "_cke_htmlToLoad_' + editor.name + '" ] = null;' +266 '}'267 + ( CKEDITOR.env.gecko ? ', 0 )' : ')()' )268 + ' )';269 253 270 // Loading via src attribute does not work in Opera.271 if ( CKEDITOR.env.opera )272 src = 'void(0);';273 274 254 iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' + 275 ' style="width:100%;height:100%"' + 276 ' frameBorder="0"' + 277 ' tabIndex="-1"' + 278 ' allowTransparency="true"' + 279 ' src="javascript:' + encodeURIComponent( src ) + '"' + 280 '></iframe>' ); 255 ' style="width:100%;height:100%"' + 256 ' frameBorder="0"' + 257 // Support for custom document.domain in IE. 258 ( isCustomDomain ? 259 ' src="javascript:void((function(){' + 260 'document.open();' + 261 'document.domain=\'' + document.domain + '\';' + 262 'document.close();' + 263 '})())"' : '' ) + 264 ' tabIndex="-1"' + 265 ' allowTransparency="true"' + 266 '></iframe>' ); 281 267 268 // Register onLoad event for iframe element, which 269 // will fill it with content and set custom domain. 270 iframe.on( 'load', function( e ) 271 { 272 e.removeListener(); 273 var doc = iframe.getFrameDocument().$; 274 275 // Custom domain handling is needed after each document.open(). 276 doc.open(); 277 if ( isCustomDomain ) 278 doc.domain = document.domain; 279 doc.write( data ); 280 doc.close(); 281 282 } ); 283 282 284 var accTitle = editor.lang.editorTitle.replace( '%1', editor.name ); 283 285 284 286 if ( CKEDITOR.env.gecko ) 285 287 { 286 // Double checking the iframe will be loaded properly(#4058).287 iframe.on( 'load', function( ev )288 {289 ev.removeListener();290 contentDomReady( iframe.$.contentWindow );291 } );292 293 288 // Accessibility attributes for Firefox. 294 289 mainElement.setAttributes( 295 290 { … … 571 566 '</html>' + 572 567 activationScript; 573 568 574 window[ '_cke_htmlToLoad_' + editor.name ] = data;575 569 CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady; 576 createIFrame(); 577 578 // Opera must use the old method for loading contents. 579 if ( CKEDITOR.env.opera ) 580 { 581 var doc = iframe.$.contentWindow.document; 582 doc.open(); 583 doc.write( data ); 584 doc.close(); 585 } 570 createIFrame( data ); 586 571 }, 587 572 588 573 getData : function() -
_source/core/_bootstrap.js
12 12 // Check is High Contrast is active by creating a temporary element with a 13 13 // background image. 14 14 15 var testImage = ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : 'about:blank'; 15 var useSpacer = CKEDITOR.env.ie && CKEDITOR.env.version < 7, 16 useBlank = CKEDITOR.env.ie && CKEDITOR.env.version == 7; 16 17 18 19 var backgroundImageUrl = useSpacer ? ( CKEDITOR.basePath + 'images/spacer.gif' ) : 20 useBlank ? 'about:blank' : 'data:image/png;base64,'; 21 17 22 var hcDetect = CKEDITOR.dom.element.createFromHtml( 18 23 '<div style="width:0px;height:0px;' + 19 24 'position:absolute;left:-10000px;' + 20 'background-image:url(' + testImage+ ')"></div>', CKEDITOR.document );25 'background-image:url(' + backgroundImageUrl + ')"></div>', CKEDITOR.document ); 21 26 22 27 hcDetect.appendTo( CKEDITOR.document.getHead() ); 23 28