/**
* jQuery EasyUI 1.2.1
*
* Licensed under the GPL:
* http://www.gnu.org/licenses/gpl.txt
*
* Copyright 2010 stworthy [ stworthy@gmail.com ]
*
*/
(function($){
function _1(e){
var _2=$.data(e.data.target,"draggable").options;
var _3=e.data;
var _4=_3.startLeft+e.pageX-_3.startX;
var _5=_3.startTop+e.pageY-_3.startY;
if(_2.deltaX!=null&&_2.deltaX!=undefined){
_4=e.pageX+_2.deltaX;
}
if(_2.deltaY!=null&&_2.deltaY!=undefined){
_5=e.pageY+_2.deltaY;
}
if(e.data.parnet!=document.body){
if($.boxModel==true){
_4+=$(e.data.parent).scrollLeft();
_5+=$(e.data.parent).scrollTop();
}
}
if(_2.axis=="h"){
_3.left=_4;
}else{
if(_2.axis=="v"){
_3.top=_5;
}else{
_3.left=_4;
_3.top=_5;
}
}
};
function _6(e){
var _7=$.data(e.data.target,"draggable").options;
var _8=$.data(e.data.target,"draggable").proxy;
if(_8){
_8.css("cursor",_7.cursor);
}else{
_8=$(e.data.target);
$.data(e.data.target,"draggable").handle.css("cursor",_7.cursor);
}
_8.css({left:e.data.left,top:e.data.top});
};
function _9(e){
var _a=$.data(e.data.target,"draggable").options;
var _b=$(".droppable").filter(function(){
return e.data.target!=this;
}).filter(function(){
var _c=$.data(this,"droppable").options.accept;
if(_c){
return $(_c).filter(function(){
return this==e.data.target;
}).length>0;
}else{
return true;
}
});
$.data(e.data.target,"draggable").droppables=_b;
var _d=$.data(e.data.target,"draggable").proxy;
if(!_d){
if(_a.proxy){
if(_a.proxy=="clone"){
_d=$(e.data.target).clone().insertAfter(e.data.target);
}else{
_d=_a.proxy.call(e.data.target,e.data.target);
}
$.data(e.data.target,"draggable").proxy=_d;
}else{
_d=$(e.data.target);
}
}
_d.css("position","absolute");
_1(e);
_6(e);
_a.onStartDrag.call(e.data.target,e);
return false;
};
function _e(e){
_1(e);
if($.data(e.data.target,"draggable").options.onDrag.call(e.data.target,e)!=false){
_6(e);
}
var _f=e.data.target;
$.data(e.data.target,"draggable").droppables.each(function(){
var _10=$(this);
var p2=$(this).offset();
if(e.pageX>p2.left&&e.pageX<p2.left+_10.outerWidth()&&e.pageY>p2.top&&e.pageY<p2.top+_10.outerHeight()){
if(!this.entered){
$(this).trigger("_dragenter",[_f]);
this.entered=true;
}
$(this).trigger("_dragover",[_f]);
}else{
if(this.entered){
$(this).trigger("_dragleave",[_f]);
this.entered=false;
}
}
});
return false;
};
function _11(e){
_1(e);
var _12=$.data(e.data.target,"draggable").proxy;
var _13=$.data(e.data.target,"draggable").options;
if(_13.revert){
if(_14()==true){
_15();
$(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop});
}else{
if(_12){
_12.animate({left:e.data.startLeft,top:e.data.startTop},function(){
_15();
});
}else{
$(e.data.target).animate({left:e.data.startLeft,top:e.data.startTop},function(){
$(e.data.target).css("position",e.data.startPosition);
});
}
}
}else{
$(e.data.target).css({position:"absolute",left:e.data.left,top:e.data.top});
_15();
_14();
}
_13.onStopDrag.call(e.data.target,e);
function _15(){
if(_12){
_12.remove();
}
$.data(e.data.target,"draggable").proxy=null;
};
function _14(){
var _16=false;
$.data(e.data.target,"draggable").droppables.each(function(){
var _17=$(this);
var p2=$(this).offset();
if(e.pageX>p2.left&&e.pageX<p2.left+_17.outerWidth()&&e.pageY>p2.top&&e.pageY<p2.top+_17.outerHeight()){
if(_13.revert){
$(e.data.target).css({position:e.data.startPosition,left:e.data.startLeft,top:e.data.startTop});
}
$(this).trigger("_drop",[e.data.target]);
_16=true;
this.entered=false;
}
});
return _16;
};
$(document).unbind(".draggable");
return false;
};
$.fn.draggable=function(_18,_19){
if(typeof _18=="string"){
return $.fn.draggable.methods[_18](this,_19);
}
return this.each(function(){
var _1a;
var _1b=$.data(this,"draggable");
if(_1b){
_1b.handle.unbind(".draggable");
_1a=$.extend(_1b.options,_18);
}else{
_1a=$.extend({},$.fn.draggable.defaults,_18||{});
}
if(_1a.disabled==true){
$(this).css("cursor","default");
return;
}
var _1c=null;
if(typeof _1a.handle=="undefined"||_1a.handle==null){
_1c=$(this);
}else{
_1c=(typeof _1a.handle=="string"?$(_1a.handle,this):_1c);
}
$.data(this,"draggable",{options:_1a,handle:_1c});
_1c.bind("mousedown.draggable",{target:this},_1d);
_1c.bind("mousemove.draggable",{target:this},_1e);
function _1d(e){
if(_1f(e)==false){
return;
}
var _20=$(e.data.target).position();
var _21={startPosition:$(e.data.target).css("position"),startLeft:_20.left,startTop:_20.top,left:_20.left,top:_20.top,startX:e.pageX,startY:e.pageY,target:e.data.target,parent:$(e.data.target).parent()[0]};
$(document).bind("mousedown.draggable",_21,_9);
$(document).bind("mousemove.draggable",_21,_e);
$(document).bind("mouseup.draggable",_21,_11);
};
function _1e(e){
if(_1f(e)){
$(this).css("cursor",_1a.cursor);
}else{
$(this).css("cursor","default");
}
};
function _1f(e){
var _22=$(_1c).offset();
var _23=$(_1c).outerWidth();
var _24=$(_1c).outerHeight();
var t=e.pageY-_22.top;
var r=_22.left+_23-e.pageX;
var b=_22.top+_24-e.pageY;
var l=e.pageX-_22.left;
return Math.min(t,r,b,l)>_1a.edge;
};
});
};
$.fn.draggable.methods={options:function(jq){
return $.data(jq[0],"draggable").options;
},proxy:function(jq){
return $.data(jq[0],"draggable").proxy;
},enable:function(jq){
return jq.each(function(){
$(this).draggable({disabled:false});
});
},disable:function(jq){
return jq.each(function(){
$(this).draggable({disabled:true});
});
}};
$.fn.draggable.defaults={proxy:null,revert:false,cursor:"move",deltaX:null,deltaY:null,handle:null,disabled:false,edge:0,axis:null,onStartDrag:function(e){
},onDrag:function(e){
},onStopDrag:function(e){
}};
})(jQuery);
(function($){
function _25(_26){
$(_26).addClass("droppable");
$(_26).bind("_dragenter",function(e,_27){
$.data(_26,"droppable").options.onDragEnter.apply(_26,[e,_27]);
});
$(_26).bind("_dragleave",function(e,_28){
$.data(_26,"droppable").options.onDragLeave.apply(_26,[e,_28]);
});
$(_26).bind("_dragover",function(e,_29){
$.data(_26,"droppable").options.onDragOver.apply(_26,[e,_29]);
});
$(_26).bind("_drop",function(e,_2a){
$.data(_26,"droppable").options.onDrop.apply(_26,[e,_2a]);
});
};
$.fn.droppable=function(_2b,_2c){
if(typeof _2b=="string"){
return $.fn.droppable.methods[_2b](this,_2c);
}
_2b=_2b||{};
return this.each(function(){
var _2d=$.data(this,"droppable");
if(_2d){
$.extend(_2d.options,_2b);
}else{
_25(this);
$.data(this,"droppable",{options:$.extend({},$.fn.droppable.defaults,_2b)});
}
});
};
$.fn.droppable.methods={};
$.fn.droppable.defaults={accept:null,onDragEnter:function(e,_2e){
},onDragOver:function(e,_2f){
},onDragLeave:function(e,_30){
},onDrop:function(e,_31){
}};
})(jQuery);
(function($){
$.fn.resizable=function(_32,_33){
if(typeof _32=="string"){
return $.fn.resizable.methods[_32](this,_33);
}
function _34(e){
var _35=e.data;
var _36=$.data(_35.target,"resizable").options;
if(_35.dir.indexOf("e")!=-1){
var _37=_35.startWidth+e.pageX-_35.startX;
_37=Math.min(Math.max(_37,_36.minWidth),_36.maxWidth);
_35.width=_37;
}
if(_35.dir.indexOf("s")!=-1){
var _38=_35.startHeight+e.pageY-_35.startY;
_38=Math.min(Math.max(_38,_36.minHeight),_36.maxHeight);
_35.height=_38;
}
if(_35.dir.indexOf("w")!=-1){
_35.width=_35.startWidth-e.pageX+_35.startX;
if(_35.width>=_36.minWidth&&_35.width<=_36.maxWidth){
_35.left=_35.startLeft+e.pageX-_35.startX;
}
}
if(_35.dir.indexOf("n")!=-1){
_35.height=_35.startHeight-e.pageY+_35.startY;
if(_35.height>=_36.minHeight&&_35.height<=_36.maxHeight){
_35.top=_35.startTop+e.pageY-_35.startY;
}
}
};
function _39(e){
var _3a=e.data;
var _3b=_3a.target;
if($.boxModel==true){
$(_3b).css({width:_3a.width-_3a.deltaWidth,height:_3a.height-_3a.deltaHeight,left:_3a.left,top:_3a.top});
}else{
$(_3b).css({width:_3a.width,height:_3a.height,left:_3a.left,top:_3a.top});
}
};
function _3c(e){
$.data(e.data.target,"resizable").options.onStartResize.call(e.data.target,e);
return false;
};
function _3d(e){
_34(e);
if($.data(e.data.target,"resizable").options.onResize.call(e.data.target,e)!=false){
_39(e);
}
return false;
};
function _3e(e){
_34(e,true);
_39(e);
$(d
- 1
- 2
- 3
前往页