Ticket #1997: 1997.patch

File 1997.patch, 5.3 kB (added by fredck, 4 months ago)
  • _whatsnew.html

     
    102102                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2002">#2002</a>] Fixed 
    103103                        the issue where the maximize editor button does not vertically expand the editing 
    104104                        area in Firefox.</li> 
     105                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With 
     106                        IE, the first 
     107                        character of table captions where being lost on table creation.</li> 
     108                <li>The selection and cursor position was not being properly handle when creating some 
     109                        elements like forms and tables.</li> 
    105110        </ul> 
    106111        <h3> 
    107112                Version 2.6 Beta 1</h3> 
  • editor/_source/classes/fckdomrange.js

     
    149149        // is "<p><b><i>^</i></b> Text</p>" (inside <i>). 
    150150        MoveToElementEditStart : function( targetElement ) 
    151151        { 
    152                 var child ; 
     152                var editable ; 
    153153 
    154                 while ( ( child = targetElement.firstChild ) && child.nodeType == 1 && FCKListsLib.InlineNonEmptyElements[ child.nodeName.toLowerCase() ] ) 
    155                         targetElement = child ; 
     154                while ( targetElement && targetElement.nodeType == 1 ) 
     155                { 
     156                        if ( FCKDomTools.CheckIsEditable( targetElement ) ) 
     157                                editable = targetElement ; 
     158                        else if ( editable ) 
     159                                break ;         // If we already found an editable element, stop the loop. 
    156160 
    157                 this.MoveToElementStart( targetElement ) ; 
     161                        targetElement = targetElement.firstChild ; 
     162                } 
     163 
     164                if ( editable ) 
     165                        this.MoveToElementStart( editable ) ; 
    158166        }, 
    159167 
    160168        InsertNode : function( node ) 
  • editor/_source/internals/fck.js

     
    669669                        range.SplitBlock() ; 
    670670                        range.InsertNode( element ) ; 
    671671 
    672                         var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ] ) ; 
     672                        var next = FCKDomTools.GetNextSourceElement( element, false, null, [ 'hr','br','param','img','area','input' ], true ) ; 
    673673 
    674674                        // Be sure that we have something after the new element, so we can move the cursor there. 
    675675                        if ( !next && FCKConfig.EnterMode != 'br') 
  • editor/_source/internals/fckdomtools.js

     
    10051005                var currentScroll = FCKTools.GetScrollPosition( window ).Y ; 
    10061006                if ( offset > 0 && offset > currentScroll ) 
    10071007                        window.scrollTo( 0, offset ) ; 
     1008        }, 
     1009 
     1010        /** 
     1011         * Check if the element can be edited inside the browser. 
     1012         */ 
     1013        CheckIsEditable : function( element ) 
     1014        { 
     1015                // Get the element name. 
     1016                var nodeName = element.nodeName.toLowerCase() ; 
     1017 
     1018                // Get the element DTD (defaults to span for unknown elements). 
     1019                var childDTD = FCK.DTD[ nodeName ] || FCK.DTD.span ; 
     1020 
     1021                // In the DTD # == text node. 
     1022                return ( childDTD['#'] && !FCKListsLib.NonEditableElements[ nodeName ] ) ; 
    10081023        } 
    10091024} ; 
  • editor/_source/internals/fcklistslib.js

     
    5454        // Object elements for the Styles System. 
    5555        StyleObjectElements : { img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 }, 
    5656 
     57        // Elementst that accept text nodes, but are not possible to edit in the browser. 
     58        NonEditableElements : { button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 }, 
     59 
    5760        // Elements used to separate block contents. 
    5861        BlockBoundaries : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 }, 
    5962        ListBoundaries  : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 } 
  • editor/dtd/fck_dtd_test.html

     
    1717        <table border="1"> 
    1818                <script type="text/javascript"> 
    1919 
    20     alert(FCK.DTD); 
    21  
    2220for ( var p in FCK.DTD ) 
    2321{ 
    2422        document.write( '<tr><td><b>' + p + '</b></td><td>' ) ; 
  • editor/fckdialog.html

     
    681681 
    682682        window.Cancel = function( dontFireChange ) 
    683683        { 
     684                Selection.EnsureSelection() ; 
    684685                return CloseDialog( dontFireChange ) ; 
    685686        } ; 
    686687 
     
    688689        { 
    689690                Throbber.Hide() ; 
    690691 
    691                 Selection.EnsureSelection() ; 
    692  
    693692                // Points the src to a non-existent location to avoid loading errors later, in case the dialog 
    694693                // haven't been completed loaded at this point. 
    695694                if ( $( 'frmMain' ) )