Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
a352b153
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,发现更多精彩内容 >>
提交
a352b153
编写于
5月 03, 2013
作者:
Y
yancend
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[case]
上级
72a286db
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
13 deletion
+20
-13
_test/plugins/font.js
_test/plugins/font.js
+4
-2
_test/plugins/wordimage.js
_test/plugins/wordimage.js
+16
-11
未找到文件。
_test/plugins/font.js
浏览文件 @
a352b153
...
@@ -587,14 +587,16 @@ test( '转换script标签', function () {
...
@@ -587,14 +587,16 @@ test( '转换script标签', function () {
test
(
'
转换style标签:style data不为空
'
,
function
()
{
test
(
'
转换style标签:style data不为空
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<style type="text/css">sdf</style>
'
);
editor
.
setContent
(
'
<style type="text/css">sdf</style>
'
);
var
html
=
'
<p><br></p><div type="text/css" cdata_tag="style" cdata_data="sdf"></div>
'
;
var
br
=
ua
.
browser
.
ie
?
'
'
:
'
<br>
'
;
var
html
=
'
<p>
'
+
br
+
'
</p><div type="text/css" cdata_tag="style" cdata_data="sdf"></div>
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
,
'
转换style标签
'
);
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
,
'
转换style标签
'
);
ua
.
checkSameHtml
(
html
,
editor
.
body
.
innerHTML
);
ua
.
checkSameHtml
(
html
,
editor
.
body
.
innerHTML
);
}
);
}
);
test
(
'
转换style标签:style data不空
'
,
function
()
{
test
(
'
转换style标签:style data不空
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<style type="text/css"></style>
'
);
editor
.
setContent
(
'
<style type="text/css"></style>
'
);
var
html
=
'
<p><br></p><div type="text/css" cdata_tag="style" ></div>
'
;
var
br
=
ua
.
browser
.
ie
?
'
'
:
'
<br>
'
;
var
html
=
'
<p>
'
+
br
+
'
</p><div type="text/css" cdata_tag="style" ></div>
'
;
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
,
'
转换style标签
'
);
ua
.
checkHTMLSameStyle
(
html
,
editor
.
document
,
editor
.
body
,
'
转换style标签
'
);
ua
.
checkSameHtml
(
html
,
editor
.
body
.
innerHTML
);
ua
.
checkSameHtml
(
html
,
editor
.
body
.
innerHTML
);
}
);
}
);
_test/plugins/wordimage.js
浏览文件 @
a352b153
...
@@ -9,20 +9,25 @@ module( 'plugins.wordimage' );
...
@@ -9,20 +9,25 @@ module( 'plugins.wordimage' );
test
(
'
检查取得word_img的url地址
'
,
function
()
{
test
(
'
检查取得word_img的url地址
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
editor
=
te
.
obj
[
0
];
editor
.
setContent
(
'
<p><span style="font-size:14px;font-family:'times new roman', serif"><img width="172px" height="111px" src="/ge/ueditor_1_2_0_0_BRANCH/themes/default/images/spacer.gif" word_img="file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.gif" style="background:url(/ge/ueditor_1_2_0_0_branch/themes/default/images/localimage.png) no-repeat center center;border:1px solid #ddd" /></span><br /></p><p><span style="font-size:14px;font-family:'times new roman', serif"><img src="http://img.baidu.com/hi/jx2/j_0001.gif" border="0" hspace="0" vspace="0" /><br /> </span></p>
'
);
editor
.
setContent
(
'
<p><span style="font-size:14px;font-family:'times new roman', serif"><img width="172px" height="111px" src="/ge/ueditor_1_2_0_0_BRANCH/themes/default/images/spacer.gif" word_img="file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.gif" style="background:url(/ge/ueditor_1_2_0_0_branch/themes/default/images/localimage.png) no-repeat center center;border:1px solid #ddd" /></span><br /></p><p><span style="font-size:14px;font-family:'times new roman', serif"><img src="http://img.baidu.com/hi/jx2/j_0001.gif" border="0" hspace="0" vspace="0" /><br /> </span></p>
'
);
editor
.
execCommand
(
'
wordimage
'
,
'
word_img
'
);
stop
();
equal
(
editor
.
word_img
.
length
,
'
1
'
,
'
有一个wordimg
'
);
setTimeout
(
function
()
{
equal
(
editor
.
word_img
[
0
],
"
file:///C:DOCUME~1DONGYA~1LOCALS~1Tempmsohtmlclip1clip_image001.gif
"
,
'
检查url地址
'
);
editor
.
execCommand
(
'
wordimage
'
,
'
word_img
'
);
equal
(
editor
.
word_img
.
length
,
'
1
'
,
'
有一个wordimg
'
);
equal
(
editor
.
word_img
[
0
],
"
file:///C:DOCUME~1DONGYA~1LOCALS~1Tempmsohtmlclip1clip_image001.gif
"
,
'
检查url地址
'
);
editor
.
setContent
(
'
<p><a href="http://www.baidu.com" target="_self" title="asdf"><span style="font-size:14px;font-family:'times new roman', serif"><img width="401px" height="174px" src="/ge/ueditor_1_2_0_0_BRANCH/themes/default/images/spacer.gif" word_img="file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.jpg" style="background:url(/ge/ueditor_1_2_0_0_branch/themes/default/images/localimage.png) no-repeat center center;border:1px solid #ddd" /></span></a><span style="font-size:14px;font-family:'times new roman', serif"><span style="font-size:14px;font-family:'times new roman', serif"><img width="172px" height="111px" src="/ge/ueditor_1_2_0_0_BRANCH/themes/default/images/spacer.gif" word_img="file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.gif" style="background:url(/ge/ueditor_1_2_0_0_branch/themes/default/images/localimage.png) no-repeat center center;border:1px solid #ddd" /></span></span></p><p><span style="font-size:14px;font-family:'times new roman', serif"><span style="font-size:14px;font-family:'times new roman', serif"><img src="/ge/ueditor_1_2_0_0_BRANCH/server/upload/uploadimages/11171332502507.gif" border="0" hspace="0" vspace="0" /><br /></span></span></p>
'
);
editor
.
setContent
(
'
<p><a href="http://www.baidu.com" target="_self" title="asdf"><span style="font-size:14px;font-family:'times new roman', serif"><img width="401px" height="174px" src="/ge/ueditor_1_2_0_0_BRANCH/themes/default/images/spacer.gif" word_img="file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.jpg" style="background:url(/ge/ueditor_1_2_0_0_branch/themes/default/images/localimage.png) no-repeat center center;border:1px solid #ddd" /></span></a><span style="font-size:14px;font-family:'times new roman', serif"><span style="font-size:14px;font-family:'times new roman', serif"><img width="172px" height="111px" src="/ge/ueditor_1_2_0_0_BRANCH/themes/default/images/spacer.gif" word_img="file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.gif" style="background:url(/ge/ueditor_1_2_0_0_branch/themes/default/images/localimage.png) no-repeat center center;border:1px solid #ddd" /></span></span></p><p><span style="font-size:14px;font-family:'times new roman', serif"><span style="font-size:14px;font-family:'times new roman', serif"><img src="/ge/ueditor_1_2_0_0_BRANCH/server/upload/uploadimages/11171332502507.gif" border="0" hspace="0" vspace="0" /><br /></span></span></p>
'
);
editor
.
execCommand
(
'
wordimage
'
,
'
word_img
'
);
setTimeout
(
function
()
{
equal
(
editor
.
word_img
.
length
,
'
2
'
,
'
有2个wordimg
'
);
editor
.
execCommand
(
'
wordimage
'
,
'
word_img
'
);
equal
(
editor
.
word_img
[
0
],
"
file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.jpg
"
,
'
检查 第一个url地址
'
);
equal
(
editor
.
word_img
.
length
,
'
2
'
,
'
有2个wordimg
'
);
equal
(
editor
.
word_img
[
1
],
"
file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.gif
"
,
'
检查 第二个url地址
'
);
equal
(
editor
.
word_img
[
0
],
"
file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.jpg
"
,
'
检查 第一个url地址
'
);
equal
(
editor
.
word_img
[
1
],
"
file:///C:
\
DOCUME~1
\
DONGYA~1
\
LOCALS~1
\
Temp
\
msohtmlclip1
\
01
\
clip_image001.gif
"
,
'
检查 第二个url地址
'
);
equal
(
editor
.
queryCommandState
(
'
wordimage
'
),
'
1
'
,
'
queryCommandState
'
);
}
);
equal
(
editor
.
queryCommandState
(
'
wordimage
'
),
'
1
'
,
'
queryCommandState
'
);
start
();
},
50
);
},
50
);
});
test
(
'
多实例编辑器检查取得word_img的url地址
'
,
function
()
{
test
(
'
多实例编辑器检查取得word_img的url地址
'
,
function
()
{
var
div1
=
document
.
createElement
(
'
div
'
);
var
div1
=
document
.
createElement
(
'
div
'
);
var
div2
=
document
.
createElement
(
'
div
'
);
var
div2
=
document
.
createElement
(
'
div
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录