Ticket #1997: 1997_2.patch

File 1997_2.patch, 5.3 KB (added by Frederico Caldeira Knabben, 16 years ago)
  • _whatsnew.html

     
    112112                        as expected.</li>
    113113                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1998">#1998</a>] The native
    114114                        XMLHttpRequest class is now used in IE, whenever it is available.</li>
     115                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1997">#1997</a>] With
     116                        IE, the first character of table captions where being lost on table creation.</li>
     117                <li>The selection and cursor position was not being properly handled when creating some
     118                        elements like forms and tables.</li>
    115119        </ul>
    116120        <h3>
    117121                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 editableElement ;
    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                                editableElement = targetElement ;
     158                        else if ( editableElement )
     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 ( editableElement )
     165                        this.MoveToElementStart( editableElement ) ;
    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        // Elements 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' ) )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy