提交 9fd0c82f 编写于 作者: C campaign

Merge remote-tracking branch 'origin/dev-1.2.6' into dev-1.2.6

......@@ -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;
......
/**
* 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;
body.innerHTML = '<p>hel</p><img src="http://img.baidu.com/hi/jx2/j_0001.gif" width="50" height="51" _src="http://img.baidu.com/hi/jx2/j_0001.gif" style="float: right;"><p>lo<br></p>';
range.selectNode(body.childNodes[1]).select();
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
......@@ -8,10 +8,10 @@
, 'ie9' => array( '10.81.96.46@8500' , "C:\\Program Files\\Internet Explorer\\iexplore.exe" )
, 'chrome' => array( '10.81.58.63@8500' , "C:\\Documents and Settings\\geqa1\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe" )
// , 'ie6' => array( '10.81.58.86@8500' , "C:\\Program Files\\Internet Explorer\\iexplore.exe" )
, 'ie8' => array( '10.81.58.64@8500' , "C:\\Program Files\\Internet Explorer\\iexplore.exe" )
// , 'ie8' => array( '10.81.58.64@8500' , "C:\\Program Files\\Internet Explorer\\iexplore.exe" )
// , 'ie7' => array( '10.81.58.87@8500' , "C:\\Program Files\\Internet Explorer\\iexplore.exe" )
, 'opera' => array( '10.81.58.64@8500' , "C:\\Program Files\\Opera\\opera.exe" )
, 'safari' => array( '10.81.58.63@8500' , "C:\\Program Files\\Safari\\Safari.exe" )
// , 'opera' => array( '10.81.58.64@8500' , "C:\\Program Files\\Opera\\opera.exe" )
// , 'safari' => array( '10.81.58.63@8500' , "C:\\Program Files\\Safari\\Safari.exe" )
);
public static $DEBUG = false;
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册