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("\x64\x6fck\x69\x6e\x67\172\x6fne"); if (dockingZoneId){dockingZone=document.getElementById(dockingZoneId); }else if (dockableObject.parentNode.getAttribute("dockin\x67")){dockingZone=dockableObject.parentNode; }if (dockingZone && typeof(dockingZone.Dock)=="f\x75nction"){var dockingOrder=parseInt(dockableObject.getAttribute("do\x63kingor\x64er")); if (isNaN(dockingOrder)){dockingOrder=null; }dockingZone.Dock(dockableObject,dockingOrder); }else if (dockableObject.parentNode!=document.body){if ("\143\x6fmplete"==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,"onmou\x73emove",RadEditorNamespace.Docking.RadGlobalMouseMoveHandler); RadEditorNamespace.Utils.AttachEventEx(document,"\157\x6ekeydown",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("t\x61\x62le"); oTable.border=0; oTable.cellSpacing=0; oTable.cellPadding=0; oTable.setAttribute("\x75nselecta\x62le","\157\x6e"); oTable.setAttribute("\x64ock\x61\x62le","al\x6c"); var oRow=oTable.insertRow(-1); var oCell=oRow.insertCell(-1); var oSpan=doc.createElement("s\x70an"); oSpan.className="Ra\x64AutoDock\x42utton"; oSpan.innerHTML="\x26nbsp;&n\x62\163\x70;&nbsp;"; oSpan.setAttribute("\x61utoD\x6f\x63k","true"); oCell.appendChild(oSpan); oCell.innerHTML+=(oTitle?"\046\x6ebsp\x3b"+oTitle: ""); oCell.colSpan=2; oCell.setAttribute("\x6eoWr\x61\x70","\x74\162\x75\x65"); oCell.setAttribute("titleGr\x69p","\x61utohide"); oCell.className="RadETi\x74leGrip"; oCell.parentNode.style.display="non\x65"; var oRow=oTable.insertRow(-1); oCell=oRow.insertCell(-1); oCell.innerHTML="\x26nbsp;"; oCell.colSpan=2; oCell.setAttribute("\x74opSide\x47\x72i\x70","\x61utohide"); oCell.className="RadES\x69\144\x65\107\x72\151p\x56erti\x63al"; oRow=oTable.insertRow(-1); oCell=oRow.insertCell(-1); oCell.innerHTML="&nbsp;&n\x62sp;&nb\x73p;"; oCell.setAttribute("\x6ceft\x53\151d\x65Grip","\x61utohide"); oCell.className="\x52adE\x53\x69de\x47\162\x69\160\x48orizont\x61l"; 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?"inline": ""; oTable.setAttribute("\x64isplay",oDisplay); if (document.all && !window.opera)oTable.style.display="\x69nline"; else oTable.setAttribute("\x73tyle","floa\x74\072\x6ceft"); 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,"autodo\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("\x72ender\x56\x65r\x74\151\x63al"); obj.RenderVertical=(attr?attr:RadEditorNamespace.Docking.RenderVertical); }if (!obj.RenderHorizontal){var attr=obj.getAttribute("re\x6ederHor\x69\172\x6fntal"); 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("d\x6fckable"); if ("str\x69ng"==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 && "\x6eo\x6e\145"!=this.style.display){ this.style.display="\151\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="\x61bsolu\x74\x65"; 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="\x6eone"; this.className=this.VerticalClassName; if (typeof(this.RenderVertical)=="\x66un\x63\x74io\x6e"){ this.RenderVertical( ); }else if (typeof(this.RenderVertical)=="\x73tr\x69\156\x67"){eval(this.RenderVertical); }}catch (ex){} this.IsVertical= true; }else if (this.IsVertical && null!=this.RenderHorizontal){try {if (this.TopSideGrip)this.TopSideGrip.style.display="\x6eon\x65"; if (this.LeftSideGrip)this.LeftSideGrip.style.display=""; this.className=this.HorizontalClassName; if (typeof(this.RenderHorizontal)=="f\x75nction"){ this.RenderHorizontal( ); }else if (typeof(this.RenderHorizontal)=="\x73tring"){eval(this.RenderHorizontal); }}catch (ex){} this.IsVertical= false; }} ,GripHitTest:function (e){var source=RadEditorNamespace.Utils.GetEventSource(e); return (null!=source && (null!=source.getAttribute("\x67ri\x70") || null!=source.getAttribute("tit\x6cegrip") || null!=source.getAttribute("\x74opsid\x65\147\x72ip") || null!=source.getAttribute("l\x65ftsidegr\x69p"))); } ,Initialize:function ( ){var arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"\x6c\x65\146\x74SideGrip", true); if (arr.length>0){ this.LeftSideGrip=arr[0]; this.LeftSideGrip.AlwaysVisible=(arr[0].getAttribute("leftSide\x47rip").toLowerCase( )=="visible"); }arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"\x74opSid\x65\x47ri\x70", true); if (arr.length>0){ this.TopSideGrip=arr[0]; this.TopSideGrip.AlwaysVisible=(arr[0].getAttribute("topSide\x47rip").toLowerCase( )=="vis\x69ble"); }arr=RadEditorNamespace.Utils.GetElementsByAttributeName(this,"title\x47rip", true); if (arr.length>0){ this.Title=arr[0]; var isAlwaysVisible=(arr[0].getAttribute("titleGr\x69p").toLowerCase( )=="\x76isible"); if (this.Title.tagName=="TD" || this.Title.tagName=="\x54\110"){ 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,"\x61utodock", 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?"": "\x6eone"; }}} ;
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 "\154ef\x74:"+this.left+" "+"r\x69ght:"+this.right+"\x20"+"\x74op:"+this.top+" "+"\x62ott\x6f\155:"+this.bottom+" "+"("+this.width+"\x20x "+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("doc\x6b\x69ng"); }obj.DockType=(dockType?dockType: "\150\x6friz"); RadEditorNamespace.Docking.DockingZones.push(obj); };RadEditorNamespace.Docking.DockingZone= {Dock:function (dockingObject,dockingOrder){if (this ==dockingObject.DockingZone)return; if (null==dockingObject.getAttribute("do\x63kable")){alert("Error\x3a You ar\x65 tryin\x67\040\164\x6f dock \x6eon-doc\x6bable\x20obje\x63t"); return; }if (!dockingObject.CanDockTo(this )){alert("\x45r\x72\x6fr: \x59ou are \x6eot all\x6fwed to\x20\144\x6fck \047"+dockingObject.id+"\047 to \047"+this.id+"\x27 dock\x69\x6eg\x20\172\x6f\156\x65"); 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="\x31px das\x68\145\x64 #\x36\066\x36666"; }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+"Butto\x6e\x73/trans\x70.gif"); } ; RadEditor.prototype.SerializeCookieName="Ra\x64EditorGl\x6fbalSeria\x6c\151\x7aeCo\x6fkie"; RadEditor.prototype.SetCookie= function (sName,sValue){sName="["+this.Id+sName+"\x5d"; 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+"\x2d"+sValue+"#"+endStr)+"\x3bpath=/;e\x78pires="+today.toUTCString( )+"\x3b"; } ; RadEditor.prototype.GetCookie= function (sName){sName="["+this.Id+sName+"\135"; 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("\x23",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="\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("title")); var tmp=this.PersistDockableObject(toolbar,oTitle, true); if (tmp){if (needSeparator){str+=","; }str+=tmp; needSeparator= true; }}str+="\x5d"; this.SetCookie("\x54ool\x62\141\x72s",str); }str="["; 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("Modu\x6ces",str); }else {if (this.IsToolbarModeEnabled(RadEditorNamespace.ToolbarModesEnum.Default)){var str=this.GetCookie("\x54oolbar\x73"); 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("M\x6fdules"); 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("\164\x69tl\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+="\047"+title+"\047"; var isReallyVisible=( false !=isVisible)? true : false; str+="\x2c"+isReallyVisible; var dZoneId=dockingZone?dockingZone.id: ""; if (!dockingZone && dockableObject.DockingZoneId)dZoneId=dockableObject.DockingZoneId; str+="\054"+"\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+="\x2c"; var rc=dockableObject.GetRect( ); str+=RadEditorNamespace.Utils.Format("\133\x7b0},\x7b\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="resiz\x65"; }else if (this.AllowMove && this.GripHitTest(e)){ this.DragMode="\x6dove"; }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="move"; }} ; var agent=navigator.userAgent.toLowerCase( ); if (useOverlay!= false && null!=document.all && agent.indexOf("\x6dsie 7\x2e\x30")==-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\x6emouse\x75p",RadEditorNamespace.Docking.GeneralMouseUp); if (this.UseInternalMove){RadEditorNamespace.Utils.AttachEventEx(document,"onmousem\x6fve",RadEditorNamespace.Docking.GeneralMouseMove); RadEditorNamespace.Utils.AttachEventEx(document,"\x6fnkeyd\x6f\x77n",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 Esc\x20to can\x63el"; } ,EndDrag:function (eventArgs){if (this.DragHelper){var rc=this.DragHelper.GetRect( ); this.MoveTo(rc.left,rc.top); if ("r\x65size"==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,"onmouse\x75p",RadEditorNamespace.Docking.GeneralMouseUp); if (this.UseInternalMove){RadEditorNamespace.Utils.DetachEventEx(document,"\x6fnm\x6f\x75sem\x6fve",RadEditorNamespace.Docking.GeneralMouseMove); RadEditorNamespace.Utils.DetachEventEx(document,"onkeydow\x6e",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 "mov\x65": this.Move(eventArgs); break; case "\x72esize": 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="\x61bsol\x75\x74e"; this.style.left=this.Left+"px"; this.style.top=this.Top+"\x70x"; if (this.NeedOverlay){ this.SetOverlayIframe( ); this.NeedOverlay= false; }if (this.Overlay){if (this.Overlay.style.display=="non\x65"){} 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+"px"; if (this.Overlay){ this.Overlay.style.height=height+"p\x78"; }}if (this.OnResize && "\x66uncti\x6f\x6e"==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="\x6eon\x65"; 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!="\x6eon\x65"); } ,IsResizing:function ( ){return ("re\x73ize"==this.DragMode); } ,IsMoving:function ( ){return ("move"==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("D\x49V"); document.body.appendChild(dragHelper); dragHelper.setAttribute("\x73tyl\x65","-\x6d\157\x7a\055\x6fpaci\x74\171\x3a0.3"); dragHelper.style.border="\x31px dash\x65\144\x20gray"; dragHelper.style.backgroundColor="\x23ccccc\x63"; dragHelper.style.filter="prog\x69d:DXIm\x61\147\x65Trans\x66orm.Mi\x63\162\x6fsoft.A\x6cpha(\x6fpaci\x74y=50)"; dragHelper.style.margin="\x30px 0px\x20\060\x70x 0\x70\170"; dragHelper.style.padding="\x30px"; dragHelper.style.position="\x61bs\x6f\154\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="\x6eon\x65"; 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("\x49FRAM\x45"); frm.src="ja\x76ascript\x3afalse"; frm.frameBorder=0; frm.scrolling="no"; frm.style.overflow="hidden"; frm.style.display="inline"; frm.style.position="absolute"; 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="\x69nline"; this.Overlay.style.position="a\x62solute"; 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!="\x6eone"); } ; 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("\x75nse\x6c\145\x63table","o\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="abs\x6flute"; overlayImage.style.display=""; overlayImage.style.left=overlayImage.style.top="0px"; 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="\156\x6fne"; }} ;
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+="\x73"; }if (offsetX<=thresholdX && this.AllowWest){resizeDir+="\x77"; }else if ((rc.width-offsetX)<=thresholdX && this.AllowEast){resizeDir+="\x65"; }return (""!=resizeDir?(resizeDir+"\x2dresize"): ""); } ,Resize:function (eventArgs){var dX=eventArgs.clientX-this.MouseX; var dY=eventArgs.clientY-this.MouseY; this.style.cursor=this.ResizeDir; switch (this.ResizeDir){case "\x6e-resi\x7a\145": this.Inflate(0,dY,null,null); break; case "s-res\x69\172\x65": this.Inflate(0,0,0,dY); break; case "w-re\x73ize": this.Inflate(dX,0,null,null); break; case "e-resiz\x65": this.Inflate(0,0,dX,0); break; case "\x6ee-resi\x7a\145": this.Inflate(0,dY,dX,null); break; case "nw\x2dresize": this.Inflate(dX,dY,null,null); break; case "\x73e-res\x69\x7ae": this.Inflate(0,0,dX,dY); break; case "s\x77-resize": 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("resize"); if ("strin\x67"==typeof(resizeFlags)){resizeFlags=resizeFlags.toLowerCase( ); }else {resizeFlags="ns\x65w"; } this.SetResizeDirs(resizeFlags); this.MinWidth=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("min\x57idth")); this.MaxWidth=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("\x6daxWi\x64\164\x68"),100000); this.MinHeight=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("\x6din\x48\x65ig\x68t")); this.MaxHeight=RadEditorNamespace.Utils.GetIntValue(this.getAttribute("\x6da\x78\x48ei\x67\150\x74"),100000); }} ;

