Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
b9848318
U
ueditor
项目概览
qq_14980201
/
ueditor
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
ueditor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b9848318
编写于
2月 28, 2013
作者:
Y
yancen
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev-1.2.5' of
https://github.com/campaign/ueditor
into dev-1.2.5
上级
4ec4917b
47565e9e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
107 addition
and
106 deletion
+107
-106
_examples/completeDemo.html
_examples/completeDemo.html
+1
-1
_test/plugins/table.cmds.js
_test/plugins/table.cmds.js
+106
-105
未找到文件。
_examples/completeDemo.html
浏览文件 @
b9848318
...
...
@@ -64,7 +64,7 @@
}
function
createEditor
(){
enableBtn
();
UE
.
getEditor
(
'
editor
'
)
UE
.
getEditor
(
'
editor
'
)
;
}
function
getAllHtml
()
{
alert
(
UE
.
getEditor
(
'
editor
'
).
getAllHtml
()
)
...
...
_test/plugins/table.cmds.js
浏览文件 @
b9848318
...
...
@@ -233,7 +233,7 @@ test('删除行',function(){
// range.setStart(editor.body.firstChild,0).collapse(true).select();
// editor.execCommand('inserttable');
//
// setTimeout(function(){
//
//
setTimeout(function(){
// var trs = editor.body.firstChild.getElementsByTagName( 'tr' );
// var ut = editor.getUETable(editor.body.firstChild);
// var cellsRange = ut.getCellsRange(trs[0].cells[0],trs[2].cells[4]);
...
...
@@ -242,19 +242,19 @@ test('删除行',function(){
//
// var td=trs[3].getElementsByTagName('td');
// ua.mousedown(td[0]);//清空选择的单元格
// equal(
editor.currentSelectedArr
.length,'0','mouse down--length');
// ua.mouseover(td[0]);//选择单元格
// ua.mouseover(td[1]);
// ua.mouseup(td[2]);
// equal(editor.currentSelectedArr.length,'2','mouse over--length');
// equal(
ut.selectedTds
.length,'0','mouse down--length');
//
//
ua.mouseover(td[0]);//选择单元格
//
//
ua.mouseover(td[1]);
//
//
ua.mouseup(td[2]);
//
//
equal(editor.currentSelectedArr.length,'2','mouse over--length');
// // editor.currentSelectedArr=[];
// // range.setStart(td[2],0).setEnd(td[4],0).select();
// // ua.mouseup(td[3]);
// // range = editor.selection.getRange();
// // ua.checkResult(range,td[2],td[2],0,0,true,'mouse up --range');
// start();
// },50);
// stop();
//
//
start();
//
//
},50);
//
//
stop();
//});
...
...
@@ -375,43 +375,42 @@ test( '选中合并过的单元格和普通单元格,查看完全拆分单元
}
);
/*trace 718*/
//test( '2次撤销删除列', function() {
// var editor = te.obj[0];
// var range = te.obj[1];
// editor.setContent( '<p></p>' );
// range.setStart( editor.body.firstChild, 0 ).collapse( true ).select();
// editor.execCommand( 'inserttable', {numCols:4,numRows:4} );
// ua.manualDeleteFillData( editor.body );
//
// setTimeout(function(){
// var trs = editor.body.firstChild.getElementsByTagName( 'tr' );
// var ut = editor.getUETable(editor.body.firstChild);
// var cellsRange = ut.getCellsRange(trs[1].cells[1],trs[2].cells[2]);
// ut.setSelected(cellsRange);
// range.setStart( trs[1].cells[1], 0 ).collapse( true ).select();
//
// editor.execCommand( 'mergecells' );
// equal( $( trs[1].cells[1] ).attr( 'rowspan' ), 2, 'rowspan 为2' );
// equal( $( trs[1].cells[1] ).attr( 'colspan' ), 2, 'colspan 为2' );
//debugger;
// editor.execCommand( 'deletecol' );
// equal( trs[1].childNodes.length, 3, '3个td' );
// editor.undoManger.undo();
// trs = editor.body.firstChild.getElementsByTagName( 'tr' );
// equal( trs[1].childNodes.length, 4, '4个td' );
// equal( $( trs[1].cells[1] ).attr( 'rowspan' ), 2, 'rowspan 为2' );
// equal( $( trs[1].cells[1] ).attr( 'colspan' ), 2, 'colspan 为2' );
//
// range.setStart( trs[1].cells[1], 0 ).collapse(1).select();
// editor.execCommand( 'deletecol' );
// equal( trs[1].childNodes.length, 3, '3个td' );
// equal( $( trs[1].cells[1] ).attr( 'rowspan' ), 1, 'rowspan 为1' );
// ok( $( trs[1].cells[1] ).attr( 'colspan' ) == undefined || $( trs[1].cells[1] ).attr( 'colspan' ) == 1, 'colspan为1或者undefined' );
// start();
// },50);
// stop();
//} );
test
(
'
2次撤销删除列
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
editor
.
setContent
(
'
<p></p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
inserttable
'
,
{
numCols
:
4
,
numRows
:
4
}
);
ua
.
manualDeleteFillData
(
editor
.
body
);
setTimeout
(
function
(){
var
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
var
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
var
cellsRange
=
ut
.
getCellsRange
(
trs
[
1
].
cells
[
1
],
trs
[
2
].
cells
[
2
]);
ut
.
setSelected
(
cellsRange
);
range
.
setStart
(
trs
[
1
].
cells
[
1
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
mergecells
'
);
equal
(
trs
[
1
].
cells
[
1
].
rowSpan
,
2
,
'
rowspan 为2
'
);
equal
(
trs
[
1
].
cells
[
1
].
colSpan
,
2
,
'
colspan 为2
'
);
editor
.
execCommand
(
'
deletecol
'
);
equal
(
trs
[
1
].
cells
.
length
,
3
,
'
3个td
'
);
editor
.
undoManger
.
undo
();
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
equal
(
trs
[
1
].
cells
.
length
,
3
,
'
3个td
'
);
equal
(
trs
[
1
].
cells
[
1
].
rowSpan
,
2
,
'
rowspan 为2
'
);
equal
(
trs
[
1
].
cells
[
1
].
colSpan
,
2
,
'
colspan 为2
'
);
range
.
setStart
(
trs
[
1
].
cells
[
1
],
0
).
collapse
(
1
).
select
();
editor
.
execCommand
(
'
deletecol
'
);
equal
(
trs
[
1
].
cells
.
length
,
3
,
'
3个td
'
);
equal
(
trs
[
1
].
cells
[
1
].
rowSpan
,
2
,
'
rowspan 为2
'
);
ok
(
trs
[
1
].
cells
[
1
].
colSpan
==
undefined
||
trs
[
1
].
cells
[
1
].
colSpan
==
1
,
'
colspan为1或者undefined
'
);
start
();
},
50
);
stop
();
}
);
/*trace 713*/
test
(
'
合并最后一列单元格后再前插入列
'
,
function
()
{
...
...
@@ -454,25 +453,31 @@ test( 'trace 1098:多次合并单元格偶切换到源码再切回来', function
ut
.
setSelected
(
cellsRange
);
range
.
setStart
(
trs
[
0
].
cells
[
0
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
mergecells
'
);
setTimeout
(
function
(){
var
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
var
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
var
cellsRange
=
ut
.
getCellsRange
(
trs
[
0
].
cells
[
1
],
trs
[
2
].
cells
[
1
]);
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
cellsRange
=
ut
.
getCellsRange
(
trs
[
0
].
cells
[
1
],
trs
[
2
].
cells
[
0
]);
ut
.
setSelected
(
cellsRange
);
range
.
setStart
(
trs
[
0
].
cells
[
1
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
mergecells
'
);
editor
.
execCommand
(
'
source
'
);
editor
.
execCommand
(
'
source
'
);
stop
();
setTimeout
(
function
()
{
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
cellsRange
=
ut
.
getCellsRange
(
trs
[
0
].
cells
[
2
],
trs
[
1
].
cells
[
0
]);
ut
.
setSelected
(
cellsRange
);
range
.
setStart
(
trs
[
0
].
cells
[
2
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
mergecells
'
);
editor
.
execCommand
(
'
source
'
);
editor
.
execCommand
(
'
source
'
);
equal
(
trs
.
length
,
3
,
'
3个tr
'
);
equal
(
trs
[
0
].
cells
[
0
].
rowSpan
,
3
,
'
第一个单元格rowspan 3
'
);
equal
(
trs
[
0
].
cells
[
1
].
rowSpan
,
3
,
'
第二个单元格rowspan 3
'
);
//我暂时搞不懂~~~~~~~~~~~~~
// for ( var index = 0; index < trs.length; index++ ) {
// equal( trs[index].childNodes.length, 3, '3个td' );
// }
equal
(
trs
[
0
].
cells
.
length
,
3
,
'
3个td
'
);
equal
(
trs
[
1
].
cells
.
length
,
0
,
'
0个td
'
);
equal
(
trs
[
2
].
cells
.
length
,
1
,
'
1个td
'
);
start
();
},
50
);
},
50
);
...
...
@@ -481,56 +486,52 @@ test( 'trace 1098:多次合并单元格偶切换到源码再切回来', function
}
);
/*trace 1307*/
//
//test( 'trace 1307:adjustTable--多次合并单元格切换到源码再切回来--选中单元格浏览器会假死', function() {
// var editor = te.obj[0];
// var range = te.obj[1];
// editor.setContent( '<p></p>' );
// range.setStart( editor.body.firstChild, 0 ).collapse( true ).select();
// editor.execCommand( 'inserttable', {numCols:4,numRows:4} );
//
// setTimeout(function(){
// var trs = editor.body.firstChild.getElementsByTagName( 'tr' );
// var ut = editor.getUETable(editor.body.firstChild);
// var cellsRange = ut.getCellsRange(trs[1].cells[0],trs[3].cells[1]);
// ut.setSelected(cellsRange);
// range.setStart( trs[1].cells[0], 0 ).collapse( true ).select();
//
// editor.execCommand( 'mergecells' );
// setTimeout(function(){
// var trs = editor.body.firstChild.getElementsByTagName( 'tr' );
// var ut = editor.getUETable(editor.body.firstChild);
// var cellsRange = ut.getCellsRange(trs[0].cells[2],trs[2].cells[1]);
// ut.setSelected(cellsRange);
// range.setStart( trs[0].cells[2], 0 ).collapse( true ).select();
// editor.execCommand( 'mergecells' );
// editor.execCommand( 'source' );
// editor.execCommand( 'source' );
// trs = editor.body.getElementsByTagName( 'tr' );
// equal( trs[1].cells[1].rowIndex, 1, '(1,1)行索引' );
// equal( $( trs[1].cells[1] ).attr( 'rootCellIndex' ), 0, '(1,1)列索引' );
//
// equal( $( trs[1].cells[2] ).attr( 'rootRowIndex' ), 0, '(1,2)行索引' );
// equal( $( trs[1].cells[2] ).attr( 'rootCellIndex' ), 2, '(1,2)列索引' );
//
// equal( $( trs[2].cells[2] ).attr( 'rootRowIndex' ), 0, '(2,2)行索引' );
// equal( $( trs[2].cells[2] ).attr( 'rootCellIndex' ), 2, '(2,2)列索引' );
//
// equal( $( trs[2].cells[0] ).attr( 'rootRowIndex' ), 1, '(2,0)行索引' );
// equal( $( trs[2].cells[0] ).attr( 'rootCellIndex' ), 0, '(2,0)列索引' );
//
// equal( trs[1].cells[0].rowSpan, 3, '第二行第一个单元格rowspan 3' );
// equal( trs[1].cells[0].colSpan, 2, '第二行第一个单元格colspan 2' );
// equal( trs[0].cells[2].rowSpan, 3, '第一行第三个单元格rowspan 3' );
// equal( trs.length, 4, '4个tr' );
// for ( var index = 0; index < trs.length; index++ ) {
// equal( trs[index].cells.length, 4, '4个td' );
// }
// start();
// },50);
// },50);
// stop();
//} );
test
(
'
trace 1307:adjustTable--多次合并单元格切换到源码再切回来--选中单元格浏览器会假死
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
editor
.
setContent
(
'
<p></p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
inserttable
'
,
{
numCols
:
4
,
numRows
:
4
}
);
setTimeout
(
function
(){
var
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
var
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
var
cellsRange
=
ut
.
getCellsRange
(
trs
[
1
].
cells
[
0
],
trs
[
3
].
cells
[
1
]);
ut
.
setSelected
(
cellsRange
);
range
.
setStart
(
trs
[
1
].
cells
[
0
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
mergecells
'
);
setTimeout
(
function
(){
var
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
var
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
var
cellsRange
=
ut
.
getCellsRange
(
trs
[
0
].
cells
[
2
],
trs
[
2
].
cells
[
0
]);
ut
.
setSelected
(
cellsRange
);
range
.
setStart
(
trs
[
0
].
cells
[
2
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
mergecells
'
);
editor
.
execCommand
(
'
source
'
);
editor
.
execCommand
(
'
source
'
);
trs
=
editor
.
body
.
getElementsByTagName
(
'
tr
'
);
equal
(
trs
[
1
].
rowIndex
,
1
,
'
(1,1)行索引
'
);
equal
(
trs
[
1
].
cells
[
0
].
cellIndex
,
0
,
'
(1,0)列索引
'
);
equal
(
trs
[
1
].
cells
[
1
].
cellIndex
,
1
,
'
(1,1)列索引
'
);
equal
(
trs
[
2
].
rowIndex
,
2
,
'
(2,2)行索引
'
);
equal
(
trs
[
2
].
cells
[
0
].
cellIndex
,
0
,
'
(2,0)列索引
'
);
equal
(
trs
[
1
].
cells
[
0
].
rowSpan
,
3
,
'
第二行第一个单元格rowspan 3
'
);
equal
(
trs
[
1
].
cells
[
0
].
colSpan
,
2
,
'
第二行第一个单元格colspan 2
'
);
equal
(
trs
[
0
].
cells
[
2
].
rowSpan
,
3
,
'
第一行第三个单元格rowspan 3
'
);
equal
(
trs
.
length
,
4
,
'
4个tr
'
);
equal
(
trs
[
0
].
cells
.
length
,
4
,
'
4个td
'
);
equal
(
trs
[
1
].
cells
.
length
,
2
,
'
2个td
'
);
equal
(
trs
[
2
].
cells
.
length
,
1
,
'
1个td
'
);
equal
(
trs
[
3
].
cells
.
length
,
2
,
'
2个td
'
);
start
();
},
50
);
},
50
);
stop
();
}
);
///*trace 2378*/
//test('不覆盖原来的class',function(){
// var editor = te.obj[0];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录