Changeset 1951

Show
Ignore:
Timestamp:
2008-05-05 04:58:00 (23 months ago)
Author:
martinkou
Message:

Fixed #2113 : Fixed unneeded <span class="Apple-style-span"> created after inserting special characters.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckdocumentprocessor.js

    r1805 r1951  
    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.getElementsByClassName ? 
     257                        doc.getElementsByClassName( 'Apple-style-span' ) : 
     258                        Array.prototype.filter.call(  
     259                                        doc.getElementsByTagName( 'span' ),  
     260                                        function( item ){ return item.className == 'Apple-style-span' ; }  
     261                                        ) ; 
     262                for ( var i = spans.length - 1 ; i >= 0 ; i-- ) 
     263                        FCKDomTools.RemoveNode( spans[i], true ) ; 
     264        } 
     265} 
  • FCKeditor/trunk/editor/_source/internals/fck_gecko.js

    r1795 r1951  
    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 ) ; 
     370 
     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 ) {} 
    365379 
    366380        // For some strange reason the SaveUndoStep() call doesn't activate the undo button at the first InsertHtml() call. 
  • FCKeditor/trunk/_whatsnew.html

    r1950 r1951  
    6565                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1633">#1633</a>] External styles should no 
    6666                        longer interfere with the appearance of the editor and floating panels now.</li> 
     67                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2113">#2113</a>] Fixed unneeded &lt;span 
     68                        class=&quot;Apple-style-span&quot;&gt; created after inserting special characters.</li> 
    6769        </ul> 
    6870        <h3>