Changeset 2139

Show
Ignore:
Timestamp:
2008-06-25 12:22:15 (7 months ago)
Author:
martinkou
Message:

Fixed #2263 : Fixed a JavaScript error in IE which occurs when there are placeholder elements in the document and the user has pressed the Source button.

Location:
FCKeditor/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/dialog/fck_anchor.html

    r1565 r2139  
    122122        { 
    123123                // Nothing was selected, so now just create a normal A 
    124                 aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ; 
     124                if ( FCKBrowserInfo.IsIE ) 
     125                        aNewAnchors.push( oEditor.FCK.InsertElement( '<a name="' + FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ) ; 
     126                else 
     127                { 
     128                        var n ; 
     129                        aNewAnchors.push( ( n = oEditor.FCK.InsertElement( 'a' ), n.name = sNewName, n ) ) ; 
     130                } 
    125131        } 
    126132        else 
     
    135141        { 
    136142                oAnchor = aNewAnchors[i] ; 
    137  
    138                 // Set the name 
    139                 oAnchor.name = sNewName ; 
    140143 
    141144                // IE does require special processing to show the Anchor's image 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r2106 r2139  
    632632                var sHtml ; 
    633633 
    634                 // Update the HTML in the view output to show. 
     634                // Update the HTML in the view output to show, also update 
     635                // FCKTempBin for IE to avoid #2263. 
    635636                if ( bIsWysiwyg ) 
    636637                { 
     
    640641 
    641642                        sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ; 
     643 
     644                        if ( FCKBrowserInfo.IsIE ) 
     645                                FCKTempBin.ToHtml() ; 
    642646 
    643647                        if ( sHtml == null ) 
     
    938942        FCK.EditorDocument      = FCK.EditingArea.Document ; 
    939943 
     944        if ( FCKBrowserInfo.IsIE ) 
     945                FCKTempBin.ToElements() ; 
     946 
    940947        FCK.InitializeBehaviors() ; 
    941948 
     
    10901097                        this.Elements[ i++ ] = null ; 
    10911098                this.Elements.length = 0 ; 
     1099        }, 
     1100 
     1101        ToHtml : function() 
     1102        { 
     1103                for ( var i = 0 ; i < this.Elements.length ; i++ ) 
     1104                        this.Elements[i] = this.Elements[i].outerHTML ; 
     1105        }, 
     1106 
     1107        ToElements : function() 
     1108        { 
     1109                var node = FCK.EditorDocument.createElement( 'div' ) ; 
     1110                for ( var i = 0 ; i < this.Elements.length ; i++ ) 
     1111                { 
     1112                        if ( typeof( this.Elements[i] ) == 'string' ) 
     1113                        { 
     1114                                node.innerHTML = this.Elements[i] ; 
     1115                                this.Elements[i] = node.firstChild ; 
     1116                        } 
     1117                } 
    10921118        } 
    10931119} ; 
  • FCKeditor/trunk/_whatsnew.html

    r2138 r2139  
    5050                        editor/css/fck_editorarea.css on how to handle style items that would break the style combo. 
    5151                        </li> 
     52                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2263">#2263</a>] Fixed a JavaScript 
     53                        error in IE which occurs when there are placeholder elements in the document and the user 
     54                        has pressed the Source button.</li> 
    5255        </ul> 
    5356        <p>