Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
0c5dac78
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,发现更多精彩内容 >>
提交
0c5dac78
编写于
5月 02, 2013
作者:
Y
yancend
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[case]添加dragdrop用例
上级
575dba09
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
1 deletion
+60
-1
_test/import.js
_test/import.js
+1
-1
_test/plugins/dragdrop.js
_test/plugins/dragdrop.js
+45
-0
_test/tools/br/js/UserAction.js
_test/tools/br/js/UserAction.js
+14
-0
未找到文件。
_test/import.js
浏览文件 @
0c5dac78
...
...
@@ -50,7 +50,7 @@
///import plugins/delete;
///import plugins/snapscreen;
///import plugins/print;
///import plugins/dragdrop;
///import plugins/searchreplace;
///import plugins/formatmatch;
///import plugins/basestyle;
...
...
_test/plugins/dragdrop.js
0 → 100644
浏览文件 @
0c5dac78
/**
* Created with JetBrains PhpStorm.
* User: Administrator
* Date: 13-4-29
* Time: 上午11:40
* To change this template use File | Settings | File Templates.
*/
module
(
'
plugins.dragdrop
'
);
test
(
'
拖拽图像不会把p切开
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
var
body
=
editor
.
body
;
editor
.
setContent
(
'
<p>hel</p><p>lo<br></p>
'
);
range
.
setStart
(
body
,
1
).
collapse
(
1
).
select
();
editor
.
execCommand
(
'
insertimage
'
,
{
src
:
'
http://img.baidu.com/hi/jx2/j_0001.gif
'
,
width
:
50
,
height
:
51
}
);
range
.
selectNode
(
body
.
childNodes
[
1
]).
select
();
editor
.
execCommand
(
'
imagefloat
'
,
'
right
'
);
equal
(
body
.
childNodes
.
length
,
3
,
'
img在两个p之间
'
);
equal
(
body
.
firstChild
.
tagName
.
toLowerCase
(),
"
p
"
,
'
img在两个p之间
'
);
equal
(
body
.
childNodes
[
1
].
tagName
.
toLowerCase
(),
"
img
"
,
'
img在两个p之间
'
);
equal
(
body
.
childNodes
[
2
].
tagName
.
toLowerCase
(),
"
p
"
,
'
img在两个p之间
'
);
ua
.
dragend
(
body
);
stop
();
setTimeout
(
function
(){
equal
(
body
.
childNodes
.
length
,
1
,
'
img在p里面
'
);
equal
(
body
.
firstChild
.
tagName
.
toLowerCase
(),
'
p
'
,
'
img在p里面
'
);
equal
(
body
.
firstChild
.
childNodes
[
1
].
tagName
.
toLowerCase
(),
'
img
'
,
'
img在p里面
'
);
start
();
},
30
);
}
);
test
(
'
拖拽图像不会把p切开,删除空span
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
var
body
=
editor
.
body
;
body
.
innerHTML
=
'
<p>asds</p><img src="http://img.baidu.com/hi/jx2/j_0001.gif" _src="http://img.baidu.com/hi/jx2/j_0001.gif" width="18" height="20" border="0" hspace="0" vspace="0" title="" style="line-height: 16px; width: 18px; height: 20px; float: right;"><span style="line-height: 16px;"></span><p>ad<br></p>
'
;
range
.
selectNode
(
body
.
childNodes
[
1
]).
select
();
ua
.
dragend
(
body
);
stop
();
setTimeout
(
function
(){
equal
(
body
.
childNodes
.
length
,
1
,
'
img在p里面
'
)
equal
(
body
.
firstChild
.
tagName
.
toLowerCase
(),
'
p
'
,
'
img在p里面
'
);
equal
(
body
.
firstChild
.
childNodes
[
1
].
tagName
.
toLowerCase
(),
'
img
'
,
'
img在p里面
'
);
start
();
},
30
);
}
);
\ No newline at end of file
_test/tools/br/js/UserAction.js
浏览文件 @
0c5dac78
...
...
@@ -320,6 +320,7 @@ UserAction = {
case
"
mouseenter
"
:
// 非标准支持,仅为测试提供,该项仅IE下work
case
"
mouseleave
"
:
case
"
contextmenu
"
:
case
"
dragend
"
:
case
"
blur
"
:
break
;
default
:
...
...
@@ -638,6 +639,19 @@ UserAction = {
contextmenu
:
function
(
target
/* :HTMLElement */
,
options
/* :Object */
)
/* :Void */
{
this
.
fireMouseEvent
(
target
,
"
contextmenu
"
,
options
);
},
/**
* Simulates a dragend on a particular element.
*
* @param {HTMLElement}
* target The element to show dragend.
* @param {Object}
* options Additional event options (use DOM standard names).
* @method dragend
* @static
*/
dragend
:
function
(
target
/* :HTMLElement */
,
options
/* :Object */
)
/* :Void */
{
this
.
fireMouseEvent
(
target
,
"
dragend
"
,
options
);
},
/**
* Simulates a blur on a particular element.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录