RadEditorNamespace.Docking= {CurrentDockingZone:null,PendingDockingZonesArray: [ ],PendingDockableObjectsArray: [ ],MakeDockable:function (element,useDragHelper,useOverlay,resizable,useInternalMove,useTooltip){if (!element)return; this.RadMakeDockable(element,(null==useDragHelper? true :useDragHelper),(null==useOverlay? true :useOverlay),resizable,useInternalMove,useTooltip); this.RadTryDock(element); } ,RadTryDock:function (dockableObject){if (dockableObject.DockingZone)return; var dockingZone; var dockingZoneId=dockableObject.getAttribute("d\x6fcki\x6egzon\x65"); if (dockingZoneId){dockingZone=document.getElementById(dockingZoneId); }else if (dockableObject.parentNode.getAttribute("do\x63k\x69ng")){dockingZone=dockableObject.parentNode; }if (dockingZone && typeof(dockingZone.Dock)=="\x66\x75ncti\x6fn"){var dockingOrder=parseInt(dockableObject.getAttribute("dock\x69n\x67orde\x72")); if (isNaN(dockingOrder)){dockingOrder=null; }dockingZone.Dock(dockableObject,dockingOrder); }else if (dockableObject.parentNode!=document.body){if ("compl\x65t\x65"==document.readyState){dockableObject.parentNode.removeChild(dockableObject); document.body.appendChild(dockableObject); }if (dockableObject.ShowOverlay){dockableObject.ShowOverlay( ); }}} ,IsDocumentDockingReady: false ,PrepareDocumentForDocking:function (overlayImageUrl){if (overlayImageUrl){var overlayImage=this.GetOverlayImage( ); if (overlayImage){overlayImage.src=overlayImageUrl; }}if (this.IsDocumentDockingReady){return; }RadEditorNamespace.Utils.AttachEventEx(document,"\x6f\x6emou\x73emo\x76e",RadEditorNamespace.Docking.RadGlobalMouseMoveHandler); RadEditorNamespace.Utils.AttachEventEx(document,"\x6fn\x6beydo\x77n",RadEditorNamespace.Docking.RadGlobalKeyDownHandler); this.IsDocumentDockingReady= true; }} ; RadEditorNamespace.Docking.RadGlobalMouseMoveHandler= function (e){if (!RadEditorNamespace.Docking || !RadEditorNamespace.Docking.CurrentDragTarget)return; if (RadEditorNamespace.Docking.CurrentDragTarget.UseInternalMove)return; if (!e){e=window.event; }RadEditorNamespace.Docking.CurrentDragTarget.DoDrag(e); if (RadEditorNamespace.Docking.CurrentDragTarget.IsMoving( )){if (null==RadEditorNamespace.Docking.CurrentDragTarget.DockingZone || RadEditorNamespace.Docking.CurrentDragTarget.UndockOnDragEnd){RadEditorNamespace.Docking.CurrentDockingZone=null; var dockingZone; var oZones=RadEditorNamespace.Docking.DockingZones; for (var i=0; i<oZones.length; i++){dockingZone=oZones[i]; if (dockingZone.HitTest(RadEditorNamespace.Docking.CurrentDragTarget,null==RadEditorNamespace.Docking.CurrentDockingZone,e)){if (!RadEditorNamespace.Docking.CurrentDockingZone){RadEditorNamespace.Docking.CurrentDockingZone=dockingZone; }}}}else if (!RadEditorNamespace.Docking.CurrentDragTarget.UndockOnDragEnd){RadEditorNamespace.Docking.CurrentDragTarget.Undock(e); }}return RadEditorNamespace.Utils.CancelEvent(e); } ; RadEditorNamespace.Docking.RadGlobalKeyDownHandler= function (e){if (!RadEditorNamespace.Docking.CurrentDragTarget)return; if (!e){e=window.event; }if (27==e.keyCode){if (CurrentDockingZone){RadEditorNamespace.Docking.CurrentDockingZone.HitTest(RadEditorNamespace.Docking.CurrentDragTarget, false ,e); RadEditorNamespace.Docking.CurrentDockingZone=null; }RadEditorNamespace.Docking.CurrentDragTarget.CancelDrag(e); }} ;
RadEditorNamespace.Docking.WrapInDockingContainer= function (oElem,isVertical,renderHorizFn,renderVerticalFn,horizClassName,verticalClassName,oTitle){var doc=document; var oTable=doc.createElement("\x74\x61ble"); oTable.border=0; oTable.cellSpacing=0; oTable.cellPadding=0; oTable.setAttribute("\x75\x6esele\x63tab\x6ce","\x6f\x6e"); oTable.setAttribute("do\x63k\x61ble","all"); var oRow=oTable.insertRow(-1); var oCell=oRow.insertCell(-1); var oSpan=doc.createElement("\163pan"); oSpan.className="\x52\x61dA\x75toDo\x63kBu\x74ton"; oSpan.innerHTML="\x26n\x62sp;&\x6ebsp\x3b&nb\x73p;"; oSpan.setAttribute("\x61u\x74oDoc\x6b","\x74\x72u\x65"); oCell.appendChild(oSpan); oCell.innerHTML+=(oTitle?"&nbs\x70;"+oTitle: ""); oCell.colSpan=2; oCell.setAttribute("noW\x72\x61p","\x74r\x75e"); oCell.setAttribute("\x74\x69tl\x65Grip","\x61u\x74ohid\x65"); oCell.className="\x52a\x64ETit\x6ceGr\x69p"; oCell.parentNode.style.display="\x6e\x6fne"; var oRow=oTable.insertRow(-1); oCell=oRow.insertCell(-1); oCell.innerHTML="&n\x62\x73p;"; oCell.colSpan=2; oCell.setAttribute("\x74\x6fp\x53ideG\x72ip","autoh\x69\x64e"); oCell.className="\x52\x61dESi\x64eGr\x69pVe\x72ti\x63al"; oRow=oTable.insertRow(-1); oCell=oRow.insertCell(-1); oCell.innerHTML="&nbsp\x3b&\x6ebsp\x3b&nb\x73p;"; oCell.setAttribute("\x6c\x65ftS\x69deG\x72ip","\141utohi\x64e"); oCell.className="\x52a\x64ESid\x65Gri\x70Hor\x69zon\x74al"; oCell=oRow.insertCell(-1); oCell.appendChild(oElem); oTable.RenderHorizontal=renderHorizFn; oTable.RenderVertical=renderVerticalFn; oTable.HorizontalClassName=horizClassName; oTable.VerticalClassName=verticalClassName; var oDisplay=document.all && !window.opera?"\x69n\x6cine": ""; oTable.setAttribute("\x64\x69spl\x61y",oDisplay); if (document.all && !window.opera)oTable.style.display="\x69\x6eline"; else oTable.setAttribute("style","\x66\x6coa\x74:le\x66t"); return oTable; } ; RadEditorNamespace.Docking.DisposeDockingObjects= function ( ){try {var oLength=RadEditorNamespace.Docking.RadDockingObjects.length; for (var counter=0; counter<oLength; counter++){var obj=RadEditorNamespace.Docking.RadDockingObjects[counter]; obj.DockingZone=null; obj.LastDockingZone=null; var arr=RadEditorNamespace.Utils.GetElementsByAttributeName(obj,"aut\x6f\x64ock", true); for (var i=0; i<arr.length; i++){arr[i].DockableObject=null; arr[i].onclick=null; }var oCells=[obj.rows[0].cells[0],obj.rows[1].cells[0],obj.rows[2].cells[0]]; for (var i=0; i<oCells.length; i++){delTd=oCells[i]; if (delTd){delTd.style.display=""; delTd.parentNode.deleteCell(delTd); }}obj.onmousemove=null; obj.onmouseout=null; obj.onmousedown=null; obj.LeftSideGrip=null; obj.TopSideGrip=null; obj.Title=null; obj.RenderHorizontal=null; obj.RenderVertical=null; obj.HorizontalClassName=null; obj.VerticalClassName=null; obj.CanDockTo=null; obj.CancelDrag=null; obj.AutoDock=null; obj.EndDrag=null; obj.FixLayout=null; obj.GetRect=null; obj.GripHitTest=null; obj.Hide=null; obj.HideOverlay=null; obj.Initialize=null; obj.IsDocked=null; obj.IsMoving=null; obj.IsOverlayVisible=null; obj.IsResizing=null; obj.IsVisible=null; obj.Nove=null; obj.NoveBy=null; obj.NoveTo=null; obj.OnDragEnd=null; obj.OnHide=null; obj.OnShow=null; obj.SetOnTop=null; obj.SetPosition=null; obj.SetSize=null; obj.Show=null; obj.ShowGrip=null; obj.ShowOverlay=null; obj.StartDrag=null; obj.Undock=null; obj.Overlay=null; }RadEditorNamespace.Docking.RadDockingObjects=null; }catch (e){}} ; RadEditorNamespace.Docking.RadDockingObjects=[ ]; RadEditorNamespace.Docking.RadMakeDockable= function (obj,useDragHelper,useOverlay,resizable,useInternalMove,useTooltip){if (!obj || obj.Undock)return; this.MakeMoveable(obj,useDragHelper,useOverlay,resizable,( true ==useTooltip),useTooltip); RadEditorNamespace.Utils.ExtendObject(obj,RadEditorNamespace.Docking.RadDockableObject); obj.UndockOnDragEnd=useDragHelper; if (!obj.RenderVertical){var attr=obj.getAttribute("r\x65nde\x72Vert\x69cal"); obj.RenderVertical=(attr?attr:RadEditorNamespace.Docking.RenderVertical); }if (!obj.RenderHorizontal){var attr=obj.getAttribute("\x72\x65n\x64erHo\x72izo\x6etal"); obj.RenderHorizontal=(attr?attr:RadEditorNamespace.Docking.RenderHorizontal); }obj.DockingZone=null; if (obj.Initialize){obj.Initialize( ); }var oDockArray=RadEditorNamespace.Docking.RadDockingObjects; oDockArray[oDockArray.length]=obj; } ; RadEditorNamespace.Docking.RadDockableObject= {OnDock:null,OnUndock:null,UndockOnDragEnd: true ,OnDragEnd:function (e){if (this.UndockOnDragEnd){ this.Undock(e); }if (RadEditorNamespace.Docking.CurrentDockingZone){RadEditorNamespace.Docking.CurrentDockingZone.Dock(this ); RadEditorNamespace.Docking.CurrentDockingZone=null; }} ,CanDockTo:function (dockingZone){var dockableMode=this.getAttribute("\144\x6fcka\x62le"); if ("st\x72i\x6eg"==typeof(dockableMode)){dockableMode=dockableMode.toLowerCase( ); }if ("\x61l\x6c"==dockableMode){return true; }else {return (dockableMode==dockingZone.DockType.toLowerCase( )); }} ,OnShow:function ( ){if (this.ShowOverlay && !this.IsDocked( )){ this.ShowOverlay( ); }} ,Docked:function ( ){ this.LastDockingZone=this.DockingZone; this.EnableResize= false; if (document.all && "\x6e\x6fne"!=this.style.display){ this.style.display="\x69\x6eline"; }if (this.HideOverlay){ this.HideOverlay( ); } this.ShowGrip(this.Title, false); this.ShowGrip(this.LeftSideGrip,!this.IsVertical); this.ShowGrip(this.TopSideGrip,this.IsVertical); this.FixLayout( ); if (this.OnDock){ this.OnDock( ); }} ,Undock:function (e){if (!this.DockingZone)return; this.DockingZone=null; this.EnableResize= true; this.parentNode.removeChild(this ); this.style.position="\x61\x62sol\x75te"; this.ShowGrip(this.Title, true); this.ShowGrip(this.LeftSideGrip, false); this.ShowGrip(this.TopSideGrip, false); document.body.appendChild(this ); this.SetOnTop( ); if (this.ShowOverlay){ this.ShowOverlay( ); }if (this.OnUndock){ this.OnUndock( ); }} ,AutoDock:function ( ){if (!this.LastDockingZone)return; this.LastDockingZone.Dock(this ); } ,IsDocked:function ( ){return (null!=this.DockingZone); } ,FixLayout:function ( ){if (null!=this.DockingZone && RadEditorNamespace.Utils.StartsWith(this.DockingZone.DockType,"vert") && null!=this.RenderVertical){if (this.IsVertical)return; try {if (this.TopSideGrip)this.TopSideGrip.style.display=""; if (this.LeftSideGrip)this.LeftSideGrip.style.display="\x6e\x6fne"; this.className=this.VerticalClassName; if (typeof(this.RenderVertical)=="func\x74i\x6fn"){ this.RenderVertical( ); }else if (typeof(this.RenderVertical)=="strin\x67"){eval(this.RenderVertical); }}catch (ex){} this.IsVertical= true; }else if (this.IsVertical && null!=this.RenderHorizontal){try {if (this.TopSideGrip)this.TopSideGrip.style.display="\156one"; if (this.LeftSideGrip)this.LeftSideGrip.style.display=""; this.className=this.HorizontalClassName; if (typeof(this.RenderHorizontal)=="func\x74i\x6fn"){ this.RenderHorizontal( ); }else if (typeof(this.RenderHorizontal)=="st\x72i\x6eg"){eval(this.RenderHorizontal); }}catch (ex){} this.IsVertical= false; }} ,GripHitTest:function (e){var source=RadEditorNamespace.Utils.GetEventSource(e); return (null!=source && (null!=source.getAttribute("\x67\x72i\x70") || null!=source.getAttribute("t\x69t\x6cegri\x70") || null!=source.getAttribute("tops\x69\x64egri\x70") || null!=source.getAttribute("\x6ce\x66tsid\x65gri\x70"))); } ,Initialize:function ( ){var arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"lef\x74S\x69deGr\x69p", true); if (arr.length>0){ this.LeftSideGrip=arr[0]; this.LeftSideGrip.AlwaysVisible=(arr[0].getAttribute("l\x65\x66tSide\x47rip").toLowerCase( )=="\x76i\x73ible"); }arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"\x74\x6fpSi\x64eGr\x69p", true); if (arr.length>0){ this.TopSideGrip=arr[0]; this.TopSideGrip.AlwaysVisible=(arr[0].getAttribute("\x74\x6fpSid\x65Gri\x70").toLowerCase( )=="visi\x62l\x65"); }arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"\x74\x69tleG\x72ip", true); if (arr.length>0){ this.Title=arr[0]; var isAlwaysVisible=(arr[0].getAttribute("ti\x74\x6ceGrip").toLowerCase( )=="vis\x69b\x6ce"); if (this.Title.tagName=="\124D" || this.Title.tagName=="\x54\x48"){ this.Title=this.Title.parentNode; } this.Title.AlwaysVisible=isAlwaysVisible; } this.ShowGrip(this.Title, true); this.ShowGrip(this.LeftSideGrip, false); this.ShowGrip(this.TopSideGrip, false); arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"au\x74o\x64ock", true); for (var i=0; i<arr.length; i++){arr[i].DockableObject=this ; arr[i].onclick= function ( ){ this.DockableObject.AutoDock( ); } ; }} ,ShowGrip:function (gripElement,bShow){if (gripElement && !gripElement.AlwaysVisible){gripElement.style.display=bShow?"": "n\x6fn\x65"; }}} ;
RadEditorNamespace.Docking.Rectangle= function (left,top,width,height){ this.left=(null!=left?left: 0); this.top=(null!=top?top: 0); this.width=(null!=width?width: 0); this.height=(null!=height?height: 0); this.right=left+width; this.bottom=top+height; };RadEditorNamespace.Docking.Rectangle.prototype.Clone= function ( ){return new RadEditorNamespace.Docking.Rectangle(this.left,this.top,this.width,this.height); } ; RadEditorNamespace.Docking.Rectangle.prototype.PointInRect= function (x,y){return (this.left<=x && x<=(this.left+this.width) && this.top<=y && y<=(this.top+this.height)); } ; RadEditorNamespace.Docking.Rectangle.prototype.Intersects= function (rect){if (null==rect)return false; if (this ==rect)return true; return (rect.left<this.right && rect.top<this.bottom && rect.right>this.left && rect.bottom>this.top); } ; RadEditorNamespace.Docking.Rectangle.prototype.ToString= function ( ){return "le\x66\164\x3a"+this.left+" "+"\162\151\x67ht\x3a"+this.right+"\x20"+"top\x3a"+this.top+" "+"\x62\x6fttom\x3a"+this.bottom+" "+"\x28"+this.width+"\x20\x78 "+this.height+")"; } ; RadEditorNamespace.Docking.Rectangle.prototype.Intersection= function (rect){if (null==rect)return false; if (this ==rect)return this.Clone( ); if (!this.Intersects(rect))return new RadEditorNamespace.Docking.Rectangle( ); var left=Math.max(this.left,rect.left); var top=Math.max(this.top,rect.top); var right=Math.min(this.right,rect.right); var bottom=Math.min(this.bottom,rect.bottom); return new RadEditorNamespace.Docking.Rectangle(left,right,right-left,bottom-top); } ; RadEditorNamespace.Docking.RadGetElementRect= function (element){if (!element){element=this ; }var left=0; var top=0; var width=element.offsetWidth; var height=element.offsetHeight; while (element.offsetParent){left+=element.offsetLeft; top+=element.offsetTop; element=element.offsetParent; }if (element.x)left=element.x; if (element.y)top=element.y; left=RadEditorNamespace.Utils.GetIntValue(left,0); top=RadEditorNamespace.Utils.GetIntValue(top,0); width=RadEditorNamespace.Utils.GetIntValue(width,0); height=RadEditorNamespace.Utils.GetIntValue(height,0); return new RadEditorNamespace.Docking.Rectangle(left,top,width,height); };RadEditorNamespace.Docking.GetScrollTop= function ( ){if (document.documentElement && document.documentElement.scrollTop){return document.documentElement.scrollTop; }else {return document.body.scrollTop; }} ; RadEditorNamespace.Docking.GetScrollLeft= function ( ){if (document.documentElement && document.documentElement.scrollLeft){return document.documentElement.scrollLeft; }else {return document.body.scrollLeft; }} ;
RadEditorNamespace.Docking.DockingZones=[ ]; RadEditorNamespace.Docking.RadRegisterDockingZone= function (obj,dockType){if (!obj)return; RadEditorNamespace.Utils.ExtendObject(obj,RadEditorNamespace.Docking.DockingZone); if (!dockType){dockType=obj.getAttribute("\144\x6fck\x69ng"); }obj.DockType=(dockType?dockType: "\x68\x6fri\x7a"); RadEditorNamespace.Docking.DockingZones.push(obj); };RadEditorNamespace.Docking.DockingZone= {Dock:function (dockingObject,dockingOrder){if (this ==dockingObject.DockingZone)return; if (null==dockingObject.getAttribute("do\x63k\x61ble")){alert("Error\x3a \x59ou \x61re \x74ryi\x6eg\x20to \x64oc\x6b no\x6e-d\x6fc\x6bab\x6ce\x20o\x62j\x65ct"); return; }if (!dockingObject.CanDockTo(this )){alert("\x45\x72ror:\x20You\x20are\x20no\x74 al\x6cowe\x64 t\x6f do\x63k\x20\047"+dockingObject.id+"\047 \x74o \x27"+this.id+"\x27\x20d\x6fckin\x67 z\x6fne"); return; }dockingObject.DockingZone=this ; dockingObject.parentNode.removeChild(dockingObject); dockingObject.style.position=""; var insertBeforeObject; if (null!=dockingOrder){insertBeforeObject=this.FindPosByDockingOrder(dockingOrder); }else {insertBeforeObject=(this.HoverElement!=this ?this.HoverElement:null); }if (insertBeforeObject){ this.insertBefore(dockingObject,insertBeforeObject); }else { this.appendChild(dockingObject); } this.HighlightElement(this.HoverElement, false); this.HoverElement=null; dockingObject.Docked( ); } ,HitTest:function (dockingObject,toHighlight,eventArgs){if (!dockingObject.CanDockTo(this ))return false; if (null==toHighlight)toHighlight= true; var dockingObjectRect=dockingObject.GetRect( ); var zoneRect=this.GetRect( ); var parLeft=RadEditorNamespace.Docking.GetScrollLeft( ); var parTop=RadEditorNamespace.Docking.GetScrollTop( ); var mouseX=eventArgs.clientX+parLeft; var mouseY=eventArgs.clientY+parTop; var zoneHit=this.GetRect( ).PointInRect(mouseX,mouseY); this.HoverElement=null; var node; for (var i=0; i<this.childNodes.length; i++){node=this.childNodes[i]; if (1!=node.nodeType)continue; if (!node.DockingZone)continue; if (node==dockingObject)continue; if (!this.HoverElement && zoneHit && node.GetRect( ).PointInRect(mouseX,mouseY)){ this.HoverElement=node; } this.HighlightElement(node,toHighlight && node==this.HoverElement); }if (!this.HoverElement){ this.HoverElement=(zoneHit?this :null); } this.HighlightElement(this,toHighlight && this ==this.HoverElement); return zoneHit; } ,HighlightElement:function (element,toHighlight){if (!element)return; if (toHighlight && null==element.OldCss){element.OldCss=element.style.cssText; element.style.border="\x31\x70x \x64ash\x65d #\x36666\x366"; }else if (!toHighlight && null!=element.OldCss){element.style.cssText=element.OldCss; element.OldCss=null; }} ,FindPosByDockingOrder:function (dockingOrder){if (0<=dockingOrder && dockingOrder<this.childNodes.length){return this.childNodes[dockingOrder]; }return null; } ,GetRect:function ( ){return RadEditorNamespace.Docking.RadGetElementRect(this ); }} ;
RadEditor.prototype.FindModuleByTitle= function (sTitle){var module; for (var j=0; j<this.Modules.length; j++){module=this.Modules[j]; if (module.Title==sTitle){return module; }}return null; } ; RadEditor.prototype.InitDocking= function ( ){if (!this.EnableDocking)return; var dockingZones=this.DockingZones; for (var item in dockingZones){var oItem=dockingZones[item]; if (oItem && oItem.tagName!=null){RadEditorNamespace.Docking.RadRegisterDockingZone(oItem); }}RadEditorNamespace.Docking.PrepareDocumentForDocking(this.SkinBasePath+"\102\x75tt\x6fns/t\x72an\x73p.g\x69f"); } ; RadEditor.prototype.SerializeCookieName="\x52\x61dEdi\x74orG\x6coba\x6cSer\x69al\x69zeC\x6foki\x65"; RadEditor.prototype.SetCookie= function (sName,sValue){sName="\x5b"+this.Id+sName+"]"; var stringToSplit=this.getOnlyCookie(this.SerializeCookieName); var begStr=""; var endStr=""; if (stringToSplit){var array=stringToSplit.split(sName); if (array && array.length>1){begStr=array[0]; endStr=array[1].substr(array[1].indexOf("#")+1); }else endStr=stringToSplit; }var today=new Date( ); today.setFullYear(today.getFullYear( )+10); document.cookie=this.SerializeCookieName+"="+(begStr+sName+"-"+sValue+"#"+endStr)+"\x3b\x70ath\x3d/;e\x78pir\x65s="+today.toUTCString( )+";"; } ; RadEditor.prototype.GetCookie= function (sName){sName="["+this.Id+sName+"]"; var cook=this.getOnlyCookie(this.SerializeCookieName); if (!cook)return null; var sValue=null; var index=cook.indexOf(sName); if (index>=0){var endIndex=index+sName.length+1; sValue=cook.substring(endIndex,cook.indexOf("\043",endIndex)); }return sValue; } ; RadEditor.prototype.getOnlyCookie= function (sName){var aCookie=document.cookie.split("\x3b\x20"); for (var i=0; i<aCookie.length; i++){var aCrumb=aCookie[i].split("\x3d"); if (sName==aCrumb[0])return aCrumb[1]; }return null; } ; RadEditor.prototype.private_Serialize= function (isStoring){if (!this.EnableClientSerialize || !this.EnableDocking)return; if (isStoring){if (this.IsToolbarModeEnabled(RadEditorNamespace.ToolbarModesEnum.Default)){var str="\x5b"; var needSeparator= false; var toolbar; var toolbarTables=this.GetHtmlToolbarElements( ); for (var i=0; i<toolbarTables.length; i++){toolbar=toolbarTables[i]; var oTitle=escape(toolbar.getAttribute("ti\x74\x6ce")); var tmp=this.PersistDockableObject(toolbar,oTitle, true); if (tmp){if (needSeparator){str+="\x2c"; }str+=tmp; needSeparator= true; }}str+="]"; this.SetCookie("\124oolba\x72s",str); }str="\x5b"; needSeparator= false; var module; for (var i=0; i<this.Modules.length; i++){module=this.Modules[i]; var tmp=this.PersistDockableObject(module.GetTopElement( ),module.Title,module.IsEnabled); if (tmp){if (needSeparator){str+=","; }str+=tmp; needSeparator= true; }}str+="]"; this.SetCookie("\115odul\x65s",str); }else {if (this.IsToolbarModeEnabled(RadEditorNamespace.ToolbarModesEnum.Default)){var str=this.GetCookie("\x54\x6fol\x62ars"); if (null!=str){var restoreInfo,toolbar; var toolbars=this.GetHtmlToolbarElements( ); var arrRestoreInfo=eval(str); for (var i=0; i<arrRestoreInfo.length; i++){restoreInfo=arrRestoreInfo[i]; var oTitle=unescape(restoreInfo[0]); toolbar=this.FindToolbarByTitle(toolbars,oTitle); if (!toolbar)continue; this.RestoreDockableObject(toolbar,restoreInfo); }}}var str=this.GetCookie("\x4d\x6fd\x75les"); if (null!=str){var restoreInfo,module; var arrRestoreInfo=eval(str); for (var i=0; i<arrRestoreInfo.length; i++){restoreInfo=arrRestoreInfo[i]; module=this.FindModuleByTitle(restoreInfo[0]); if (!module)continue; var isVisible=this.RestoreDockableObject(module.GetTopElement( ),restoreInfo); module.SetEnabled(isVisible); }}}} ; RadEditor.prototype.FindToolbarByTitle= function (toolbars,sTitle){for (var j=0; j<toolbars.length; j++){var toolbar=toolbars[j]; if (toolbar.getAttribute("\x74\x69t\x6ce")==sTitle){return toolbar; }}return null; } ; RadEditor.prototype.PersistDockableObject= function (dockableObject,title,isVisible){if (!dockableObject || !dockableObject.Undock)return null; var dockingZone=dockableObject.DockingZone; var str="\x5b"; str+="\047"+title+"\x27"; var isReallyVisible=( false !=isVisible)? true : false; str+="\x2c"+isReallyVisible; var dZoneId=dockingZone?dockingZone.id: ""; if (!dockingZone && dockableObject.DockingZoneId)dZoneId=dockableObject.DockingZoneId; str+="\x2c"+"\047"+(dZoneId)+"\047"; if (null!=dockingZone){for (var j=0; j<dockingZone.childNodes.length; j++){if (dockableObject==dockingZone.childNodes[j]){str+=("\x2c"+j); break; }}}else {str+=","; var rc=dockableObject.GetRect( ); str+=RadEditorNamespace.Utils.Format("\x5b\x7b0}\x2c{1}\x5d",rc.left,rc.top); }str+="]"; return str; } ; RadEditor.prototype.RestoreDockableObject= function (dockableObject,restoreInfo){if (!dockableObject || !dockableObject.Undock)return null; var title=restoreInfo[0]; var isVisible=restoreInfo[1]; var dockingZoneId=restoreInfo[2]; var dockingOrder=null; var left=null; var top=null; if (dockingZoneId){dockingOrder=restoreInfo[3]; }else {left=restoreInfo[3][0]; top=restoreInfo[3][1]; }if ( false ==isVisible)dockableObject.Hide( ); else dockableObject.Show( ); if (""==dockingZoneId){dockableObject.Undock( ); dockableObject.MoveTo(left,top); }else if (null!=(dockingZone=document.getElementById(dockingZoneId)) && null!=dockingZone.Dock){dockingZone.Dock(dockableObject,dockingOrder); }return isVisible; } ;
RadEditorNamespace.Docking.CurrentDragTarget=null; RadEditorNamespace.Docking.MakeMoveable= function (obj,useDragHelper,useOverlay,resizable,useInternalMove,useTooltip){if (!obj || obj.Move)return; RadEditorNamespace.Utils.ExtendObject(obj,RadEditorNamespace.Docking.RadMoveableObject); if (resizable!= false){RadEditorNamespace.Utils.ExtendObject(obj,RadEditorNamespace.Docking.ResizableObject); obj.InitResize( ); }obj.onmouseout= function (e){if (""!=this.style.cursor){ this.style.cursor=""; }} ; obj.onmousedown= function (e){if (!e){e=window.event; }if (document.all && !window.opera && e.button!=1){return; }if (this.SetOnTop)this.SetOnTop( ); this.DragMode=""; if (this.AllowResize && this.ResizeDir){ this.DragMode="\x72es\x69ze"; }else if (this.AllowMove && this.GripHitTest(e)){ this.DragMode="\x6d\x6fve"; }if (""!=this.DragMode){ this.StartDrag(e); }RadEditorNamespace.Utils.CancelEvent(e); return false; } ; obj.onmousemove= function (e){if (!e){e=window.event; }if (!this.IsResizing( ) && null!=this.CalcResizeDir){ this.ResizeDir=this.CalcResizeDir(e); this.style.cursor=this.ResizeDir; }if (!this.ResizeDir && this.GripHitTest(e)){ this.style.cursor="mov\x65"; }} ; var agent=navigator.userAgent.toLowerCase( ); if (useOverlay!= false && null!=document.all && agent.indexOf("ms\x69e\x207.0")==-1){ this.EnableOverlay(obj); }obj.UseDragHelper=(useDragHelper!= false); obj.UseInternalMove=( false !=useInternalMove); } ; RadEditorNamespace.Docking.RadMoveableObject= {OnDragStart:null,OnDragEnd:null,AllowMove: true ,AllowResize: true ,UseDragHelper: true ,UseInternalMove: true ,StartDrag:function (eventArgs){ this.MouseX=eventArgs.clientX; this.MouseY=eventArgs.clientY; RadEditorNamespace.Utils.AttachEventEx(document,"\x6f\x6emous\x65up",RadEditorNamespace.Docking.GeneralMouseUp); if (this.UseInternalMove){RadEditorNamespace.Utils.AttachEventEx(document,"\x6f\x6emou\x73emo\x76e",RadEditorNamespace.Docking.GeneralMouseMove); RadEditorNamespace.Utils.AttachEventEx(document,"onke\x79d\x6fwn",RadEditorNamespace.Docking.GeneralKeyDown); }RadEditorNamespace.Docking.CurrentDragTarget=this ; if (this.UseDragHelper){ this.DragHelper=RadEditorNamespace.Docking.GetGlobalDragHelper( ); this.DragHelper.Show(this.GetRect( )); }if (this.OnDragStart){ this.OnDragStart(eventArgs); }RadEditorNamespace.Docking.ShowOverlayImage(this ); window.status="\x48\x69t\x20Esc \x74o c\x61nce\x6c"; } ,EndDrag:function (eventArgs){if (this.DragHelper){var rc=this.DragHelper.GetRect( ); this.MoveTo(rc.left,rc.top); if ("res\x69\x7ae"==this.DragMode){ this.SetSize(rc.width,rc.height); }} this.CancelDrag(eventArgs); if (this.OnDragEnd){ this.OnDragEnd(eventArgs); }} ,CancelDrag:function (eventArgs){RadEditorNamespace.Docking.CurrentDragTarget=null; RadEditorNamespace.Docking.HideOverlayImage( ); RadEditorNamespace.Utils.DetachEventEx(document,"onmou\x73\x65up",RadEditorNamespace.Docking.GeneralMouseUp); if (this.UseInternalMove){RadEditorNamespace.Utils.DetachEventEx(document,"onmou\x73e\x6dove",RadEditorNamespace.Docking.GeneralMouseMove); RadEditorNamespace.Utils.DetachEventEx(document,"onk\x65\x79down",RadEditorNamespace.Docking.GeneralKeyDown); }if (this.DragHelper){ this.DragHelper.Hide( ); this.DragHelper=null; } this.DragMode=""; window.status=""; if (this.Tooltip){ this.Tooltip.Hide( ); }} ,DoDrag:function (eventArgs){switch (this.DragMode){case "mo\x76\x65": this.Move(eventArgs); break; case "\x72\x65siz\x65": this.Resize(eventArgs); break; } this.MouseX=eventArgs.clientX; this.MouseY=eventArgs.clientY; } ,GripHitTest:function (eventArgs){var source=RadEditorNamespace.Utils.GetEventSource(eventArgs); return (null!=source && null!=source.getAttribute("g\x72i\x70")); } ,Move:function (eventArgs){var dX=eventArgs.clientX-this.MouseX; var dY=eventArgs.clientY-this.MouseY; if (this.DragHelper){ this.DragHelper.MoveBy(dX,dY); }else { this.MoveBy(dX,dY); }} ,MoveBy:function (dX,dY){if (!this.Left){ this.Left=parseInt(this.style.left); }if (!this.Top){ this.Top=parseInt(this.style.top); } this.MoveTo(this.Left+dX,this.Top+dY); } ,MoveTo:function (x,y){ this.Left=x; this.Top=y; this.style.position="abso\x6c\x75te"; this.style.left=this.Left+"\x70\x78"; this.style.top=this.Top+"p\x78"; if (this.NeedOverlay){ this.SetOverlayIframe( ); this.NeedOverlay= false; }if (this.Overlay){if (this.Overlay.style.display=="\x6eo\x6ee"){} this.Overlay.style.top=this.style.top; this.Overlay.style.left=this.style.left; }} ,SetSize:function (width,height){width=parseInt(width); if (!isNaN(width) && width>=0){ this.style.width=width+"px"; if (this.Overlay){ this.Overlay.style.width=width+"px"; }}height=parseInt(height); if (!isNaN(height) && height>=0){ this.style.height=height+"\x70\170"; if (this.Overlay){ this.Overlay.style.height=height+"\x70\x78"; }}if (this.OnResize && "fu\x6ec\x74ion"==typeof(this.OnResize))this.OnResize( ); } ,GetRect:function ( ){if (this ==RadEditorNamespace.Docking.CurrentDragTarget && this.DragHelper && this.DragHelper.IsVisible( )){return RadEditorNamespace.Docking.RadGetElementRect(this.DragHelper); }else {return RadEditorNamespace.Docking.RadGetElementRect(this ); }} ,SetPosition:function (rect){if (rect){ this.MoveTo(rect.left,rect.top); this.SetSize(rect.width,rect.height); }} ,SetOnTop:function ( ){var maxZIndex=0; var zIndex=0; var siblings=this.parentNode.childNodes; var node; for (var i=0; i<siblings.length; i++){node=siblings[i]; if (1!=node.nodeType)continue; zIndex=parseInt(node.style.zIndex); if (zIndex>maxZIndex){maxZIndex=zIndex; }} this.style.zIndex=maxZIndex+1; } ,Show:function (rect){if (this.IsVisible( ))return; this.style.display=this.OldDisplayMode?this.OldDisplayMode: ""; if (null!=rect){ this.SetPosition(rect); } this.SetOnTop( ); if (this.OnShow){ this.OnShow( ); }} ,Hide:function ( ){if (!this.IsVisible( ))return; this.OldDisplayMode=this.style.display; this.style.display="\156o\x6ee"; if (this.OnHide){ this.OnHide( ); }} ,OnShow:function ( ){if (this.ShowOverlay){ this.ShowOverlay( ); }} ,OnHide:function ( ){if (this.HideOverlay){ this.HideOverlay( ); }} ,IsVisible:function ( ){return (this.style.display!="none"); } ,IsResizing:function ( ){return ("\x72e\x73ize"==this.DragMode); } ,IsMoving:function ( ){return ("\x6do\x76e"==this.DragMode); }} ; RadEditorNamespace.Docking.GeneralMouseUp= function (eventArgs){if (!RadEditorNamespace.Docking.CurrentDragTarget)return; if (!eventArgs){eventArgs=window.event; }RadEditorNamespace.Docking.CurrentDragTarget.EndDrag(eventArgs); } ; RadEditorNamespace.Docking.GeneralMouseMove= function (eventArgs){if (!RadEditorNamespace.Docking.CurrentDragTarget)return; if (!eventArgs){eventArgs=window.event; }RadEditorNamespace.Docking.CurrentDragTarget.DoDrag(eventArgs); RadEditorNamespace.Utils.CancelEvent(eventArgs); } ; RadEditorNamespace.Docking.GeneralKeyDown= function (eventArgs){if (!RadEditorNamespace.Docking.CurrentDragTarget)return; if (!eventArgs){eventArgs=window.event; }if (27==eventArgs.keyCode){RadEditorNamespace.Docking.CurrentDragTarget.CancelDrag(eventArgs); }} ; RadEditorNamespace.Docking.GlobalDragHelper=null; RadEditorNamespace.Docking.GetGlobalDragHelper= function ( ){if (RadEditorNamespace.Docking.GlobalDragHelper){return RadEditorNamespace.Docking.GlobalDragHelper; }var dragHelper=document.createElement("\x44\x49V"); document.body.appendChild(dragHelper); dragHelper.setAttribute("\x73\x74y\x6ce","-moz\x2do\x70acit\x79:0.\x33"); dragHelper.style.border="1px \x64\x61shed\x20gra\x79"; dragHelper.style.backgroundColor="\x23\x63ccc\x63c"; dragHelper.style.filter="p\x72\x6fgid:D\x58Ima\x67eTr\x61n\x73fo\x72m.M\x69cro\x73of\x74.\x41lp\x68a\x28o\x70a\x63it\x79=\x350\x29"; dragHelper.style.margin="\x30\x70x 0p\x78 0p\x78 0p\x78"; dragHelper.style.padding="0px"; dragHelper.style.position="\x61\x62sol\x75te"; dragHelper.style.top=10; dragHelper.style.left=10; dragHelper.style.width=100; dragHelper.style.height=100; dragHelper.style.zIndex=50000; dragHelper.style.overflow="hidd\x65n"; dragHelper.style.display="\x6e\x6fne"; RadEditorNamespace.Docking.MakeMoveable(dragHelper, false , false , true); RadEditorNamespace.Docking.GlobalDragHelper=dragHelper; return dragHelper; } ; RadEditorNamespace.Docking.EnableOverlay= function (obj){obj.SetOverlayIframe= function ( ){var frm=document.createElement("I\x46R\x41ME"); frm.src="ja\x76a\x73crip\x74:fa\x6cse"; frm.frameBorder=0; frm.scrolling="no"; frm.style.overflow="\x68\x69dde\x6e"; frm.style.display="i\x6e\x6cine"; frm.style.position="\141bso\x6cute"; try {var rect=this.GetRect( ); frm.style.width=rect.width; frm.style.height=rect.height; frm.style.left=rect.left; frm.style.top=rect.top; }catch (ex){} this.parentNode.insertBefore(frm,this ); this.Overlay=frm; } ; obj.ShowOverlay= function ( ){if (this.Overlay){ this.parentNode.insertBefore(this.Overlay,this ); this.Overlay.style.display="\x69\x6eline"; this.Overlay.style.position="\141bsol\x75te"; var rect=this.GetRect( ); this.Overlay.style.width=rect.width; this.Overlay.style.height=rect.height; this.Overlay.style.left=rect.left; this.Overlay.style.top=rect.top; }} ; obj.HideOverlay= function ( ){if (null!=this.Overlay && null!=this.Overlay.parentNode){ this.Overlay.parentNode.removeChild(this.Overlay); this.Overlay.style.display="n\x6fn\x65"; }} ; obj.IsOverlayVisible= function ( ){return (this.Overlay && this.Overlay.style.display!="non\x65"); } ; obj.NeedOverlay= true; } ; RadEditorNamespace.Docking.OverlayImage=null; RadEditorNamespace.Docking.GetOverlayImage= function ( ){if (!RadEditorNamespace.Docking.OverlayImage){var img=document.createElement("\x49\x4dG"); img.style.display="n\x6fn\x65"; img.setAttribute("uns\x65l\x65ctab\x6ce","\x6f\x6e"); var RadCancelEvent= function ( ){return false; } ; img.onselectstart=RadCancelEvent; img.ondragstart=RadCancelEvent; img.onmouseover=RadCancelEvent; img.onmousemove=RadCancelEvent; RadEditorNamespace.Docking.OverlayImage=img; }return RadEditorNamespace.Docking.OverlayImage; } ; RadEditorNamespace.Docking.ShowOverlayImage= function (insertBefore){var overlayImage=this.GetOverlayImage( ); if (overlayImage){document.body.appendChild(overlayImage); overlayImage.style.position="a\x62\x73olut\x65"; overlayImage.style.display=""; overlayImage.style.left=overlayImage.style.top="\060p\x78"; overlayImage.style.width=parseInt(window.screen.width)-1; overlayImage.style.height=parseInt(window.screen.height)-1; }} ; RadEditorNamespace.Docking.HideOverlayImage= function ( ){var overlayImage=this.GetOverlayImage( ); if (overlayImage){overlayImage.parentNode.removeChild(overlayImage); overlayImage.style.display="\x6eo\x6ee"; }} ;
RadEditorNamespace.Docking.ThresholdX=5; RadEditorNamespace.Docking.ThresholdY=5; RadEditorNamespace.Docking.ResizableObject= {EnableResize: true ,CalcResizeDir:function (eventArgs,thresholdX,thresholdY){if (!this.EnableResize)return ""; var srcElem=eventArgs.srcElement?eventArgs.srcElement:eventArgs.target; if (srcElem!=this )return ""; var rc=this.GetRect( ); var resizeDir=""; if (null==thresholdX)thresholdX=RadEditorNamespace.Docking.ThresholdX; if (null==thresholdY)thresholdY=RadEditorNamespace.Docking.ThresholdY; var offsetX,offsetY; if (null!=eventArgs.offsetY){offsetX=eventArgs.offsetX; offsetY=eventArgs.offsetY; }else if (null!=eventArgs.layerY){offsetX=eventArgs.layerX; offsetY=eventArgs.layerY; }if (offsetY<=thresholdY && this.AllowNorth){resizeDir+="\x6e"; }else if ((rc.height-offsetY)<=thresholdY && this.AllowSouth){resizeDir+="s"; }if (offsetX<=thresholdX && this.AllowWest){resizeDir+="\x77"; }else if ((rc.width-offsetX)<=thresholdX && this.AllowEast){resizeDir+="\x65"; }return (""!=resizeDir?(resizeDir+"\x2dr\x65size"): ""); } ,Resize:function (eventArgs){var dX=eventArgs.clientX-this.MouseX; var dY=eventArgs.clientY-this.MouseY; this.style.cursor=this.ResizeDir; switch (this.ResizeDir){case "n-r\x65s\x69ze": this.Inflate(0,dY,null,null); break; case "\x73-\x72esiz\x65": this.Inflate(0,0,0,dY); break; case "\167-resi\x7ae": this.Inflate(dX,0,null,null); break; case "\x65\x2dr\x65size": this.Inflate(0,0,dX,0); break; case "\x6e\x65-r\x65size": this.Inflate(0,dY,dX,null); break; case "nw-re\x73i\x7ae": this.Inflate(dX,dY,null,null); break; case "\x73\x65-\x72esi\x7ae": this.Inflate(0,0,dX,dY); break; case "\x73\x77-r\x65siz\x65": this.Inflate(dX,0,null,dY); break; default:break; }} ,Inflate:function (offsetLeft,offsetTop,offsetWidth,offsetHeight){var rc=this.GetRect( ); var top=rc.top+offsetTop; var left=rc.left+offsetLeft; if (top<0){offsetTop=-rc.top; }if (left<0){offsetLeft=-rc.left; }top=rc.top+offsetTop; left=rc.left+offsetLeft; if (null==offsetWidth)offsetWidth=-offsetLeft; if (null==offsetHeight)offsetHeight=-offsetTop; var width=rc.width+offsetWidth; var height=rc.height+offsetHeight; width=Math.max(this.MinWidth,width); width=Math.min(this.MaxWidth,width); height=Math.max(this.MinHeight,height); height=Math.min(this.MaxHeight,height); var targetElement=(this.DragHelper?this.DragHelper: this ); if (rc.width!=width){targetElement.MoveBy(offsetLeft,0); targetElement.SetSize(width,null); }if (rc.height!=height){targetElement.MoveBy(0,offsetTop); targetElement.SetSize(null,height); }} ,SetResizeDirs:function (resizeFlags){ this.AllowNorth=(-1!=resizeFlags.indexOf("\x6e")); this.AllowSouth=(-1!=resizeFlags.indexOf("\x73")); this.AllowEast=(-1!=resizeFlags.indexOf("e")); this.AllowWest=(-1!=resizeFlags.indexOf("\167")); } ,InitResize:function ( ){var resizeFlags=this.getAttribute("re\x73i\x7ae"); if ("\x73\x74ring"==typeof(resizeFlags)){resizeFlags=resizeFlags.toLowerCase( ); }else {resizeFlags="\x6es\x65w"; } this.SetResizeDirs(resizeFlags); this.MinWidth=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("minWi\x64t\x68")); this.MaxWidth=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("max\x57i\x64th"),100000); this.MinHeight=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("\x6di\x6eHeig\x68t")); this.MaxHeight=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("maxH\x65i\x67ht"),100000); }} ;
