提交 a352b153 编写于 作者: Y yancend

[case]

上级 72a286db
...@@ -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?'&nbsp;':'<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?'&nbsp;':'<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);
} ); } );
...@@ -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:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, serif"><span style="font-size:14px;font-family:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, serif"><span style="font-size:14px;font-family:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, serif"><span style="font-size:14px;font-family:&#39;times new roman&#39;, 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:&#39;times new roman&#39;, serif"><span style="font-size:14px;font-family:&#39;times new roman&#39;, 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.
先完成此消息的编辑!
想要评论请 注册