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"); ASPxClientButton = _aspxCreateClass(ASPxClientControl, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.isASPxClientButton = true; this.allowFocus = true; this.autoPostBackFunction = null; this.causesValidation = true; this.checked = false; this.clickLocked = false; this.groupName = ""; this.focusElementSelected = false; this.pressed = false; this.useSubmitBehavior = true; this.validationGroup = ""; this.validationContainerID = null; this.validateInvisibleEditors = false; this.buttonCell = null; this.contentDiv = null; this.checkedInput = null; this.buttonImage = null; this.internalButton = null; this.textElement = null; this.textControl = null; this.textContainer = null; this.isTextEmpty = false; this.CheckedChanged = new ASPxClientEvent(); this.GotFocus = new ASPxClientEvent(); this.LostFocus = new ASPxClientEvent(); this.Click = new ASPxClientEvent(); }, InlineInitialize: function() { this.InitializeEvents(); this.InitializeEnabled(); this.InitializeChecked(); this.PreventButtonImageDragging(); }, InitializeEnabled: function(){ this.SetEnabledInternal(this.clientEnabled, true); }, InitializeChecked: function(){ this.SetCheckedInternal(this.checked, true); }, InitializeEvents: function(){ if (!this.isNative) { var element = this.GetInternalButton(); if(element) element.onfocus = null; var textControl = this.GetTextControl(); if (textControl) { if (__aspxIE) _aspxAttachEventToElement(textControl, "mouseup", _aspxClearSelection); _aspxPreventElementDragAndSelect(textControl, false); } } var name = this.name; this.onClick = function() { var processOnServer = aspxBClick(name); if (!processOnServer) { var evt = _aspxGetEvent(arguments[0]); if (evt) _aspxPreventEvent(evt); } return processOnServer; }; this.onGotFocus = function() { aspxBGotFocus(name); }; this.onLostFocus = function() { aspxBLostFocus(name); }; this.onKeyUp = function(evt) { aspxBKeyUp(evt, name); }; this.onKeyDown = function(evt) { aspxBKeyDown(evt, name); }; if(!this.isNative) { this.AttachNativeHandlerToMainElement("focus", "SetFocus"); this.AttachNativeHandlerToMainElement("click", "DoClick"); } }, PreventButtonImageDragging: function() { var image = this.GetButtonImage(); if(image) { if(__aspxNetscapeFamily) image.onmousedown = function(evt) { evt.cancelBubble = true; return false; }; else image.ondragstart = function() { return false; }; } }, AttachNativeHandlerToMainElement: function(handlerName, correspondingMethodName) { var mainElement = this.GetMainElement(); if (!_aspxIsExistsElement(mainElement)) return; mainElement[handlerName] = Function("_aspxBCallButtonMethod('" + this.name + "', '" + correspondingMethodName + "')"); }, GetContentDiv: function(){ if(!_aspxIsExistsElement(this.contentDiv)) this.contentDiv = this.GetChild("_CD"); return this.contentDiv; }, GetButtonCell: function(){ if(!_aspxIsExistsElement(this.buttonCell)) this.buttonCell = this.GetChild("_B"); return this.buttonCell; }, GetButtonCheckedInput: function(){ if(!_aspxIsExistsElement(this.checkedInput)) this.checkedInput = _aspxGetElementById(this.name + "_CH"); return this.checkedInput; }, GetButtonImage: function(){ if(!_aspxIsExistsElement(this.buttonImage)) this.buttonImage = _aspxGetChildByTagName(this.GetButtonCell(), "IMG", 0); return this.buttonImage; }, GetInternalButton: function() { if(!_aspxIsExistsElement(this.internalButton)) this.internalButton = this.isNative ? this.GetMainElement() : _aspxGetChildByTagName(this.GetMainElement(), "INPUT", 0); return this.internalButton; }, GetTextContainer: function() { if (!this.textContainer) { var textElement = this.GetTextElement(); this.textContainer = _aspxGetChildByTagName(textElement, "SPAN", 0); } return this.textContainer; }, GetTextElement: function(){ if(!_aspxIsExistsElement(this.textElement)){ var contentDiv = this.GetContentDiv(); if (this.GetButtonImage() == null) this.textElement = contentDiv; else { this.textElement = _aspxGetChildByTagName(contentDiv, "TD", 0); var img = _aspxGetChildByTagName(this.textElement, "IMG", 0); if (img) this.textElement = _aspxGetChildByTagName(contentDiv, "TD", 1); } } return this.textElement; }, GetTextControl: function(){ if(!_aspxIsExistsElement(this.textControl)) this.textControl = _aspxGetParentByTagName(this.GetTextElement(), "table"); if (!_aspxIsExistsElement(this.textControl) || (this.textControl.id == this.name)) this.textControl = this.GetTextElement(); return this.textControl; }, GetPostfixes: function(){ return this.isNative ? [""] : ["_B"]; }, IsHovered: function(){ var hoverElement = this.isNative ? this.GetMainElement() : this.GetButtonCell(); return aspxGetStateController().currentHoverItemName == hoverElement.id; }, SetEnabledInternal: function(enabled, initialization) { if(!this.enabled) return; if(!initialization || !enabled) this.ChangeEnabledStateItems(enabled); this.ChangeEnabledAttributes(enabled); }, ChangeEnabledAttributes: function(enabled) { if(this.isNative) this.GetMainElement().disabled = !enabled; else { var element = this.GetInternalButton(); if(element) element.disabled = !enabled; } this.ChangeEnabledEventsAttributes(_aspxChangeEventsMethod(enabled)); }, ChangeEnabledEventsAttributes: function(method) { var element = this.GetMainElement(); method(element, "click", this.onClick); if (this.allowFocus){ if (!this.isNative) element = this.GetInternalButton(); if(element) { method(element, "focus", this.onGotFocus); method(element, "blur", this.onLostFocus); if (!this.isNative){ method(element, "keyup", this.onKeyUp); method(element, "blur", this.onKeyUp); method(element, "keydown", this.onKeyDown); } } } }, ChangeEnabledStateItems: function(enabled){ if(!this.isNative){ aspxGetStateController().SetElementEnabled(this.GetButtonCell(), enabled); this.UpdateFocusedStyle(); } }, RequiredPreventDoublePostback: function(){ return __aspxFirefox && !this.isNative; }, OnFocus: function() { if(!this.allowFocus) return false; this.focused = true; if(this.isInitialized) this.RaiseFocus(); this.UpdateFocusedStyle(); }, OnLostFocus: function() { if(!this.allowFocus) return false; this.focused = false; if(this.isInitialized) this.RaiseLostFocus(); this.UpdateFocusedStyle(); }, CauseValidation: function() { if (this.causesValidation && typeof(ASPxClientEdit) != "undefined") return this.validationContainerID != null ? ASPxClientEdit.ValidateEditorsInContainerById(this.validationContainerID, this.validationGroup, this.validateInvisibleEditors) : ASPxClientEdit.ValidateGroup(this.validationGroup, this.validateInvisibleEditors); else return true; }, OnClick: function() { if(this.clickLocked) return true; else if(this.checked && this.groupName != "" && this.GetCheckedGroupList().length > 1) return; this.SetFocus(); var isValid = this.CauseValidation(); var processOnServer = this.autoPostBack; if (this.groupName != "") { if(this.GetCheckedGroupList().length == 1) this.SetCheckedInternal(!this.checked, false); else { this.SetCheckedInternal(true, false); this.ClearButtonGroupChecked(true); } processOnServer = this.RaiseCheckedChanged(); if (processOnServer && isValid) this.SendPostBack("CheckedChanged"); } processOnServer = this.RaiseClick(); if (processOnServer && isValid){ var requiredPreventDoublePostback = this.RequiredPreventDoublePostback(); var postponePostback = __aspxAndroidMobilePlatform; if(requiredPreventDoublePostback || postponePostback) _aspxSetTimeout("_aspxBCallButtonMethod(\"" + this.name + "\", \"SendPostBack\", \"Click\" );", 0); else this.SendPostBack("Click"); return !requiredPreventDoublePostback; } return false; }, OnKeyUp: function(evt) { if(this.pressed) this.SetUnpressed(); }, OnKeyDown: function(evt) { if(evt.keyCode == ASPxKey.Enter || evt.keyCode == ASPxKey.Space) this.SetPressed(); }, GetChecked: function(){ return this.groupName != "" ? this.GetButtonCheckedInput().value == "1" : false; }, GetCheckedGroupList: function(){ var result = [ ]; aspxGetControlCollection().ForEachControl(function(control) { if (ASPxIdent.IsASPxClientButton(control) && (control.groupName == this.groupName) && control.RenderExistsOnPage()) result.push(control); }, this); return result; }, ClearButtonGroupChecked: function(raiseCheckedChanged){ var list = this.GetCheckedGroupList(); for(var i = 0; i < list.length; i ++){ if(list[i] != this && list[i].checked) { list[i].SetCheckedInternal(false, false); if(raiseCheckedChanged) list[i].RaiseCheckedChanged(); } } }, ApplyCheckedStyle: function(){ var stateController = aspxGetStateController(); if(this.IsHovered()) stateController.SetCurrentHoverElement(null); stateController.SelectElementBySrcElement(this.GetButtonCell()); }, ApplyUncheckedStyle: function(){ var stateController = aspxGetStateController(); if(this.IsHovered()) stateController.SetCurrentHoverElement(null); stateController.DeselectElementBySrcElement(this.GetButtonCell()); }, SetCheckedInternal: function(checked, initialization){ if(initialization && checked || (this.checked != checked)){ this.checked = checked; var inputElement = this.GetButtonCheckedInput(); if(inputElement) inputElement.value = checked ? "1" : "0"; if(checked) this.ApplyCheckedStyle(); else this.ApplyUncheckedStyle(); } }, ApplyPressedStyle: function(){ aspxGetStateController().OnMouseDownOnElement(this.GetButtonCell()); }, ApplyUnpressedStyle: function(){ aspxGetStateController().OnMouseUpOnElement(this.GetButtonCell()); }, SetPressed: function(){ this.pressed = true; this.ApplyPressedStyle(); }, SetUnpressed: function(){ this.pressed = false; this.ApplyUnpressedStyle(); }, SetFocus: function(){ if(!this.allowFocus || this.focused) return; var element = this.GetInternalButton(); if(element) { var hiddenInternalButtonRequiresVisibilityToGetFocused = __aspxWebKitFamily && !this.isNative ; if(hiddenInternalButtonRequiresVisibilityToGetFocused) ASPxClientButton.MakeHiddenElementFocusable(element); if(_aspxIsFocusable(element) && _aspxGetActiveElement() != element) element.focus(); if(hiddenInternalButtonRequiresVisibilityToGetFocused) ASPxClientButton.RestoreHiddenElementAppearance(element); } }, ApplyFocusedStyle: function(){ if(this.focusElementSelected) return; if(typeof(aspxGetStateController) != "undefined") aspxGetStateController().SelectElementBySrcElement(this.GetContentDiv()); this.focusElementSelected = true; }, ApplyUnfocusedStyle: function(){ if(!this.focusElementSelected) return; if(typeof(aspxGetStateController) != "undefined") aspxGetStateController().DeselectElementBySrcElement(this.GetContentDiv()); this.focusElementSelected = false; }, UpdateFocusedStyle: function(){ if(this.isNative) return; if(this.enabled && this.clientEnabled && this.allowFocus && this.focused) this.ApplyFocusedStyle(); else this.ApplyUnfocusedStyle(); }, SendPostBack: function(postBackArg){ if(!this.enabled || !this.clientEnabled) return; var arg = postBackArg || ""; if(this.autoPostBackFunction) this.autoPostBackFunction(arg); else if(!this.useSubmitBehavior) ASPxClientControl.prototype.SendPostBack.call(this, arg); if(this.useSubmitBehavior && !this.isNative) this.ClickInternalButton(); }, ClickInternalButton: function(){ var element = this.GetInternalButton(); if(element) { this.clickLocked = true; if (__aspxNetscapeFamily) this.CreateUniqueIDCarrier(); _aspxDoElementClick(element); if (__aspxNetscapeFamily) this.RemoveUniqueIDCarrier(); this.clickLocked = false; } }, CreateUniqueIDCarrier: function() { var name = this.uniqueID; var id = this.GetUniqueIDCarrierID(); var field = _aspxCreateHiddenField(name, id); var form = this.GetParentForm(); if(form) form.appendChild(field); }, RemoveUniqueIDCarrier: function() { var field = document.getElementById(this.GetUniqueIDCarrierID()); if (field) field.parentNode.removeChild(field); }, GetUniqueIDCarrierID: function() { return this.uniqueID + "_UIDC"; }, DoClick: function(){ if(!this.enabled || !this.clientEnabled) return; var button = this.isNative ? this.GetMainElement() : this.GetInternalButton(); if(button) _aspxDoElementClick(button); else this.OnClick(); }, GetChecked: function(){ return this.checked; }, SetChecked: function(checked){ this.SetCheckedInternal(checked, false); this.ClearButtonGroupChecked(false); }, GetText: function(){ if (this.isTextEmpty) return ""; else return this.isNative ? this.GetMainElement().value : this.GetTextContainer().innerHTML; }, SetText: function(text){ this.isTextEmpty = (text == null || text == ""); var mainElement = this.GetMainElement(); if (this.isNative) mainElement.value = (text != null) ? text : ""; else { var textContainer = this.GetTextContainer(); textContainer.innerHTML = this.isTextEmpty ? " " : text; if (this.clientVisible && __aspxIE && __aspxBrowserVersion >= 9) _aspxSetElementDisplay(mainElement, true); } }, SetEnabled: function(enabled){ if (this.clientEnabled != enabled) { if (!enabled && this.focused) this.OnLostFocus(); this.clientEnabled = enabled; this.SetEnabledInternal(enabled, false); } }, GetEnabled: function(){ return this.enabled && this.clientEnabled; }, Focus: function(){ this.SetFocus(); }, RaiseCheckedChanged: function(){ var processOnServer = this.autoPostBack || this.IsServerEventAssigned("CheckedChanged"); if(!this.CheckedChanged.IsEmpty()){ var args = new ASPxClientProcessingModeEventArgs(processOnServer); this.CheckedChanged.FireEvent(this, args); processOnServer = args.processOnServer; } return processOnServer; }, RaiseFocus: function(){ if(!this.GotFocus.IsEmpty()){ var args = new ASPxClientEventArgs(); this.GotFocus.FireEvent(this, args); } }, RaiseLostFocus: function(){ if(!this.LostFocus.IsEmpty()){ var args = new ASPxClientEventArgs(); this.LostFocus.FireEvent(this, args); } }, RaiseClick: function(){ var processOnServer = this.autoPostBack || this.IsServerEventAssigned("Click"); if(!this.Click.IsEmpty()){ var args = new ASPxClientProcessingModeEventArgs(processOnServer); this.Click.FireEvent(this, args); processOnServer = args.processOnServer; } return processOnServer; } }); ASPxClientButton.Cast = ASPxClientControl.Cast; ASPxClientButton.MakeHiddenElementFocusable = function(element) { element.__dxHiddenElementState = { parentDisplay: element.parentNode.style.display, height: element.style.height, width: element.style.width }; element.parentNode.style.display = "block"; element.style.height = "1px"; element.style.width = "1px"; }; ASPxClientButton.RestoreHiddenElementAppearance = function(element) { var state = element.__dxHiddenElementState; element.parentNode.style.display = state.parentDisplay; element.style.height = state.height; element.style.width = state.width; delete element.__dxHiddenElementState; }; ASPxIdent.IsASPxClientButton = function(obj) { return !!obj.isASPxClientButton; }; function _aspxBCallButtonMethod(name, methodName, arg) { var button = aspxGetControlCollection().Get(name); if (button != null) button[methodName](arg); } function aspxBGotFocus(name){ var button = aspxGetControlCollection().Get(name); if(button != null) return button.OnFocus(); } function aspxBLostFocus(name){ var button = aspxGetControlCollection().Get(name); if(button != null) return button.OnLostFocus(); } function aspxBClick(name){ var button = aspxGetControlCollection().Get(name); if(button != null) return button.OnClick(); } function aspxBKeyDown(evt,name){ var button = aspxGetControlCollection().Get(name); if(button != null) button.OnKeyDown(evt); } function aspxBKeyUp(evt,name){ var button = aspxGetControlCollection().Get(name); if(button != null) button.OnKeyUp(evt); } } /* playback timings (ms): captures_list: 145.151 exclusion.robots: 0.078 exclusion.robots.policy: 0.072 RedisCDXSource: 1.495 esindex: 0.007 LoadShardBlock: 128.339 (3) PetaboxLoader3.datanode: 125.539 (4) CDXLines.iter: 13.257 (3) load_resource: 91.716 PetaboxLoader3.resolve: 56.217 */