Ticket #3812: 3812_3.patch

File 3812_3.patch, 5.1 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    210210                        editor.on( 'editingBlockReady', function()
    211211                                {
    212212                                        var mainElement,
     213                                                fieldset,
    213214                                                iframe,
    214215                                                isLoadingData,
    215216                                                isPendingFocus,
     
    223224                                        {
    224225                                                if ( iframe )
    225226                                                        iframe.remove();
     227                                                if ( fieldset )
     228                                                        fieldset.remove();
    226229
    227                                                 iframe = new CKEDITOR.dom.element( 'iframe' )
    228                                                         .setAttributes({
    229                                                                 frameBorder : 0,
    230                                                                 tabIndex : -1,
    231                                                                 allowTransparency : true })
    232                                                         .setStyles({
    233                                                                 width : '100%',
    234                                                                 height : '100%' });
     230                                                // The document domain must be set within the src
     231                                                // attribute.
     232                                                var src = 'void( (function(){' +
     233                                                                'document.open();' +
     234                                                                ( CKEDITOR.env.ie && isCustomDomain ? 'document.domain="' + document.domain + '";' : '' ) +
     235                                                                'document.write( window.parent._cke_htmlToLoad_' + editor.name + ' );' +
     236                                                                'document.close();' +
     237                                                                'window.parent._cke_htmlToLoad_' + editor.name + ' = null;' +
     238                                                        '})() )';
    235239
    236                                                 if ( CKEDITOR.env.ie )
    237                                                 {
    238                                                         if ( isCustomDomain )
    239                                                         {
    240                                                                 // The document domain must be set within the src
    241                                                                 // attribute.
    242                                                                 iframe.setAttribute( 'src',
    243                                                                         'javascript:void( (function(){' +
    244                                                                                 'document.open();' +
    245                                                                                 'document.domain="' + document.domain + '";' +
    246                                                                                 'document.write( window.parent._cke_htmlToLoad_' + editor.name + ' );' +
    247                                                                                 'document.close();' +
    248                                                                                 'window.parent._cke_htmlToLoad_' + editor.name + ' = null;' +
    249                                                                         '})() )' );
    250                                                         }
    251                                                         else
    252                                                                 // To avoid HTTPS warnings.
    253                                                                 iframe.setAttribute( 'src', 'javascript:void(0)' );
    254                                                 }
     240                                                // Loading via src attribute does not work in Opera.
     241                                                if ( CKEDITOR.env.opera )
     242                                                        src = 'void(0);';
    255243
     244                                                iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
     245                                                                ' style="width:100%;height:100%"' +
     246                                                                ' frameBorder="0"' +
     247                                                                ' tabIndex="-1"' +
     248                                                                ' allowTransparency="true"' +
     249                                                                ' src="javascript:' + encodeURIComponent( src ) + '"' +
     250                                                                '></iframe>' );
     251
    256252                                                var accTitle = editor.lang.editorTitle.replace( '%1', editor.name );
    257253
    258254                                                if ( CKEDITOR.env.gecko )
     
    277273                                                else if ( CKEDITOR.env.ie )
    278274                                                {
    279275                                                        // Accessibility label for IE.
    280                                                         var fieldset = CKEDITOR.dom.element.createFromHtml(
     276                                                        fieldset = CKEDITOR.dom.element.createFromHtml(
    281277                                                                '<fieldset style="height:100%' +
    282278                                                                        ( CKEDITOR.env.quirks ? ';position:relative' : '' ) +
    283279                                                                '">' +
     
    444440                                                                if ( CKEDITOR.env.ie && ( CKEDITOR.env.quirks || CKEDITOR.env.version < 8 ) )
    445441                                                                        holderElement.setStyle( 'position', 'relative' );
    446442
    447                                                                 // Create the iframe at load for all browsers
    448                                                                 // except FF and IE with custom domain.
    449                                                                 if ( !isCustomDomain || !CKEDITOR.env.gecko )
    450                                                                         createIFrame();
    451 
    452443                                                                // The editor data "may be dirty" after this
    453444                                                                // point.
    454445                                                                editor.mayBeDirty = true;
     
    486477                                                                        '</html>' +
    487478                                                                        activationScript;
    488479
    489                                                                 // For custom domain in IE, set the global variable
    490                                                                 // that will temporarily hold the editor data. This
    491                                                                 // reference will be used in the ifram src.
    492                                                                 if ( isCustomDomain )
    493                                                                         window[ '_cke_htmlToLoad_' + editor.name ] = data;
    494 
     480                                                                window[ '_cke_htmlToLoad_' + editor.name ] = data;
    495481                                                                CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady;
     482                                                                createIFrame();
    496483
    497                                                                 // We need to recreate the iframe in FF for every
    498                                                                 // data load, otherwise the following spellcheck
    499                                                                 // and execCommand features will be active only for
    500                                                                 // the first time.
    501                                                                 // The same is valid for IE with custom domain,
    502                                                                 // because the iframe src must be reset every time.
    503                                                                 if ( isCustomDomain || CKEDITOR.env.gecko )
    504                                                                         createIFrame();
    505 
    506                                                                 // For custom domain in IE, the data loading is
    507                                                                 // done through the src attribute of the iframe.
    508                                                                 if ( !isCustomDomain )
     484                                                                // Opera must use the old method for loading contents.
     485                                                                if ( CKEDITOR.env.opera )
    509486                                                                {
    510487                                                                        var doc = iframe.$.contentWindow.document;
    511488                                                                        doc.open();
  • CHANGES.html

     
    6060                <li><a href="http://dev.fckeditor.net/ticket/3835">#3835</a> : Element path is not refreshed
    6161                        after click on 'newpage'; and safari is not putting focus on document also.
    6262                        </li>
     63                <li><a href="http://dev.fckeditor.net/ticket/3812">#3812</a> : Fixed an issue in which the editor
     64                        may show up empty or uneditable in IE7, 8 and Firefox 3.</li>
    6365        </ul>
    6466        <h3>
    6567                CKEditor 3.0 RC</h3>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy