// (c) Copyright Microsoft Corporation. // This source is subject to the Microsoft Permissive License. // See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. // All other rights reserved. Type.registerNamespace("Telerik.Web"); Telerik.Web.IDragSource=function(){ }; Telerik.Web.IDragSource.prototype={get_dragDataType:function(){ throw Error.notImplemented(); },getDragData:function(){ throw Error.notImplemented(); },get_dragMode:function(){ throw Error.notImplemented(); },onDragStart:function(){ throw Error.notImplemented(); },onDrag:function(){ throw Error.notImplemented(); },onDragEnd:function(){ throw Error.notImplemented(); }}; Telerik.Web.IDragSource.registerInterface("Telerik.Web.IDragSource"); Telerik.Web.IDropTarget=function(){ }; Telerik.Web.IDropTarget.prototype={get_dropTargetElement:function(){ throw Error.notImplemented(); },canDrop:function(){ throw Error.notImplemented(); },drop:function(){ throw Error.notImplemented(); },onDragEnterTarget:function(){ throw Error.notImplemented(); },onDragLeaveTarget:function(){ throw Error.notImplemented(); },onDragInTarget:function(){ throw Error.notImplemented(); }}; Telerik.Web.IDropTarget.registerInterface("Telerik.Web.IDropTarget"); Telerik.Web.DragMode=function(){ throw Error.invalidOperation(); }; Telerik.Web.DragMode.prototype={Copy:0,Move:1}; Telerik.Web.DragMode.registerEnum("Telerik.Web.DragMode"); Telerik.Web.DragDropEventArgs=function(_1,_2,_3){ this._dragMode=_1; this._dataType=_2; this._data=_3; }; Telerik.Web.DragDropEventArgs.prototype={get_dragMode:function(){ return this._dragMode||null; },get_dragDataType:function(){ return this._dataType||null; },get_dragData:function(){ return this._data||null; }}; Telerik.Web.DragDropEventArgs.registerClass("Telerik.Web.DragDropEventArgs"); Telerik.Web._DragDropManager=function(){ this._instance=null; this._events=null; }; Telerik.Web._DragDropManager.prototype={add_dragStart:function(_4){ this.get_events().addHandler("dragStart",_4); },remove_dragStart:function(_5){ this.get_events().removeHandler("dragStart",_5); },get_events:function(){ if(!this._events){ this._events=new Sys.EventHandlerList(); } return this._events; },add_dragStop:function(_6){ this.get_events().addHandler("dragStop",_6); },remove_dragStop:function(_7){ this.get_events().removeHandler("dragStop",_7); },_getInstance:function(){ if(!this._instance){ if(Sys.Browser.agent===Sys.Browser.InternetExplorer){ this._instance=new Telerik.Web.IEDragDropManager(); }else{ this._instance=new Telerik.Web.GenericDragDropManager(); } this._instance.initialize(); this._instance.add_dragStart(Function.createDelegate(this,this._raiseDragStart)); this._instance.add_dragStop(Function.createDelegate(this,this._raiseDragStop)); } return this._instance; },startDragDrop:function(_8,_9,_a){ this._getInstance().startDragDrop(_8,_9,_a); },registerDropTarget:function(_b,_c){ this._getInstance().registerDropTarget(_b,_c); },unregisterDropTarget:function(_d){ this._getInstance().unregisterDropTarget(_d); },dispose:function(){ delete this._events; Sys.Application.unregisterDisposableObject(this); Sys.Application.removeComponent(this); },_raiseDragStart:function(_e,_f){ var _10=this.get_events().getHandler("dragStart"); if(_10){ _10(this,_f); } },_raiseDragStop:function(_11,_12){ var _13=this.get_events().getHandler("dragStop"); if(_13){ _13(this,_12); } }}; Telerik.Web._DragDropManager.registerClass("Telerik.Web._DragDropManager"); Telerik.Web.DragDropManager=new Telerik.Web._DragDropManager(); Telerik.Web.IEDragDropManager=function(){ Telerik.Web.IEDragDropManager.initializeBase(this); this._dropTargets=null; this._radius=10; this._activeDragVisual=null; this._activeContext=null; this._activeDragSource=null; this._underlyingTarget=null; this._oldOffset=null; this._potentialTarget=null; this._isDragging=false; this._mouseUpHandler=null; this._documentMouseMoveHandler=null; this._documentDragOverHandler=null; this._dragStartHandler=null; this._mouseMoveHandler=null; this._dragEnterHandler=null; this._dragLeaveHandler=null; this._dragOverHandler=null; this._dropHandler=null; }; Telerik.Web.IEDragDropManager.prototype={add_dragStart:function(_14){ this.get_events().addHandler("dragStart",_14); },remove_dragStart:function(_15){ this.get_events().removeHandler("dragStart",_15); },add_dragStop:function(_16){ this.get_events().addHandler("dragStop",_16); },remove_dragStop:function(_17){ this.get_events().removeHandler("dragStop",_17); },initialize:function(){ Telerik.Web.IEDragDropManager.callBaseMethod(this,"initialize"); this._mouseUpHandler=Function.createDelegate(this,this._onMouseUp); this._documentMouseMoveHandler=Function.createDelegate(this,this._onDocumentMouseMove); this._documentDragOverHandler=Function.createDelegate(this,this._onDocumentDragOver); this._dragStartHandler=Function.createDelegate(this,this._onDragStart); this._mouseMoveHandler=Function.createDelegate(this,this._onMouseMove); this._dragEnterHandler=Function.createDelegate(this,this._onDragEnter); this._dragLeaveHandler=Function.createDelegate(this,this._onDragLeave); this._dragOverHandler=Function.createDelegate(this,this._onDragOver); this._dropHandler=Function.createDelegate(this,this._onDrop); },dispose:function(){ if(this._dropTargets){ for(var i=0;i0){ this._scrollDeltaX=this._scrollDeltaY=0; if(ev.clientX<_7d.x+this._scrollEdgeConst){ this._scrollDeltaX=-this._scrollByConst; }else{ if(ev.clientX>_7d.width-this._scrollEdgeConst){ this._scrollDeltaX=this._scrollByConst; } } if(ev.clientY<_7d.y+this._scrollEdgeConst){ this._scrollDeltaY=-this._scrollByConst; }else{ if(ev.clientY>_7d.height-this._scrollEdgeConst){ this._scrollDeltaY=this._scrollByConst; } } if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){ this._scroller.set_enabled(true); }else{ this._scroller.set_enabled(false); } } },_onScrollerTick:function(){ var _7e=document.body.scrollLeft; var _7f=document.body.scrollTop; window.scrollBy(this._scrollDeltaX,this._scrollDeltaY); var _80=document.body.scrollLeft; var _81=document.body.scrollTop; var _82=this._activeDragVisual; var _83={x:parseInt(_82.style.left)+(_80-_7e),y:parseInt(_82.style.top)+(_81-_7f)}; TelerikCommonScripts.setLocation(_82,_83); }}; Telerik.Web.GenericDragDropManager.registerClass("Telerik.Web.GenericDragDropManager",Telerik.Web.IEDragDropManager); if(Sys.Browser.agent===Sys.Browser.Safari){ Telerik.Web.GenericDragDropManager.__loadSafariCompatLayer=function(ddm){ ddm._getScrollOffset=ddm.getScrollOffset; ddm.getScrollOffset=function(_85,_86){ return {x:0,y:0}; }; ddm._getBrowserRectangle=ddm.getBrowserRectangle; ddm.getBrowserRectangle=function(){ var _87=ddm._getBrowserRectangle(); var _88=ddm._getScrollOffset(document.body,true); return {x:_87.x+_88.x,y:_87.y+_88.y,width:_87.width+_88.x,height:_87.height+_88.y}; }; }; } if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();