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("\x64ockingzo\x6ee"); if (dockingZoneId){dockingZone=document.getElementById(dockingZoneId); }else if (dockableObject.parentNode.getAttribute("d\x6fcking")){dockingZone=dockableObject.parentNode; }if (dockingZone && typeof(dockingZone.Dock)=="\x66unct\x69\x6fn"){var dockingOrder=parseInt(dockableObject.getAttribute("dockin\x67order")); if (isNaN(dockingOrder)){dockingOrder=null; }dockingZone.Dock(dockableObject,dockingOrder); }else if (dockableObject.parentNode!=document.body){if ("\x63om\x70\x6cet\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,"onmo\x75semove",RadEditorNamespace.Docking.RadGlobalMouseMoveHandler); RadEditorNamespace.Utils.AttachEventEx(document,"onk\x65ydown",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("unselec\x74able","on"); oTable.setAttribute("\144\x6fckabl\x65","\x61ll"); var oRow=oTable.insertRow(-1); var oCell=oRow.insertCell(-1); var oSpan=doc.createElement("\x73pan"); oSpan.className="\122\x61\144A\x75toDockB\x75\164\x74on"; oSpan.innerHTML="\046\x6ebsp;&nb\x73p;&nbsp\x3b"; oSpan.setAttribute("\x61ut\x6f\104o\x63k","\x74rue"); oCell.appendChild(oSpan); oCell.innerHTML+=(oTitle?"\x26nbsp;"+oTitle: ""); oCell.colSpan=2; oCell.setAttribute("\x6eoWrap","\x74rue"); oCell.setAttribute("titleGri\x70","\x61utohide"); oCell.className="\x52adE\x54\151t\x6ceGrip"; oCell.parentNode.style.display="none"; var oRow=oTable.insertRow(-1); oCell=oRow.insertCell(-1); oCell.innerHTML="\x26n\x62\163\x70;"; oCell.colSpan=2; oCell.setAttribute("\x74opSideGr\x69p","\x61uto\x68\151d\x65"); oCell.className="Rad\x45\123\x69\x64eG\x72ipVerti\x63al"; oRow=oTable.insertRow(-1); oCell=oRow.insertCell(-1); oCell.innerHTML="&nbs\x70;&nbsp;&\x6ebsp;"; oCell.setAttribute("\x6ceftSide\x47\162\x69p","aut\x6f\150i\x64e"); oCell.className="RadESi\x64eGripHo\x72\151\x7a\157\x6etal"; 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?"in\x6cine": ""; oTable.setAttribute("displ\x61y",oDisplay); if (document.all && !window.opera)oTable.style.display="i\x6eline"; else oTable.setAttribute("style","\x66l\x6f\x61t:l\x65ft"); 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,"\x61uto\x64\157\x63k", 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("ren\x64erVerti\x63al"); obj.RenderVertical=(attr?attr:RadEditorNamespace.Docking.RenderVertical); }if (!obj.RenderHorizontal){var attr=obj.getAttribute("re\x6ederHori\x7aontal"); 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("dockabl\x65"); if ("stri\x6e\147"==typeof(dockableMode)){dockableMode=dockableMode.toLowerCase( ); }if ("all"==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 && "\x6eone"!=this.style.display){ this.style.display="\151\x6elin\x65"; }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="\141\x62solute"; 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="none"; this.className=this.VerticalClassName; if (typeof(this.RenderVertical)=="\x66unc\x74\151\x6fn"){ this.RenderVertical( ); }else if (typeof(this.RenderVertical)=="s\x74ring"){eval(this.RenderVertical); }}catch (ex){} this.IsVertical= true; }else if (this.IsVertical && null!=this.RenderHorizontal){try {if (this.TopSideGrip)this.TopSideGrip.style.display="none"; if (this.LeftSideGrip)this.LeftSideGrip.style.display=""; this.className=this.HorizontalClassName; if (typeof(this.RenderHorizontal)=="functi\x6fn"){ this.RenderHorizontal( ); }else if (typeof(this.RenderHorizontal)=="st\x72ing"){eval(this.RenderHorizontal); }}catch (ex){} this.IsVertical= false; }} ,GripHitTest:function (e){var source=RadEditorNamespace.Utils.GetEventSource(e); return (null!=source && (null!=source.getAttribute("\x67r\x69\160") || null!=source.getAttribute("title\x67rip") || null!=source.getAttribute("\x74opsid\x65\147\x72ip") || null!=source.getAttribute("l\x65ftsideg\x72ip"))); } ,Initialize:function ( ){var arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"left\x53ideGrip", true); if (arr.length>0){ this.LeftSideGrip=arr[0]; this.LeftSideGrip.AlwaysVisible=(arr[0].getAttribute("\x6ceft\x53\x69de\x47rip").toLowerCase( )=="visible"); }arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"topSi\x64eGrip", true); if (arr.length>0){ this.TopSideGrip=arr[0]; this.TopSideGrip.AlwaysVisible=(arr[0].getAttribute("topS\x69deGrip").toLowerCase( )=="visib\x6c\145"); }arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"ti\x74leGrip", true); if (arr.length>0){ this.Title=arr[0]; var isAlwaysVisible=(arr[0].getAttribute("\x74itleGri\x70").toLowerCase( )=="visible"); if (this.Title.tagName=="T\x44" || this.Title.tagName=="TH"){ 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,"autodo\x63k", 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?"": "none"; }}} ;
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 "l\x65\x66t:"+this.left+"\x20"+"r\x69\147\x68t:"+this.right+" "+"\x74op:"+this.top+" "+"\x62ottom:"+this.bottom+" "+"\x28"+this.width+"\x20x "+this.height+"\x29"; } ; 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("\144o\x63king"); }obj.DockType=(dockType?dockType: "\x68oriz"); RadEditorNamespace.Docking.DockingZones.push(obj); };RadEditorNamespace.Docking.DockingZone= {Dock:function (dockingObject,dockingOrder){if (this ==dockingObject.DockingZone)return; if (null==dockingObject.getAttribute("dock\x61ble")){alert("Error: \x59ou are\x20\164\x72ying\x20to doc\x6b\040\x6eon-d\x6fckab\x6ce ob\x6aect"); return; }if (!dockingObject.CanDockTo(this )){alert("Err\x6fr: You \x61\162\x65 not a\x6clowed t\x6f dock \x27"+dockingObject.id+"\047\x20to \x27"+this.id+"\047\x20docking\x20zone"); 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="1px \x64ashed #\x3666666"; }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+"\x42\x75ttons\x2ftransp.\x67if"); } ; RadEditor.prototype.SerializeCookieName="RadEdit\x6frGlobalS\x65\162\x69alize\x43ookie"; 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+"\x3d"+(begStr+sName+"-"+sValue+"\x23"+endStr)+"\x3bpath=\x2f\073\x65xpir\x65\163\x3d"+today.toUTCString( )+"\x3b"; } ; RadEditor.prototype.GetCookie= function (sName){sName="\x5b"+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("#",endIndex)); }return sValue; } ; RadEditor.prototype.getOnlyCookie= function (sName){var aCookie=document.cookie.split("; "); for (var i=0; i<aCookie.length; i++){var aCrumb=aCookie[i].split("="); 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="\133"; 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\x74le")); var tmp=this.PersistDockableObject(toolbar,oTitle, true); if (tmp){if (needSeparator){str+=","; }str+=tmp; needSeparator= true; }}str+="]"; this.SetCookie("\x54oolbars",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+="\x2c"; }str+=tmp; needSeparator= true; }}str+="]"; this.SetCookie("\x4dodul\x65\163",str); }else {if (this.IsToolbarModeEnabled(RadEditorNamespace.ToolbarModesEnum.Default)){var str=this.GetCookie("Too\x6cbars"); 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("Module\x73"); 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("titl\x65")==sTitle){return toolbar; }}return null; } ; RadEditor.prototype.PersistDockableObject= function (dockableObject,title,isVisible){if (!dockableObject || !dockableObject.Undock)return null; var dockingZone=dockableObject.DockingZone; var str="["; str+="\x27"+title+"\x27"; var isReallyVisible=( false !=isVisible)? true : false; str+=","+isReallyVisible; var dZoneId=dockingZone?dockingZone.id: ""; if (!dockingZone && dockableObject.DockingZoneId)dZoneId=dockableObject.DockingZoneId; str+=","+"\x27"+(dZoneId)+"\047"; if (null!=dockingZone){for (var j=0; j<dockingZone.childNodes.length; j++){if (dockableObject==dockingZone.childNodes[j]){str+=(","+j); break; }}}else {str+=","; var rc=dockableObject.GetRect( ); str+=RadEditorNamespace.Utils.Format("[{0},{\x31}]",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="\x72\x65size"; }else if (this.AllowMove && this.GripHitTest(e)){ this.DragMode="move"; }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="m\x6fve"; }} ; var agent=navigator.userAgent.toLowerCase( ); if (useOverlay!= false && null!=document.all && agent.indexOf("\155\x73ie 7.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,"\157\x6emouseup",RadEditorNamespace.Docking.GeneralMouseUp); if (this.UseInternalMove){RadEditorNamespace.Utils.AttachEventEx(document,"\x6fnmo\x75\163\x65move",RadEditorNamespace.Docking.GeneralMouseMove); RadEditorNamespace.Utils.AttachEventEx(document,"on\x6beydown",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="Hit Es\x63 to can\x63el"; } ,EndDrag:function (eventArgs){if (this.DragHelper){var rc=this.DragHelper.GetRect( ); this.MoveTo(rc.left,rc.top); if ("re\x73ize"==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,"\x6fnmouseup",RadEditorNamespace.Docking.GeneralMouseUp); if (this.UseInternalMove){RadEditorNamespace.Utils.DetachEventEx(document,"\x6fnmous\x65\x6do\x76\145",RadEditorNamespace.Docking.GeneralMouseMove); RadEditorNamespace.Utils.DetachEventEx(document,"onkeydo\x77n",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 "\x6dove": this.Move(eventArgs); break; case "\162\x65size": 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("\x67rip")); } ,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="absol\x75te"; this.style.left=this.Left+"px"; this.style.top=this.Top+"px"; if (this.NeedOverlay){ this.SetOverlayIframe( ); this.NeedOverlay= false; }if (this.Overlay){if (this.Overlay.style.display=="no\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+"\x70x"; if (this.Overlay){ this.Overlay.style.width=width+"px"; }}height=parseInt(height); if (!isNaN(height) && height>=0){ this.style.height=height+"px"; if (this.Overlay){ this.Overlay.style.height=height+"\x70x"; }}if (this.OnResize && "function"==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="\156\x6fne"; 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 ("\162\x65size"==this.DragMode); } ,IsMoving:function ( ){return ("\x6dove"==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("DI\x56"); document.body.appendChild(dragHelper); dragHelper.setAttribute("st\x79le","\x2dmoz-opac\x69ty:0.3"); dragHelper.style.border="1px das\x68ed gray"; dragHelper.style.backgroundColor="\x23ccccc\x63"; dragHelper.style.filter="\x70rogid:\x44\x58I\x6d\141\x67eTr\x61nsform\x2e\115\x69crosof\x74.Alp\x68a(opa\x63ity=5\x30)"; dragHelper.style.margin="\x30px\x20\060\x70x 0p\x78 0px"; dragHelper.style.padding="\x30px"; dragHelper.style.position="\141\x62\163o\x6cute"; dragHelper.style.top=10; dragHelper.style.left=10; dragHelper.style.width=100; dragHelper.style.height=100; dragHelper.style.zIndex=50000; dragHelper.style.overflow="\x68idden"; dragHelper.style.display="\156\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("\x49FRAME"); frm.src="\x6aavascri\x70\164\x3afalse"; frm.frameBorder=0; frm.scrolling="\x6eo"; frm.style.overflow="\x68idden"; frm.style.display="\x69nline"; frm.style.position="abso\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="inlin\x65"; this.Overlay.style.position="\x61bsolute"; 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="none"; }} ; obj.IsOverlayVisible= function ( ){return (this.Overlay && this.Overlay.style.display!="\x6eon\x65"); } ; obj.NeedOverlay= true; } ; RadEditorNamespace.Docking.OverlayImage=null; RadEditorNamespace.Docking.GetOverlayImage= function ( ){if (!RadEditorNamespace.Docking.OverlayImage){var img=document.createElement("IMG"); img.style.display="\x6eone"; img.setAttribute("unsele\x63table","\157\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="abso\x6cute"; overlayImage.style.display=""; overlayImage.style.left=overlayImage.style.top="\060px"; 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="\x6e\x6f\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+="n"; }else if ((rc.height-offsetY)<=thresholdY && this.AllowSouth){resizeDir+="s"; }if (offsetX<=thresholdX && this.AllowWest){resizeDir+="w"; }else if ((rc.width-offsetX)<=thresholdX && this.AllowEast){resizeDir+="e"; }return (""!=resizeDir?(resizeDir+"\x2d\x72esize"): ""); } ,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-re\x73ize": this.Inflate(0,dY,null,null); break; case "s-resize": this.Inflate(0,0,0,dY); break; case "w-re\x73ize": this.Inflate(dX,0,null,null); break; case "e-r\x65size": this.Inflate(0,0,dX,0); break; case "\x6ee-resiz\x65": this.Inflate(0,dY,dX,null); break; case "\x6ew-resi\x7a\145": this.Inflate(dX,dY,null,null); break; case "se-resi\x7ae": this.Inflate(0,0,dX,dY); break; case "sw-resiz\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("n")); this.AllowSouth=(-1!=resizeFlags.indexOf("s")); this.AllowEast=(-1!=resizeFlags.indexOf("e")); this.AllowWest=(-1!=resizeFlags.indexOf("\x77")); } ,InitResize:function ( ){var resizeFlags=this.getAttribute("\x72esize"); if ("\x73tring"==typeof(resizeFlags)){resizeFlags=resizeFlags.toLowerCase( ); }else {resizeFlags="nsew"; } this.SetResizeDirs(resizeFlags); this.MinWidth=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("minWidt\x68")); this.MaxWidth=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("\x6da\x78\x57idt\x68"),100000); this.MinHeight=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("minHeigh\x74")); this.MaxHeight=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("\x6daxHeigh\x74"),100000); }} ;

