Ticket #2113: 2113_2.patch

File 2113_2.patch, 2.4 KB (added by Martin Kou, 16 years ago)
  • _whatsnew.html

     
    4949                        fckstyles.xml in servers which cannot return the correct content type header for .xml files.</li>
    5050                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2102">#2102</a>] Fixed FCKConfig.DocType
    5151                        which stopped working in FCKeditor 2.6.</li>
     52                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2113">#2113</a>] Fixed unneeded &lt;span
     53                        class=&quot;Apple-style-span&quot;&gt; created after inserting special characters.</li>
    5254        </ul>
    5355        <h3>
    5456                Version 2.6</h3>
  • editor/_source/internals/fck_gecko.js

     
    361361        this.EditorDocument.execCommand( 'inserthtml', false, html ) ;
    362362        this.Focus() ;
    363363
     364        // Save the caret position before calling document processor.
     365        var range = new FCKDomRange( this.EditorWindow ) ;
     366        range.MoveToSelection() ;
     367        var bookmark = range.CreateBookmark() ;
     368
    364369        FCKDocumentProcessor.Process( FCK.EditorDocument ) ;
    365370
     371        // Restore caret position, ignore any errors in case the document
     372        // processor removed the bookmark <span>s for some reason.
     373        try
     374        {
     375                range.MoveToBookmark( bookmark ) ;
     376                range.Select() ;
     377        }
     378        catch ( e ) {}
     379
    366380        // For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call.
    367381        this.Events.FireEvent( "OnSelectionChange" ) ;
    368382}
  • editor/_source/internals/fckdocumentprocessor.js

     
    247247                fakeImg.className = 'FCK__Flash' ;
    248248                fakeImg.setAttribute( '_fckflash', 'true', 0 );
    249249        } ) ;
     250
     251// Buggy <span class="Apple-style-span"> tags added by Safari.
     252if ( FCKBrowserInfo.IsSafari )
     253{
     254        FCKDocumentProcessor.AppendNew().ProcessDocument = function( doc )
     255        {
     256                var spans = doc.getElementsByTagName( 'span' ) ;
     257                for ( var i = 0 ; i < spans.length ; i++ )
     258                        ( spans[i].className == 'Apple-style-span' ) && ( FCKDomTools.RemoveNode( spans[i], true ) ) ;
     259        }
     260}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy