📄 webhtmleditordocking.txt.exclude
字号:
MotionHanlderList[0]=new MotionHanlderMoveTo(MoveToObject);
MotionHanlderBatchHanlderObjcet = new Object();
MotionHanlderBatchHanlderObjcet.EffectsUpdateRate= this.EffectsUpdateRate;
MotionHanlderBatchHanlderObjcet.EffectsDuration = this.EffectsDuration;
MotionHanlderBatchHanlderObjcet.EffectsEndEvents = function (){if (obj.AllowShowDragHelperCopy){ obj.DragHandleElemOnClick(e); }};
MotionHanlderBatchHanlderObjcet.EffectsEndDeferEvents = function (){if (Cache_OnMouseOverDockingZone){Cache_OnMouseOverDockingZone.InsertBefore(obj); Cache_OnMouseOverDockingZone=null;}} ;
MotionHanlderBatchHanlderObjcet.MotionHanlderList = MotionHanlderList ;
new MotionHanlderBatchHanlder(MotionHanlderBatchHanlderObjcet);
}
else
{
this.MoveTo(rect.left, rect.top);
if (this.AllowShowDragHelperCopy)
{
this.DragHandleElemOnClick(e);
}
if (Cache_OnMouseOverDockingZone)
{
Cache_OnMouseOverDockingZone.InsertBefore(this);
Cache_OnMouseOverDockingZone=null;
}
}
}
DockableObjectEventHandler.prototype.Hide = function(elem,flag)
{
if (elem&&!elem.IsVisible)
{
elem.style.display=flag?"": "none";
}
}
DockableObjectEventHandler.prototype.GetDockableObjectChildNodeByAttribute = function(dockableObject,attribute, flag)
{
var aray=[];
if (null != dockableObject)
{
if (!flag&&null != dockableObject&&null != dockableObject.className&& dockableObject.className == attribute)
{
aray.push(dockableObject);
}
for (var i=0; i<dockableObject.childNodes.length; i++)
{
aray=aray.concat(this.GetDockableObjectChildNodeByAttribute(dockableObject.childNodes[i],attribute));
}
}
return aray;
}
DockableObjectEventHandler.prototype.Initialize = function()
{
var array = this.GetDockableObjectChildNodeByAttribute(this,"DragHandleHorizontal", true);
if(array.length==0)
{
array = this.GetDockableObjectChildNodeByAttribute(this,"DragHandleVertical", true);
}
if (array.length>0)
{
this.DragHandleElem=array[0];
this.DragHandleElem.IsVisible=(array[0].getAttribute("Bvisible")?array[0].getAttribute("Bvisible").toLowerCase() == "visible":false);
}
array=this.GetDockableObjectChildNodeByAttribute(this,"WheDockableObjectTitleBar", true);
if (array.length>0)
{
this.TitleGrip=array[0];
var visible=(array[0].getAttribute("Bvisible")?array[0].getAttribute("Bvisible").toLowerCase() == "visible":false);
if (this.TitleGrip.tagName == "TD"||this.TitleGrip.tagName == "TH")
{
this.TitleGrip=this.TitleGrip.parentNode;
}
this.TitleGrip.IsVisible=visible;
}
this.Hide(this.TitleGrip, true);
this.Hide(this.DragHandleElem, false);
array=this.GetDockableObjectChildNodeByAttribute(this,"WheDockableObjectCommandButton", true);
for (var i=0; i<array.length; i++)
{
array[i].ParentDockableObject=this ;
array[i].onclick= function (){this.ParentDockableObject.InsertBefore(); } ;
}
}
DockableObjectEventHandler.prototype.AlwayCheckChangeDockingModeEvent = function()
{
if (null != this.ParentDockingZone&&VerifyIndexOf(this.ParentDockingZone.DockingMode,"Vertical")&&null != this.ChangeVerticalEvent)
{
if (this.CurrentDockingModeIsVertical)
{
return;
}
try
{
if (typeof(this.ChangeVerticalEvent) == "function")
{
this.ChangeVerticalEvent();
}
else if (typeof(this.ChangeVerticalEvent) == "string")
{
eval(this.ChangeVerticalEvent);
}
}
catch (ex){}
this.CurrentDockingModeIsVertical= true;
}
else if (this.CurrentDockingModeIsVertical&&null != this.ChangeHorizontalEvent)
{
try
{
if (typeof(this.ChangeHorizontalEvent) == "function")
{
this.ChangeHorizontalEvent();
}
else if (typeof(this.ChangeHorizontalEvent) == "string")
{
eval(this.ChangeHorizontalEvent);
}
}
catch (ex){}
this.CurrentDockingModeIsVertical= false;
}
}
DockableObjectEventHandler.prototype.CheckDockableModeisDockingMode = function(dockingZone)
{
var dockableAttribute=this.getAttribute("dockable");
if ("string" == typeof(dockableAttribute))
{
dockableAttribute=dockableAttribute.toLowerCase();
}
if ("all" == dockableAttribute)
{
return true;
}
else
{
return (dockableAttribute == dockingZone.DockingMode.toLowerCase());
}
}
DockableObjectEventHandler.prototype.SetDefault = function()
{
this.ParentDockingZoneCopy=this.ParentDockingZone;
this.CanDragResize= false;
if (document.all&&"none" != this.style.display)
{
this.style.display="inline";
}
if (this.SimulateLayerSetVisible)
{
this.SimulateLayerSetVisible();
}
this.Hide(this.TitleGrip, false);
this.Hide(this.DragHandleElem, true);
this.AlwayCheckChangeDockingModeEvent();
if (this.Obo)
{
this.Obo();
}
}
function DockDragEventHandler(controller, effectsUpdateRate, effectsDuration, effectsEnable)
{
this.Controller = controller;
this.EffectsUpdateRate = effectsUpdateRate;
this.EffectsDuration = effectsDuration;
this.EffectsEnable = effectsEnable;
}
DockDragEventHandler.prototype.ShowDragHelperTooltip = function(e)
{
if (!Cache_SelectDockableObject)
{
return;
}
this.Controller.DragHelperTooltipElem = this.Controller.GetDragHelperTooltipObject(Cache_SelectDockableObject);
var rect,dragHelperToolipValue,x,y;
if (this.Controller.DragHelperElem)
{
rect=this.Controller.DragHelperElem.Bounds();
}
else
{
rect=this.Bounds();
}
this.Controller.SetWindowScroll(rect);
switch (this.DragMode)
{
case "move":
this.Controller.ShowDragHelperTooltip(e,rect, true);
break;
case "resize":
this.Controller.ShowDragHelperTooltip(e,rect, false);
break;
default:
return;
}
}
DockDragEventHandler.prototype.InsertBeforeDragHelperFrame = function()
{
if (this.InsertBeforeSimulateLayer)
{
this.InsertBeforeSimulateLayer();
}
}
DockDragEventHandler.prototype.Show = function(rect)
{
if (this.IsVisible())
{
return;
}
this.style.display=this.DisplayState?this.DisplayState: "";
if (null != rect)
{
this.SetPosition(rect);
}
this.SetzIndex();
if (this.InsertBeforeDragHelperFrame)
{
this.InsertBeforeDragHelperFrame();
}
}
DockDragEventHandler.prototype.WhereOnMouseUp = function(e)
{
if (!Cache_SelectDockableObject)
{
return;
}
if (!e)
{
e=window.event;
}
Cache_SelectDockableObject.MouseUpEvent(e);
}
var Cache_SelectDockableObject;
DockDragEventHandler.prototype.WhereOnMouseMove = function(e)
{
if (!Cache_SelectDockableObject)
{
return;
}
if (!e)
{
e=window.event;
}
Cache_SelectDockableObject.OnMouseOverEvent(e);
CancelEvent(e);
}
Cache_SelectDockableObjectRect=null ;
DockDragEventHandler.prototype.SetDocumentDragEvent = function(e)
{
this.clientX=e.clientX;
this.clientY=e.clientY;
this.Controller.Editor.attachEvent(document,"onmouseup",this.WhereOnMouseUp);
if (this.AllowMove)
{
this.Controller.Editor.attachEvent(document,"onmousemove",this.WhereOnMouseMove);
}
Cache_SelectDockableObject=this ;
Cache_SelectDockableObjectRect = this.Bounds();
if (this.AllowShowDragHelper)
{
this.Controller.DragHelperElem.Show(this.Bounds());
}
if (this.OnDragStart)
{
this.OnDragStart(e);
}
ShowScreenCacheImage();
this.ShowDragHelperTooltip(e);
window.status="";
}
DockDragEventHandler.prototype.Clear = function(e)
{
Cache_SelectDockableObject = null;
Cache_SelectDockableObjectRect = null;
HideScreenCacheImage();
this.Controller.Editor.detachEvent(document,"onmouseup",this.WhereOnMouseUp);
if (this.AllowMove)
{
this.Controller.Editor.detachEvent(document,"onmousemove",this.WhereOnMouseMove);
}
if (this.Controller.DragHelperElem)
{
this.Controller.DragHelperElem.Hide();
}
this.DragMode="";
window.status="";
if (this.Controller.DragHelperTooltipElem)
{
this.Controller.DragHelperTooltipElem.Hide();
this.Controller.DragHelperTooltipElem.innerHTML="";
this.Controller.DragHelperTooltipElem == null;
}
}
DockDragEventHandler.prototype.OnMouseOverEvent = function(e)
{
switch (this.DragMode)
{
case "move":
this.AccountMoveSize(e);
break;
case "resize":
this.OnResizeSize(e);
break;
}
this.clientX=e.clientX;
this.clientY=e.clientY;
this.ShowDragHelperTooltip(e);
}
DockDragEventHandler.prototype.IsDragMove = function()
{
return ("move" == this.DragMode);
}
DockDragEventHandler.prototype.IsDragResize = function()
{
return ("resize" == this.DragMode);
}
DockDragEventHandler.prototype.onmousemove = function(e)
{
if (!e)
{
e=window.event;
}
if (!this.IsDragResize()&&null != this.GetResizeSize)
{
this.ResizeSize=this.GetResizeSize(e);
this.style.cursor=this.ResizeSize;
}
if (!this.ResizeSize)
{
var source=GetSrcElement(e);
switch(source.className)
{
case "DragHandleVertical":
case "DragHandleHorizontal":
case "WheDockableObjectTitleBar":
this.style.cursor="move";
}
}
}
DockDragEventHandler.prototype.Bounds = function()
{
if (this == Cache_SelectDockableObject&&this.Controller.DragHelperElem&&this.Controller.DragHelperElem.IsVisible())
{
return GetObjectBounds(this.Controller.DragHelperElem);
}
else
{
return GetObjectBounds(this );
}
}
DockDragEventHandler.prototype.onmousedown = function(e)
{
if (!e)
{
e=window.event;
}
if (document.all&&e.button != 1)
{
return;
}
if (this.SetzIndex)
{
this.SetzIndex();
}
this.DragMode="";
if (this.CanResize&&this.ResizeSize)
{
this.DragMode="resize";
}
else if (this.CanMove)
{
var source=GetSrcElement(e);
switch(source.className)
{
case "DragHandleVertical":
case "DragHandleHorizontal":
case "WheDockableObjectTitleBar":
this.DragMode="move";
}
}
if ("" != this.DragMode)
{
this.SetDocumentDragEvent(e);
}
CancelEvent(e);
return false;
}
DockDragEventHandler.prototype.onmouseout = function(e)
{
if ("" != this.style.cursor)
{
this.style.cursor="";
}
}
DockDragEventHandler.prototype.IsVisible = function()
{
return (this.style.display != "none");
}
DockDragEventHandler.prototype.Hide = function()
{
if (!this.IsVisible())
{
return;
}
this.DisplayState=this.style.display;
this.style.display="none";
if (this.SimulateLayerSetVisible)
{
this.SimulateLayerSetVisible();
}
}
DockDragEventHandler.prototype.SetSize = function(width,height)
{
width=parseInt(width);
if (!isNaN(width)&&width>=0)
{
this.style["width"]=width+"px";
if (this.SimulateLayer)
{
this.SimulateLayer.style["width"]=width+"px";
}
}
height=parseInt(height);
if (!isNaN(height)&&height>=0)
{
this.style["height"]=height+"px";
if (this.SimulateLayer)
{
this.SimulateLayer.style["height"]=height+"px";
}
}
}
DockDragEventHandler.prototype.SetPosition = function(rect)
{
if (rect)
{
this.MoveTo(rect.left,rect.top);
this.SetSize(rect["width"],rect["height"]);
}
}
DockDragEventHandler.prototype.AccountMoveSize = function(e)
{
var x=e.clientX-this.clientX;
var y=e.clientY-this.clientY;
if (this.Controller.DragHelperElem)
{
this.Controller.DragHelperElem.MoveBy(x,y);
}
else
{
this.MoveBy(x,y);
}
}
DockDragEventHandler.prototype.MouseUpEvent = function(e)
{
var rect;
if (this.Controller.DragHelperElem)
{
var rect=this.Controller.DragHelperElem.Bounds();
}
this.Clear(e);
if (this.OnMouseUpEvent)
{
this.OnMouseUpEvent(e, rect);
}
}
DockDragEventHandler.prototype.MoveBy = function(x,y)
{
if (!this.MoveToX)
{
this.MoveToX=parseInt(this.style.left);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -