module( 'plugins.enterkey' ); ///* // 闭合选区 // 1.p末尾或中间回车 // 2.列表中回车(关于列表的回车必须加上li这个插件) // 2.1 列表标号后面有文本 // 2.2列表标号后没有文本 // 3.h1后回车 // 4.带有BIU样式的文本后面回车 // // 不闭合选区 // 1.选中部分表格后回车 // 2.选中文本后回车 // // 复合操作 // 1.回车后撤销 // */ //fixed in future /*trace 3174*/ //test( 'trace 2864:table中回车,br做回车', function () { // te.dom[0].parentNode.removeChild(te.dom[0]); // var div2 = document.body.appendChild( document.createElement( 'div' ) ); // $( div2 ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' ); // te.dom.push(div2); // baidu.editor.plugins.table = function(){}; // var editor = new baidu.editor.Editor({'initialContent':'

欢迎使用ueditor

','autoFloatEnabled':false,'enterTag':'br'}); // te.obj.push(editor); // editor.render(div2); // var range = new baidu.editor.dom.Range( editor.document ); // te.obj.push(range); // editor.setContent('
aa
' ); // stop(); // setTimeout(function(){ // te.obj[4].selectNode(editor.body.firstChild.firstChild.firstChild.firstChild).select(); // ua.keydown(editor.body,{'keyCode':13}); // setTimeout(function(){ // equal(ua.getChildHTML(te.obj[3].body.firstChild),'
','
做回车'); // te.dom[1].parentNode.removeChild(te.dom[1]); // start(); // },50); // },50); //} ); //test( 'br做回车,选区非闭合', function () { // te.dom[0].parentNode.removeChild(te.dom[0]); // var div2 = document.body.appendChild( document.createElement( 'div' ) ); // $( div2 ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' ); // te.dom.push(div2); // baidu.editor.plugins.table = function(){}; // var editor = new baidu.editor.Editor({'initialContent':'

欢迎使用ueditor

','autoFloatEnabled':false,'enterTag':'br'}); // te.obj.push(editor); // editor.render(div2); // stop(); // editor.ready(function(){ // var range = new baidu.editor.dom.Range( editor.document ); // te.obj.push(range); // editor.setContent('

hello1

hello2

' ); // // setTimeout(function(){ // te.obj[4].setStart(editor.body.firstChild,0).setEnd(editor.body.lastChild,1).select(); // ua.keydown(editor.body,{'keyCode':13}); // setTimeout(function(){ // ua.manualDeleteFillData(te.obj[3].body); // var html = 'h
lo'; // equal(ua.getChildHTML(te.obj[3].body.firstChild),html,'
做回车'); // te.dom[1].parentNode.removeChild(te.dom[1]); // start(); // },50); // },50); // }); //} ); test( 'br做回车,选区非闭合', function () { te.dom[0].parentNode.removeChild(te.dom[0]); var div2 = document.body.appendChild( document.createElement( 'div' ) ); $( div2 ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' ); te.dom.push(div2); baidu.editor.plugins.table = function(){}; var editor = new baidu.editor.Editor({'initialContent':'

欢迎使用ueditor

','autoFloatEnabled':false,'enterTag':'br'}); te.obj.push(editor); editor.render(div2); stop(); editor.ready(function(){ var range = new baidu.editor.dom.Range( editor.document ); te.obj.push(range); editor.setContent('

hello

' ); te.obj[4].setStart(editor.body.firstChild.firstChild,1).setEnd(editor.body.firstChild.firstChild,3).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout(function(){ ua.manualDeleteFillData(te.obj[3].body); var html = 'h
lo'; equal(ua.getChildHTML(te.obj[3].body.firstChild),html,'
做回车'); editor.setContent('

hello

' ); te.obj[4].setStart( editor.body.lastChild,0 ).setEnd(editor.body.lastChild,1).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout(function(){ ua.manualDeleteFillData(te.obj[3].body); var html = 'hello
'; equal(ua.getChildHTML(te.obj[3].body.firstChild),html,'
做回车'); editor.setContent('

hello

heoll

' ); te.obj[4].setStart( editor.body.lastChild,1 ).setEnd(editor.body.lastChild,2).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout(function(){ ua.manualDeleteFillData(te.obj[3].body); var html = 'hello
'; equal(ua.getChildHTML(te.obj[3].body.firstChild),html,'
做回车'); editor.setContent('

hello


' ); te.obj[4].setStart( editor.body.lastChild,0 ).setEnd(editor.body.lastChild,1).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout(function(){ ua.manualDeleteFillData(te.obj[3].body); var html = 'hello
'; equal(ua.getChildHTML(te.obj[3].body.firstChild),html,'
做回车'); editor.setContent('

hello

www.baidu.com

' ); te.obj[4].setStart( editor.body.lastChild,0 ).setEnd(editor.body.lastChild,1).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout(function(){ ua.manualDeleteFillData(te.obj[3].body); var html = 'hello
'; equal(ua.getChildHTML(te.obj[3].body.firstChild),html,'
做回车'); te.dom[1].parentNode.removeChild(te.dom[1]); start(); },20); },20); },20); },20); },20); }); } ); test( 'br做回车,选区闭合', function () { te.dom[0].parentNode.removeChild(te.dom[0]); var div2 = document.body.appendChild( document.createElement( 'div' ) ); $( div2 ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' ); te.dom.push(div2); baidu.editor.plugins.table = function(){}; var editor = new baidu.editor.Editor({'initialContent':'

欢迎使用ueditor

','autoFloatEnabled':false,'enterTag':'br'}); te.obj.push(editor); editor.render(div2); stop(); editor.ready(function () { var range = new baidu.editor.dom.Range(editor.document); te.obj.push(range); editor.setContent('

hello

'); setTimeout(function () { te.obj[4].setStart(editor.body.firstChild.firstChild, 1).collapse(true).select(); ua.keydown(editor.body, {'keyCode':13}); setTimeout(function () { ua.manualDeleteFillData(te.obj[3].body); var html = 'h
ello'; equal(ua.getChildHTML(te.obj[3].body.firstChild), html, '
做回车,选区闭合'); te.dom[1].parentNode.removeChild(te.dom[1]); start(); }, 50); }, 50); }); } ); test( 'br做回车,选区闭合,在节点尾部输入回车,要插入2个br', function () { te.dom[0].parentNode.removeChild(te.dom[0]); var div2 = document.body.appendChild( document.createElement( 'div' ) ); $(div2).css('width', '500px').css('height', '500px').css('border', '1px solid #ccc'); te.dom.push(div2); baidu.editor.plugins.table = function () { }; var editor = new baidu.editor.Editor({'initialContent':'

欢迎使用ueditor

', 'autoFloatEnabled':false, 'enterTag':'br'}); te.obj.push(editor); editor.render(div2); stop(); editor.ready(function () { var range = new baidu.editor.dom.Range(editor.document); te.obj.push(range); editor.setContent('

hello

'); setTimeout(function () { te.obj[4].setStart(editor.body.firstChild.firstChild, 5).collapse(true).select(); ua.keydown(editor.body, {'keyCode':13}); setTimeout(function () { ua.manualDeleteFillData(te.obj[3].body); var html = 'hello

'; equal(ua.getChildHTML(te.obj[3].body.firstChild), html, '
做回车,选区闭合,在节点尾部输入回车'); te.dom[1].parentNode.removeChild(te.dom[1]); start(); }, 50); }, 50); }); }); test( 'table首行中回车', function () { var editor = te.obj[0]; if(!ua.browser.ie){ var range = new baidu.editor.dom.Range( editor.document ); editor.setContent('

' ); range.selectNode(editor.body.firstChild.firstChild.firstChild.firstChild).select(); ua.keydown(editor.body,{'keyCode':13}); stop(); setTimeout(function(){ equal(ua.getChildHTML(te.obj[0].body.firstChild),'
','加入p');//opera中,由原生方法实现p标签 start(); },20); } } ); test( '去除_moz_dirty', function () { if(browser.gecko){ var editor = te.obj[0]; var range = te.obj[1]; editor.setContent( '迎使用uedit' ); range.selectNode(editor.body.firstChild.lastChild.firstChild).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout( function () { equal(ua.getChildHTML(editor.body),'

迎使用uedit

',''); start(); }, 20 ); stop(); } } ); ///*不作处理chrome会产生div*/ test( 'chrome删除div', function () { var editor = te.obj[0]; var range = te.obj[1]; var body = editor.body; if(ua.browser.webkit){ editor.body.innerHTML = '

一级标题


'; range.setStart( body.firstChild.firstChild, 4 ).collapse( 1 ).select(); ua.keydown(editor.body,{'keyCode':13}); range.selectNode(body.lastChild.firstChild).select(); var index = editor.undoManger.index; var br = ua.browser.ie ? '' : '
'; ua.keyup(editor.body,{'keyCode':13}); equal(editor.undoManger.list.length,2,'保存现场'); setTimeout( function () { equal( body.childNodes.length, 2, '2个子节点' ); equal(body.lastChild.tagName.toLowerCase(),'p','div转成p'); equal(ua.getChildHTML(body),'

一级标题


','检查内容'); start(); }, 60 ); stop(); }else{ } } ); test( 'formatBlock', function () { if(ua.browser.ie)return; //这个处理不针对ie var editor = te.obj[0]; var range = te.obj[1]; editor.setContent( '
hello1
hello2
' ); setTimeout( function () { var tds = editor.body.getElementsByTagName('td'); range.setStart(tds[0],1).collapse(true).select(); ua.keydown(editor.body,{'keyCode':13}); setTimeout( function () { ua.keyup(editor.body,{'keyCode':13}); setTimeout( function () { var td = editor.body.getElementsByTagName('td')[0]; equal(td.firstChild&&td.firstChild.tagName.toLowerCase(),'p','加上p'); equal(td.firstChild.innerHTML,'hello1','hello1'); start(); }, 60 ); }, 60 ); }, 60 ); stop(); } ); test( '跨td不删', function () { var editor = te.obj[0]; var range = te.obj[1]; editor.setContent( '
hello1
hello2
' ); editor.addListener("keydown", function (type, evt) { setTimeout( function () { ok(evt.defaultPrevented||!evt.returnValue, "keydown"); start(); }, 60 ); }); setTimeout(function () { var tds = editor.body.getElementsByTagName('td'); range.setStart(tds[0], 0).setEnd(tds[2], 1).select(); ua.keydown(editor.body, {'keyCode': 13}); }, 60); stop(); } ); ////presskey相关,先不测 //test( '普通文本中间回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

你好编辑器

' ); // range.setStart( body.firstChild.firstChild, 2 ).collapse( 1 ).select(); // editor.focus(); // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // var ps = body.childNodes; // equal( ps.length, 2, '2个p' ); // equal( ps[0].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ps[1].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ua.getChildHTML( ps[0] ), '你好', '第一个p里是你好' ); // equal( ua.getChildHTML( ps[1] ), '编辑器', '第一个p里是编辑器' ); // start(); // }, 30 ); // }, 100 ); // stop(); //} ); // //test( '普通文本末尾回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

你好编辑器

' ); // range.setStart( body.firstChild, 1 ).collapse( 1 ).select(); // editor.focus(); // var br = (ua.browser.ie) ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // ua.keydown( body ); // editor.focus(); // setTimeout( function () { // var ps = body.childNodes; // equal( ps.length, 2, '2个p' ); // equal( ps[0].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ps[1].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ua.getChildHTML( ps[0] ), '你好编辑器', '第一个p里是你好编辑器' ); // equal( ua.getChildHTML( ps[1] ), br, '第一个p里是br' ); // start(); // }, 60 ); // }, 100 ); // stop(); //} ); // // //不好检查 //test( 'table中回车', function () { // var div2 = document.body.appendChild( document.createElement( 'div' ) ); // $( div2 ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' ); // baidu.editor.plugins.table = function(){}; // var editor = new baidu.editor.Editor({'initialContent':'

欢迎使用ueditor

','autoFloatEnabled':false}); // editor.render(div2); // stop(); // setTimeout(function(){ // var range = new baidu.editor.dom.Range( editor.document ); // var body = editor.body; // editor.setContent('




' ); // var tds = editor.body.getElementsByTagName( 'td' ); // tds[0].innerHTML = 'hello'; // tds[1].innerHTML = 'hello'; // tds[2].innerHTML = 'hello'; // range.setStart( tds[0].firstChild, 0 ).setEnd(tds[2].lastChild,1).select(); // var re = ua.keydown(editor.body,{'keyCode':13}); // setTimeout(function(){ // start(); // },20); // },20); //} ); ///*不作处理chrome会产生div*/ //test( 'trace766 :H1回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

一级标题

' ); // // range.setStart( body.firstChild, 1 ).collapse( 1 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // // var tagName = body.lastChild.tagName.toLowerCase(); // ok( tagName == 'p' || tagName == 'h1', '回车后不会产生div' ); // equal( body.childNodes.length, 2, '2个子节点' ); // start(); // }, 60 ); // }, 100 ); // stop(); //} ); // // //test( 'trace 1382:空列表标号后回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '
' ); // var li = body.getElementsByTagName( 'li' )[0]; // range.setStart( li, 0 ).collapse( 1 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // var ol = body.getElementsByTagName( 'ol' ); // equal( ol.length, 0, '列表被删除了' ); // start(); // }, 100 ); // }, 100 ); // stop(); //} ); // //test( '列表有内容处回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '
  1. 列表1
  2. 列表2
' ); // var lis = body.getElementsByTagName( 'li' ); // range.setStart( lis[1].firstChild, 1 ).collapse( 1 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // var ol = body.getElementsByTagName( 'ol' )[0]; // lis = ol.childNodes; // equal( lis.length, 3, '3个li' ); // for ( var index = 0; index < lis.length; index++ ) // equal( lis[index].tagName.toLowerCase(), 'li', 'tag名为li' ); // equal( ua.getChildHTML( lis[1] ), '

列表2

', '第二个列表自动加了p' ); // equal( ua.getChildHTML( lis[2] ), '

' + br + '

', '新增了一个列表项' ); // start(); // }, 70 ); // }, 100 ); // stop(); //} ); // // //test( 'trace766 :BIU文本中间回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

有样式的文本

' ); // // var str = body.getElementsByTagName( 'strong' )[0]; // range.setStart( str.firstChild, 2 ).collapse( 1 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { //// ua.checkHTMLSameStyle( '有样​', editor.document, body.firstChild, '查看第1个p的内容' ); // //1.2版本中,回车/空格只后有不可见的字符,ua.checkHTMLSameStyle检查的话,的内容不好检查,即会多出一个子节点,改成如下: // baidu.editor.dom.domUtils.removeDirtyAttr( body.lastChild ); // if ( ua.browser.chrome ) { // equal( body.firstChild.innerHTML.toLowerCase(), '有样​', '查看第1个p的内容' ); // ua.checkHTMLSameStyle( '式的文本', editor.document, body.lastChild, '查看第2个p的内容' ); // } // else if ( ua.browser.gecko ) { // equal( body.firstChild.innerHTML.toLowerCase(), '有样', '查看第1个p的内容' ); // equal( body.lastChild.innerHTML, '​式的文本', '查看第2个p的内容' ); // } // else { // equal( body.firstChild.innerHTML.toLowerCase(), '有样​', '查看第1个p的内容' ); // ua.checkHTMLSameStyle( '式的文本', editor.document, body.lastChild, '查看第2个p的内容' ); // } // start(); // }, 70 ); // }, 100 ); // stop(); //} ); // //test( 'trace841 :BIU文本后面回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

有样式的文本

' ); // var strong = body.getElementsByTagName( 'strong' )[0]; //// range.setStart( strong.firstChild, 6 ).collapse( 1 ).select(); // range.setStart( strong, 1 ).collapse( 1 ).select(); // editor.focus(); // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // ua.keydown( body, {keyCode:13} ); // baidu.editor.dom.domUtils.removeDirtyAttr( body.lastChild ); //// ua.checkHTMLSameStyle( '有样​', editor.document, body.firstChild, '查看第1个p的内容' ); // //1.2版本中,回车/空格只后有不可见的字符,ua.checkHTMLSameStyle检查的话,的内容不好检查,即会多出一个子节点,而且每种浏览器的具体结果不同,改成如下: // if ( ua.browser.chrome ) // equal( body.firstChild.innerHTML.toLowerCase(), '有样式的文本​', '查看第1个p的内容' ); // else if ( ua.browser.gecko ) // equal( body.firstChild.innerHTML.toLowerCase(), '有样式的文本', '查看第1个p的内容' ); // else // equal( body.firstChild.innerHTML.toLowerCase(), '有样式的文本​', '查看第1个p的内容' ); // /*ie中有一个已知bug,trace841,暂时不修的*/ // var br = ua.browser.gecko ? '' : '
'; // if ( !ua.browser.ie ) { // /*firefox不知道为什么用程序的方式回车始终不会产生br,可能太快了,浏览器没来得及处理*/ // if ( ua.browser.gecko ) // equal( body.lastChild.innerHTML, '', '查看第2个p的内容' ); // else // ua.checkHTMLSameStyle( '' + br + '', editor.document, body.lastChild, '查看第2个p的内容' ); // } // start(); // }, 500 ); // }, 100 ); // stop(); //} ); // // //test( '不闭合选择普通文本回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

普通文本回车

' ); // range.setStart( body.firstChild.firstChild, 2 ).setEnd( body.firstChild.firstChild, 4 ).select(); // editor.focus(); // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // var ps = body.childNodes; // equal( ps.length, 2, '2个p' ); // equal( ps[0].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ps[1].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ua.getChildHTML( ps[0] ), '普通', '第一个p里是你好编辑器' ); // equal( ua.getChildHTML( ps[1] ), '回车', '第2个p里是br' ); // start(); // }, 60 ); // }, 100 ); // stop(); //} ); // //test( '不闭合选择段落回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

不闭合选择两个段落1

不闭合选择两个段落2

' ); // range.setStart( body.firstChild.firstChild, 3 ).setEnd( body.lastChild.firstChild, 5 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // var ps = body.childNodes; // equal( ps.length, 2, '2个p' ); // equal( ps[0].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ps[1].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ua.getChildHTML( ps[0] ), '不闭合', '第一个p里是你好编辑器' ); // equal( ua.getChildHTML( ps[1] ), '两个段落2', '第一个p里是br' ); // start(); // }, 60 ); // }, 100 ); // stop(); //} ); // // //test( '撤销回车不闭合删除段落', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '

不闭合选择两个段落1

不闭合选择两个段落2

' ); // range.setStart( body.firstChild.firstChild, 3 ).setEnd( body.lastChild.firstChild, 5 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // setTimeout( function () { // te.presskey( "enter", "" ); // editor.focus(); // setTimeout( function () { // var ps = body.childNodes; // equal( ps.length, 2, '2个p' ); // equal( ps[0].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ps[1].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ua.getChildHTML( ps[0] ), '不闭合', '第一个p里是你好编辑器' ); // equal( ua.getChildHTML( ps[1] ), '两个段落2', '第一个p里是br' ); // editor.undoManger.undo(); // equal( ps.length, 2, '2个p' ); // equal( ps[0].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ps[1].tagName.toLowerCase(), 'p', 'tag名为p' ); // equal( ua.getChildHTML( ps[0] ), '不闭合选择两个段落1', '第一个p里是你好编辑器' ); // equal( ua.getChildHTML( ps[1] ), '不闭合选择两个段落2', '第一个p里是br' ); // start(); // }, 60 ); // }, 100 ); // stop(); //} ); // ///*1723 ie 在源码中写
,自动变成

,在ie中
会导致undo操作多记了一步*/ //test( '撤销回车删除空列表', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '
' ); // var li = body.getElementsByTagName( 'li' )[0]; // range.setStart( li.firstChild, 0 ).collapse( 1 ).select(); // editor.focus(); // // setTimeout( function () { // te.presskey( "enter", "" ); // /*好像用程序控制按回车的速度会比程序捕获的速度快, // 所以程序还没反应过来时keydown已经触发完了, // 而keydown中用于进行场景保存的,这样就会导致undo操作失效*/ // ua.keydown( body ); // editor.focus(); // setTimeout( function () { // var ol = body.getElementsByTagName( 'ol' ); // equal( ol.length, 0, '列表被删除了' ); // setTimeout( function () { // editor.undoManger.undo(); // equal( ua.getChildHTML( body ), '

', '撤销删除列表' ); // start(); // }, 50 ); // // }, 150 ); // }, 100 ); // stop(); //} ); // //test( '撤销列表中的回车', function () { // var editor = te.obj[0]; // var range = te.obj[1]; // var body = editor.body; // editor.setContent( '
  1. 列表
' ); // var li = body.getElementsByTagName( 'li' )[0]; // range.setStart( li.firstChild, 1 ).collapse( 1 ).select(); // editor.focus(); // var br = ua.browser.ie ? '' : '
'; // // setTimeout( function () { // te.presskey( "enter", "" ); // ua.keydown( body ); // editor.focus(); // setTimeout( function () { // var li = body.getElementsByTagName( 'li' ); // equal( li.length, 2, '2个列表子项' ); // equal( ua.getChildHTML( li[0] ), '

列表

' ); // equal( ua.getChildHTML( li[1] ), '

' + br + '

' ); // editor.undoManger.undo(); // equal( ua.getChildHTML( body ), '
  1. 列表

', '撤销后列表恢复原状' ); // start(); // }, 250 ); // }, 100 ); // stop(); //} );