Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
16f28e0a
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,发现更多精彩内容 >>
提交
16f28e0a
编写于
8月 08, 2013
作者:
Y
yancend
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[case]
上级
41b8dc7e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
82 addition
and
11 deletion
+82
-11
_test/plugins/defaultfilter.js
_test/plugins/defaultfilter.js
+22
-5
_test/plugins/shortcutmenu.js
_test/plugins/shortcutmenu.js
+60
-6
未找到文件。
_test/plugins/defaultfilter.js
浏览文件 @
16f28e0a
...
...
@@ -6,6 +6,20 @@
* To change this template use File | Settings | File Templates.
*/
module
(
'
plugins.defaultfilter
'
);
test
(
'
对代码的行号不处理
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div></td>
'
);
// var br = ua.browser.ie?'':'<br>';
var
html
=
'
<table><tbody><tr><td class=
\
"gutter
\
"><div class=
\
"line number1 index0 alt2
\
">1</div><div class=
\
"line number2 index1 alt1
\
">2</div></td></tr></tbody></table>
'
;
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
html
,
'
table补全,对代码的行号不处理
'
)
}
);
test
(
'
空td,th,caption
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<table><caption></caption><tbody><tr><th></th><th></th></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></tbody></table>
'
);
var
br
=
ua
.
browser
.
ie
?
''
:
'
<br>
'
;
var
html
=
'
<table><caption>
'
+
br
+
'
</caption><tbody><tr><th>
'
+
br
+
'
</th><th>
'
+
br
+
'
</th></tr><tr><td>
'
+
br
+
'
</td><td>
'
+
br
+
'
</td></tr><tr><td>
'
+
br
+
'
</td><td>
'
+
br
+
'
</td></tr></tbody></table>
'
;
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
html
,
'
空td,th,caption,添加text
'
)
}
);
test
(
'
转换a标签
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<a href="http://elearning.baidu.com/url/RepositoryEntry/68616197" target="_blank">
'
);
...
...
@@ -34,12 +48,13 @@ test( '删span中的white-space标签', function () {
// var html = '<p style="list-style: none;">hello</p>';
// ua.checkSameHtml(html,editor.body.innerHTML,'删p中的margin|padding标签');
//} );
test
(
'
给空p加br
'
,
function
()
{
test
(
'
给空p加br
&&转对齐样式
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<p
style="list-style: none;
" ></p>
'
);
editor
.
setContent
(
'
<p
align ="center
" ></p>
'
);
var
br
=
ua
.
browser
.
ie
?
'
'
:
'
<br>
'
;
// var html = '<p style="list-style: none;">'+br+'</p>';
equal
(
editor
.
body
.
firstChild
.
innerHTML
,
br
)
// "<p style=\"text-align:center;list-style: none;\"><br></p>"
var
html
=
'
<p style=
\
"text-align:center;
\
">
'
+
br
+
'
</p>
'
;
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
html
,
'
给空p加br&&转对齐样式
'
);
}
);
test
(
'
删div
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
...
...
@@ -55,7 +70,9 @@ test( 'allowDivTransToP--false 不转div', function () {
editor
.
ready
(
function
(){
var
html
=
'
<div class="socore" ><div class="sooption" style="padding: 1px;" >视频</div></div>
'
;
editor
.
setContent
(
html
);
ua
.
checkSameHtml
(
html
,
editor
.
body
.
innerHTML
,
'
删div
'
);
var
padding
=
(
ua
.
browser
.
ie
&&
ua
.
browser
.
ie
<
9
)?
'
PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 1px
'
:
'
padding: 1px;
'
;
var
html_a
=
'
<div class="socore" ><div class="sooption" style="
'
+
padding
+
'
" >视频</div></div>
'
;
ua
.
checkSameHtml
(
html_a
,
editor
.
body
.
innerHTML
,
'
不转div
'
);
UE
.
delEditor
(
'
ue
'
);
start
();
});
...
...
_test/plugins/shortcutmenu.js
浏览文件 @
16f28e0a
...
...
@@ -11,22 +11,76 @@ test( '基本的shortcutmenu', function() {
//设置菜单内容\
var
div
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
div
'
));
div
.
id
=
'
ue
'
;
var
editor
=
UE
.
getEditor
(
"
ue
"
,
{
shortcutMenu
:
[
"
fontfamily
"
,
"
fontsize
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
forecolor
"
,
"
backcolor
"
,
"
insertorderedlist
"
,
"
insertunorderedlist
"
]});
var
editor
=
UE
.
getEditor
(
"
ue
"
,
{
shortcutMenu
:
[
"
fontfamily
"
,
"
fontsize
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
forecolor
"
,
"
backcolor
"
,
"
insertorderedlist
"
,
"
insertunorderedlist
"
]});
stop
();
editor
.
ready
(
function
()
{
ua
.
contextmenu
(
editor
.
body
);
setTimeout
(
function
()
{
var
menu
=
document
.
getElementsByClassName
(
"
edui-shortcutmenu
"
)[
0
];
equal
(
!!
menu
,
true
,
'
右键检查菜单是否存在
'
);
setTimeout
(
function
()
{
var
menu
=
document
.
getElementsByClassName
(
"
edui-shortcutmenu
"
)[
0
];
equal
(
!!
menu
,
true
,
'
右键检查菜单是否存在
'
);
ok
(
menu
.
style
.
display
==
""
||
menu
.
style
.
display
==
"
block
"
,
'
右键检查菜单是否显示
'
);
ok
(
menu
.
style
.
display
==
""
||
menu
.
style
.
display
==
"
block
"
,
'
右键检查菜单是否显示
'
);
ua
.
mousedown
(
editor
.
body
.
firstChild
);
equal
(
menu
.
style
.
display
,
"
none
"
,
'
鼠标按下检查菜单是否隐藏
'
);
equal
(
menu
.
style
.
display
,
"
none
"
,
'
鼠标按下检查菜单是否隐藏
'
);
UE
.
delEditor
(
'
ue
'
);
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
te
.
dom
.
push
(
document
.
getElementById
(
'
edui_fixedlayer
'
));
start
()
},
100
);
});
});
test
(
'
键盘操作,隐藏shortcutmenu
'
,
function
()
{
//设置菜单内容\
var
div
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
div
'
));
div
.
id
=
'
ue
'
;
var
editor
=
UE
.
getEditor
(
"
ue
"
,{
shortcutMenu
:
[
"
fontfamily
"
,
"
fontsize
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
forecolor
"
,
"
backcolor
"
,
"
insertorderedlist
"
,
"
insertunorderedlist
"
]});
stop
();
editor
.
ready
(
function
()
{
ua
.
contextmenu
(
editor
.
body
);
setTimeout
(
function
(){
var
menu
=
document
.
getElementsByClassName
(
"
edui-shortcutmenu
"
)[
0
];
equal
(
!!
menu
,
true
,
'
右键检查菜单是否存在
'
);
ok
(
menu
.
style
.
display
==
""
||
menu
.
style
.
display
==
"
block
"
,
'
右键检查菜单是否显示
'
);
ua
.
keydown
(
editor
.
body
.
firstChild
);
equal
(
menu
.
style
.
display
,
"
none
"
,
'
键盘按下检查菜单是否隐藏
'
);
UE
.
delEditor
(
'
ue
'
);
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
te
.
dom
.
push
(
document
.
getElementById
(
'
edui_fixedlayer
'
));
start
()
},
100
);
});
}
);
test
(
'
框选内容
'
,
function
()
{
//设置菜单内容\
var
div
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
div
'
));
div
.
id
=
'
ue
'
;
var
editor
=
UE
.
getEditor
(
"
ue
"
,{
shortcutMenu
:
[
"
fontfamily
"
,
"
fontsize
"
,
"
bold
"
,
"
italic
"
,
"
underline
"
,
"
forecolor
"
,
"
backcolor
"
,
"
insertorderedlist
"
,
"
insertunorderedlist
"
]});
stop
();
editor
.
ready
(
function
()
{
editor
.
setContent
(
'
<p>hello</p>
'
);
var
range
=
new
baidu
.
editor
.
dom
.
Range
(
editor
.
document
);
range
.
setStart
(
editor
.
body
.
firstChild
.
firstChild
,
0
).
setEnd
(
editor
.
body
.
firstChild
.
firstChild
,
2
).
select
();
var
sc
=
editor
.
selection
.
getRange
().
startContainer
;
var
ec
=
editor
.
selection
.
getRange
().
endContainer
;
var
so
=
editor
.
selection
.
getRange
().
startOffset
;
var
eo
=
editor
.
selection
.
getRange
().
endOffset
;
var
collapsed
=
editor
.
selection
.
getRange
().
collapsed
;
ua
.
contextmenu
(
editor
.
body
);
setTimeout
(
function
(){
var
menu
=
document
.
getElementsByClassName
(
"
edui-shortcutmenu
"
)[
0
];
equal
(
!!
menu
,
true
,
'
右键检查菜单是否存在
'
);
ok
(
menu
.
style
.
display
==
""
||
menu
.
style
.
display
==
"
block
"
,
'
右键检查菜单是否显示
'
);
ua
.
checkResult
(
editor
.
selection
.
getRange
(),
sc
,
ec
,
so
,
eo
,
collapsed
,
'
检查range不变
'
);
ua
.
keydown
(
editor
.
body
.
firstChild
);
UE
.
delEditor
(
'
ue
'
);
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
te
.
dom
.
push
(
document
.
getElementById
(
'
edui_fixedlayer
'
));
start
()
},
100
);
});
}
);
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录