Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
71881288
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,发现更多精彩内容 >>
提交
71881288
编写于
4月 28, 2013
作者:
C
campaign
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev-1.2.6' into dev-1.2.6
上级
dc11ae83
f7060813
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
168 addition
and
161 deletion
+168
-161
_test/import.js
_test/import.js
+1
-1
_test/plugins/enterkey.js
_test/plugins/enterkey.js
+24
-24
_test/plugins/font.js
_test/plugins/font.js
+1
-0
_test/plugins/highlightcode.js
_test/plugins/highlightcode.js
+134
-134
_test/plugins/keystrokes.js
_test/plugins/keystrokes.js
+1
-1
_test/plugins/music.js
_test/plugins/music.js
+7
-1
未找到文件。
_test/import.js
浏览文件 @
71881288
...
...
@@ -63,7 +63,7 @@
///import plugins/keystrokes;
///import plugins/fiximgclick;
///import plugins/autolink;
///import plugins/
highligh
tcode;
///import plugins/
inser
tcode;
///import plugins/list;
///import plugins/convertcase;
///import plugins/spechars;
...
...
_test/plugins/enterkey.js
浏览文件 @
71881288
...
...
@@ -16,31 +16,31 @@ module( 'plugins.enterkey' );
// 复合操作
// 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
'
:
'
<p>欢迎使用ueditor</p>
'
,
'
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
(
'
<table width="100%" border="1" bordercolor="#000000"><tbody><tr><td >aa</td></tbody></table>
'
);
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
),
'
<tbody><tr><td><br></td></tr></tbody>
'
,
'
<br>做回车
'
);
te
.
dom
[
1
].
parentNode
.
removeChild
(
te
.
dom
[
1
]);
start
();
},
50
);
},
50
);
}
);
//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':'<p>欢迎使用ueditor</p>','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(' <table width="100%" border="1" bordercolor="#000000"><tbody><tr><td >aa</td></tbody></table>' );
// 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),'<tbody><tr><td><br></td></tr></tbody>','<br>做回车');
// 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
'
)
);
...
...
_test/plugins/font.js
浏览文件 @
71881288
...
...
@@ -474,6 +474,7 @@ test( 'trace 721:预先设置下划线和字体颜色,再输入文本,查
}
);
test
(
'
trace 3337:字符边框
'
,
function
()
{
if
(
ua
.
browser
.
opera
)
return
;
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
editor
.
setContent
(
'
<p></p>
'
);
...
...
_test/plugins/highlightcode.js
浏览文件 @
71881288
...
...
@@ -5,153 +5,153 @@
* Time: 下午1:16
* To change this template use File | Settings | File Templates.
*/
module
(
'
plugins.highlightcode
'
);
var
toolbars_
=
[
[
'
source
'
,
'
inserthtml
'
,
'
highlightcode
'
]
];
/*trace 3290*/
test
(
'
插入代码
'
,
function
(){
var
editor
=
new
baidu
.
editor
.
Editor
({
'
UEDITOR_HOME_URL
'
:
'
../../../
'
,
'
autoFloatEnabled
'
:
false
,
'
toolbars
'
:
toolbars_
});
var
div
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
div
'
)
);
$
(
div
).
css
(
'
width
'
,
'
500px
'
).
css
(
'
height
'
,
'
500px
'
).
css
(
'
border
'
,
'
1px solid #ccc
'
);
editor
.
render
(
div
);
var
range
=
new
baidu
.
editor
.
dom
.
Range
(
editor
.
document
);
stop
();
editor
.
ready
(
function
(){
var
br
=
baidu
.
editor
.
browser
.
ie
?
'
'
:
'
<br />
'
;
editor
.
setContent
(
'
<p>
'
+
br
+
'
</p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
1
).
select
();
setTimeout
(
function
(){
editor
.
execCommand
(
'
highlightcode
'
,
'
<?php echo "Hello World"; ?>
'
,
'
php
'
);
var
s
=
'
<pre class=
\
"brush: php;toolbar:false;
\
" ><?php echo "Hello World"; ?>
\n
</pre>
'
;
equal
(
editor
.
getContent
().
substring
(
0
,
81
),
s
,
'
代码高亮
'
);
var
tds
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
td
'
);
range
.
selectNode
(
tds
[
0
]).
select
();
equal
(
editor
.
queryCommandState
(
'
highlightcode
'
),
1
,
'
插入代码高亮
'
);
editor
.
execCommand
(
'
highlightcode
'
,
'
<?php echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; ?>
'
,
'
php
'
);
stop
();
setTimeout
(
function
(){
equal
(
editor
.
getContent
().
substring
(
0
,
161
),
'
<pre class="brush: php;toolbar:false;" ><?php echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; ?>
\n
</pre>
'
,
'
代码修改
'
);
editor
.
fireEvent
(
'
fullscreenchanged
'
);
var
html
=
[];
editor
.
fireEvent
(
'
getAllHtml
'
,
html
);
ok
(
html
[
1
].
indexOf
(
'
SyntaxHighlighter
'
)
!=-
1
,
'
加载SyntaxHighlighter
'
);
ua
.
manualDeleteFillData
(
editor
.
body
);
tds
=
editor
.
body
.
getElementsByTagName
(
'
td
'
);
range
.
selectNode
(
tds
[
0
]).
select
();
editor
.
execCommand
(
'
highlightcode
'
);
var
br
=
ua
.
browser
.
ie
?
'
'
:
'
<br>
'
equal
(
ua
.
getChildHTML
(
editor
.
body
),
'
<p>
'
+
br
+
'
</p>
'
,
'
去掉代码高亮
'
);
div
.
parentNode
.
removeChild
(
div
);
start
();
},
50
);
},
500
);
},
50
);
});
/*trace 2648*/
/*trace 3142*/
//test('切换源码不插入br',function(){
//module('plugins.highlightcode');
//var toolbars_ = [
// [ 'source','inserthtml','highlightcode']
//];
///*trace 3290*/
//test('插入代码',function(){
// var editor = new baidu.editor.Editor({'UEDITOR_HOME_URL':'../../../','autoFloatEnabled':false,'toolbars':toolbars_});
// var div = document.body.appendChild( document.createElement( 'div' ) );
// $( div ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' );
//
te.obj[2]
.render(div);
// var range = new baidu.editor.dom.Range(
te.obj[2]
.document );
//
editor
.render(div);
// var range = new baidu.editor.dom.Range(
editor
.document );
// stop();
// setTimeout(function(){
// te.obj[2].setContent('<p></p>');
// range.setStart(te.obj[2].body.firstChild,0).collapse(true).select();
// te.obj[2].execCommand('highlightcode','<?php echo "Hello World"; ?>','php');
// var length=te.obj[2].body.childNodes.length;
// ua.manualDeleteFillData(te.obj[2].body);
// te.obj[2].execCommand('source');
// editor.ready(function(){
// var br = baidu.editor.browser.ie ? ' ' : '<br />';
// editor.setContent('<p>' + br + '</p>');
// range.setStart(editor.body.firstChild,0).collapse(1).select();
// setTimeout(function(){
// te.obj[2].execCommand('source');
// ok(length==te.obj[2].body.childNodes.length,'不增加br');
// editor.execCommand('highlightcode','<?php echo "Hello World"; ?>','php');
// var s = '<pre class=\"brush: php;toolbar:false;\" ><?php echo "Hello World"; ?>\n</pre>';
// equal( editor.getContent().substring(0,81),s,'代码高亮');
// var tds = editor.body.firstChild.getElementsByTagName('td');
// range.selectNode(tds[0]).select();
// equal(editor.queryCommandState('highlightcode'),1,'插入代码高亮');
// editor.execCommand('highlightcode','<?php echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; ?>','php');
// stop();
// setTimeout(function(){
// equal( editor.getContent().substring(0,161),'<pre class="brush: php;toolbar:false;" ><?php echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; echo "Hello World"; ?>\n</pre>','代码修改');
// editor.fireEvent('fullscreenchanged');
// var html = [];
// editor.fireEvent('getAllHtml',html);
// ok(html[1].indexOf('SyntaxHighlighter')!=-1,'加载SyntaxHighlighter');
// ua.manualDeleteFillData(editor.body);
// tds = editor.body.getElementsByTagName('td');
// range.selectNode(tds[0]).select();
// editor.execCommand('highlightcode');
// var br = ua.browser.ie?' ':'<br>'
// equal(ua.getChildHTML(editor.body),'<p>'+br+'</p>','去掉代码高亮');
// div.parentNode.removeChild(div);
// start();
// },50);
// },500);
// },50);
//});
//
///*trace 2648*/
///*trace 3142*/
////test('切换源码不插入br',function(){
//// var div = document.body.appendChild( document.createElement( 'div' ) );
//// $( div ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' );
//// te.obj[2].render(div);
//// var range = new baidu.editor.dom.Range( te.obj[2].document );
//// stop();
//// setTimeout(function(){
//// te.obj[2].setContent('<p></p>');
//// range.setStart(te.obj[2].body.firstChild,0).collapse(true).select();
//// te.obj[2].execCommand('highlightcode','<?php echo "Hello World"; ?>','php');
//// var length=te.obj[2].body.childNodes.length;
//// ua.manualDeleteFillData(te.obj[2].body);
//// te.obj[2].execCommand('source');
//// setTimeout(function(){
//// te.obj[2].execCommand('source');
//// ok(length==te.obj[2].body.childNodes.length,'不增加br');
//// div.parentNode.removeChild(div);
//// start();
//// },50);
//// },50);
////});
//
///*trace 2472*/
//test('插入两个字符',function(){
// var editor = new baidu.editor.Editor({'UEDITOR_HOME_URL':'../../../','autoFloatEnabled':false,'toolbars':toolbars_});
// var div = document.body.appendChild( document.createElement( 'div' ) );
// $( div ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' );
// editor.render(div);
// var range = new baidu.editor.dom.Range( editor.document );
// stop();
// setTimeout(function(){
// editor.setContent('<p></p>');
// range.setStart(editor.body.firstChild,0).collapse(true).select();
// editor.execCommand('highlightcode','aaa','php');
// ua.manualDeleteFillData(editor.body);
// var br = ua.browser.ie?' ':'<br/>';
// equal( editor.getContent().substring(0, 158),'<pre class=\"brush: php;toolbar:false;\" >aaa\n</pre><p>'+br+'</p>','插入成功');
// div.parentNode.removeChild(div);
// start();
// },50);
// },50);
//});
/*trace 2472*/
test
(
'
插入两个字符
'
,
function
(){
var
editor
=
new
baidu
.
editor
.
Editor
({
'
UEDITOR_HOME_URL
'
:
'
../../../
'
,
'
autoFloatEnabled
'
:
false
,
'
toolbars
'
:
toolbars_
});
var
div
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
div
'
)
);
$
(
div
).
css
(
'
width
'
,
'
500px
'
).
css
(
'
height
'
,
'
500px
'
).
css
(
'
border
'
,
'
1px solid #ccc
'
);
editor
.
render
(
div
);
var
range
=
new
baidu
.
editor
.
dom
.
Range
(
editor
.
document
);
stop
();
setTimeout
(
function
(){
editor
.
setContent
(
'
<p></p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
highlightcode
'
,
'
aaa
'
,
'
php
'
);
ua
.
manualDeleteFillData
(
editor
.
body
);
var
br
=
ua
.
browser
.
ie
?
'
'
:
'
<br/>
'
;
equal
(
editor
.
getContent
().
substring
(
0
,
158
),
'
<pre class=
\
"brush: php;toolbar:false;
\
" >aaa
\n
</pre><p>
'
+
br
+
'
</p>
'
,
'
插入成功
'
);
div
.
parentNode
.
removeChild
(
div
);
start
();
},
50
);
});
/*trace 3138*/
/*trace 3203*/
test
(
'
插入代码后撤销
'
,
function
(){
var
editor
=
new
baidu
.
editor
.
Editor
({
'
UEDITOR_HOME_URL
'
:
'
../../../
'
,
'
autoFloatEnabled
'
:
false
,
'
toolbars
'
:
toolbars_
});
var
div
=
document
.
body
.
appendChild
(
document
.
createElement
(
'
div
'
)
);
$
(
div
).
css
(
'
width
'
,
'
500px
'
).
css
(
'
height
'
,
'
500px
'
).
css
(
'
border
'
,
'
1px solid #ccc
'
);
editor
.
render
(
div
);
var
range
=
new
baidu
.
editor
.
dom
.
Range
(
editor
.
document
);
stop
();
editor
.
ready
(
function
(){
var
br
=
baidu
.
editor
.
browser
.
ie
?
''
:
'
<br />
'
;
editor
.
setContent
(
'
<p>
'
+
br
+
'
</p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
1
).
select
();
setTimeout
(
function
(){
editor
.
execCommand
(
'
highlightcode
'
,
'
<body><table><tbody><tr><td><br></td></tr></tbody></table></body>
'
,
'
html
'
);
ua
.
manualDeleteFillData
(
editor
.
body
);
equal
(
editor
.
getContent
(),
'
<pre class="brush: html;toolbar:false;" ><body><table><tbody><tr><td><br></td></tr></tbody></table></body>
\n
</pre><p><br/></p>
'
,
'
内容未被改变
'
);
equal
(
editor
.
body
.
style
.
cursor
,
'
text
'
,
'
检查光标样式
'
);
ua
.
keydown
(
editor
.
body
,{
'
keyCode
'
:
90
,
'
ctrlKey
'
:
true
});
equal
(
editor
.
getContent
(),
''
,
'
插入的代码被撤销
'
);
equal
(
editor
.
body
.
style
.
cursor
,
'
text
'
,
'
检查光标样式
'
);
div
.
parentNode
.
removeChild
(
div
);
start
();
},
500
);
},
50
);
});
/*trace 3202*/
//超时,暂时注掉--luqiong
//test('插入两段代码后修改第一段代码',function(){
//
///*trace 3138*/
///*trace 3203*/
//test('插入代码后撤销',function(){
// var editor = new baidu.editor.Editor({'UEDITOR_HOME_URL':'../../../','autoFloatEnabled':false,'toolbars':toolbars_});
// var div = document.body.appendChild( document.createElement( 'div' ) );
// $( div ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' );
//
te.obj[2]
.render(div);
// var range = new baidu.editor.dom.Range(
te.obj[2]
.document );
//
editor
.render(div);
// var range = new baidu.editor.dom.Range(
editor
.document );
// stop();
//
te.obj[2]
.ready(function(){
//
editor
.ready(function(){
// var br = baidu.editor.browser.ie ? '' : '<br />';
//
te.obj[2]
.setContent('<p>' + br + '</p>');
// range.setStart(
te.obj[2]
.body.firstChild,0).collapse(1).select();
//
editor
.setContent('<p>' + br + '</p>');
// range.setStart(
editor
.body.firstChild,0).collapse(1).select();
// setTimeout(function(){
// te.obj[2].execCommand('highlightcode','<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','html');
// ua.manualDeleteFillData(te.obj[2].body);
// range.setStart(te.obj[2].body.lastChild,0).collapse(1).select();
// setTimeout(function(){
// te.obj[2].execCommand('highlightcode','<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','java');
// ua.manualDeleteFillData(te.obj[2].body);
// var tds = te.obj[2].body.firstChild.getElementsByTagName('td');
// range.setStart(tds[0],0).collapse(1).select();
// te.obj[2].execCommand('highlightcode','123<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','html');
// equal( te.obj[2].body.getElementsByTagName('table').length,2,'2段代码');
// equal( te.obj[2].body.getElementsByTagName('code')[0].innerHTML,'123<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','第一段代码被修改');
// equal( te.obj[2].body.getElementsByTagName('code')[1].innerHTML,'<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','第二段代码内容不变');
// /*trace 3221*/
// range.selectNode(tds[0]).select();
// equal(te.obj[2].queryCommandState('autotypeset'),-1,'自动排版不可用');
// equal(te.obj[2].queryCommandState('pasteplain'),-1,'纯文本粘贴不可用');
// div.parentNode.removeChild(div);
// start();
// },500);
// editor.execCommand('highlightcode','<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','html');
// ua.manualDeleteFillData(editor.body);
// equal( editor.getContent(),'<pre class="brush: html;toolbar:false;" ><body><table><tbody><tr><td><br></td></tr></tbody></table></body>\n</pre><p><br/></p>','内容未被改变');
// equal( editor.body.style.cursor,'text','检查光标样式');
// ua.keydown(editor.body,{'keyCode':90,'ctrlKey':true});
// equal( editor.getContent(),'','插入的代码被撤销');
// equal( editor.body.style.cursor,'text','检查光标样式');
// div.parentNode.removeChild(div);
// start();
// },500);
// },50);
//});
//
///*trace 3202*/
////超时,暂时注掉--luqiong
////test('插入两段代码后修改第一段代码',function(){
//// var div = document.body.appendChild( document.createElement( 'div' ) );
//// $( div ).css( 'width', '500px' ).css( 'height', '500px' ).css( 'border', '1px solid #ccc' );
//// te.obj[2].render(div);
//// var range = new baidu.editor.dom.Range( te.obj[2].document );
//// stop();
//// te.obj[2].ready(function(){
//// var br = baidu.editor.browser.ie ? '' : '<br />';
//// te.obj[2].setContent('<p>' + br + '</p>');
//// range.setStart(te.obj[2].body.firstChild,0).collapse(1).select();
//// setTimeout(function(){
//// te.obj[2].execCommand('highlightcode','<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','html');
//// ua.manualDeleteFillData(te.obj[2].body);
//// range.setStart(te.obj[2].body.lastChild,0).collapse(1).select();
//// setTimeout(function(){
//// te.obj[2].execCommand('highlightcode','<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','java');
//// ua.manualDeleteFillData(te.obj[2].body);
//// var tds = te.obj[2].body.firstChild.getElementsByTagName('td');
//// range.setStart(tds[0],0).collapse(1).select();
//// te.obj[2].execCommand('highlightcode','123<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','html');
//// equal( te.obj[2].body.getElementsByTagName('table').length,2,'2段代码');
//// equal( te.obj[2].body.getElementsByTagName('code')[0].innerHTML,'123<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','第一段代码被修改');
//// equal( te.obj[2].body.getElementsByTagName('code')[1].innerHTML,'<body><table><tbody><tr><td><br></td></tr></tbody></table></body>','第二段代码内容不变');
//// /*trace 3221*/
//// range.selectNode(tds[0]).select();
//// equal(te.obj[2].queryCommandState('autotypeset'),-1,'自动排版不可用');
//// equal(te.obj[2].queryCommandState('pasteplain'),-1,'纯文本粘贴不可用');
//// div.parentNode.removeChild(div);
//// start();
//// },500);
//// },500);
//// },50);
////});
_test/plugins/keystrokes.js
浏览文件 @
71881288
...
...
@@ -120,7 +120,7 @@ test('在列表中,跨行选中,输入tab键',function(){
range
.
setStart
(
editor
.
body
.
firstChild
.
firstChild
.
firstChild
.
firstChild
,
1
).
setEnd
(
editor
.
body
.
firstChild
.
childNodes
[
1
].
firstChild
.
firstChild
,
1
).
select
();
ua
.
keydown
(
editor
.
body
,{
'
keyCode
'
:
9
});
setTimeout
(
function
(){
equal
(
te
.
obj
[
0
].
undoManger
.
list
.
length
,
1
,
'
undoManger.index
'
);
equal
(
te
.
obj
[
0
].
undoManger
.
index
,
1
,
'
undoManger.index
'
);
ua
.
manualDeleteFillData
(
te
.
obj
[
0
].
body
);
equal
(
te
.
obj
[
0
].
body
.
firstChild
.
tagName
.
toLowerCase
(),
'
ol
'
,
'
外面套了一层ol
'
);
equal
(
te
.
obj
[
0
].
body
.
firstChild
.
childNodes
.
length
,
2
,
''
);
...
...
_test/plugins/music.js
浏览文件 @
71881288
...
...
@@ -6,5 +6,11 @@ test( '音乐', function () {
editor
.
setContent
(
'
<p>hello</p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
music
'
,{
url
:
"
http://box.baidu.com/widget/flash/bdspacesong.swf?from=tiebasongwidget&url=…artist=%E5%BC%A0%E6%B6%A6%E8%B4%9E&extra=Vol.%202&autoPlay=false&loop=true
"
});
equal
(
editor
.
getContent
(),
'
<p><embed type=
\
"application/x-shockwave-flash
\
" class=
\
"edui-faked-music
\
" pluginspage=
\
"http://www.macromedia.com/go/getflashplayer
\
" src=
\
"http://box.baidu.com/widget/flash/bdspacesong.swf?from=tiebasongwidget&url=…artist=%E5%BC%A0%E6%B6%A6%E8%B4%9E&extra=Vol.%202&autoPlay=false&loop=true
\
" width=
\
"400
\
" height=
\
"95
\
" align=
\
"none
\
" wmode=
\
"transparent
\
" play=
\
"true
\
" loop=
\
"false
\
" menu=
\
"false
\
" allowscriptaccess=
\
"never
\
" allowfullscreen=
\
"true
\
" /></p><p>hello<br/></p>
'
);
stop
();
setTimeout
(
function
(){
// equal(editor.getContent(),'<p><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-music\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://box.baidu.com/widget/flash/bdspacesong.swf?from=tiebasongwidget&url=…artist=%E5%BC%A0%E6%B6%A6%E8%B4%9E&extra=Vol.%202&autoPlay=false&loop=true\" width=\"400\" height=\"95\" align=\"none\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\" /></p><p>hello<br/></p>');
equal
(
editor
.
body
.
firstChild
.
firstChild
.
tagName
.
toLowerCase
(),
'
img
'
);
equal
(
editor
.
body
.
firstChild
.
firstChild
.
className
,
'
edui-faked-music
'
);
start
();
},
50
);
}
);
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录