(function () { var ASPxClientBeginCallbackEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(command){ this.constructor.prototype.constructor.call(this); this.command = command; } }); var ASPxClientGlobalBeginCallbackEventArgs = ASPx.CreateClass(ASPxClientBeginCallbackEventArgs, { constructor: function(control, command){ this.constructor.prototype.constructor.call(this, command); this.control = control; } }); var ASPxClientEndCallbackEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(){ this.constructor.prototype.constructor.call(this); } }); var ASPxClientGlobalEndCallbackEventArgs = ASPx.CreateClass(ASPxClientEndCallbackEventArgs, { constructor: function(control){ this.constructor.prototype.constructor.call(this); this.control = control; } }); var ASPxClientCustomDataCallbackEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(result) { this.constructor.prototype.constructor.call(this); this.result = result; } }); var ASPxClientCallbackErrorEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function (message, callbackId) { this.constructor.prototype.constructor.call(this); this.message = message; this.handled = false; this.callbackId = callbackId; } }); var ASPxClientGlobalCallbackErrorEventArgs = ASPx.CreateClass(ASPxClientCallbackErrorEventArgs, { constructor: function (control, message, callbackId) { this.constructor.prototype.constructor.call(this, message, callbackId); this.control = control; } }); var ASPxClientValidationCompletedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function (container, validationGroup, invisibleControlsValidated, isValid, firstInvalidControl, firstVisibleInvalidControl) { this.constructor.prototype.constructor.call(this); this.container = container; this.validationGroup = validationGroup; this.invisibleControlsValidated = invisibleControlsValidated; this.isValid = isValid; this.firstInvalidControl = firstInvalidControl; this.firstVisibleInvalidControl = firstVisibleInvalidControl; } }); var ASPxClientControlsInitializedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(isCallback) { this.isCallback = isCallback; } }); var ASPxClientControlBeforePronounceEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(messageParts, control){ this.constructor.prototype.constructor.call(this); this.messageParts = messageParts; this.control = control; } }); var ASPxClientControlUnloadEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(control){ this.constructor.prototype.constructor.call(this); this.control = control; } }); var BeforeInitCallbackEventArgs = ASPx.CreateClass(ASPxClientEventArgs, { constructor: function(callbackOwnerID){ this.constructor.prototype.constructor.call(this); this.callbackOwnerID = callbackOwnerID; } }); ASPx.createControl = function(type, name, windowName, properties, events, setupMethod, data){ var dxo = new type(name); dxo.InitGlobalVariable(windowName & windowName.length > 0 ? windowName : name); if(properties) dxo.SetProperties(properties); if(events) dxo.SetEvents(events); if(setupMethod) setupMethod.call(dxo); if(data) dxo.SetData(data); dxo.AfterCreate(); }; var ASPxClientControlBase = ASPx.CreateClass(null, { constructor: function(name){ this.name = name; this.uniqueID = name; this.globalName = name; this.stateObject = null; this.encodeHtml = true; this.enabled = true; this.clientEnabled = true; this.savedClientEnabled = true; this.clientVisible = true; this.accessibilityCompliant = false; this.autoPostBack = false; this.allowMultipleCallbacks = true; this.callBack = null; this.enableCallbackAnimation = false; this.enableSlideCallbackAnimation = false; this.slideAnimationDirection = null; this.beginCallbackAnimationProcessing = false; this.endCallbackAnimationProcessing = false; this.savedCallbackResult = null; this.savedCallbacks = null; this.isCallbackAnimationPrevented = false; this.lpDelay = 300; this.lpTimer = -1; this.requestCount = 0; this.enableSwipeGestures = false; this.disableSwipeGestures = false; this.Gestures = false; this.repeatedGestureValue = 0; this.repeatedGestureCount = 0; this.isInitialized = false; this.initialFocused = false; this.leadingAfterInitCall = ASPxClientControl.LeadingAfterInitCallConsts.None; this.serverEvents = []; this.loadingElement = null; this.loadingDivElement = null; this.hasPhantomLoadingElements = false; this.mainElement = null; this.touchUIMouseScroller = null; this.hiddenFields = { }; this.callbackHandlersQueue = new ASPx.ControlCallbackHandlersQueue(this); this.Init = new ASPxClientEvent(); this.BeginCallback = new ASPxClientEvent(); this.EndCallback = new ASPxClientEvent(); this.EndCallbackAnimationStart = new ASPxClientEvent(); this.CallbackError = new ASPxClientEvent(); this.CustomDataCallback = new ASPxClientEvent(); this.BeforePronounce = new ASPxClientEvent(); this.Unload = new ASPxClientEvent(); aspxGetControlCollection().Add(this); }, Initialize: function() { if(this.callBack != null) this.InitializeCallBackData(); if (this.useCallbackQueue()) this.callbackQueueHelper = new ASPx.ControlCallbackQueueHelper(this); ASPx.AccessibilityUtils.createAccessibleBackgrounds(this); if(this.accessibilityCompliant) ASPx.AccessibilityPronouncer.EnsureInitialize(); }, InlineInitialize: function() { this.savedClientEnabled = this.clientEnabled; }, InitializeGestures: function() { if(this.isSwipeGesturesEnabled() & this.Gestures) { ASPx.GesturesHelper.AddSwipeGestureHandler(this.name, function() { return this.GetCallbackAnimationElement(); }.aspxBind(this), function(evt) { return this.CanHandleGestureCore(evt); }.aspxBind(this), function(value) { return this.AllowStartGesture(); }.aspxBind(this), function(value) { return this.StartGesture(); }.aspxBind(this), function(value) { return this.AllowExecuteGesture(value); }.aspxBind(this), function(value) { this.ExecuteGesture(value); }.aspxBind(this), function(value) { this.CancelGesture(value); }.aspxBind(this), this.GetDefaultanimationEngineType() ); if(ASPx.Browser.MSTouchUI) this.touchUIMouseScroller = ASPx.MouseScroller.Create( function() { return this.GetCallbackAnimationElement(); }.aspxBind(this), function() { return null; }, function() { return this.GetCallbackAnimationElement(); }.aspxBind(this), function(element) { return this.NeedPreventTouchUIMouseScrolling(element); }.aspxBind(this), true ); } }, isSwipeGesturesEnabled: function() { return !this.disableSwipeGestures & (this.enableSwipeGestures || ASPx.Browser.TouchUI); }, isSlideCallbackAnimationEnabled: function() { return this.enableSlideCallbackAnimation || this.isSwipeGesturesEnabled(); }, InitGlobalVariable: function(varName){ if(!window) return; this.globalName = varName; window[varName] = this; }, SetProperties: function(properties, obj){ if(!obj) obj = this; for(var name in properties){ if(properties.hasOwnProperty(name)) obj[name] = properties[name]; } }, SetEvents: function(events, obj){ if(!obj) obj = this; for(var name in events){ if(events.hasOwnProperty(name) & obj[name] && obj[name].AddHandler) obj[name].AddHandler(events[name]); } }, SetData: function(data){ }, useCallbackQueue: function(){ return false; }, NeedPreventTouchUIMouseScrolling: function(element) { return false; }, InitailizeFocus: function() { if(this.initialFocused & this.IsVisible()) this.Focus(); }, AfterCreate: function() { this.InlineInitialize(); this.InitializeGestures(); }, AfterInitialize: function() { this.initializeAriaDescriptor(); this.InitailizeFocus(); this.isInitialized = true; this.RaiseInit(); if(this.savedCallbacks) { for(var i = 0; i < this.savedCallbacks.length; i++) this.CreateCallbackInternal(this.savedCallbacks[i].arg, this.savedCallbacks[i].command, false, this.savedCallbacks[i].callbackInfo); this.savedCallbacks = null; } }, InitializeCallBackData: function() { }, IsDOMDisposed: function() { return !ASPx.IsExistsElement(this.GetMainElement()); }, initializeAriaDescriptor: function() { if(this.ariaDescription) { var descriptionObject = ASPx.Json.Eval(this.ariaDescription); if(descriptionObject) { this.ariaDescriptor = new AriaDescriptor(this, descriptionObject); this.applyAccessibilityAttributes(this.ariaDescriptor); } } }, applyAccessibilityAttributes: function() { }, setAriaDescription: function(selector, argsList) { if(this.ariaDescriptor) this.ariaDescriptor.setDescription(selector, argsList || [[]]); }, allowRestoreFocusOnCallbacks: function(){ return this.accessibilityCompliant; }, HtmlEncode: function(text) { return this.encodeHtml ? ASPx.Str.EncodeHtml(text) : text; }, IsServerEventAssigned: function(eventName){ return ASPx.Data.ArrayIndexOf(this.serverEvents, eventName) >= 0; }, OnPost: function(args){ this.UpdateStateObject(); if(this.stateObject != null) this.UpdateStateHiddenField(); }, OnPostFinalization: function(args){ }, UpdateStateObject: function(){ }, UpdateStateObjectWithObject: function(obj){ if(!obj) return; if(!this.stateObject) this.stateObject = { }; for(var key in obj) if(obj.hasOwnProperty(key)) this.stateObject[key] = obj[key]; }, UpdateStateHiddenField: function(){ var stateHiddenField = this.GetStateHiddenField(); if(stateHiddenField) { var stateObjectStr = ASPx.Json.ToJson(this.stateObject); stateHiddenField.value = ASPx.Str.EncodeHtml(stateObjectStr); } }, GetStateHiddenField: function() { return this.GetHiddenField(this.GetStateHiddenFieldName(), this.GetStateHiddenFieldID(), this.GetStateHiddenFieldParent(), this.GetStateHiddenFieldOrigin()); }, GetStateHiddenFieldName: function() { return this.uniqueID; }, GetStateHiddenFieldID: function() { return this.name + "_State"; }, GetStateHiddenFieldOrigin: function() { return this.GetMainElement(); }, GetStateHiddenFieldParent: function() { var element = this.GetStateHiddenFieldOrigin(); return element ? element.parentNode : null; }, GetHiddenField: function(name, id, parent, beforeElement) { var hiddenField = this.hiddenFields[id]; if(!hiddenField || !ASPx.IsValidElement(hiddenField)) { if(parent) { var existingHiddenField = ASPx.GetElementById(this.GetStateHiddenFieldID()); this.hiddenFields[id] = hiddenField = existingHiddenField || ASPx.CreateHiddenField(name, id); if(existingHiddenField) return existingHiddenField; if(beforeElement) parent.insertBefore(hiddenField, beforeElement); else parent.appendChild(hiddenField); } } return hiddenField; }, GetChildElement: function(idPostfix){ var mainElement = this.GetMainElement(); if(idPostfix.charAt & idPostfix.charAt(0) !== "_") idPostfix = "_" + idPostfix; return mainElement ? ASPx.CacheHelper.GetCachedChildById(this, mainElement, this.name + idPostfix) : null; }, getChildControl: function(idPostfix) { var result = null; var childControlId = this.getChildControlUniqueID(idPostfix); ASPx.GetControlCollection().ProcessControlsInContainer(this.GetMainElement(), function(control) { if(control.uniqueID == childControlId) result = control; }); return result; }, getChildControlUniqueID: function(idPostfix) { idPostfix = idPostfix.split("_").("$"); if(idPostfix.charAt & idPostfix.charAt(0) !== "$") idPostfix = "$" + idPostfix; return this.uniqueID + idPostfix; }, getInnerControl: function(idPostfix) { var name = this.name + idPostfix; var result = window[name]; return result & Ident.IsASPxClientControl(result) ? result : null; }, GetParentForm: function(){ return ASPx.GetParentByTagName(this.GetMainElement(), "FORM"); }, GetMainElement: function(){ if(!ASPx.IsExistsElement(this.mainElement)) this.mainElement = ASPx.GetElementById(this.name); return this.mainElement; }, IsLoadingContainerVisible: function(){ return this.IsVisible(); }, GetLoadingElement: function(){ return ASPx.GetElementById(this.name + "_LP"); }, GetClonedLoading: function(){ return document.getElementById(this.GetLoadingElement().id + "V"); }, CloneLoading: function(element, parent) { var clone = element.cloneNode(true); clone.id = element.id + "V"; parent.appendChild(clone); return clone; }, CreateLoadingWithoutBordersInsideContainer: function(container) { var loading = this.CreateLoadingInsideContainer(container, false, true, true); var contentStyle = ASPx.GetCurrentStyle(container); if(!loading || !contentStyle) return; var elements = [ ]; var table = (loading.tagName == "TABLE") ? loading : ASPx.GetNodeByTagName(loading, "TABLE", 0); if(table != null) elements.push(table); else elements.push(loading); var cells = ASPx.GetNodesByTagName(loading, "TD"); if(!cells) cells = [ ]; for(var i = 0; i < cells.length; i++) elements.push(cells[i]); for(var i = 0; i < elements.length; i++) { var el = elements[i]; el.style.backgroundColor = contentStyle.backgroundColor; ASPx.RemoveBordersAndShadows(el); } }, CreateLoadingInsideContainer: function(parentElement, hideContent, collapseHeight, collapseWidth) { if(this.ShouldHideExistingLoadingElements()) this.HideLoading(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } var element = this.GetLoadingElement(); if(element != null){ var width = collapseWidth ? 0 : ASPx.GetClearClientWidth(parentElement); var height = collapseHeight ? 0 : ASPx.GetClearClientHeight(parentElement); if(hideContent){ for(var i = parentElement.childNodes.length - 1; i > -1; i--){ if(parentElement.childNodes[i].style) parentElement.childNodes[i].style.display = "none"; else if(parentElement.childNodes[i].nodeType == 3) parentElement.removeChild(parentElement.childNodes[i]); } } else parentElement.innerHTML = ""; var table = document.createElement("TABLE"); parentElement.appendChild(table); table.border = 0; table.cellPadding = 0; table.cellSpacing = 0; ASPx.SetStyles(table, { width: (width > 0) ? width : "100%", height: (height > 0) ? height : "100%" }); var tbody = document.createElement("TBODY"); table.appendChild(tbody); var tr = document.createElement("TR"); tbody.appendChild(tr); var td = document.createElement("TD"); tr.appendChild(td); td.align = "center"; td.vAlign = "middle"; element = this.CloneLoading(element, td); ASPx.SetElementDisplay(element, true, true); this.loadingElement = element; return element; } else parentElement.innerHTML = " "; return null; }, CreateLoadingWithAbsolutePosition: function(parentElement, offsetElement) { if(this.ShouldHideExistingLoadingElements()) this.HideLoading(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } if(!offsetElement) offsetElement = parentElement; var element = this.GetLoadingElement(); if(element != null) { element = this.CloneLoading(element, parentElement); ASPx.SetStyles(element, { position: "absolute" }); ASPx.SetElementDisplay(element, true, true); ASPx.Evt.AttachEventToElement(element, ASPx.Evt.GetMouseWheelEventName(), ASPx.Evt.PreventEvent); this.SetLoadingLocation(offsetElement, element); this.loadingElement = element; return element; } return null; }, CreateLoadingInline: function(parentElement, centerInParent){ if(this.ShouldHideExistingLoadingElements()) this.HideLoading(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } var element = this.GetLoadingElement(); if(element != null) { element = this.CloneLoading(element, parentElement); if(centerInParent){ ASPx.SetElementDisplay(element, true, true, true); parentElement.style.textAlign = "center"; } else ASPx.SetElementDisplay(element, true, true); this.loadingElement = element; return element; } return null; }, ShowLoading: function() { }, ShowLoadingElements: function() { if(this.InCallback() || this.lpTimer > -1) return; this.ShowLoadingDiv(); if(this.IsCallbackAnimationEnabled()) this.StartBeginCallbackAnimation(); else this.ShowLoadingElementsInternal(); }, ShowLoadingElementsInternal: function() { if(this.lpDelay > 0 & !this.IsCallbackAnimationEnabled()) this.lpTimer = window.setTimeout(function() { this.ShowLoadingOnTimer(); }.aspxBind(this), this.lpDelay); else { this.RestoreLoadingDivOpacity(); this.ShowLoading(); } }, GetLoadingOffsetElement: function (baseElement) { if(this.IsCallbackAnimationEnabled()) { var element = this.GetLoadingCallbackAnimationOffsetElement(); if(element) { var container = typeof(ASPx.AnimationHelper) != "undefined" ? ASPx.AnimationHelper.findSlideAnimationContainer(element) : null; if(container) return container.parentNode.parentNode; else return element; } } return baseElement; }, GetLoadingCallbackAnimationOffsetElement: function () { return this.GetCallbackAnimationElement(); }, IsCallbackAnimationEnabled: function () { return (this.enableCallbackAnimation || this.isSlideCallbackAnimationEnabled()) & !this.isCallbackAnimationPrevented; }, GetDefaultanimationEngineType: function() { return ASPx.AnimationEngineType.DEFAULT; }, StartBeginCallbackAnimation: function () { this.beginCallbackAnimationProcessing = true; this.isCallbackFinished = false; var element = this.GetCallbackAnimationElement(); if(element & this.isSlideCallbackAnimationEnabled() && this.slideAnimationDirection) ASPx.AnimationHelper.slideOut(element, this.slideAnimationDirection, this.FinishBeginCallbackAnimation.aspxBind(this), this.GetDefaultanimationEngineType()); else if(element & this.enableCallbackAnimation) ASPx.AnimationHelper.fadeOut(element, this.FinishBeginCallbackAnimation.aspxBind(this)); else this.FinishBeginCallbackAnimation(); }, CancelBeginCallbackAnimation: function() { if(this.beginCallbackAnimationProcessing) { this.beginCallbackAnimationProcessing = false; var element = this.GetCallbackAnimationElement(); ASPx.AnimationHelper.cancelAnimation(element); } }, FinishBeginCallbackAnimation: function () { this.beginCallbackAnimationProcessing = false; if(!this.isCallbackFinished) this.ShowLoadingElementsInternal(); else { this.DoCallback(this.savedCallbackResult); this.savedCallbackResult = null; } }, CheckBeginCallbackAnimationInProgress: function(callbackResult) { if(this.beginCallbackAnimationProcessing) { this.savedCallbackResult = callbackResult; this.isCallbackFinished = true; return true; } return false; }, StartEndCallbackAnimation: function () { this.HideLoading(); this.SetInitialLoadingDivOpacity(); this.RaiseEndCallbackAnimationStart(); this.endCallbackAnimationProcessing = true; var element = this.GetCallbackAnimationElement(); if(element & this.isSlideCallbackAnimationEnabled() && this.slideAnimationDirection) ASPx.AnimationHelper.slideIn(element, this.slideAnimationDirection, this.FinishEndCallbackAnimation.aspxBind(this), this.GetDefaultanimationEngineType()); else if(element & this.enableCallbackAnimation) ASPx.AnimationHelper.fadeIn(element, this.FinishEndCallbackAnimation.aspxBind(this)); else this.FinishEndCallbackAnimation(); this.slideAnimationDirection = null; }, FinishEndCallbackAnimation: function () { this.DoEndCallback(); this.endCallbackAnimationProcessing = false; this.CheckRepeatGesture(); }, CheckEndCallbackAnimationNeeded: function() { if(!this.endCallbackAnimationProcessing & this.requestCount == 1) { this.StartEndCallbackAnimation(); return true; } return false; }, PreventCallbackAnimation: function() { this.isCallbackAnimationPrevented = true; }, GetCallbackAnimationElement: function() { return null; }, AssignSlideAnimationDirectionByPagerArgument: function(arg, currentPageIndex) { this.slideAnimationDirection = null; if(this.isSlideCallbackAnimationEnabled() & typeof(ASPx.AnimationHelper) != "undefined") { if(arg == PagerCommands.Next || arg == PagerCommands.Last) this.slideAnimationDirection = ASPx.AnimationHelper.SLIDE_LEFT_DIRECTION; else if(arg == PagerCommands.First || arg == PagerCommands.Prev) this.slideAnimationDirection = ASPx.AnimationHelper.SLIDE_RIGHT_DIRECTION; else if(!isNaN(currentPageIndex) & arg.indexOf(PagerCommands.PageNumber) == 0) { var newPageIndex = parseInt(arg.substring(2)); if(!isNaN(newPageIndex)) this.slideAnimationDirection = newPageIndex < currentPageIndex ? ASPx.AnimationHelper.SLIDE_RIGHT_DIRECTION : ASPx.AnimationHelper.SLIDE_LEFT_DIRECTION; } } }, TryShowPhantomLoadingElements: function () { if(this.hasPhantomLoadingElements & this.InCallback()) { this.hasPhantomLoadingElements = false; this.ShowLoadingDivAnd(); } }, ShowLoadingDivAnd: function () { this.ShowLoadingDiv(); this.RestoreLoadingDivOpacity(); this.ShowLoading(); }, HideLoadingElements: function() { this.CancelBeginCallbackAnimation(); this.HideLoading(); this.HideLoadingDiv(); }, ShowLoadingOnTimer: function() { this.ClearLoadingTimer(); if(!this.IsDOMDisposed()) { this.RestoreLoadingDivOpacity(); this.ShowLoading(); } }, ClearLoadingTimer: function() { this.lpTimer = ASPx.Timer.ClearTimer(this.lpTimer); }, HideLoading: function() { this.ClearLoadingTimer(); this.hasPhantomLoadingElements = false; if(ASPx.IsExistsElement(this.loadingElement)) { ASPx.RemoveElement(this.loadingElement); this.loadingElement = null; } }, SetLoadingLocation: function(offsetElement, loading, x, y, offsetX, offsetY) { if(!ASPx.IsExists(x) || !ASPx.IsExists(y)){ var x1 = ASPx.GetAbsoluteX(offsetElement); var y1 = ASPx.GetAbsoluteY(offsetElement); var x2 = x1; var y2 = y1; if(offsetElement == document.body){ x2 += ASPx.GetDocumentMaxClientWidth(); y2 += ASPx.GetDocumentMaxClientHeight(); } else{ x2 += offsetElement.offsetWidth; y2 += offsetElement.offsetHeight; } if(x1 < ASPx.GetDocumentScrollLeft()) x1 = ASPx.GetDocumentScrollLeft(); if(y1 < ASPx.GetDocumentScrollTop()) y1 = ASPx.GetDocumentScrollTop(); if(x2 > ASPx.GetDocumentScrollLeft() + ASPx.GetDocumentClientWidth()) x2 = ASPx.GetDocumentScrollLeft() + ASPx.GetDocumentClientWidth(); if(y2 > ASPx.GetDocumentScrollTop() + ASPx.GetDocumentClientHeight()) y2 = ASPx.GetDocumentScrollTop() + ASPx.GetDocumentClientHeight(); x = x1 + ((x2 - x1 - loading.offsetWidth) / 2); y = y1 + ((y2 - y1 - loading.offsetHeight) / 2); } if(ASPx.IsExists(offsetX) & ASPx.IsExists(offsetY)){ x += offsetX; y += offsetY; } x = ASPx.PrepareClientPosForElement(x, loading, true); y = ASPx.PrepareClientPosForElement(y, loading, false); if(ASPx.Browser.IE & ASPx.Browser.Version > 8 && (y - Math.floor(y) === 0.5)) y = Math.ceil(y); ASPx.SetStyles(loading, { left: x, top: y }); }, GetLoadingDiv: function(){ return ASPx.GetElementById(this.name + "_LD"); }, CreateLoadingDiv: function(parentElement, offsetElement){ if(this.ShouldHideExistingLoadingElements()) this.HideLoadingDiv(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } if(!offsetElement) offsetElement = parentElement; var div = this.GetLoadingDiv(); if(div != null){ div = div.cloneNode(true); parentElement.appendChild(div); ASPx.SetElementDisplay(div, true, true); ASPx.Evt.AttachEventToElement(div, ASPx.TouchUIHelper.touchMouseDownEventName, ASPx.Evt.PreventEvent); ASPx.Evt.AttachEventToElement(div, ASPx.TouchUIHelper.touchMouseMoveEventName, ASPx.Evt.PreventEvent); ASPx.Evt.AttachEventToElement(div, ASPx.TouchUIHelper.touchMouseUpEventName, ASPx.Evt.PreventEvent); ASPx.Evt.AttachEventToElement(div, ASPx.Evt.GetMouseWheelEventName(), ASPx.Evt.PreventEvent); this.SetLoadingDivBounds(offsetElement, div); this.loadingDivElement = div; this.SetInitialLoadingDivOpacity(); return div; } return null; }, SetInitialLoadingDivOpacity: function() { if(!this.loadingDivElement) return; ASPx.Attr.SaveStyleAttribute(this.loadingDivElement, "opacity"); ASPx.Attr.SaveStyleAttribute(this.loadingDivElement, "filter"); ASPx.SetElementOpacity(this.loadingDivElement, 0.01); }, RestoreLoadingDivOpacity: function() { if(!this.loadingDivElement) return; ASPx.Attr.RestoreStyleAttribute(this.loadingDivElement, "opacity"); ASPx.Attr.RestoreStyleAttribute(this.loadingDivElement, "filter"); }, SetLoadingDivBounds: function(offsetElement, loadingDiv) { var absX = (offsetElement == document.body) ? 0 : ASPx.GetAbsoluteX(offsetElement); var absY = (offsetElement == document.body) ? 0 : ASPx.GetAbsoluteY(offsetElement); ASPx.SetStyles(loadingDiv, { left: ASPx.PrepareClientPosForElement(absX, loadingDiv, true), top: ASPx.PrepareClientPosForElement(absY, loadingDiv, false) }); var width = (offsetElement == document.body) ? ASPx.GetDocumentWidth() : offsetElement.offsetWidth; var height = (offsetElement == document.body) ? ASPx.GetDocumentHeight() : offsetElement.offsetHeight; if(height < 0) height = 0; ASPx.SetStyles(loadingDiv, { width: width, height: height }); var correctedWidth = 2 * width - loadingDiv.offsetWidth; if(correctedWidth <= 0) correctedWidth = width; var correctedHeight = 2 * height - loadingDiv.offsetHeight; if(correctedHeight <= 0) correctedHeight = height; ASPx.SetStyles(loadingDiv, { width: correctedWidth, height: correctedHeight }); }, ShowLoadingDiv: function() { }, HideLoadingDiv: function() { this.hasPhantomLoadingElements = false; if(ASPx.IsExistsElement(this.loadingDivElement)){ ASPx.RemoveElement(this.loadingDivElement); this.loadingDivElement = null; } }, CanHandleGesture: function(evt) { return false; }, CanHandleGestureCore: function(evt) { var source = ASPx.Evt.GetEventSource(evt); if(ASPx.GetIsParent(this.loadingElement, source) || ASPx.GetIsParent(this.loadingDivElement, source)) return true; var callbackAnimationElement = this.GetCallbackAnimationElement(); if(!callbackAnimationElement) return false; var animationContainer = ASPx.AnimationHelper.getSlideAnimationContainer(callbackAnimationElement, false, false); if(animationContainer & ASPx.GetIsParent(animationContainer, source) && !ASPx.GetIsParent(animationContainer.childNodes[0], source)) return true; return this.CanHandleGesture(evt); }, AllowStartGesture: function() { return !this.beginCallbackAnimationProcessing & !this.endCallbackAnimationProcessing; }, StartGesture: function() { }, AllowExecuteGesture: function(value) { return false; }, ExecuteGesture: function(value) { }, CancelGesture: function(value) { if(this.repeatedGestureCount === 0) { this.repeatedGestureValue = value; this.repeatedGestureCount = 1; } else { if(this.repeatedGestureValue * value > 0) this.repeatedGestureCount++; else this.repeatedGestureCount--; if(this.repeatedGestureCount === 0) this.repeatedGestureCount = 0; } }, CheckRepeatGesture: function() { if(this.repeatedGestureCount !== 0) { if(this.AllowExecuteGesture(this.repeatedGestureValue)) this.ExecuteGesture(this.repeatedGestureValue, this.repeatedGestureCount); this.repeatedGestureValue = 0; this.repeatedGestureCount = 0; } }, AllowExecutePagerGesture: function (pageIndex, pageCount, value) { if(pageIndex < 0) return false; if(pageCount <= 1) return false; if(value > 0 & pageIndex === 0) return false; if(value < 0 & pageIndex === pageCount - 1) return false; return true; }, ExecutePagerGesture: function(pageIndex, pageCount, value, count, method) { if(!count) count = 1; var pageIndex = pageIndex + (value < 0 ? count : -count); if(pageIndex < 0) pageIndex = 0; if(pageIndex > pageCount - 1) pageIndex = pageCount - 1; method(PagerCommands.PageNumber + pageIndex); }, RaiseInit: function(){ if(!this.Init.IsEmpty()){ var args = new ASPxClientEventArgs(); this.Init.FireEvent(this, args); } }, RaiseBeginCallbackInternal: function(command){ if(!this.BeginCallback.IsEmpty()){ var args = new ASPxClientBeginCallbackEventArgs(command); this.BeginCallback.FireEvent(this, args); } }, RaiseEndCallbackInternal: function() { if(!this.EndCallback.IsEmpty()){ var args = new ASPxClientEndCallbackEventArgs(); this.EndCallback.FireEvent(this, args); } }, RaiseCallbackErrorInternal: function(message, callbackId) { if(!this.CallbackError.IsEmpty()) { var args = new ASPxClientCallbackErrorEventArgs(message, callbackId); this.CallbackError.FireEvent(this, args); if(args.handled) return { isHandled: true, errorMessage: args.message }; } }, RaiseBeginCallback: function(command){ this.RaiseBeginCallbackInternal(command); aspxGetControlCollection().RaiseBeginCallback(this, command); }, RaiseEndCallback: function(){ this.RaiseEndCallbackInternal(); aspxGetControlCollection().RaiseEndCallback(this); }, RaiseCallbackError: function (message, callbackId) { var result = this.RaiseCallbackErrorInternal(message, callbackId); if(!result) result = aspxGetControlCollection().RaiseCallbackError(this, message, callbackId); return result; }, RaiseEndCallbackAnimationStart: function(){ if(!this.EndCallbackAnimationStart.IsEmpty()){ var args = new ASPxClientEventArgs(); this.EndCallbackAnimationStart.FireEvent(this, args); } }, RaiseBeforePronounce: function(message) { var args = new ASPxClientControlBeforePronounceEventArgs(message, this); if(!this.BeforePronounce.IsEmpty()) this.BeforePronounce.FireEvent(this, args); return args; }, RaiseUnload: function() { var args = new ASPxClientControlUnloadEventArgs(this); if(!this.Unload.IsEmpty()) this.Unload.FireEvent(this, args); }, SendMessageToAssistiveTechnology: function(message) { if(!this.accessibilityCompliant) return; this.PronounceMessageInternal(message, ASPx.AccessibilityPronouncerType.live); }, PronounceMessageInternal: function(messageArg, type) { var message = messageArg; if(!ASPx.Ident.IsArray(messageArg)) message = [messageArg]; var args = this.RaiseBeforePronounce(message); ASPx.AccessibilityPronouncer.Pronounce(args, type); }, IsVisible: function() { var element = this.GetMainElement(); return ASPx.IsElementVisible(element); }, IsDisplayedElement: function(element) { while(element & element.tagName != "BODY") { if(!ASPx.GetElementDisplay(element)) return false; element = element.parentNode; } return true; }, IsDisplayed: function() { return this.IsDisplayedElement(this.GetMainElement()); }, IsHiddenElement: function(element) { return element & element.offsetWidth == 0 && element.offsetHeight == 0; }, IsHidden: function() { return this.IsHiddenElement(this.GetMainElement()); }, Focus: function() { }, GetClientVisible: function(){ return this.GetVisible(); }, SetClientVisible: function(visible){ this.SetVisible(visible); }, GetVisible: function(){ return this.clientVisible; }, SetVisible: function(visible){ if(this.clientVisible != visible){ this.clientVisible = visible; ASPx.SetElementDisplay(this.GetMainElement(), visible); if(visible) { this.AdjustControl(); var mainElement = this.GetMainElement(); if(mainElement) aspxGetControlCollection().AdjustControls(mainElement); } } }, GetEnabled: function() { return this.clientEnabled; }, SetEnabled: function(enabled) { this.clientEnabled = enabled; if(ASPxClientControl.setEnabledLocked) return; else ASPxClientControl.setEnabledLocked = true; this.savedClientEnabled = enabled; aspxGetControlCollection().ProcessControlsInContainer(this.GetMainElement(), function(control) { if(ASPx.IsFunction(control.SetEnabled)) control.SetEnabled(enabled & control.savedClientEnabled); }); delete ASPxClientControl.setEnabledLocked; }, InCallback: function() { return this.requestCount > 0; }, DoBeginCallback: function(command) { this.RaiseBeginCallback(command || ""); aspxGetControlCollection().Before_WebForm_InitCallback(this.name); if(typeof(WebForm_InitCallback) != "undefined" & WebForm_InitCallback) { __theFormPostData = ""; __theFormPostCollection = [ ]; this.ClearPostBackEventInput("__EVENTTARGET"); this.ClearPostBackEventInput("__EVENTARGUMENT"); WebForm_InitCallback(); this.savedFormPostData = __theFormPostData; this.savedFormPostCollection = __theFormPostCollection; } }, ClearPostBackEventInput: function(id){ var element = ASPx.GetElementById(id); if(element != null) element.value = ""; }, PerformDataCallback: function(arg, handler) { this.CreateCustomDataCallback(arg, "", handler); }, sendCallbackViaQueue: function (prefix, arg, showLoading, context, handler) { if (!this.useCallbackQueue()) return false; var context = context || this; var token = this.callbackQueueHelper.sendCallback(ASPx.FormatCallbackArg(prefix, arg), context, handler || context.OnCallback, prefix); if (showLoading) this.callbackQueueHelper.showLoadingElements(); return token; }, CreateCallback: function (arg, command, handler) { var callbackInfo = this.CreateCallbackInfo(ASPx.CallbackType.Common, handler || null); var callbackID = this.CreateCallbackByInfo(arg, command, callbackInfo); return callbackID; }, CreateCustomDataCallback: function(arg, command, handler) { var callbackInfo = this.CreateCallbackInfo(ASPx.CallbackType.Data, handler); this.CreateCallbackByInfo(arg, command, callbackInfo); }, CreateCallbackByInfo: function(arg, command, callbackInfo) { if(!this.CanCreateCallback()) return; var callbackID; if(typeof(WebForm_DoCallback) != "undefined" & WebForm_DoCallback && ASPx.documentLoaded) callbackID = this.CreateCallbackInternal(arg, command, true, callbackInfo); else { if(!this.savedCallbacks) this.savedCallbacks = []; var callbackInfo = { arg: arg, command: command, callbackInfo: callbackInfo }; if(this.allowMultipleCallbacks) this.savedCallbacks.push(callbackInfo); else this.savedCallbacks[0] = callbackInfo; } return callbackID; }, CreateCallbackInternal: function(arg, command, viaTimer, callbackInfo) { var watcher = ASPx.ControlUpdateWatcher.getInstance(); if(watcher & !watcher.CanSendCallback(this, arg)) { this.CancelCallbackInternal(); return; } this.requestCount++; this.DoBeginCallback(command); if(typeof(arg) == "undefined") arg = ""; if(typeof(command) == "undefined") command = ""; var callbackID = this.SaveCallbackInfo(callbackInfo); if(viaTimer) window.setTimeout(function() { this.CreateCallbackCore(arg, command, callbackID); }.aspxBind(this), 0); else this.CreateCallbackCore(arg, command, callbackID); return callbackID; }, CancelCallbackInternal: function() { this.CancelCallbackCore(); this.HideLoadingElements(); }, CancelCallbackCore: function() { }, CreateCallbackCore: function(arg, command, callbackID) { var callBackMethod = this.GetCallbackMethod(command); __theFormPostData = this.savedFormPostData; __theFormPostCollection = this.savedFormPostCollection; callBackMethod.call(this, this.GetSerializedCallbackInfoByID(callbackID) + arg); }, GetCallbackMethod: function(command){ return this.callBack; }, CanCreateCallback: function() { return !this.InCallback() || (this.allowMultipleCallbacks & !this.beginCallbackAnimationProcessing && !this.endCallbackAnimationProcessing); }, DoLoadCallbackScripts: function() { ASPx.ProcessScriptsAndLinks(this.name, true); }, DoEndCallback: function() { if(this.IsCallbackAnimationEnabled() & this.CheckEndCallbackAnimationNeeded()) return; this.requestCount--; if (this.requestCount < 1) this.callbackHandlersQueue.executeCallbacksHandlers(); if(this.HideLoadingOnCallback() & this.requestCount < 1) this.HideLoadingElements(); if(this.isSwipeGesturesEnabled() & this.Gestures) { ASPx.GesturesHelper.UpdateSwipeAnimationContainer(this.name); if(this.touchUIMouseScroller) this.touchUIMouseScroller.update(); } this.isCallbackAnimationPrevented = false; this.OnCallbackFinalized(); this.AssignEllipsisTooltips(); this.RaiseEndCallback(); }, DoFinalizeCallback: function() { }, OnCallbackFinalized: function() { }, AssignEllipsisTooltips: function() { }, HideLoadingOnCallback: function() { return true; }, ShouldHideExistingLoadingElements: function() { return true; }, EvalCallbackResult: function(resultString){ return eval(resultString); }, ParseJSProperties: function(resultObj) { if(resultObj.) { for(var name in resultObj.) if(resultObj..hasOwnProperty(name)) this[name] = resultObj.[name]; } }, DoCallback: function(result) { if(this.IsCallbackAnimationEnabled() & this.CheckBeginCallbackAnimationInProgress(result)) return; result = ASPx.Str.Trim(result); if(result.indexOf(ASPx.CallbackResultPrefix) != 0) this.ProcessCallbackGeneralError(result, false); else { var resultObj = null; try { resultObj = this.EvalCallbackResult(result); } catch(e) { } if(resultObj) { ASPx.CacheHelper.DropCache(this); if(resultObj.redirect) { this.ParseJSProperties(resultObj); ASPx.Url.Redirect(resultObj.redirect); } else if(ASPx.IsExists(resultObj.generalError)) { this.ProcessCallbackGeneralError(resultObj.generalError, true); } else { var errorObj = resultObj.error; if(errorObj) this.ProcessCallbackError(errorObj,resultObj.id); else { this.ParseJSProperties(resultObj); var callbackInfo = this.DequeueCallbackInfo(resultObj.id); if(callbackInfo & callbackInfo.type == ASPx.CallbackType.Data) this.ProcessCustomDataCallback(resultObj.result, callbackInfo); else { if (this.useCallbackQueue() & this.callbackQueueHelper.getCallbackInfoById(resultObj.id)) this.callbackQueueHelper.processCallback(resultObj.result, resultObj.id); else { this.ProcessCallback(resultObj.result, resultObj.id); if(callbackInfo & callbackInfo.handler) { var handlerInfo = { handler: callbackInfo.handler, result: resultObj.result.data }; this.callbackHandlersQueue.addCallbackHandler(handlerInfo); } } } } } } } this.DoLoadCallbackScripts(); }, DoCallbackError: function(result) { this.HideLoadingElements(); this.ProcessCallbackGeneralError(result, false); }, DoControlClick: function(evt) { this.OnControlClick(ASPx.Evt.GetEventSource(evt), evt); }, ProcessCallback: function (result, callbackId) { this.OnCallback(result, callbackId); }, ProcessCustomDataCallback: function(result, callbackInfo) { if(callbackInfo.handler != null) callbackInfo.handler(this, result); this.RaiseCustomDataCallback(result); }, RaiseCustomDataCallback: function(result) { if(!this.CustomDataCallback.IsEmpty()) { var arg = new ASPxClientCustomDataCallbackEventArgs(result); this.CustomDataCallback.FireEvent(this, arg); } }, OnCallback: function(result) { }, CreateCallbackInfo: function(type, handler) { return { type: type, handler: handler }; }, GetSerializedCallbackInfoByID: function(callbackID) { return this.GetCallbackInfoByID(callbackID).type + callbackID + ASPx.CallbackSeparator; }, SaveCallbackInfo: function(callbackInfo) { var activeCallbacksInfo = this.GetActiveCallbacksInfo(); for(var i = 0; i < activeCallbacksInfo.length; i++) { if(activeCallbacksInfo[i] == null) { activeCallbacksInfo[i] = callbackInfo; return i; } } activeCallbacksInfo.push(callbackInfo); return activeCallbacksInfo.length - 1; }, GetActiveCallbacksInfo: function() { var persistentProperties = this.GetPersistentProperties(); if(!persistentProperties.activeCallbacks) persistentProperties.activeCallbacks = [ ]; return persistentProperties.activeCallbacks; }, GetPersistentProperties: function() { var storage = _aspxGetPersistentControlPropertiesStorage(); var persistentProperties = storage[this.name]; if(!persistentProperties) { persistentProperties = { }; storage[this.name] = persistentProperties; } return persistentProperties; }, GetCallbackInfoByID: function(callbackID) { return this.GetActiveCallbacksInfo()[callbackID]; }, DequeueCallbackInfo: function(index) { var activeCallbacksInfo = this.GetActiveCallbacksInfo(); if(index < 0 || index >= activeCallbacksInfo.length) return null; var result = activeCallbacksInfo[index]; activeCallbacksInfo[index] = null; return result; }, ProcessCallbackError: function (errorObj, callbackId) { var data = ASPx.IsExists(errorObj.data) ? errorObj.data : null; var result = this.RaiseCallbackError(errorObj.message, callbackId); if(result.isHandled) this.OnCallbackErrorAfterHandle(result.errorMessage, data); else this.OnCallbackError(result.errorMessage, data); }, OnCallbackError: function(errorMessage, data) { if(errorMessage) ASPx.ShowErrorAlert(errorMessage); }, OnCallbackErrorAfterHandle: function(errorMessage, data) { }, ProcessCallbackGeneralError: function(errorMessage, serverExceptionOnLastCallback) { this.serverExceptionOnLastCallback = serverExceptionOnLastCallback; var result = this.RaiseCallbackError(errorMessage); if(!result.isHandled) this.OnCallbackGeneralError(result.errorMessage); }, OnCallbackGeneralError: function(errorMessage) { this.OnCallbackError(errorMessage, null); }, SendPostBack: function(params) { if(typeof(__doPostBack) != "undefined") __doPostBack(this.uniqueID, params); else{ var form = this.GetParentForm(); if(form) form.submit(); } }, IsValidInstance: function () { return aspxGetControlCollection().GetByName(this.name) === this; }, OnDispose: function() { var varName = this.globalName; if(varName & varName !== "" && window && window[varName] && window[varName] == this){ try{ delete window[varName]; } catch(e){ } } if(this.callbackQueueHelper) this.callbackQueueHelper.detachEvents(); }, OnGlobalControlsInitialized: function(args) { }, OnGlobalBrowserWindowResized: function(args) { }, OnGlobalBeginCallback: function(args) { }, OnGlobalEndCallback: function(args) { }, OnGlobalCallbackError: function(args) { }, OnGlobalValidationCompleted: function(args) { }, DOMContentLoaded: function() { }, IsStateControllerEnabled: function() { return false; }, InitializeDOM: function() { var mainElement = this.GetMainElement(); if(mainElement) mainElement["dxinit"] = true; }, IsDOMInitialized: function() { var mainElement = this.GetMainElement(); return mainElement & mainElement["dxinit"]; }, AdjustControl: function(nestedCall) { }, OnBrowserWindowResizeInternal: function(e) { }, InControlTree: function(tree) { } }); ASPxClientControlBase.Cast = function(obj) { if(typeof obj == "string") return window[obj]; return obj; }; var persistentControlPropertiesStorage = null; function _aspxGetPersistentControlPropertiesStorage() { if(persistentControlPropertiesStorage == null) persistentControlPropertiesStorage = { }; return persistentControlPropertiesStorage; } var ELLIPSIS_MARKER_CLASS = "dx-ellipsis"; var ELLIPSIS_TOOLTIP_MARKER_ATTR = "dxEllipsisTitle"; var ASPxClientControl = ASPx.CreateClass(ASPxClientControlBase, { constructor: function(name){ this.constructor.prototype.constructor.call(this, name); this.rtl = false; this.enableEllipsis = false; this.isNative = false; this.isControlCollapsed = false; this.isInsideHierarchyAdjustment = false; this.controlOwner = null; this.adjustedSizes = { }; this.dialogContentHashTable = { }; this.renderIFrameForPopupElements = false; this.widthValueSetInPercentage = false; this.heightValueSetInPercentage = false; this.verticalAlignedElements = { }; this.wrappedTextContainers = { }; this.scrollPositionState = { }; this.sizingConfig = { allowSetWidth: true, allowSetHeight: true, correction : false, adjustControl : false, PercentHeight: false, AutoHeight: false }; this.percentSizeConfig = { width: -1, height: -1, markerWidth: -1, markerHeight: -1 }; }, InlineInitialize: function() { this.InitializeDOM(); ASPxClientControlBase.prototype.InlineInitialize.call(this); }, AfterCreate: function() { ASPxClientControlBase.prototype.AfterCreate.call(this); if(!this.CanInitializeAdjustmentOnDOMContentLoaded() || ASPx.IsStartupScriptsRunning()) this.InitializeAdjustment(); }, DOMContentLoaded: function() { if(this.CanInitializeAdjustmentOnDOMContentLoaded()) this.InitializeAdjustment(); }, CanInitializeAdjustmentOnDOMContentLoaded: function() { return !ASPx.Browser.IE || ASPx.Browser.Version >= 10; }, InitializeAdjustment: function() { this.UpdateAdjustmentFlags(); this.AdjustControl(); }, AfterInitialize: function() { this.AdjustControl(); ASPxClientControlBase.prototype.AfterInitialize.call(this); }, IsStateControllerEnabled: function(){ return typeof(ASPx.GetStateController) != "undefined" & ASPx.GetStateController(); }, GetWidth: function() { return this.GetMainElement().offsetWidth; }, GetHeight: function() { return this.GetMainElement().offsetHeight; }, SetWidth: function(width) { if(this.sizingConfig.allowSetWidth) this.SetSizeCore("width", width, "GetWidth", false); }, SetHeight: function(height) { if(this.sizingConfig.allowSetHeight) this.SetSizeCore("height", height, "GetHeight", false); }, SetSizeCore: function(sizePropertyName, size, getFunctionName, corrected) { if(size < 0) return; this.GetMainElement().style[sizePropertyName] = size + "px"; this.UpdateAdjustmentFlags(sizePropertyName); if(this.sizingConfig.adjustControl) this.AdjustControl(true); if(this.sizingConfig.correction & !corrected) { var realSize = this[getFunctionName](); if(realSize != size) { var correctedSize = size - (realSize - size); this.SetSizeCore(sizePropertyName, correctedSize, getFunctionName, true); } } }, AdjustControl: function(nestedCall) { if(this.IsAdjustmentRequired() & (!ASPxClientControl.adjustControlLocked || nestedCall)) { ASPxClientControl.adjustControlLocked = true; try { if(!this.IsAdjustmentAllowed()) return; this.AdjustControlCore(); this.UpdateAdjustedSizes(); } finally { delete ASPxClientControl.adjustControlLocked; } } this.AssignEllipsisTooltips(); this.TryShowPhantomLoadingElements(); }, ResetControlAdjustment: function () { this.adjustedSizes = { }; }, UpdateAdjustmentFlags: function(sizeProperty) { var mainElement = this.GetMainElement(); if(mainElement) { var mainElementStyle = ASPx.GetCurrentStyle(mainElement); this.UpdatePercentSizeConfig([mainElementStyle.width, mainElement.style.width], [mainElementStyle.height, mainElement.style.height], sizeProperty); } }, UpdatePercentSizeConfig: function(widths, heights, modifyStyleProperty) { switch(modifyStyleProperty) { case "width": this.UpdatePercentWidthConfig(widths); break; case "height": this.UpdatePercentHeightConfig(heights); break; default: this.UpdatePercentWidthConfig(widths); this.UpdatePercentHeightConfig(heights); break; } this.ResetControlPercentMarkerSize(); }, UpdatePercentWidthConfig: function(widths) { this.widthValueSetInPercentage = false; for(var i = 0; i < widths.length; i++) { if(this.IsPercentageWidth(widths[i])) { this.percentSizeConfig.width = widths[i]; this.widthValueSetInPercentage = true; break; } } }, IsPercentageWidth: function(width) { return ASPx.IsPercentageSize(width); }, UpdatePercentHeightConfig: function(heights) { this.heightValueSetInPercentage = false; for(var i = 0; i < heights.length; i++) { if(ASPx.IsPercentageSize(heights[i])) { this.percentSizeConfig.height = heights[i]; this.heightValueSetInPercentage = true; break; } } }, GetAdjustedSizes: function() { var mainElement = this.GetMainElement(); if(mainElement) return { width: mainElement.offsetWidth, height: mainElement.offsetHeight }; return { width: 0, height: 0 }; }, IsAdjusted: function() { return (this.adjustedSizes.width & this.adjustedSizes.width > 0) && (this.adjustedSizes.height && this.adjustedSizes.height > 0); }, IsAdjustmentRequired: function() { if(!this.IsAdjusted()) return true; if(this.widthValueSetInPercentage) return true; if(this.heightValueSetInPercentage) return true; var sizes = this.GetAdjustedSizes(); for(var name in sizes){ if(this.adjustedSizes[name] !== sizes[name]) return true; } return false; }, IsAdjustmentAllowed: function() { var mainElement = this.GetMainElement(); return mainElement & this.IsDisplayed() && !this.IsHidden() && this.IsDOMInitialized(); }, UpdateAdjustedSizes: function() { var sizes = this.GetAdjustedSizes(); for(var name in sizes) if(sizes.hasOwnProperty(name)) this.adjustedSizes[name] = sizes[name]; }, AdjustControlCore: function() { }, AdjustAutoHeight: function() { }, IsControlCollapsed: function() { return this.isControlCollapsed; }, NeedCollapseControl: function() { return this.NeedCollapseControlCore() & this.IsAdjustmentRequired() && this.IsAdjustmentAllowed(); }, NeedCollapseControlCore: function() { return false; }, CollapseEditor: function() { }, CollapseControl: function() { this.SaveScrollPositions(); var mainElement = this.GetMainElement(), marker = this.GetControlPercentSizeMarker(); marker.style.height = this.heightValueSetInPercentage & this.sizingConfig.PercentHeight ? this.percentSizeConfig.height : (mainElement.offsetHeight + "px"); mainElement.style.display = "none"; this.isControlCollapsed = true; }, ExpandControl: function() { var mainElement = this.GetMainElement(); mainElement.style.display = ""; this.GetControlPercentSizeMarker().style.height = "0px"; this.isControlCollapsed = false; this.RestoreScrollPositions(); }, CanCaeadjustment: function() { return this.NeedCollapseControlCore(); }, IsExpandableByAdjustment: function() { return false; }, HasFixedPosition: function() { return false; }, SaveScrollPositions: function() { var mainElement = this.GetMainElement(); this.scrollPositionState.outer = ASPx.GetOuterScrollPosition(mainElement.parentNode); this.scrollPositionState.inner = ASPx.GetInnerScrollPositions(mainElement); }, RestoreScrollPositions: function() { ASPx.RestoreOuterScrollPosition(this.scrollPositionState.outer); ASPx.RestoreInnerScrollPositions(this.scrollPositionState.inner); }, GetControlPercentSizeMarker: function() { if(this.percentSizeMarker === undefined) { this.percentSizeMarker = ASPx.CreateHtmlElementFromString(""); ASPx.InsertElementAfter(this.percentSizeMarker, this.GetMainElement()); } return this.percentSizeMarker; }, KeepControlPercentSizeMarker: function(needCollapse, needCalculateHeight) { var mainElement = this.GetMainElement(), marker = this.GetControlPercentSizeMarker(), markerHeight; if(needCollapse) this.CollapseControl(); if(this.widthValueSetInPercentage & marker.style.width !== this.percentSizeConfig.width) marker.style.width = this.percentSizeConfig.width; if(needCalculateHeight) { if(this.IsControlCollapsed()) markerHeight = marker.style.height; marker.style.height = this.percentSizeConfig.height; } this.percentSizeConfig.markerWidth = marker.offsetWidth; if(needCalculateHeight) { this.percentSizeConfig.markerHeight = marker.offsetHeight; if(this.IsControlCollapsed()) marker.style.height = markerHeight; else marker.style.height = "0px"; } if(needCollapse) this.ExpandControl(); }, ResetControlPercentMarkerSize: function() { this.percentSizeConfig.markerWidth = -1; this.percentSizeConfig.markerHeight = -1; }, GetControlPercentMarkerSize: function(hideControl, force) { var needCalculateHeight = this.heightValueSetInPercentage & this.sizingConfig.PercentHeight; if(force || this.percentSizeConfig.markerWidth < 1 || (needCalculateHeight & this.percentSizeConfig.markerHeight < 1)) this.KeepControlPercentSizeMarker(hideControl && !this.IsControlCollapsed(), needCalculateHeight); return { width: this.percentSizeConfig.markerWidth, height: this.percentSizeConfig.markerHeight }; }, AssignEllipsisTooltips: function() { if(this.RequireAssignTooltips()) this.AssignEllipsisTooltipsCore(); }, AssignEllipsisTooltipsCore: function(rootElement, reassingExistingTooltips) { var requirePaddingManipulation = ASPx.Browser.IE || ASPx.Browser.Edge || ASPx.Browser.Firefox; rootElement = rootElement || this.GetMainElement(); var nodes = this.GetEllipsisNodes(rootElement); var nodeInfos = []; var nodesCount = nodes.length; for(var i = 0; i < nodesCount; i++) { var node = nodes[i]; var info = { node: node }; if(requirePaddingManipulation) { var style = ASPx.GetCurrentStyle(node); info.paddingLeft = node.style.paddingLeft; info.totalPadding = ASPx.GetLeftRightPaddings(node, style); } nodeInfos.push(info); } if(requirePaddingManipulation) { for(var i = 0; i < nodesCount; i++) { var info = nodeInfos[i]; ASPx.SetStyles(info.node, { paddingLeft: info.totalPadding }, true); } } for(var i = 0; i < nodesCount; i++) { var info = nodeInfos[i]; var node = info.node; info.isTextShortened = node.scrollWidth > node.clientWidth; info.hasTitle = ASPx.Attr.GetAttribute(node, "title") !== null; if(!info.hasTitle || reassingExistingTooltips) info.title = this.GetEllipsisTooltipText(node); } for(var i = 0; i < nodesCount; i++) { var info = nodeInfos[i]; var node = info.node; if(info.isTextShortened & info.title) { ASPx.Attr.SetAttribute(node, "title", info.title); ASPx.Attr.SetAttribute(node, ELLIPSIS_TOOLTIP_MARKER_ATTR, true); } if(!info.isTextShortened & info.hasTitle) ASPx.Attr.RemoveAttribute(node, "title"); } if(requirePaddingManipulation) { for(var i = 0; i < nodesCount; i++) { var info = nodeInfos[i]; var node = info.node; node.style.paddingLeft = info.paddingLeft; } } }, GetEllipsisNodes: function(element) { var ellipsibleNodes = ASPx.Data.CollectionToArray(ASPx.GetNodesByClassName(element, ELLIPSIS_MARKER_CLASS)); if(ASPx.ElementHasCssClass(element, ELLIPSIS_MARKER_CLASS)) ellipsibleNodes.push(element); return ellipsibleNodes.filter(function(node) { return !ASPx.Attr.IsExistsAttribute(node, "title") || ASPx.Attr.IsExistsAttribute(node, ELLIPSIS_TOOLTIP_MARKER_ATTR); }); }, GetEllipsisTooltipText: function(element) { if(element & ASPx.IsExists(element.innerText)) return element.innerText; return ASPx.GetInnerText(element); }, RequireAssignTooltips: function() { return this.enableEllipsis & !ASPx.Browser.MobileUI; }, OnBrowserWindowResize: function(e) { }, OnBrowserWindowResizeInternal: function(e){ if(this.BrowserWindowResizeSubscriber()) this.OnBrowserWindowResize(e); }, BrowserWindowResizeSubscriber: function() { return this.widthValueSetInPercentage || !this.IsAdjusted(); }, ShrinkWrappedText: function(getElements, key, reCorrect) { if(!ASPx.Browser.Safari) return; var elements = ASPx.CacheHelper.GetCachedElements(this, key, getElements, this.wrappedTextContainers); for(var i = 0; i < elements.length; i++) this.ShrinkWrappedTextInContainer(elements[i], reCorrect); }, ShrinkWrappedTextInContainer: function(container, reCorrect) { if(!ASPx.Browser.Safari || !container || (container.dxWrappedTextShrinked & !reCorrect) || container.offsetWidth === 0) return; ASPx.ShrinkWrappedTextInContainer(container); container.dxWrappedTextShrinked = true; }, CorrectWrappedText: function(getElements, key, reCorrect) { var elements = ASPx.CacheHelper.GetCachedElements(this, key, getElements, this.wrappedTextContainers); for(var i = 0; i < elements.length; i++) this.CorrectWrappedTextInContainer(elements[i], reCorrect); }, CorrectWrappedTextInContainer: function(container, reCorrect) { if(!container || (container.dxWrappedTextCorrected & !reCorrect) || container.offsetWidth === 0) return; ASPx.AdjustWrappedTextInContainer(container); container.dxWrappedTextCorrected = true; }, CorrectVerticalAlignment: function(alignMethod, getElements, key, reAlign) { var elements = ASPx.CacheHelper.GetCachedElements(this, key, getElements, this.verticalAlignedElements); for(var i = 0; i < elements.length; i++) this.CorrectElementVerticalAlignment(alignMethod, elements[i], reAlign); }, CorrectElementVerticalAlignment: function(alignMethod, element, reAlign) { if(!element || (element.dxVerticalAligned & !reAlign) || element.offsetHeight === 0) return; alignMethod(element); element.dxVerticalAligned = true; }, ResetElementVerticalAligmentFlag: function(element) { if(!element || !element.dxVerticalAligned) return; element.dxVerticalAligned = false; }, ClearVerticalAlignedElementsCache: function() { ASPx.CacheHelper.DropCache(this.verticalAlignedElements); }, ClearWrappedTextContainersCache: function() { ASPx.CacheHelper.DropCache(this.wrappedTextContainers); }, AdjustPagerControls: function() { if(typeof(ASPx.GetPagersCollection) != "undefined") ASPx.GetPagersCollection().AdjustControls(this.GetMainElement()); }, InControlTree: function(tree) { var mainElement = this.GetMainElement(); if(mainElement & mainElement.id) tree.createNode(mainElement.id, this); }, GetItemElementName: function(element) { var name = ""; if(element.id) name = element.id.substring(this.name.length + 1); return name; }, GetLinkElement: function(element) { if(element == null) return null; return (element.tagName == "A") ? element : ASPx.GetNodeByTagName(element, "A", 0); }, GetInternalHyperlinkElement: function(parentElement, index) { var element = ASPx.GetNodeByTagName(parentElement, "A", index); if(element == null) element = ASPx.GetNodeByTagName(parentElement, "SPAN", index); return element; }, OnControlClick: function(clickedElement, htmlEvent) { } }); ASPxClientControl.Cast = function(obj) { if(typeof obj == "string") return window[obj]; return obj; }; ASPxClientControl.AdjustControls = function(container, collapseControls){ aspxGetControlCollection().AdjustControls(container, collapseControls); }; ASPxClientControl.GetControlCollection = function(){ return aspxGetControlCollection(); }; ASPxClientControl.LeadingAfterInitCallConsts = { None: 0, Direct: 1, Reverse: 2 }; var ASPxClientComponent = ASPx.CreateClass(ASPxClientControl, { constructor: function (name) { this.constructor.prototype.constructor.call(this, name); }, IsDOMDisposed: function() { return false; } }); var ASPxClientControlCollection = ASPx.CreateClass(ASPx.CollectionBase, { constructor: function(){ this.constructor.prototype.constructor.call(this); this.prevWndWidth = ""; this.prevWndHeight = ""; this.requestCountInternal = 0; this.BeforeInitCallback = new ASPxClientEvent(); this.ControlsInitialized = new ASPxClientEvent(); this.BrowserWindowResized = new ASPxClientEvent(); this.BeginCallback = new ASPxClientEvent(); this.EndCallback = new ASPxClientEvent(); this.CallbackError = new ASPxClientEvent(); this.ValidationCompleted = new ASPxClientEvent(); aspxGetControlCollectionCollection().Add(this); }, Add: function(element) { var existsElement = this.Get(element.name); if(existsElement & existsElement !== element) this.Remove(existsElement); ASPx.CollectionBase.prototype.Add.call(this, element.name, element); }, Remove: function(element) { if(element & element instanceof ASPxClientControl) element.OnDispose(); ASPx.CollectionBase.prototype.Remove.call(this, element.name); }, GetGlobal: function(name) { var result = window[name]; return result & Ident.IsASPxClientControl(result) ? result : null; }, GetByName: function(name){ return this.Get(name) || this.GetGlobal(name); }, GetCollectionType: function(){ return ASPxClientControlCollection.BaseCollectionType; }, GetControlsByPredicate: function(predicate) { var result = []; this.ForEachControl(function(control) { if(!predicate || predicate(control)) result.push(control); }); return result; }, GetControlsByType: function(type) { return this.GetControlsByPredicate(function(control) { return type & (control instanceof type); }); }, ForEachControl: function(action, context) { context = context || this; this.elementsMap.forEachEntry(function(name, control) { if(Ident.IsASPxClientControl(control)) return action.call(context, control); }, context); }, forEachControlHierarchy: function(container, context, collapseControls, processFunc) { context = context || this; var controlTree = new ASPx.ControlTree(this, container); controlTree.forEachControl(collapseControls, function(control) { processFunc.call(context, control); }); }, AdjustControls: function(container, collapseControls) { container = container || null; window.setTimeout(function() { this.AdjustControlsCore(container, collapseControls); }.aspxBind(this), 0); }, AdjustControlsCore: function(container, collapseControls) { this.forEachControlHierarchy(container, this, collapseControls, function(control) { control.AdjustControl(); }); }, CollapseControls: function(container) { this.ProcessControlsInContainer(container, function(control) { if(control.isASPxClientEdit) control.CollapseEditor(); else if(!!window.ASPxClientRibbon & control instanceof ASPxClientRibbon) control.CollapseControl(); }); }, AtlasInitialize: function(isCallback) { if(ASPx.Browser.IE & ASPx.Browser.MajorVersion < 9) { var func = function() { if(_aspxIsLinksLoaded()) ASPx.ProcessScriptsAndLinks("", isCallback); else setTimeout(func, 100); }; func(); } else ASPx.ProcessScriptsAndLinks("", isCallback); }, DOMContentLoaded: function() { this.ForEachControl(function(control){ control.DOMContentLoaded(); }); }, OnDocumentUnload: function() { this.ForEachControl(function(control) { control.RaiseUnload(); }); }, Initialize: function() { ASPx.GetPostHandler().Post.AddHandler( function(s, e) { this.OnPost(e); }.aspxBind(this) ); ASPx.GetPostHandler().PostFinalization.AddHandler( function(s, e) { this.OnPostFinalization(e); }.aspxBind(this) ); this.InitializeElements(false ); if(typeof(Sys) != "undefined" & typeof(Sys.Application) != "undefined") { var checkIsInitialized = function() { if(Sys.Application.get_isInitialized()) Sys.Application.add_load(aspxCAInit); else setTimeout(checkIsInitialized, 0); }; checkIsInitialized(); } this.InitWindowSizeCache(); }, InitializeElements: function(isCallback) { this.ForEachControl(function(control){ if(!control.isInitialized) control.Initialize(); }); this.AfterInitializeElementsLeadingCall(); this.AfterInitializeElements(); this.RaiseControlsInitialized(isCallback); }, AfterInitializeElementsLeadingCall: function() { var controls = {}; controls[ASPxClientControl.LeadingAfterInitCallConsts.Direct] = []; controls[ASPxClientControl.LeadingAfterInitCallConsts.Reverse] = []; this.ForEachControl(function(control) { if(control.leadingAfterInitCall != ASPxClientControl.LeadingAfterInitCallConsts.None & !control.isInitialized) controls[control.leadingAfterInitCall].push(control); }); var directInitControls = controls[ASPxClientControl.LeadingAfterInitCallConsts.Direct], reverseInitControls = controls[ASPxClientControl.LeadingAfterInitCallConsts.Reverse]; for(var i = 0, control; control = directInitControls[i]; i++) control.AfterInitialize(); for(var i = reverseInitControls.length - 1, control; control = reverseInitControls[i]; i--) control.AfterInitialize(); }, AfterInitializeElements: function() { this.ForEachControl(function(control) { if(control.leadingAfterInitCall == ASPxClientControl.LeadingAfterInitCallConsts.None & !control.isInitialized) control.AfterInitialize(); }); ASPx.RippleHelper.Init(); }, DoFinalizeCallback: function() { this.ForEachControl(function(control){ control.DoFinalizeCallback(); }); }, ProcessControlsInContainer: function(container, processFunc) { this.ForEachControl(function(control){ if(!container || this.IsControlInContainer(container, control)) processFunc(control); }); }, IsControlInContainer: function(container, control) { if(control.GetMainElement) { var mainElement = control.GetMainElement(); if(mainElement & (mainElement != container)) { if(ASPx.GetIsParent(container, mainElement)) return true; } } return false; }, RaiseControlsInitialized: function(isCallback) { if(typeof(isCallback) == "undefined") isCallback = true; var args = new ASPxClientControlsInitializedEventArgs(isCallback); if(!this.ControlsInitialized.IsEmpty()) this.ControlsInitialized.FireEvent(this, args); this.ForEachControl(function(control){ control.OnGlobalControlsInitialized(args); }); }, RaiseBrowserWindowResized: function() { var args = new ASPxClientEventArgs(); if(!this.BrowserWindowResized.IsEmpty()) this.BrowserWindowResized.FireEvent(this, args); this.ForEachControl(function(control){ control.OnGlobalBrowserWindowResized(args); }); }, RaiseBeginCallback: function (control, command) { var args = new ASPxClientGlobalBeginCallbackEventArgs(control, command); if(!this.BeginCallback.IsEmpty()) this.BeginCallback.FireEvent(this, args); this.ForEachControl(function(control){ control.OnGlobalBeginCallback(args); }); this.IncrementRequestCount(); }, RaiseEndCallback: function (control) { var args = new ASPxClientGlobalEndCallbackEventArgs(control); if (!this.EndCallback.IsEmpty()) this.EndCallback.FireEvent(this, args); this.ForEachControl(function(control){ control.OnGlobalEndCallback(args); }); this.DecrementRequestCount(); }, InCallback: function() { return this.requestCountInternal > 0; }, RaiseCallbackError: function (control, message, callbackId) { var args = new ASPxClientGlobalCallbackErrorEventArgs(control, message, callbackId); if (!this.CallbackError.IsEmpty()) this.CallbackError.FireEvent(this, args); this.ForEachControl(function(control){ control.OnGlobalCallbackError(args); }); if(args.handled) return { isHandled: true, errorMessage: args.message }; return { isHandled: false, errorMessage: message }; }, RaiseValidationCompleted: function (container, validationGroup, invisibleControlsValidated, isValid, firstInvalidControl, firstVisibleInvalidControl) { var args = new ASPxClientValidationCompletedEventArgs(container, validationGroup, invisibleControlsValidated, isValid, firstInvalidControl, firstVisibleInvalidControl); if (!this.ValidationCompleted.IsEmpty()) this.ValidationCompleted.FireEvent(this, args); this.ForEachControl(function(control){ control.OnGlobalValidationCompleted(args); }); }, Before_WebForm_InitCallback: function(callbackOwnerID){ var args = new BeforeInitCallbackEventArgs(callbackOwnerID); this.BeforeInitCallback.FireEvent(this, args); }, InitWindowSizeCache: function(){ this.prevWndWidth = ASPx.GetDocumentClientWidth(); this.prevWndHeight = ASPx.GetDocumentClientHeight(); }, OnBrowserWindowResize: function(evt){ var shouldIgnoreNestedEvents = ASPx.Browser.IE & ASPx.Browser.MajorVersion == 8; if(shouldIgnoreNestedEvents) { if(this.prevWndWidth === "" || this.prevWndHeight === "" || this.browserWindowResizeLocked) return; this.browserWindowResizeLocked = true; } this.OnBrowserWindowResizeCore(evt); if(shouldIgnoreNestedEvents) this.browserWindowResizeLocked = false; }, OnBrowserWindowResizeCore: function(htmlEvent){ var args = this.CreateOnBrowserWindowResizeEventArgs(htmlEvent); if(this.CalculateIsBrowserWindowSizeChanged()) { this.forEachControlHierarchy(null, this, true, function(control) { if(control.IsDOMInitialized()) control.OnBrowserWindowResizeInternal(args); }); this.RaiseBrowserWindowResized(); } }, CreateOnBrowserWindowResizeEventArgs: function(htmlEvent){ return { htmlEvent: htmlEvent, wndWidth: ASPx.GetDocumentClientWidth(), wndHeight: ASPx.GetDocumentClientHeight(), prevWndWidth: this.prevWndWidth, prevWndHeight: this.prevWndHeight }; }, CalculateIsBrowserWindowSizeChanged: function(){ var wndWidth = ASPx.GetDocumentClientWidth(); var wndHeight = ASPx.GetDocumentClientHeight(); var isBrowserWindowSizeChanged = (this.prevWndWidth != wndWidth) || (this.prevWndHeight != wndHeight); if(isBrowserWindowSizeChanged){ this.prevWndWidth = wndWidth; this.prevWndHeight = wndHeight; return true; } return false; }, OnPost: function(args){ this.ForEachControl(function(control) { control.OnPost(args); }, null); }, OnPostFinalization: function(args){ this.ForEachControl(function(control) { control.OnPostFinalization(args); }, null); }, IncrementRequestCount: function() { this.requestCountInternal++; }, DecrementRequestCount: function() { this.requestCountInternal--; }, ResetRequestCount: function() { this.requestCountInternal = 0; } }); ASPxClientControlCollection.BaseCollectionType = "Control"; var controlCollection = null; function aspxGetControlCollection(){ if(controlCollection == null) controlCollection = new ASPxClientControlCollection(); return controlCollection; } var ControlCollectionCollection = ASPx.CreateClass(ASPx.CollectionBase, { constructor: function(){ this.constructor.prototype.constructor.call(this); }, Add: function(element) { var key = element.GetCollectionType(); if(!key) throw "The collection type isn't specified."; if(this.Get(key)) throw "The collection with type='" + key + "' already exists."; ASPx.CollectionBase.prototype.Add.call(this, key, element); }, RemoveDisposedControls: function(){ var baseCollection = this.Get(ASPxClientControlCollection.BaseCollectionType); var disposedControls = []; baseCollection.elementsMap.forEachEntry(function(name, control) { if(!ASPx.Ident.IsASPxClientControl(control)) return; if(control.IsDOMDisposed()) disposedControls.push(control); }); for(var i = 0; i < disposedControls.length; i++) { this.elementsMap.forEachEntry(function(key, collection) { if(ASPx.Ident.IsASPxClientCollection(collection)) collection.Remove(disposedControls[i]); }); } } }); var controlCollectionCollection = null; function aspxGetControlCollectionCollection(){ if(controlCollectionCollection == null) controlCollectionCollection = new ControlCollectionCollection(); return controlCollectionCollection; } var AriaDescriptionAttributes = { Role: "0", AriaLabel: "1", TabIndex: "2", AriaOwns: "3", AriaDescribedBy: "4", AriaDisabled: "5", AriaHasPopup: "6", AriaLevel: "7" }; var AriaDescriptor = ASPx.CreateClass(null, { constructor: function(ownerControl, description) { this.ownerControl = ownerControl; this.rootElement = ownerControl.GetMainElement(); this.description = description; }, setDescription: function(name, argList) { var description = this.findChildDescription(name); if(description) { var elements = name ? this.rootElement.querySelectorAll(this.getDescriptionSelector(description)) : [this.rootElement]; for(var i = 0; i < elements.length; i++) this.applyDescriptionToElement(elements[i], description, argList[i] || argList[0]); } }, getDescriptionName: function(description) { return description.n; }, getDescriptionSelector: function(description) { return description.s; }, findChildDescription: function(name) { if(name === this.getDescriptionName(this.description)) return this.description; var childCollection = this.description.c || []; for(var i = 0; i < childCollection.length; i++) { var childDescription = childCollection[i]; if(this.getDescriptionName(childDescription) === name) return childDescription; } return null; }, applyDescriptionToElement: function(element, description, args) { if(!description || !element) return; this.trySetAriaOwnsAttribute(element, description); this.trySetAriaDescribedByAttribute(element, description); this.trySetAttribute(element, description, AriaDescriptionAttributes.Role, "role"); this.trySetAttribute(element, description, AriaDescriptionAttributes.TabIndex, "tabindex"); this.trySetAttribute(element, description, AriaDescriptionAttributes.AriaLevel, "aria-level"); this.executeOnDescription(description, AriaDescriptionAttributes.AriaLabel, function(value) { ASPx.Attr.SetAttribute(element, "aria-label", ASPx.Str.ApplyReplacement(value, args)); }); this.executeOnDescription(description, AriaDescriptionAttributes.AriaDisabled, function(value) { ASPx.Attr.SetAttribute(element, "aria-disabled", !!value); }); this.executeOnDescription(description, AriaDescriptionAttributes.AriaHasPopup, function(value) { ASPx.Attr.SetAttribute(element, "aria-haspopup", !!value); }); }, trySetAriaDescribedByAttribute: function(element, description) { this.executeOnDescription(description, AriaDescriptionAttributes.AriaDescribedBy, function(selectorInfo) { var descriptor = this.getNodesBySelector(element, selectorInfo.descriptorSelector)[0]; var target = this.getNodesBySelector(element, selectorInfo.targetSelector)[0]; if(!target || !descriptor) return; ASPx.Attr.SetAttribute(target, "aria-describedby", this.getNodeId(descriptor)); }); }, trySetAriaOwnsAttribute: function(element, description) { this.executeOnDescription(description, AriaDescriptionAttributes.AriaOwns, function(selector) { var ownedNodes = this.getNodesBySelector(element, selector); var ariaOwnsAttributeValue = ""; for(var i = 0; i < ownedNodes.length; i++) ariaOwnsAttributeValue += (this.getNodeId(ownedNodes[i]) + (i != ownedNodes.length - 1 ? " " : "")); ASPx.Attr.SetAttribute(element, "aria-owns", ariaOwnsAttributeValue); }); }, trySetAttribute: function(element, description, ariaAttribute, attributeName) { this.executeOnDescription(description, ariaAttribute, function(value) { ASPx.Attr.SetAttribute(element, attributeName, description[ariaAttribute]); }); }, executeOnDescription: function(description, ariaDescAttr, callback) { var descInfo = description[ariaDescAttr]; if(ASPx.IsExists(descInfo)) callback.aspxBind(this)(descInfo); }, getNodesBySelector: function(element, selector) { var id = element.id || ""; var childNodes = element.querySelectorAll("#" + this.getNodeId(element) + " > " + selector); ASPx.Attr.SetOrRemoveAttribute(element, "id", id); return childNodes; }, getNodeId: function(node) { if(!node.id) node.id = this.createRandomId(); return node.id; }, createRandomId: function() { return "r" + ASPx.CreateGuid(); } }); PagerCommands = { Next : "PBN", Prev : "PBP", Last : "PBL", First : "PBF", PageNumber : "PN", PageSize : "PSP" }; ASPx.Callback = function(result, context){ var collection = aspxGetControlCollection(); collection.DoFinalizeCallback(); var control = collection.Get(context); if(control != null) control.DoCallback(result); ASPx.RippleHelper.ReInit(); }; ASPx.CallbackError = function(result, context){ var control = aspxGetControlCollection().Get(context); if(control != null) control.DoCallbackError(result, false); }; ASPx.CClick = function(name, evt) { var control = aspxGetControlCollection().Get(name); if(control != null) control.DoControlClick(evt); }; function aspxCAInit() { var isAppInit = typeof(Sys$_Application$initialize) != "undefined" & ASPx.FunctionIsInCallstack(arguments.callee, Sys$_Application$initialize, 10 ); aspxGetControlCollection().AtlasInitialize(!isAppInit); } ASPx.Evt.AttachEventToElement(window, "resize", aspxGlobalWindowResize); function aspxGlobalWindowResize(evt){ aspxGetControlCollection().OnBrowserWindowResize(evt); } ASPx.Evt.AttachEventToElement(window, "unload", aspxClassesUnload); function aspxClassesUnload(evt) { aspxGetControlCollection().OnDocumentUnload(); } ASPx.Evt.AttachEventToElement(window.document, "DOMContentLoaded", aspxClassesDOMContentLoaded); function aspxClassesDOMContentLoaded(evt){ aspxGetControlCollection().DOMContentLoaded(); } ASPx.GetControlCollection = aspxGetControlCollection; ASPx.GetControlCollectionCollection = aspxGetControlCollectionCollection; ASPx.GetPersistentControlPropertiesStorage = _aspxGetPersistentControlPropertiesStorage; ASPx.PagerCommands = PagerCommands; window.ASPxClientBeginCallbackEventArgs = ASPxClientBeginCallbackEventArgs; window.ASPxClientGlobalBeginCallbackEventArgs = ASPxClientGlobalBeginCallbackEventArgs; window.ASPxClientEndCallbackEventArgs = ASPxClientEndCallbackEventArgs; window.ASPxClientGlobalEndCallbackEventArgs = ASPxClientGlobalEndCallbackEventArgs; window.ASPxClientCallbackErrorEventArgs = ASPxClientCallbackErrorEventArgs; window.ASPxClientGlobalCallbackErrorEventArgs = ASPxClientGlobalCallbackErrorEventArgs; window.ASPxClientCustomDataCallbackEventArgs = ASPxClientCustomDataCallbackEventArgs; window.ASPxClientValidationCompletedEventArgs = ASPxClientValidationCompletedEventArgs; window.ASPxClientControlsInitializedEventArgs = ASPxClientControlsInitializedEventArgs; window.ASPxClientControlBeforePronounceEventArgs = ASPxClientControlBeforePronounceEventArgs; window.ASPxClientControlUnloadEventArgs = ASPxClientControlUnloadEventArgs; window.ASPxClientControlCollection = ASPxClientControlCollection; window.ASPxClientControlBase = ASPxClientControlBase; window.ASPxClientControl = ASPxClientControl; window.ASPxClientComponent = ASPxClientComponent; })(); t6n1b