var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); ASPxDockPanelStateObserver = _aspxCreateClass(null, { constructor: function (observedPanel) { this.panel = observedPanel; this.trackState = true; this.previousState = { zone: null }; this.currentState = { zone: this.panel.zone }; }, UpdateState: function () { if (!this.trackState) return; this.previousState = this.currentState; this.currentState = { zone: this.panel.zone } }, IsBeingDocked: function () { return this.currentState.zone && this.previousState.zone != this.currentState.zone; }, IsBeingFloated: function () { return this.previousState.zone && !this.currentState.zone; } }); ASPxClientDockPanel = _aspxCreateClass(ASPxClientPopupControl, { DefaultWindowIndex: -1, AnimationDelay: 30, MaxAnimationTime: 400, AnimationOffset: 20, UndockOnDoubleClickOffset: 5, StateHiddenInputIDPostfix: '_SHF', BeforeDockServerEventName: "BeforeDock", AfterDockServerEventName: "AfterDock", BeforeFloatServerEventName: "BeforeFloat", AfterFloatServerEventName: "AfterFloat", RaiseBeforeDockEventCommand: "EBD", RaiseAfterDockEventCommand: "EAD", RaiseBeforeFloatEventCommand: "EBF", RaiseAfterFloatEventCommand: "EAF", constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.panelUID = null; this.forbiddenZones = []; this.mode = 'All'; this.requireFreezingLayout = false; this.zone = null; this.initialParentNode = null; this.trackDimensions = true; this.allowCorrectYOffsetPosition = false; this.fixated = false; this.initialShadowVisible = false; this.freezed = false; this.allowEnsureContent = true; this.firstShowProcessed = false; this.floatingState = true; this.updateDimensionsOnFloatingState = false; this.completeSwitchingToFloatingStateOnCallback = false; this.floatingStateAllowResize = false; this.floatingStateEnableContentScrolling = false; this.animationLocked = false; this.inUndockedState = false; this.contentFlexibilityEnabled = false; this.widthFixed = false; this.heightFixed = false; this.inPostback = false; this.floatingStateDimensions = { width: 0, height: 0, minWidth: 0, minHeight: 0, maxWidth: 0, maxHeight: 0 }; this.floatingStateContentOverflow = { x: 'visible', y: 'visible', both: 'visible' }; this.stateObserver = new ASPxDockPanelStateObserver(this); this.BeforeDock = new ASPxClientEvent(); this.AfterDock = new ASPxClientEvent(); this.BeforeFloat = new ASPxClientEvent(); this.AfterFloat = new ASPxClientEvent(); this.StartDragging = new ASPxClientEvent(); this.EndDragging = new ASPxClientEvent(); }, SendPostBack: function(params) { if(!this.inPostback) { this.inPostback = true; ASPxClientControl.prototype.SendPostBack.call(this, params); } }, GetMainElement: function() { return this.GetWindowElement(this.DefaultWindowIndex); }, GetContentScrollbarsOwner: function() { return this.liteRender ? this.GetWindowContentElement(this.DefaultWindowIndex) : this.GetWindowScrollDiv(this.DefaultWindowIndex); }, InlineInitialize: function() { ASPxClientPopupControl.prototype.InlineInitialize.call(this); var mainElement = this.GetMainElement(); this.initialParentNode = mainElement.parentNode; mainElement.panelUID = this.panelUID; this.widthFixed = this.width > 0; this.heightFixed = this.height > 0; ASPxClientDockPanelBag.Get().RegisterPanel(this); }, Initialize: function() { ASPxClientPopupControl.prototype.Initialize.call(this); this.AfterResizing.AddHandler(function(s, e) { s.StoreFloatingStateDimensions(); }); this.Shown.AddHandler(function(s, e) { s.UpdateManagerClientLayoutState(); }); this.CloseUp.AddHandler(function(s, e) { s.UpdateManagerClientLayoutState(); }); if(this.allowDragging) this.AssignDoubleClickEventHandlers(); }, InitializeWindow: function(index) { ASPxClientPopupControl.prototype.InitializeWindow.call(this, index); if (!this.GetShowOnPageLoad(index) && this.GetZoneUID()) { var savedShown = this.Shown, savedCloseUp = this.CloseUp, savedClosing = this.Closing, eventStub = new ASPxClientEvent(); this.Shown = eventStub; this.CloseUp = eventStub; this.Closing = eventStub; this.allowEnsureContent = false; this.FirstShowWindow(index, false); this.Hide(); this.allowEnsureContent = true; this.Shown = savedShown; this.CloseUp = savedCloseUp; this.Closing = savedClosing; } }, AssignDoubleClickEventHandlers: function() { if(this.isWindowDragging) { var mainElement = this.GetMainElement(); _aspxAttachEventToElement(mainElement, 'dblclick', this.GetDoubleClickHandler()); } else { var header = this.GetWindowHeaderElement(this.DefaultWindowIndex); if(header) _aspxAttachEventToElement(header, 'dblclick', this.GetDoubleClickHandler()); } }, GetDoubleClickHandler: function() { var closeBtn = this.GetWindowCloseButton(this.DefaultWindowIndex); var instance = this; if(!closeBtn) return function() { instance.ProcessMouseDoubleClick(); } return function(evt) { var source = _aspxGetEventSource(evt); if(_aspxGetIsParent(closeBtn, source)) return; instance.ProcessMouseDoubleClick(); } }, StoreInitialSettings: function() { var contentCurrentStyle = _aspxGetCurrentStyle(this.GetContentScrollbarsOwner()); this.floatingStateContentOverflow.x = contentCurrentStyle.overflowX; this.floatingStateContentOverflow.y = contentCurrentStyle.overflowY; this.floatingStateContentOverflow.both = contentCurrentStyle.overflow; this.floatingStateDimensions.minWidth = this.minWidth; this.floatingStateDimensions.minHeight = this.minHeight; this.floatingStateDimensions.maxWidth = this.maxWidth; this.floatingStateDimensions.maxHeight = this.maxHeight; this.floatingStateAllowResize = this.allowResize; this.floatingStateEnableContentScrolling = this.enableContentScrolling; this.initialShadowVisible = this.shadowVisible; }, SetPanelElementsVisibility: function(visible) { var elements = [ this.GetWindowHeaderElement(this.DefaultWindowIndex), this.GetWindowContentElement(this.DefaultWindowIndex), this.GetWindowFooterElement(this.DefaultWindowIndex) ]; for(var i = 0; i < elements.length; i++) { if(elements[i]) _aspxSetElementVisibility(elements[i], visible); } }, FirstShowWindow: function(index, allowChangeZIndex) { ASPxClientPopupControl.prototype.FirstShowWindow.call(this, index, allowChangeZIndex); this.SetPanelElementsVisibility(false); var iFrame = _aspxGetChildByTagName(this.GetMainElement(), 'IFRAME', 0); if(iFrame) { var instance = this; aspxGetControlCollection().ControlsInitialized.AddHandler(function() { window.setTimeout(function() { instance.ProcessFirstShowWindow(); }, 0); }); } else this.ProcessFirstShowWindow(); }, ProcessFirstShowWindow: function() { if(this.firstShowProcessed) return; this.StoreInitialSettings(); this.StoreFloatingStateDimensions(); this.DockOnFirstShow(); if(this.requireFreezingLayout) { this.freezed = true; if(this.zone) this.DisableDragging(); } this.SetPanelElementsVisibility(true); this.SetLastFloatState(); this.firstShowProcessed = true; }, ProcessMouseDoubleClick: function() { if(this.zone && !this.floatingState && this.mode != 'DockedOnly') { if(!this.GetLastFloatPosition()) { var position = this.GetDefaultUndockPosition(); this.SetWindowLeft(this.DefaultWindowIndex, position.x); this.SetWindowTop(this.DefaultWindowIndex, position.y); this.UpdateWindowsStateInputElement(); this.UpdateWindowsStateCookie(); } if(!this.RaiseBeforeFloat()) return; this.zone.HidePanelPlaceholder(); this.MakeFloatInternal(this.GetLastFloatPosition()); if(this.stateObserver.IsBeingFloated()) this.RaiseAfterFloat(); } else if(this.mode != 'FloatOnly') { var lastDockedState = this.GetState().lastDockedState; var zone = ASPxClientDockZoneBag.Get().GetZoneByUID(lastDockedState.zoneUID); if(!zone || !this.RaiseBeforeDock(zone)) return; this.DockToLastZone(); if(this.stateObserver.IsBeingDocked()) this.RaiseAfterDock(); } }, GetStateHiddenInput: function() { return _aspxGetElementById(this.name + this.StateHiddenInputIDPostfix); }, GetState: function() { var stateInput = this.GetStateHiddenInput(); var state = eval('(' + stateInput.value + ');'); return { zoneUID: state[0], visibleIndex: state[1], lastDockedState: { zoneUID: state[2], visibleIndex: state[3] }, lastFloatState: { left: state[4], top: state[5] } }; }, GetZoneUID: function() { return this.GetState().zoneUID; }, SetZoneUID: function(zoneUID) { var state = this.GetState(); var stateInput = this.GetStateHiddenInput(); stateInput.value = _aspxToJson([zoneUID || '', state.visibleIndex, state.lastDockedState.zoneUID, state.lastDockedState.visibleIndex, state.lastFloatState.left, state.lastFloatState.top]); }, SetLastDockedState: function(lastDockedState) { var state = this.GetState(); var stateInput = this.GetStateHiddenInput(); stateInput.value = _aspxToJson([state.zoneUID, state.visibleIndex, lastDockedState.zoneUID, lastDockedState.visibleIndex, state.lastFloatState.left, state.lastFloatState.top]); }, SetLastFloatState: function() { if(!this.floatingState) return; var state = this.GetState(); var stateInput = this.GetStateHiddenInput(); var position = this.GetElementAbsolutePosition(this.GetMainElement()); stateInput.value = _aspxToJson([state.zoneUID, state.visibleIndex, state.lastDockedState.zoneUID, state.lastDockedState.visibleIndex, position.x, position.y]); }, GetLastFloatPosition: function() { var lastFloatState = this.GetState().lastFloatState; if(lastFloatState.left && lastFloatState.top) { return { x: lastFloatState.left, y: lastFloatState.top } } return null; }, GetLayoutStateObject: function() { return [ this.GetVisible(), this.mode, this.GetZoneUID(), this.widthFixed ? (this.floatingStateDimensions.width + '') : '0', this.heightFixed ? (this.floatingStateDimensions.height + '') : '0', this.GetCurrentLeft(this.DefaultWindowIndex), this.GetCurrentTop(this.DefaultWindowIndex), this.GetVisibleIndex() ]; }, UpdateManagerClientLayoutState: function() { var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.UpdatePanelsLayoutState(); }, GetCursorOverPanelLocation: function(cursorPos, panelSpacing, isHorizontal) { var mainElement = this.GetMainElement(); var x = _aspxGetAbsoluteX(mainElement); var y = _aspxGetAbsoluteY(mainElement); var width = this.GetWidth(); var height = this.GetHeight(); if(isHorizontal) width += panelSpacing; else height += panelSpacing; if(cursorPos.x < x || cursorPos.x > x + width || cursorPos.y < y || cursorPos.y > y + height) return null; if(isHorizontal) return cursorPos.x > (x + width / 2) ? 'right' : 'left'; return cursorPos.y > (y + height / 2) ? 'bottom' : 'top'; }, GetDockedDimensions: function(zoneResizableDimension, isHorizontal) { var storedDimensions = this.floatingState ? this.floatingStateDimensions : { width: this.GetWidth(), height: this.GetHeight() }; if(this.floatingState) this.EnableContentFlexibility(); var storedContentFlexibilityEnabled = this.contentFlexibilityEnabled; this.SetSizeInternal(this.floatingStateDimensions.width, this.floatingStateDimensions.height); if(isHorizontal) { this.SetHeightInternal(zoneResizableDimension); if(this.floatingStateDimensions.height < zoneResizableDimension && !this.widthFixed) { if(storedContentFlexibilityEnabled) this.DisableContentFlexibility(); this.SetWidthInternal(1); if(storedContentFlexibilityEnabled) this.EnableContentFlexibility(); } } else { this.SetWidthInternal(zoneResizableDimension); if(this.floatingStateDimensions.width < zoneResizableDimension && !this.heightFixed) { if(storedContentFlexibilityEnabled) this.DisableContentFlexibility(); this.SetHeightInternal(1); if(storedContentFlexibilityEnabled) this.EnableContentFlexibility(); } } var dimensions = { width: this.GetWidth(), height: this.GetHeight() }; if(this.floatingState) this.DisableContentFlexibility(); this.SetSizeInternal(storedDimensions.width, storedDimensions.height); return dimensions; }, StoreFloatingStateDimensions: function() { if(this.trackDimensions) { this.StoreFloatingStateDimensionsCore(this.GetWidth(), this.GetHeight()); this.UpdateManagerClientLayoutState(); } }, StoreFloatingStateDimensionsCore: function(width, height) { this.floatingStateDimensions.width = width; this.floatingStateDimensions.height = height; }, GetCurrentWindowWidth: function(index) { if(!this.floatingState) return this.floatingStateDimensions.width; return ASPxClientPopupControl.prototype.GetCurrentWindowWidth.call(this, index); }, GetCurrentWindowHeight: function(index) { if(!this.floatingState) return this.floatingStateDimensions.height; return ASPxClientPopupControl.prototype.GetCurrentWindowHeight.call(this, index); }, SetShadowVisibility: function(visible) { this.shadowVisible = visible; if(this.liteRender) this.SetShadowVisibilityLite(visible); else this.SetShadowVisibilityClassic(visible); }, SetShadowVisibilityLite: function(visible) { var mainElement = this.GetWindowMainCell(this.GetMainElement()); var shadowClassName = ASPxClientPopupControlCssClasses.ShadowLiteCssClassName; if(visible) { if(!_aspxElementHasCssClass(mainElement, shadowClassName)) mainElement.className = _aspxTrim(mainElement.className) + ' ' + shadowClassName; } else mainElement.className = _aspxTrim(mainElement.className.replace(shadowClassName, '')); }, SetShadowVisibilityClassic: function(visible) { var shadowTable = this.enableAnimation ? this.GetWindowShadowTable(this.DefaultWindowIndex) : this.GetWindowElement(this.DefaultWindowIndex); if(shadowTable) { var shadowCol = shadowTable.rows[0].cells[1]; var shadowRow = shadowTable.rows[1]; _aspxSetElementDisplay(shadowCol, visible); _aspxSetElementDisplay(shadowRow, visible); } }, SetHeaderFooterOverflow: function(overflow) { var elements = [ this.GetWindowHeaderElement(this.DefaultWindowIndex), this.GetWindowFooterElement(this.DefaultWindowIndex) ]; for(var i = 0; i < elements.length; i++) { if(elements[i]) elements[i].style.overflow = overflow; } }, EnableContentFlexibility: function() { var contentElement = this.GetContentScrollbarsOwner(); this.enableContentScrolling = true; this.contentFlexibilityEnabled = true; contentElement.style.overflow = 'auto'; contentElement.style.overflowX = 'auto'; contentElement.style.overflowY = 'auto'; this.minWidth = null; this.minHeight = null; this.maxWidth = null; this.maxHeight = null; this.contentFlexibilityEnabled = true; }, DisableContentFlexibility: function() { var contentElement = this.GetContentScrollbarsOwner(); contentElement.style.overflowX = this.floatingStateContentOverflow.x; contentElement.style.overflowY = this.floatingStateContentOverflow.y; contentElement.style.overflow = this.floatingStateContentOverflow.both; this.enableContentScrolling = this.floatingStateEnableContentScrolling; if(!this.liteRender && !this.enableContentScrolling) { contentElement.style.height = ''; contentElement.style.width = ''; } this.minWidth = this.floatingStateDimensions.minWidth; this.minHeight = this.floatingStateDimensions.minHeight; this.maxWidth = this.floatingStateDimensions.maxWidth; this.maxHeight = this.floatingStateDimensions.maxHeight; this.contentFlexibilityEnabled = false; }, SetAllowResize: function(allowResize) { this.allowResize = allowResize; if(this.liteRender) this.SetAllowResizeLite(allowResize); else this.SetAllowResizeClassic(allowResize); }, SetAllowResizeLite: function(allowResize) { var windowElement = this.GetWindowElement(this.DefaultWindowIndex); var windowMainCell = this.GetWindowMainCell(windowElement); var windowHeader = this.GetWindowHeaderElement(this.DefaultWindowIndex); var sizeGrip = this.GetWindowSizeGripLite(this.DefaultWindowIndex); var storedHanlder = this.GetWindowElementMouseMoveEventHandler(this.DefaultWindowIndex); if(allowResize) { _aspxRestoreStyleAttribute(windowElement, 'cursor'); _aspxAttachEventToElement(windowElement, 'mousemove', storedHanlder); } else { _aspxChangeStyleAttribute(windowElement, 'cursor', 'default'); _aspxRemoveStyleAttribute(windowMainCell, 'cursor'); if(windowHeader) windowHeader.style.cursor = 'move'; _aspxDetachEventFromElement(windowElement, 'mousemove', storedHanlder); } if(sizeGrip) _aspxSetElementDisplay(sizeGrip, allowResize); }, SetAllowResizeClassic: function(allowResize) { var windowMainCell = this.GetWindowMainCell(this.GetMainElement()); var clientTable = this.GetWindowClientTable(this.DefaultWindowIndex); var windowContent = this.GetWindowContentElement(this.DefaultWindowIndex); var windowHeader = this.GetWindowHeaderElement(this.DefaultWindowIndex); var gripCell = this.GetWindowSizeGripElement(this.DefaultWindowIndex); if(allowResize) { _aspxRestoreStyleAttribute(windowMainCell, 'cursor'); _aspxRestoreAttribute(windowMainCell, 'onmousemove'); _aspxRestoreStyleAttribute(windowContent, 'cursor'); } else { _aspxChangeStyleAttribute(windowMainCell, 'cursor', 'default'); _aspxRemoveStyleAttribute(clientTable, 'cursor'); if(windowHeader) windowHeader.style.cursor = 'move'; _aspxChangeAttribute(windowMainCell, 'onmousemove', null); _aspxChangeStyleAttribute(windowContent, 'cursor', 'default'); } if(gripCell) _aspxSetElementDisplay(gripCell, allowResize); }, ResizeForDock: function(dockedDimensions) { this.SetSizeInternal(dockedDimensions.width, dockedDimensions.height); if(!this.liteRender && this.initialShadowVisible && !this.enableAnimation) { if(this.zone.IsHorizontalOrientation()) this.SetWidthInternal(this.GetWidth() - __aspxPopupShadowWidth); else this.SetHeightInternal(this.GetHeight() - __aspxPopupShadowHeight); } }, OnResize: function(evt, index, cursor, resizePanel) { ASPxClientPopupControl.prototype.OnResize.call(this, evt, index, cursor, resizePanel); this.widthFixed = cursor.horizontalDirection == "w" || cursor.horizontalDirection == "e"; this.heightFixed = cursor.verticalDirection == "n" || cursor.verticalDirection == "s"; }, Fixate: function() { var mainElement = this.GetMainElement(); var offset = { x: mainElement.offsetLeft, y: mainElement.offsetTop }; mainElement.style.left = offset.x + 'px'; mainElement.style.top = offset.y + 'px'; mainElement.style.position = 'absolute'; this.fixated = true; }, RemoveFixation: function() { var mainElement = this.GetMainElement(); mainElement.style.position = 'static'; this.fixated = false; }, EnsureContent: function(windowIndex, isInit) { if(this.contentLoadingMode != 'OnDock' && this.contentLoadingMode != 'OnFloating' && this.contentLoadingMode != 'OnDockStateChange' && this.allowEnsureContent) { ASPxClientPopupControl.prototype.EnsureContent.call(this, windowIndex, isInit); } }, OnCallbackInternal: function(html, windowIndex, isError) { ASPxClientPopupControl.prototype.OnCallbackInternal.call(this, html, windowIndex, isError); _aspxSetElementVisibility(this.GetContentContainer(windowIndex), true); var instance = this; window.setTimeout(function() { if(instance.completeSwitchingToFloatingStateOnCallback) { instance.CompleteSwitchingToFloatingState(); instance.completeSwitchingToFloatingStateOnCallback = false; } instance.StoreFloatingStateDimensions(); }, 0); }, LoadContent: function() { var mainElement = this.GetMainElement(); if(!mainElement.loading) { mainElement.loading = true; this.CreateWindowCallback(this.DefaultWindowIndex, this.DefaultWindowIndex); } }, DisableDragging: function() { this.allowDragging = false; var elements = [ this.GetWindowHeaderElement(this.DefaultWindowIndex), this.GetWindowMainCell(this.GetMainElement()) ]; for(var i = 0; i < elements.length; i++) { if(elements[i]) elements[i].style.cursor = 'default'; } }, OnDragStart: function(evt, index) { if(!this.allowDragging || this.animationLocked) return; this.ApplyZonesAllowedStyle(); this.ApplyZonesForbiddenStyle(); var instance = this; var evtMock = __aspxIE ? { clientX: evt.clientX, clientY: evt.clientY } : evt; window.setTimeout(function() { ASPxClientPopupControl.prototype.OnDragStart.call(instance, evtMock, index); }, 0); }, OnDrag: function(index, x, y, xClientCorrection, yClientCorrection, evt) { var retValue = ASPxClientPopupControl.prototype.OnDrag.call(this, index, x, y, xClientCorrection, yClientCorrection); if(!this.inUndockedState && !this.animationLocked) { this.trackDimensions = false; var cursorPos = { x: _aspxGetEventX(evt), y: _aspxGetEventY(evt) }; if(this.zone) { this.UndockInternal(true); ASPxClientPopupControl.prototype.InitDragInfo.call(this, index, evt); } this.SearchForCurrentZone(cursorPos); this.RaiseStartDragging(); this.inUndockedState = true; } var popupCollection = aspxGetPopupControlCollection(); var cursorPos = { x: x - popupCollection.gragXOffset, y: y - popupCollection.gragYOffset }; if(!evt.ctrlKey) this.SearchForCurrentZone(cursorPos); else if(this.zone) { this.zone.HidePanelPlaceholder(); this.zone = null; } return retValue; }, SearchForCurrentZone: function(cursorPos) { var newZone = null; var zoneList = ASPxClientDockZoneBag.Get().GetZoneList(); for(var i = 0; i < zoneList.length; i++) { if(zoneList[i].IsCursorInsideZone(cursorPos)) { if(this.zone && this.zone.zoneUID === zoneList[i].zoneUID) { this.zone.MovePanelPlaceholder(cursorPos); return; } newZone = zoneList[i]; break; } } if(this.zone) { this.zone.HidePanelPlaceholder(); this.zone = null; } if(newZone) { this.zone = newZone; this.zone.MovePanelPlaceholder(cursorPos); this.zone.ShowPanelPlaceholder(this); } }, OnDragStop: function(index) { ASPxClientPopupControl.prototype.OnDragStop.call(this, index); this.RemoveZonesAllowedStyle(); this.RemoveZonesForbiddenStyle(); if(!this.inUndockedState) return; this.inUndockedState = false; this.RaiseEndDragging(); var dockingInfo = this.GetDockingInfo(); if(dockingInfo && dockingInfo.canDock && this.RaiseBeforeDock(this.zone)) { this.DockInternal(dockingInfo.dimensions); return; } if(this.zone) this.zone.HidePanelPlaceholder(); var lastDockedState = this.GetState().lastDockedState; if(this.mode === 'DockedOnly' && lastDockedState.zoneUID) { this.stateObserver.trackState = false; this.DockToLastZone(); this.stateObserver.trackState = true; return; } if(this.stateObserver.IsBeingDocked() && !this.RaiseBeforeFloat()) { this.stateObserver.trackState = false; this.DockToLastZone(); this.stateObserver.trackState = true; return; } this.SwitchToFloatingState(); this.SetLastFloatState(); if(this.stateObserver.IsBeingFloated()) this.RaiseAfterFloat(); }, IsZoneForbidden: function(zone) { for(var i = 0; i < this.forbiddenZones.length; i++) { if(this.forbiddenZones[i] === zone.zoneUID) return true; } return false; }, GetDockingInfo: function() { if(!this.zone) return null; var dockedDimensions = null; var canDock = this.mode != 'FloatOnly' && !this.freezed && !this.IsZoneForbidden(this.zone); if(canDock) { if(this.zone.IsFillOrientation()) { dockedDimensions = { width: this.zone.initialWidth, height: this.zone.initialHeight }; canDock &= this.zone.CanDockPanel(); } else { var isHorizontalZone = this.zone.IsHorizontalOrientation(); var zoneResizableDimension = isHorizontalZone ? this.zone.initialHeight : this.zone.initialWidth; dockedDimensions = this.GetDockedDimensions(zoneResizableDimension, isHorizontalZone); canDock &= this.zone.CanDockPanel(isHorizontalZone ? dockedDimensions.width : dockedDimensions.height); } } return { canDock: canDock, dimensions: dockedDimensions }; }, SwitchToFloatingState: function() { var requireContentUpdate = !this.floatingState && (this.contentLoadingMode === 'OnFloating' || this.contentLoadingMode === 'OnDockStateChange'); this.zone = null; this.floatingState = true; if(this.floatingStateAllowResize) this.SetAllowResize(true); this.DisableContentFlexibility(); if(requireContentUpdate) { this.LoadContent(); this.updateDimensionsOnFloatingState = true; this.completeSwitchingToFloatingStateOnCallback = true; } else this.CompleteSwitchingToFloatingState(); }, CompleteSwitchingToFloatingState: function() { this.stateObserver.UpdateState(); this.SetSizeInternal(this.floatingStateDimensions.width, this.floatingStateDimensions.height); this.trackDimensions = true; if(this.updateDimensionsOnFloatingState) { this.StoreFloatingStateDimensions(); this.updateDimensionsOnFloatingState = false; } if(this.IsVisible()) this.AdjustContentOnDockStateChanged(); this.UpdateManagerClientLayoutState(); }, CompleteDocking: function(mainElement, dockedDimensions, onFirstShow) { this.zone.DockPanel(this, dockedDimensions, onFirstShow); this.stateObserver.UpdateState(); mainElement.style.position = 'static'; var requireRefreshContent = this.stateObserver.IsBeingDocked() && (this.contentLoadingMode === 'OnDock' || this.contentLoadingMode === 'OnDockStateChange'); if(requireRefreshContent) { this.LoadContent(); this.updateDimensionsOnFloatingState = true; } if(!onFirstShow) { this.UpdateManagerClientLayoutState(); this.RaiseAfterDock(); } this.zone.AdjustControlCore(); if(this.IsVisible()) this.AdjustContentOnDockStateChanged(); this.SetLastDockedState({ zoneUID: this.GetZoneUID(), visibleIndex: this.GetVisibleIndex() }); var windowIFrame = this.FindWindowIFrame(this.DefaultWindowIndex); if(windowIFrame) _aspxSetElementDisplay(windowIFrame, false); if(this.animationLocked) this.animationLocked = false; }, AdjustContentOnDockStateChanged: function() { var contentElement = this.GetContentContainer(this.DefaultWindowIndex); var collection = aspxGetControlCollection(); collection.AdjustControls(contentElement, false); }, DockOnFirstShow: function() { var zoneUID = this.GetZoneUID(); if(!zoneUID) return; var zoneList = ASPxClientDockZoneBag.Get().GetZoneList(); for(var i = 0; i < zoneList.length; i++) { if(zoneList[i].zoneUID === zoneUID) { this.zone = zoneList[i]; break; } } if(this.zone) this.zone.AdjustControl(); this.trackDimensions = false; var dockingInfo = this.GetDockingInfo(); if(dockingInfo && dockingInfo.canDock) this.DockInternal(dockingInfo.dimensions, true); else this.SwitchToFloatingState(); }, DockToLastZone: function() { var lastDockedState = this.GetState().lastDockedState; if(!lastDockedState.zoneUID) return; var zoneBag = ASPxClientDockZoneBag.Get(); var zone = zoneBag.GetZoneByUID(lastDockedState.zoneUID); if(zone) this.Dock(zone, lastDockedState.visibleIndex); }, DockInternal: function(dockedDimensions, onFirstShow) { var mainElement = this.GetMainElement(); this.floatingState = false; if(this.floatingStateAllowResize) this.SetAllowResize(false); if(this.initialShadowVisible) this.SetShadowVisibility(false); this.EnableContentFlexibility(); if(this.zone.IsHorizontalOrientation()) _aspxSetElementFloat(mainElement, 'left'); if(this.enableAnimation && !onFirstShow) this.StartDockAnimation(mainElement, dockedDimensions); else this.CompleteDocking(mainElement, dockedDimensions, onFirstShow); }, UndockInternal: function(showPlaceholder) { var mainElement = this.GetMainElement(); var position = this.GetUndockToPosition(); if(showPlaceholder) { this.zone.FixatePanels(this); this.zone.MovePanelPlaceholderToPanel(this); } this.initialParentNode.appendChild(mainElement); mainElement.style.position = 'absolute'; _aspxSetElementFloat(mainElement, 'none'); this.SetWindowPos(this.DefaultWindowIndex, mainElement, position.x, position.y); if(!this.IsVisible()) { this.SetWindowLeft(this.DefaultWindowIndex, position.x); this.SetWindowTop(this.DefaultWindowIndex, position.y); } if(this.initialShadowVisible) this.SetShadowVisibility(true); this.zone.UndockPanel(this); if(showPlaceholder) { this.zone.ShowPanelPlaceholder(this); this.zone.RemovePanelsFixation(); } var windowIFrame = this.FindWindowIFrame(this.DefaultWindowIndex); if(windowIFrame) _aspxSetElementDisplay(windowIFrame, true); this.zone = null; }, GetUndockToPosition: function() { var mainElement = this.GetMainElement(); if(this.IsVisible()) return this.GetElementAbsolutePosition(mainElement) var storedDisplay = mainElement.style.display; mainElement.style.display = 'block'; var position = this.GetElementAbsolutePosition(mainElement); mainElement.style.display = storedDisplay; return position; }, MakeFloatInternal: function(position) { if(this.floatingState) return; this.UndockInternal(); this.SwitchToFloatingState(); if(!position) position = this.GetDefaultUndockPosition(); this.SetWindowPos(this.DefaultWindowIndex, this.GetMainElement(), position.x, position.y); if(!this.IsVisible()) { this.SetWindowLeft(this.DefaultWindowIndex, position.x); this.SetWindowTop(this.DefaultWindowIndex, position.y); } }, GetDefaultUndockPosition: function() { var undockToPos = this.GetUndockToPosition(); return { x: undockToPos.x + this.UndockOnDoubleClickOffset, y: undockToPos.y + this.UndockOnDoubleClickOffset } }, StartDockAnimation: function(mainElement, dockedDimensions) { this.animationLocked = true; mainElement.animationIterationCount = 0; mainElement.dockedDimensions = dockedDimensions; mainElement.destPosition = this.zone.GetPanelPlaceholderPosition(); mainElement.isHorizontalZone = this.zone.IsHorizontalOrientation(); this.IntializeAnimationOffsets(mainElement, dockedDimensions); mainElement.animationStart = new Date(); this.HandleDockAnimation(); }, IntializeAnimationOffsets: function(mainElement, dockedDimensions) { var intialHeight = this.GetHeight(); var initialWidth = this.GetWidth(); var position = this.GetElementAbsolutePosition(mainElement); mainElement.moveAnimationOffset = { horizontal: position.x > mainElement.destPosition.x ? -this.AnimationOffset : this.AnimationOffset, vertical: position.y > mainElement.destPosition.y ? -this.AnimationOffset : this.AnimationOffset } mainElement.resizeAnimationOffset = { horizontal: initialWidth > dockedDimensions.width ? -this.AnimationOffset : this.AnimationOffset, vertical: intialHeight > dockedDimensions.height ? -this.AnimationOffset : this.AnimationOffset }; }, GetAnimationState: function(mainElement) { var moveIterationCoeff = Math.log(mainElement.animationIterationCount); var resizeIterationCoeff = Math.sqrt(mainElement.animationIterationCount); var position = this.GetElementAbsolutePosition(mainElement); var dimensions = { width: this.GetWidth(), height: this.GetHeight() }; var newPosition = { x: position.x + moveIterationCoeff * mainElement.moveAnimationOffset.horizontal, y: position.y + moveIterationCoeff * mainElement.moveAnimationOffset.vertical }; var newDimensions = { width: dimensions.width + resizeIterationCoeff * mainElement.resizeAnimationOffset.horizontal, height: dimensions.height + resizeIterationCoeff * mainElement.resizeAnimationOffset.vertical }; var positionReached = { x: mainElement.moveAnimationOffset.horizontal > 0 ? newPosition.x >= mainElement.destPosition.x : newPosition.x <= mainElement.destPosition.x, y: mainElement.moveAnimationOffset.vertical > 0 ? newPosition.y >= mainElement.destPosition.y : newPosition.y <= mainElement.destPosition.y }; var dimensionReached = { width: mainElement.resizeAnimationOffset.horizontal > 0 ? newDimensions.width >= mainElement.dockedDimensions.width : newDimensions.width <= mainElement.dockedDimensions.width, height: mainElement.resizeAnimationOffset.vertical > 0 ? newDimensions.height >= mainElement.dockedDimensions.height : newDimensions.height <= mainElement.dockedDimensions.height }; return { newPosition: newPosition, newDimensions: newDimensions, positionReached: positionReached, dimensionReached: dimensionReached }; }, HandleDockAnimation: function() { var mainElement = this.GetMainElement(); mainElement.animationIterationCount++; var state = this.GetAnimationState(mainElement); var finished = (state.positionReached.x && state.positionReached.y && state.dimensionReached.width && state.dimensionReached.height) || (new Date() - mainElement.animationStart > this.MaxAnimationTime); if(finished) { this.CompleteDocking(mainElement, mainElement.dockedDimensions); return; } this.SetWindowPos(this.DefaultWindowIndex, mainElement, state.positionReached.x ? mainElement.destPosition.x : state.newPosition.x, state.positionReached.y ? mainElement.destPosition.y : state.newPosition.y); this.SetSizeInternal(state.dimensionReached.width ? mainElement.dockedDimensions.width : state.newDimensions.width, state.dimensionReached.height ? mainElement.dockedDimensions.height : state.newDimensions.height); var instance = this; window.setTimeout(function() { instance.HandleDockAnimation(); }, this.AnimationDelay); }, ShowLoadingPanel: function(windowIndex) { _aspxSetElementVisibility(this.GetContentContainer(windowIndex), false); ASPxClientPopupControl.prototype.ShowLoadingPanel.call(this, windowIndex); }, ApplyZonesAllowedStyle: function() { this.ProcessZones(this.GetAllowedZones(), function(zone) { zone.ApplyDockingAllowedStyle() }); }, RemoveZonesAllowedStyle: function() { this.ProcessZones(this.GetAllowedZones(), function(zone) { zone.RemoveDockingAllowedStyle() }); }, ApplyZonesForbiddenStyle: function() { this.ProcessZones(this.GetForbiddenZones(), function(zone) { zone.ApplyDockingForbiddenStyle() }); }, RemoveZonesForbiddenStyle: function() { this.ProcessZones(this.GetForbiddenZones(), function(zone) { zone.RemoveDockingForbiddenStyle() }); }, ProcessZones: function(zones, action) { for(var i = 0; i < zones.length; i++) action(zones[i]); }, GetForbiddenZones: function() { var forbiddenZones = []; var zoneBag = ASPxClientDockZoneBag.Get(); for(var i = 0; i < this.forbiddenZones.length; i++) { var zone = zoneBag.GetZoneByUID(this.forbiddenZones[i]); if(zone) forbiddenZones.push(zone); } return forbiddenZones; }, GetAllowedZones: function() { var zoneCollection = ASPxClientDockZoneBag.Get().GetZoneList(); var allowedZones = []; for(var i = 0; i < zoneCollection.length; i++) { var zone = zoneCollection[i]; if(!this.IsZoneForbidden(zone)) allowedZones.push(zone); } return allowedZones; }, GetBeforeDockPostbackArgs: function(zone) { return [ this.RaiseBeforeDockEventCommand, zone.zoneUID, zone.GetPanelAfterPlaceholderVisibleIndex() + 1 ]; }, GetBeforeFloatPostbackArgs: function() { return [ this.RaiseBeforeFloatEventCommand, this.GetState().lastDockedState.zoneUID ]; }, GetAfterFloatPostbackArgs: function() { return [ this.RaiseAfterFloatEventCommand, this.GetState().lastDockedState.zoneUID ]; }, RaiseBeforeDock: function(zone) { var processOnServer = this.IsServerEventAssigned(this.BeforeDockServerEventName); var args = new ASPxClientDockPanelProcessingModeCancelEventArgs(processOnServer, zone); if(!this.BeforeDock.IsEmpty()) this.BeforeDock.FireEvent(this, args); if(!args.cancel && args.processOnServer && this.isInitialized) { var postbackArgs = this.GetBeforeDockPostbackArgs(zone); this.SendPostBack(_aspxToJson(postbackArgs)); return; } var dockManager = ASPxClientDockManager.Get(); return !args.cancel && zone.RaiseBeforeDock(this) && (dockManager ? dockManager.RaiseBeforeDock(this, zone) : true); }, RaiseAfterDock: function() { var processOnServer = this.IsServerEventAssigned(this.AfterDockServerEventName); var args = new ASPxClientProcessingModeEventArgs(processOnServer); if(!this.AfterDock.IsEmpty()) this.AfterDock.FireEvent(this, args); if(args.processOnServer && this.isInitialized) { this.SendPostBack(_aspxToJson([this.RaiseAfterDockEventCommand])); return; } this.zone.RaiseAfterDock(this); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaiseAfterDock(this, this.zone); }, RaiseBeforeFloat: function() { var processOnServer = this.IsServerEventAssigned(this.BeforeFloatServerEventName); var zone = ASPxClientDockZoneBag.Get().GetZoneByUID(this.GetState().lastDockedState.zoneUID); var args = new ASPxClientDockPanelProcessingModeCancelEventArgs(processOnServer, zone); if(!this.BeforeFloat.IsEmpty()) this.BeforeFloat.FireEvent(this, args); if(args.processOnServer && this.isInitialized) { var postbackArgs = this.GetBeforeFloatPostbackArgs(); this.SendPostBack(_aspxToJson(postbackArgs)); return; } var dockManager = ASPxClientDockManager.Get(); if(dockManager && !args.cancel) return dockManager.RaiseBeforeFloat(this, zone); return !args.cancel; }, RaiseAfterFloat: function() { var processOnServer = this.IsServerEventAssigned(this.AfterFloatServerEventName); var zone = ASPxClientDockZoneBag.Get().GetZoneByUID(this.GetState().lastDockedState.zoneUID); var args = new ASPxClientDockPanelProcessingModeEventArgs(processOnServer, zone); if(!this.AfterFloat.IsEmpty()) this.AfterFloat.FireEvent(this, args); if(args.processOnServer && this.isInitialized) { var postbackArgs = this.GetAfterFloatPostbackArgs(); this.SendPostBack(_aspxToJson(postbackArgs)); return; } var dockManager = ASPxClientDockManager.Get(); if(dockManager) { dockManager.RaiseAfterFloat(this, zone); } }, RaiseStartDragging: function() { if(!this.StartDragging.IsEmpty()) this.StartDragging.FireEvent(this, new ASPxClientEventArgs()); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaiseStartPanelDragging(this); }, RaiseEndDragging: function() { if(!this.EndDragging.IsEmpty()) this.EndDragging.FireEvent(this, new ASPxClientEventArgs()); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaiseEndPanelDragging(this); }, RaiseClosing: function(index) { var dockManager = ASPxClientDockManager.Get(); var managerCancel = false; if(dockManager) managerCancel = dockManager.RaisePanelClosing(this); if(!this.Closing.IsEmpty()) return ASPxClientPopupControl.prototype.RaiseClosing.call(this, index); return managerCancel; }, RaiseCloseUp: function(index) { ASPxClientPopupControl.prototype.RaiseCloseUp.call(this, index); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaisePanelCloseUp(this); }, RaisePopUp: function(index) { ASPxClientPopupControl.prototype.RaisePopUp.call(this, index); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaisePanelPopUp(this); }, RaiseShowen: function(index) { ASPxClientPopupControl.prototype.RaiseShowen.call(this, index); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaisePanelShown(this); }, RaiseResize: function(index) { ASPxClientPopupControl.prototype.RaiseResize.call(this, index); var dockManager = ASPxClientDockManager.Get(); if(dockManager) dockManager.RaisePanelResize(this); }, DoShowWindowAtPos: function(index, x, y, ignorePopupElement, closeOtherWindows, allowChangeZIndex) { if(this.floatingState) { ASPxClientPopupControl.prototype.DoShowWindowAtPos.call(this, index, x, y, ignorePopupElement, false, allowChangeZIndex); return; } var visible = ASPxClientPopupControl.prototype.InternalIsWindowVisible.call(this, this.DefaultWindowIndex); if(visible) return; this.RaisePopUp(this.DefaultWindowIndex); var mainElement = this.GetMainElement(); mainElement.style.display = this.storedMainElementDisplay; _aspxSetElementVisibility(mainElement, true); this.AdjustContentOnShow(index); this.ApplyPanelCachedSize(index); if(this.zone) { this.zone.UpdatePanelsVisibleIndices(); this.zone.ApplyPanelSpacing(); this.zone.CorrectResizableDimensionCore(); } ASPxClientPopupControl.prototype.UpdateWindowsStateInputElement.call(this); ASPxClientPopupControl.prototype.UpdateWindowsStateCookie.call(this); ASPxClientPopupControl.prototype.OnWindowShown.call(this, this.DefaultWindowIndex); }, ApplyPanelCachedSize: function() { var cachedSize = this.GetWindowCachedSize(this.DefaultWindowIndex); if(cachedSize != null) { this.SetWindowSizeInternal(this.GetWindow(this.DefaultWindowIndex), cachedSize.width, cachedSize.height); this.ResetWindowCachedSize(this.DefaultWindowIndex); } }, DoHideWindowCore: function(index) { var mainElement = this.GetMainElement(); this.storedMainElementDisplay = mainElement.style.display; ASPxClientPopupControl.prototype.DoHideWindowCore.call(this, index); if(this.zone) { this.zone.UpdatePanelsVisibleIndices(); this.zone.ApplyPanelSpacing(); this.zone.CorrectResizableDimensionCore(); } }, SetWindowSize: function(window, width, height) { if(this.floatingState) { this.SetWindowSizeInternal(window, width, height); if(!this.IsVisible()) { this.StoreFloatingStateDimensionsCore(width, height); this.UpdateManagerClientLayoutState(); } return; } this.StoreFloatingStateDimensionsCore(width, height); this.UpdateManagerClientLayoutState(); }, SetSize: function(width, height) { ASPxClientPopupControl.prototype.SetSize.call(this, width, height); this.widthFixed = true; this.heightFixed = true; }, SetWidth: function(width) { ASPxClientPopupControl.prototype.SetWidth.call(this, width); this.widthFixed = true; }, SetHeight: function(height) { ASPxClientPopupControl.prototype.SetHeight.call(this, height); this.heightFixed = true; }, SetSizeInternal: function(width, height) { if(__aspxIE && __aspxBrowserVersion < 8) { var contentElement = this.GetWindowContentElement(this.DefaultWindowIndex); var currentStyle = _aspxGetCurrentStyle(contentElement); width -= _aspxPxToInt(currentStyle.borderLeftWidth) + _aspxPxToInt(currentStyle.borderRightWidth); height -= _aspxPxToInt(currentStyle.borderTopWidth) + _aspxPxToInt(currentStyle.borderBottomWidth); } this.SetWindowSizeInternal(null, width, height); }, SetHeightInternal: function(height) { this.SetSizeInternal(this.GetWidth(), height); }, SetWidthInternal: function(width) { this.SetSizeInternal(width, this.GetHeight()); }, SetWindowSizeInternal: function(window, width, height) { ASPxClientPopupControl.prototype.SetWindowSize.call(this, window, width, height); }, GetOwnerZone: function() { return this.zone; }, Dock: function(zone, visibleIndex) { var destinationZoneExists = zone && zone.zoneUID; if(!destinationZoneExists || this.IsDockInSamePlace(zone, visibleIndex)) return; if(this.IsDockInSameZone(zone)) { this.SetVisibleIndex(visibleIndex); return; } if(this.zone) this.MakeFloatInternal(); this.zone = zone; this.trackDimensions = false; var dockingInfo = this.GetDockingInfo(); var canDock = dockingInfo && dockingInfo.canDock; if(!canDock) { this.zone = null; return; } this.SetVisibleIndexCore(_aspxIsExists(visibleIndex) ? visibleIndex : this.zone.GetDockedPanelsMaxVisibleIndex() + 1); this.DockInternal(dockingInfo.dimensions, true); this.zone.UpdatePanelsVisibleIndices(); }, MakeFloat: function(x, y) { if(_aspxIsExists(x) && _aspxIsExists(y)) this.MakeFloatInternal({ x: x, y: y }); else this.MakeFloatInternal(); }, GetVisibleIndex: function() { return this.GetState().visibleIndex; }, SetVisibleIndex: function(visibleIndex) { if(this.floatingState) { this.SetVisibleIndexCore(visibleIndex); return; } this.zone.GetMainElement().insertBefore(this.GetMainElement(), this.GetInsertBeforePanelNode(visibleIndex)); this.zone.UpdatePanelsVisibleIndices(); this.zone.ApplyPanelSpacing(); }, IsDocked: function() { return !!this.zone; }, SetVisibleIndexCore: function(visibleIndex) { var state = this.GetState(); var stateInput = this.GetStateHiddenInput(); stateInput.value = _aspxToJson([state.zoneUID, visibleIndex, state.lastDockedState.zoneUID, state.lastDockedState.visibleIndex, state.lastFloatState.left, state.lastFloatState.top]); }, IsDockInSameZone: function(destinationZone) { return this.zone && this.zone.zoneUID === destinationZone.zoneUID; }, IsDockInSamePlace: function(destinationZone, visibleIndex) { if(!this.IsDockInSameZone(destinationZone)) return false; var dockedPanels = this.zone.GetOrderedPanelsList(); return _aspxIsExists(visibleIndex) ? this.GetVisibleIndex() === visibleIndex : dockedPanels[dockedPanels.length - 1].panelUID === this.panelUID; }, GetInsertBeforePanelNode: function(visibleIndex) { var panels = this.zone.GetOrderedPanelsList(); var result = []; for(var i = 0; i < panels.length; i++) { if(panels[i].panelUID !== this.panelUID && panels[i].IsVisible()) result.push(panels[i]); } var insertBeforePanel = result[visibleIndex]; return insertBeforePanel ? insertBeforePanel.GetMainElement() : null; }, GetElementAbsolutePosition: function(element) { return { x: _aspxGetAbsoluteX(element), y: _aspxGetAbsoluteY(element) }; } }); ASPxClientDockPanel.Cast = ASPxClientControl.Cast; ASPxClientDockPanelProcessingModeCancelEventArgs = _aspxCreateClass(ASPxClientProcessingModeCancelEventArgs, { constructor: function (processOnServer, zone) { this.constructor.prototype.constructor.call(this, processOnServer); this.zone = zone; } }); ASPxClientDockPanelProcessingModeEventArgs = _aspxCreateClass(ASPxClientProcessingModeEventArgs, { constructor: function (processOnServer, zone) { this.constructor.prototype.constructor.call(this, processOnServer); this.zone = zone; } }); } /* playback timings (ms): CDXLines.iter: 20.099 (3) exclusion.robots: 0.234 captures_list: 169.484 RedisCDXSource: 8.664 esindex: 0.017 load_resource: 138.738 PetaboxLoader3.datanode: 142.983 (4) PetaboxLoader3.resolve: 64.73 LoadShardBlock: 129.104 (3) exclusion.robots.policy: 0.218 */