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"); MVCxClientBeginCallbackEventArgs = _aspxCreateClass(ASPxClientBeginCallbackEventArgs, { constructor: function(command){ this.constructor.prototype.constructor.call(this, command); this.customArgs = {}; } }); MVCx = {}; MVCx.CallbackHtmlContentPrefix = "/*DXHTML*/"; MVCx.CallbackHtmlContentPlaceholder = "<%html%>"; MVCx.EditorsValuesKey = "DXMVCEditorsValues"; MVCx.PerformControlCallback = function(name, url, arg, params, customParams) { var data = {}; data.DXCallbackName = name; data.DXCallbackArgument = arg; if(params != null) { for(var key in params) data[key] = params[key]; } if(customParams != null) { for(var key in customParams) if(!data[key]) data[key] = customParams[key]; } $.ajax({ type: 'POST', url: url, dataType: 'html', data: data, error: function(response) { var ctrl = aspxGetControlCollection().Get(data.DXCallbackName); if (ctrl != null) { if(typeof(response.responseText) == "string" && response.responseText != "") ctrl.DoCallbackError(response.responseText); else if(typeof(response) == "string" && response != "") ctrl.DoCallbackError(response); } }, success: function(response) { var ctrl = aspxGetControlCollection().Get(data.DXCallbackName); if (ctrl != null) ctrl.DoCallback(response); } }); } MVCx.SyncEditorsValues = function(){ aspxGetControlCollection().ForEachControl(function(control){ if(!MVCx.IsExistingClientEdit(control)) return; if(control.GetMainElement() && _aspxIsValidElement(control.GetMainElement())){ var form = _aspxGetParentByTagName(control.GetMainElement(), "FORM"); if(form){ if(!form.DXEditorValues) form.DXEditorValues = {}; form.DXEditorValues[control.name] = control.GetEnabled() ? MVCx.GetEditorValueByControl(control) : null; } } }); for(var i = 0; i < document.forms.length; i++){ var form = document.forms[i]; if(!form.DXEditorValues) continue; if(!form.DXEditorValuesField){ form.DXEditorValuesField = _aspxCreateHiddenField(MVCx.EditorsValuesKey, ""); form.appendChild(form.DXEditorValuesField); } if(form.DXEditorValuesField) form.DXEditorValuesField.value = _aspxToJson(form.DXEditorValues); } } MVCx.IsExistingClientEdit = function(control){ if(!ASPxIdent.IsASPxClientEdit(control)) return false; var valueInputElement = MVCx.GetValueInputMethod(control).call(control); return !control.isNative && _aspxIsExistsElement(valueInputElement); }, MVCx.GetValueInputMethod = function(control){ return control.FindStateInputElement || control.GetStateInput || control.GetInputElement; }, MVCx.GetEditorValueByControl = function(control){ return IsMultipleValueOwner(control) ? control.GetSelectedValues() : control.GetValue(); } MVCx.EditorValueChanged = function(s, e){ MVCx.SyncEditorsValues(); if(s.context) s.context.validate("blur"); } MVCx.GetEditorByElements = function(elements){ for(var i = 0; i < elements.length; i++){ var control = MVCx.GetEditorByElement(elements[i]); if (control) return control; } return null; } MVCx.GetEditorByElement = function(element){ var getNameMethods = [ function(id){ return id; }, function(id){ var idParts = id.split("_I"); return (idParts.length > 0) ? idParts[0] : ""; }, function(id){ var idParts = id.split("_S"); return (idParts.length > 0) ? idParts[0] : ""; }, function(id){ var idParts = id.split("_VI"); return (idParts.length > 0) ? idParts[0] : ""; } ]; var control = null; for(var j = 0; j < getNameMethods.length; j++){ var controlName = getNameMethods[j](element.id); var control = aspxGetControlCollection().Get(controlName); if(control && ASPxIdent.IsASPxClientEdit(control)) return control; } return null; } if(typeof(Sys) != "undefined" && typeof(Sys.Mvc) != "undefined") { MVCx.RequiredValidator = function MVCx_RequiredValidator(){ MVCx.RequiredValidator.initializeBase(this); } MVCx.RequiredValidator.prototype = { editor: null, getEditor: function(context){ if(!this.editor) this.editor = MVCx.GetEditorByElements(context.fieldContext.elements); return this.editor; }, validate: function(value, context){ var editor = this.getEditor(context); if(editor) return value != null && String(value).length > 0; return MVCx.RequiredValidator.callBaseMethod(this, 'validate', [value, context]); } } MVCx.RequiredValidator.registerClass('MVCx.RequiredValidator', Sys.Mvc.RequiredValidator); MVCx.RequiredValidator.create = function (rule) { return Function.createDelegate(new MVCx.RequiredValidator(), new MVCx.RequiredValidator().validate); } Sys.Mvc.ValidatorRegistry.validators["required"] = MVCx.RequiredValidator.create; MVCx.FieldContext = function MVCx_FieldContext(formContext){ MVCx.FieldContext.initializeBase(this); } MVCx.FieldContext.prototype = { editor: null, getEditor: function(){ if(!this.editor) this.editor = MVCx.GetEditorByElements(this.elements); return this.editor; }, enableDynamicValidation: function(){ MVCx.FieldContext.callBaseMethod(this, 'enableDynamicValidation'); var editor = this.getEditor(this.elements); if(editor) editor.context = this; }, _getStringValue: function(){ var editor = this.getEditor(); if(editor) return editor.GetValueString(); return MVCx.FieldContext.callBaseMethod(this, '_getStringValue'); }, $12: function(){ var editor = this.getEditor(); if(editor) return editor.GetValueString(); return MVCx.FieldContext.callBaseMethod(this, '$12'); }, validate: function(eventName) { var errors = MVCx.FieldContext.callBaseMethod(this, 'validate', [eventName]); var editor = this.getEditor(); if(editor){ editor.SetIsValid(errors.length == 0); if(!editor.GetIsValid()) editor.SetErrorText(errors[0]); } return errors; } } MVCx.FieldContext.registerClass('MVCx.FieldContext', Sys.Mvc.FieldContext); if(Sys.Mvc.FormContext){ if(Sys.Mvc.FormContext._parseJsonOptions) eval("Sys.Mvc.FormContext._parseJsonOptions = " + Sys.Mvc.FormContext._parseJsonOptions.toString().replace("Sys.Mvc.FieldContext", "MVCx.FieldContext")); else if(Sys.Mvc.FormContext.$12) eval("Sys.Mvc.FormContext.$12 = " + Sys.Mvc.FormContext.$12.toString().replace("Sys.Mvc.FieldContext", "MVCx.FieldContext")); } if(typeof(_aspxClearProcessingProc) != "undefined"){ MVCx._aspxClearProcessingProc = _aspxClearProcessingProc; _aspxClearProcessingProc = function(edit) { MVCx._aspxClearProcessingProc(edit); if(edit.context) edit.context.clearErrors(); } } if(typeof(Sys.Mvc.MvcHelpers) != "undefined"){ var _asyncRequestInternal = Sys.Mvc.MvcHelpers._asyncRequest || Sys.Mvc.MvcHelpers.$2; Sys.Mvc.MvcHelpers._asyncRequest = Sys.Mvc.MvcHelpers.$2 = function(url, verb, body, triggerElement, ajaxOptions){ if(body && body.length > 0 && !body.endsWith('&')) body += '&'; body += ("DXScript=" + ASPxResourceManager.GetResourcesElementsString(_aspxGetIncludeScripts(), "src", "DXScript")); var customMethodOnSuccess = ajaxOptions.onSuccess; ajaxOptions.onSuccess = function(ajaxContext){ if(customMethodOnSuccess) customMethodOnSuccess(ajaxContext); _aspxProcessScriptsAndLinks('', true); } _asyncRequestInternal(url, verb, body, triggerElement, ajaxOptions); } } } if (typeof(jQuery) != "undefined") { if (typeof(jQuery.validator) != "undefined"){ var a = c = $; var checkInternal = $.validator.prototype.check; var showLabelInternal = $.validator.prototype.showLabel; function getValueOfEditor(element){ var control = MVCx.GetEditorByElement(element); return control ? control.GetValueString() : element.value.replace(/\r/g, ""); } function getMainElement(element){ var control = MVCx.GetEditorByElement(element); if (!control) return element; return control.GetExternalTable() || control.GetMainElement(); } eval("checkInternal = " + checkInternal.toString() .replace("element.value.replace(/\\r/g,\"\")", "getValueOfEditor(element)") .replace("element.value.replace(/\\r/g, \"\")", "getValueOfEditor(element)") .replace("a.value.replace(/\\r/g,\"\")", "getValueOfEditor(a)") .replace("a.value.replace(/\\r/g, \"\")", "getValueOfEditor(a)") ); eval("showLabelInternal = " + showLabelInternal.toString() .replace("insertAfter(element)", "insertAfter(getMainElement(element))") .replace("insertAfter(a)", "insertAfter(getMainElement(a))") ); $.validator.prototype.check = function(element){ checkInternal.call(this, element); var control = MVCx.GetEditorByElement(element); if (control) ShowErrorForDXEditor(control, this.errorMap[control.name]); }; $.validator.prototype.showLabel = function(element, message){ var control = MVCx.GetEditorByElement(element); if (control && control.GetErrorCell()) ShowErrorForDXEditor(control, message) else showLabelInternal.call(this, element, message); } function ShowErrorForDXEditor(control, message){ control.SetIsValid(!message); if(message) control.SetErrorText(message); } } if (typeof(jQuery.validator) != "undefined" && typeof(jQuery.validator.unobtrusive) != "undefined"){ var parseInternal = jQuery.validator.unobtrusive.parse; $.extend($.validator.unobtrusive, { prototype: { parse: function(selector){ parseInternal(selector); } }, parse: function(selector){ this.prototype.parse(selector); var editors = ASPxClientControl.GetControlCollection().elements; if (editors){ eval("jQuery.validator.unobtrusive.parseDXElement = " + jQuery.validator.unobtrusive.parseElement.toString() .replace("validationInfo(form)", "$(form).data(\"unobtrusiveValidation\")") .replace("$element.attr(prefix)", "MVCx.GetEditorByElement(element).unobtrusiveValidationAttributes[prefix]") .replace("$element.attr(prefix + this)", "MVCx.GetEditorByElement(element).unobtrusiveValidationAttributes[prefix + this]") .replace("h(f)", "a(f).data(\"unobtrusiveValidation\")") .replace("i(f)", "a(f).data(\"unobtrusiveValidation\")") .replace("d.attr(c)", "MVCx.GetEditorByElement(b).unobtrusiveValidationAttributes[c]") .replace("d.attr(c+this)", "MVCx.GetEditorByElement(b).unobtrusiveValidationAttributes[c + this]") .replace("d.attr(c + this)", "MVCx.GetEditorByElement(b).unobtrusiveValidationAttributes[c + this]") ); var instance = this; $.each(editors, function () { if (!this.unobtrusiveValidationAttributes && this.GetInputElement != "undefined") return; instance.parseDXElement(MVCx.GetValueInputMethod(this).call(this), true); }); } $("form").each(function () { var info = $(this).data("unobtrusiveValidation"); if (!info) return; $(this).removeData("validator"); info.attachValidation(); }); } }); } var ajaxInternal = jQuery.ajax; var cleanInternal = jQuery.clean; jQuery.extend({ prototype:{ ajax: function(settings){ return ajaxInternal(settings); }, clean: function(elems, context, fragment, scripts){ return cleanInternal(elems, context, fragment, scripts); } }, ajax: function(settings){ var baseBeforeSendMethod = settings.beforeSend; settings.beforeSend = function(jqXHR, options){ if(baseBeforeSendMethod) baseBeforeSendMethod(jqXHR, options); jqXHR.setRequestHeader("DXScript", ASPxResourceManager.GetResourcesElementsString(_aspxGetIncludeScripts(), "src", "DXScript")); }; return this.prototype.ajax(settings); }, clean: function(elems, context, fragment, scripts){ var result = this.prototype.clean(elems, context, fragment, scripts); for(var i=0; scripts && i < scripts.length; i++){ var script = scripts[i]; if (script && script.id && script.id.indexOf(__aspxStartupScriptPrefix) == 0){ fragment.appendChild(script); scripts.splice(i--, 1); } } return result; } }); var domManipInternal = jQuery.fn.domManip; jQuery.fn.extend({ domManip: function(args, table, callback){ var result = arguments.length > 3 ? domManipInternal.call(this, args, table, callback, arguments[3]) : domManipInternal.call(this, args, table, callback); if(__aspxDocumentLoaded) _aspxRunStartupScripts(); return result; } }); } MVCx.EditorSetValue = function(value){ if(this.oldSetValue) this.oldSetValue(value); MVCx.EditorValueChanged(this, new ASPxClientEventArgs()); } MVCx.MultipleEditorSelectAll = function(){ if(this.oldSelectAll) this.oldSelectAll(); MVCx.EditorValueChanged(this, new ASPxClientEventArgs()); } MVCx.MultipleEditorUnselectAll = function(){ if(this.oldUnselectAll) this.oldUnselectAll(); MVCx.EditorValueChanged(this, new ASPxClientEventArgs()); } function aspxMVCControlsInitialized(s, e){ aspxGetControlCollection().ForEachControl(function(control){ if(!MVCx.IsExistingClientEdit(control) || control.AreSyncHandlersAdded) return; control.ValueChanged.AddHandler(MVCx.EditorValueChanged); control.EnabledChanged.AddHandler(MVCx.EditorValueChanged); if(__aspxIE) control.LostFocus.AddHandler(MVCx.EditorValueChanged); if (IsMultipleValueOwner(control)) control.SelectedIndexChanged.AddHandler(MVCx.EditorValueChanged); if(!control.oldSetValue){ control.oldSetValue = control.SetValue; control.SetValue = MVCx.EditorSetValue; } if(IsMultipleValueOwner(control) && !control.oldSelectAll){ control.oldSelectAll = control.SelectAll; control.SelectAll = MVCx.MultipleEditorSelectAll; } if(IsMultipleValueOwner(control) && !control.oldUnselectAll){ control.oldUnselectAll = control.UnselectAll; control.UnselectAll = MVCx.MultipleEditorUnselectAll; } control.AreSyncHandlersAdded = true; }); MVCx.SyncEditorsValues(); } function IsMultipleValueOwner(control) { return control && (control instanceof ASPxClientListBox || control instanceof ASPxClientCheckBoxList); } aspxGetControlCollection().ControlsInitialized.AddHandler(aspxMVCControlsInitialized); MVCxClientUtils = {}; MVCxClientUtils.FinalizeCallback = function(){ _aspxProcessScriptsAndLinks('', true); } } /* playback timings (ms): PetaboxLoader3.datanode: 159.713 (4) captures_list: 176.807 esindex: 0.017 PetaboxLoader3.resolve: 33.228 exclusion.robots.policy: 0.221 LoadShardBlock: 118.339 (3) exclusion.robots: 0.236 RedisCDXSource: 2.573 load_resource: 90.963 CDXLines.iter: 46.202 (3) */