Ticket #2263: 2263.patch

File 2263.patch, 3.1 KB (added by martinkou, 21 months ago)
  • _whatsnew.html

     
    4242        <p> 
    4343                Fixed Bugs:</p> 
    4444        <ul> 
    45                 <li></li> 
     45                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2263">#2263</a>] Fixed a JavaScript 
     46                        error in IE which occurs when there are placeholder elements in the document and the user 
     47                        has pressed the Source button.</li> 
    4648        </ul> 
    4749        <p> 
    4850                <a href="_whatsnew_history.html">See previous versions history</a></p> 
  • editor/_source/internals/fck.js

     
    631631 
    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                { 
    637638                        FCKCommands.GetCommand( 'ShowBlocks' ).SaveState() ; 
     
    640641 
    641642                        sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ; 
    642643 
     644                        if ( FCKBrowserInfo.IsIE ) 
     645                                FCKTempBin.ToHtml() ; 
     646 
    643647                        if ( sHtml == null ) 
    644648                                return false ; 
    645649                } 
     
    937941        FCK.EditorWindow        = FCK.EditingArea.Window ; 
    938942        FCK.EditorDocument      = FCK.EditingArea.Document ; 
    939943 
     944        if ( FCKBrowserInfo.IsIE ) 
     945                FCKTempBin.ToElements() ; 
     946 
    940947        FCK.InitializeBehaviors() ; 
    941948 
    942949        // Listen for mousedown and mouseup events for tracking drag and drops. 
     
    10891096                while ( i < this.Elements.length ) 
    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} ; 
    10941120 
  • editor/dialog/fck_anchor.html

     
    121121        if ( aNewAnchors.length == 0 ) 
    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 
    127133        { 
     
    135141        { 
    136142                oAnchor = aNewAnchors[i] ; 
    137143 
    138                 // Set the name 
    139                 oAnchor.name = sNewName ; 
    140  
    141144                // IE does require special processing to show the Anchor's image 
    142145                // Opera doesn't allow to select empty anchors 
    143146                if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera )