Changeset 804

Show
Ignore:
Timestamp:
2007-09-12 11:12:57 (15 months ago)
Author:
martinkou
Message:

Fixed #427 and #277 : Fixed the issue where unneeded <div> tags are added inside list items when the text justification is applied.
Merged test cases from Fred's patch.

Location:
FCKeditor/trunk
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/fckeditor.html

    r793 r804  
    117117LoadScript( '_source/commandclasses/fckfitwindow.js' ) ; 
    118118LoadScript( '_source/commandclasses/fcklistcommands.js' ) ; 
     119LoadScript( '_source/commandclasses/fckjustifycommands.js' ) ; 
    119120LoadScript( '_source/commandclasses/fckcorestylecommand.js' ) ; 
    120121LoadScript( '_source/commandclasses/fckremoveformatcommand.js' ) ; 
  • FCKeditor/trunk/editor/_source/internals/fckcommands.js

    r774 r804  
    8989                case 'PasteWord'        : oCommand = new FCKPasteWordCommand() ; break ; 
    9090 
     91                case 'JustifyLeft'      : oCommand = new FCKJustifyCommand( 'left' ) ; break ; 
     92                case 'JustifyCenter'    : oCommand = new FCKJustifyCommand( 'center' ) ; break ; 
     93                case 'JustifyRight'     : oCommand = new FCKJustifyCommand( 'right' ) ; break ; 
     94                case 'JustifyFull'      : oCommand = new FCKJustifyCommand( 'justify' ) ; break ; 
     95 
    9196                case 'TableInsertRowAfter'              : oCommand = new FCKTableCommand('TableInsertRowAfter') ; break ; 
    9297                case 'TableInsertRowBefore'             : oCommand = new FCKTableCommand('TableInsertRowBefore') ; break ; 
  • FCKeditor/trunk/fckpackager.xml

    r774 r804  
    127127                <File path="editor/_source/commandclasses/fckfitwindow.js" /> 
    128128                <File path="editor/_source/commandclasses/fcklistcommands.js" /> 
     129                <File path="editor/_source/commandclasses/fckjustifycommands.js" /> 
    129130                <File path="editor/_source/commandclasses/fckcorestylecommand.js" /> 
    130131                <File path="editor/_source/commandclasses/fckremoveformatcommand.js" /> 
     
    218219                <File path="editor/_source/commandclasses/fckfitwindow.js" /> 
    219220                <File path="editor/_source/commandclasses/fcklistcommands.js" /> 
     221                <File path="editor/_source/commandclasses/fckjustifycommands.js" /> 
    220222                <File path="editor/_source/commandclasses/fckcorestylecommand.js" /> 
    221223                <File path="editor/_source/commandclasses/fckremoveformatcommand.js" /> 
  • FCKeditor/trunk/_test/automated/tests/fckdomrange.html

    r132 r804  
    2828        <script type="text/javascript"> 
    2929 
     30var FCKConfig = { EnterMode : 'p' } ; 
     31 
    3032FCKScriptLoader.Load( 'FCKDomRange' ) ; 
    3133 
     
    529531        if ( docFrag.AppendTo ) docFrag.AppendTo( tmpDiv ) ; else tmpDiv.appendChild( docFrag ) ; 
    530532 
    531         assertEquals( 'Range HTML', 'this text has no block tag. it should be corrected when working with the enter key set to p or div tags. the <strong id=_strongnopara>br configuration</strong> should not make changes instead.', GetTestInnerHtml( tmpDiv ) ) ; 
     533        assertEquals( 'Range HTML', 'this text has no block tag.<br>it should be corrected when working with the enter key set to p or div tags. the <strong id=_strongnopara>br configuration</strong> should not make changes instead.<br>it has three lines separated by br tags.', GetTestInnerHtml( tmpDiv ) ) ; 
    532534} 
    533535 
     
    613615                        alt="" /> 
    614616        </p> 
    615         This text has no block tag. It should be corrected when working with the enter key 
     617        This text has no block tag.<br />It should be corrected when working with the enter key 
    616618        set to "p" or "div" tags. The <strong id="_StrongNoPara">"br" configuration</strong> 
    617         should not make changes instead. 
     619        should not make changes instead.<br />It has three lines separated by BR tags. 
    618620        <p> 
    619621                In the test we will try to recreate this document using the editor tools. To make 
  • FCKeditor/trunk/_test/manual/fckdomrange/test1.html

    r774 r804  
    3737FCKConfig.Debug = false ; 
    3838FCKConfig.BasePath = '../../../editor/' ; 
     39FCKConfig.EnterMode = 'br' ; 
     40 
     41FCKListsLib.Setup() ; 
    3942 
    4043var oRange ; 
     
    5659        document.getElementById('xEndNode').innerHTML                   = ( oRange.EndNode ? oRange.EndNode.nodeType == 1 ? oRange.EndNode.tagName : '[text]' : 'null' ) ; 
    5760         
    58         document.getElementById('xStartNode').title     = oRange.StartNode.nodeType == 1 ? '' : oRange.StartNode.nodeValue ; 
    59         document.getElementById('xEndNode').title       = oRange.EndNode.nodeType == 1 ? '' : oRange.EndNode.nodeValue ; 
     61        document.getElementById('xStartNode').title     = ( !oRange.StartNode || oRange.StartNode.nodeType == 1 ) ? '' : oRange.StartNode.nodeValue ; 
     62        document.getElementById('xEndNode').title       = ( !oRange.EndNode || oRange.EndNode.nodeType == 1 ) ? '' : oRange.EndNode.nodeValue ; 
    6063} 
    6164 
     
    169172        UpdateDetails() ; 
    170173        oRange.Window.focus() ; 
     174} 
     175 
     176function GetParagraphs() 
     177{ 
     178        var paragraphs = oRange.GetParagraphs() ; 
     179         
     180        var msg = '' ; 
     181 
     182        var div = oRange.Window.document.createElement( 'div' ) ; 
     183 
     184        // To avoid breaking ranges, we should process it in reverse order. 
     185        for ( var i = paragraphs.length - 1 ; i >= 0 ; i-- ) 
     186        { 
     187                div.innerHTML = '' ; 
     188                paragraphs[i].ExtractContents().AppendTo( div ) ; 
     189                msg = div.innerHTML + '\n---\n' + msg ; 
     190        } 
     191         
     192        msg = 'Number of ranges: ' + paragraphs.length + '\n---\n' + msg ; 
     193         
     194        alert( msg ) ; 
    171195} 
    172196 
     
    223247                <input type="button" value="Check Is Collapsed" onclick="CheckIsCollapsed(); return false;" /> 
    224248                <input type="button" value="Check Is Empty" onclick="CheckIsEmpty(); return false;" /> 
     249                <input type="button" value="Get Paragraphs" onclick="GetParagraphs(); return false;" /> 
    225250        </p> 
    226251        <table> 
  • FCKeditor/trunk/_test/manual/fckdomrange/test1_inner.html

    r132 r804  
    8686                        alt="" /> 
    8787        </p> 
    88         This text has no block tag. It should be corrected when working with the enter key 
     88        This text has no block tag.<br /> 
     89        It should be corrected when working with the enter key 
    8990        set to "p" or "div" tags. The <strong>"br" configuration</strong> should not make 
    90         changes instead. 
     91        changes instead.<br /> 
     92        It has three lines separated by BR. 
    9193        <p> 
    9294                In the test we will try to recreate this document using the editor tools. To make