Changeset 201

Show
Ignore:
Timestamp:
2007-03-09 20:07:16 (3 years ago)
Author:
fredck
Message:

Fixed #99 : The <div> element is now considered a block container if EnterMode=p|br. It acts like a simple block only if EnterMode=div.

Location:
FCKeditor/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/classes/fckelementpath.js

    r132 r201  
    4242                        var sElementName = e.nodeName.toLowerCase() ; 
    4343 
    44                         if ( !eBlockLimit && !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null ) 
    45                                 eBlock = e ; 
     44                        if ( !eBlockLimit ) 
     45                        { 
     46                                if ( !eBlock && FCKListsLib.PathBlockElements[ sElementName ] != null ) 
     47                                        eBlock = e ; 
    4648 
    47                         // TODO: Review the Regex and move it to the RegexLib. 
    48                         if ( !eBlockLimit && (/^(?:body|td|th|caption|form)$/).test( sElementName ) ) 
    49                                 eBlockLimit = e ; 
     49                                if ( FCKListsLib.PathBlockLimitElements[ sElementName ] != null ) 
     50                                        eBlockLimit = e ; 
     51                        } 
    5052 
    5153                        aElements.push( e ) ; 
    5254 
    53                         if ( sElementName == 'BODY' ) 
     55                        if ( sElementName == 'body' ) 
    5456                                break ; 
    5557                } 
     
    6264} 
    6365 
     66 
  • FCKeditor/trunk/editor/_source/internals/fck.js

    r194 r201  
    8989                this.EditingArea = new FCKEditingArea( document.getElementById( 'xEditingArea' ) ) ; 
    9090                this.EditingArea.FFSpellChecker = false ; 
     91                 
     92                // Final setup of the lists lib. 
     93                FCKListsLib.Setup() ; 
    9194 
    9295                // Set the editor's startup contents 
  • FCKeditor/trunk/editor/_source/internals/fcklistslib.js

    r188 r201  
    3434        NonEmptyBlockElements : { p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 }, 
    3535 
    36         // Elements that may be considered the "Block boundary" in an element path. 
    37         PathBlockElements : { address:1,blockquote:1,div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 }, 
    38  
    3936        // Inline elements which MUST have child nodes. 
    4037        InlineChildReqElements : { abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 }, 
    4138 
    4239        // Elements marked as empty "Empty" in the XHTML DTD. 
    43         EmptyElements : { base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 } 
     40        EmptyElements : { base:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 }, 
     41         
     42        // Elements that may be considered the "Block boundary" in an element path. 
     43        PathBlockElements : { address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1 }, 
     44         
     45        // Elements that may be considered the "Block limit" in an element path. 
     46        PathBlockLimitElements : { body:1,td:1,th:1,caption:1,form:1 }, 
     47 
     48        // Final setup of FCKListsLib once the editor is loaded (at FCK.StartEditor).  
     49        // TODO: For v3, there should be a generic way to register to the editor 
     50        // startup event, so this function would not be needed to be defined here, not 
     51        // even be called at FCK.StartEditor. 
     52        Setup : function() 
     53        { 
     54                // <div> is considered a block element only if EnterMode=div, otherwise it is a block limit. 
     55                if ( FCKConfig.EnterMode == 'div' ) 
     56                        this.PathBlockElements.div = 1 ; 
     57                else 
     58                        this.PathBlockLimitElements.div = 1 ; 
     59        } 
    4460} ; 
  • FCKeditor/trunk/_whatsnew.html

    r197 r201  
    101101                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/211">#211</a>] Some invalid 
    102102                        inputs, like "&lt;p&gt;" where making the caret disappear in Firefox.</li> 
     103                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/99">#99</a>] The &lt;div&gt; 
     104                        element is now considered a block container if EnterMode=p|br. It acts like a simple 
     105                        block only if EnterMode=div.</li> 
    103106        </ul> 
    104107        <h3>