1Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.ValidatorCalloutBehavior = function AjaxControlToolkit$ValidatorCalloutBehavior(element) { 2AjaxControlToolkit.ValidatorCalloutBehavior.initializeBase(this, [element]);this._warningIconImageUrl = null;this._closeImageUrl = null;this._cssClass = "ajax__validatorcallout";this._highlightCssClass = null;this._width = "200px";this._invalid = false;this._originalValidationMethod = null;this._validationMethodOverride = null;this._elementToValidate = null;this._popupTable = null;this._errorMessageCell = null;this._calloutArrowCell = null;this._warningIconImage = null;this._closeImage = null;this._closeCellInnerDiv = null;this._popupBehavior = null;this._onShowJson = null;this._onHideJson = null;this._focusAttached = false;this._isOpen = false;this._isBuilt = false;this._focusHandler = Function.createDelegate(this, this._onfocus);this._closeClickHandler = Function.createDelegate(this, this._oncloseClick);} 3AjaxControlToolkit.ValidatorCalloutBehavior.prototype = { 4initialize : function() { 5AjaxControlToolkit.ValidatorCalloutBehavior.callBaseMethod(this, 'initialize');var elt = this.get_element();if(elt.evaluationfunction) { 6this._originalValidationMethod = Function.createDelegate(elt, elt.evaluationfunction);this._validationMethodOverride = Function.createDelegate(this, this._onvalidate);elt.evaluationfunction = this._validationMethodOverride;} 7var clientState = this.get_ClientState();if ((null != clientState) && ("" !== clientState)) { 8this._ensureCallout();this.show();} 9}, 10_ensureCallout : function() { 11if (!this._isBuilt) { 12var elt = this.get_element();var elementToValidate = this._elementToValidate = $get(elt.controltovalidate);var popupTableBody = document.createElement("tbody");var popupTableRow = document.createElement("tr");var calloutCell = document.createElement("td");var calloutTable = document.createElement("table");var calloutTableBody = document.createElement("tbody");var calloutTableRow = document.createElement("tr");var iconCell = document.createElement("td");var closeCell = document.createElement("td");var closeCellInnerDiv = this._closeCellInnerDiv = document.createElement("div");var popupTable = this._popupTable = document.createElement("table");var calloutArrowCell = this._calloutArrowCell = document.createElement("td");var warningIconImage = this._warningIconImage = document.createElement("img");var closeImage = this._closeImage = document.createElement("img");var errorMessageCell = this._errorMessageCell = document.createElement("td");popupTable.id = this.get_id() + "_popupTable";popupTable.cellPadding = 0;popupTable.cellSpacing = 0;popupTable.border = 0;popupTable.width = this.get_width();popupTable.className = this._cssClass;popupTableRow.className = "ajax__validatorcallout_popup_table_row";calloutCell.className = "ajax__validatorcallout_callout_cell";calloutTable.cellPadding = 0;calloutTable.cellSpacing = 0;calloutTable.border = 0;calloutTable.className = "ajax__validatorcallout_callout_table";calloutTableRow.className = "ajax__validatorcallout_callout_table_row";calloutArrowCell.className = "ajax__validatorcallout_callout_arrow_cell";iconCell.className = "ajax__validatorcallout_icon_cell";warningIconImage.border = 0;warningIconImage.src = this.get_warningIconImageUrl();errorMessageCell.className = "ajax__validatorcallout_error_message_cell";errorMessageCell.innerHTML = this._getErrorMessage();closeCell.className = "ajax__validatorcallout_close_button_cell";closeCellInnerDiv.className = "ajax__validatorcallout_innerdiv";closeImage.src = this.get_closeImageUrl();elt.parentNode.appendChild(popupTable) 13popupTable.appendChild(popupTableBody);popupTableBody.appendChild(popupTableRow);popupTableRow.appendChild(calloutCell);calloutCell.appendChild(calloutTable);calloutTable.appendChild(calloutTableBody);calloutTableBody.appendChild(calloutTableRow);calloutTableRow.appendChild(calloutArrowCell);popupTableRow.appendChild(iconCell);iconCell.appendChild(warningIconImage);popupTableRow.appendChild(errorMessageCell);popupTableRow.appendChild(closeCell);closeCellInnerDiv.appendChild(closeImage);closeCell.appendChild(closeCellInnerDiv);var div = document.createElement("div");div.className = "ajax__validatorcallout_innerdiv";calloutArrowCell.appendChild(div);for(var i = 14;i > 0;i--) 14{ 15var line = document.createElement("div");line.style.width = i.toString() + "px";div.appendChild(line);} 16this._popupBehavior = $create( 17AjaxControlToolkit.PopupBehavior, 18{ 19positioningMode : AjaxControlToolkit.PositioningMode.Absolute, 20parentElement : elementToValidate 21}, 22{ }, 23null, 24this._popupTable);if (this._onShowJson) { 25this._popupBehavior.set_onShow(this._onShowJson);} 26if (this._onHideJson) { 27this._popupBehavior.set_onHide(this._onHideJson);} 28$addHandler(this._closeCellInnerDiv, "click", this._closeClickHandler);this._isBuilt = true;} 29}, 30dispose : function() { 31if (this._isBuilt) { 32this.hide();if (this._focusAttached) { 33$removeHandler(this._elementToValidate, "focus", this._focusHandler);this._focusAttached = false;} 34$removeHandler(this._closeCellInnerDiv, "click", this._closeClickHandler);this._onShowJson = null;this._onHideJson = null;if (this._popupBehavior) { 35this._popupBehavior.dispose();this._popupBehavior = null;} 36if (this._closeBehavior) { 37this._closeBehavior.dispose();this._closeBehavior = null;} 38if (this._popupTable) { 39this._popupTable.parentNode.removeChild(this._popupTable);this._popupTable = null;this._errorMessageCell = null;this._elementToValidate = null;this._calloutArrowCell = null;this._warningIconImage = null;this._closeImage = null;this._closeCellInnerDiv = null;} 40this._isBuilt = false;} 41AjaxControlToolkit.ValidatorCalloutBehavior.callBaseMethod(this, 'dispose');}, 42_getErrorMessage : function() {
43return this.get_element().errormessage || AjaxControlToolkit.Resources.ValidatorCallout_DefaultErrorMessage;}, 44show : function(force) { 45if (force || !this._isOpen) { 46this._isOpen = true;if(force && AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout) { 47AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout.hide();} 48if(AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout != null) { 49return;} 50AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = this;this._popupBehavior.set_x($common.getSize(this._elementToValidate).width);this._popupBehavior.show();} 51}, 52hide : function() { 53if(AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout == this) { 54AjaxControlToolkit.ValidatorCalloutBehavior._currentCallout = null;} 55if (this._isOpen || $common.getVisible(this._popupTable)) { 56this._isOpen = false;this._popupBehavior.hide();} 57}, 58_onfocus : function(e) { 59if(!this._originalValidationMethod(this.get_element())) { 60this._ensureCallout();if(this._highlightCssClass) { 61Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass);} 62this.show(true);return false;} else { 63this.hide();return true;} 64}, 65_oncloseClick : function(e) { 66this.hide();}, 67_onvalidate : function(val) { 68if(!this._originalValidationMethod(val)) { 69this._ensureCallout();if(this._highlightCssClass) { 70Sys.UI.DomElement.addCssClass(this._elementToValidate, this._highlightCssClass);} 71if (!this._focusAttached) { 72$addHandler(this._elementToValidate, "focus", this._focusHandler);this._focusAttached = true;} 73this.show(false);this._invalid = true;return false;} else { 74if(this._highlightCssClass && this._invalid) { 75Sys.UI.DomElement.removeCssClass(this._elementToValidate, this._highlightCssClass) 76} 77this._invalid = false;this.hide();return true;} 78}, 79get_onShow : function() { 80return this._popupBehavior ? this._popupBehavior.get_onShow() : this._onShowJson;}, 81set_onShow : function(value) { 82if (this._popupBehavior) { 83this._popupBehavior.set_onShow(value) 84} else { 85this._onShowJson = value;} 86this.raisePropertyChanged('onShow');}, 87get_onShowBehavior : function() { 88return this._popupBehavior ? this._popupBehavior.get_onShowBehavior() : null;}, 89onShow : function() { 90if (this._popupBehavior) { 91this._popupBehavior.onShow();} 92}, 93get_onHide : function() { 94return this._popupBehavior ? this._popupBehavior.get_onHide() : this._onHideJson;}, 95set_onHide : function(value) { 96if (this._popupBehavior) { 97this._popupBehavior.set_onHide(value) 98} else { 99this._onHideJson = value;} 100this.raisePropertyChanged('onHide');}, 101get_onHideBehavior : function() { 102return this._popupBehavior ? this._popupBehavior.get_onHideBehavior() : null;}, 103onHide : function() { 104if (this._popupBehavior) { 105this._popupBehavior.onHide();} 106}, 107get_warningIconImageUrl : function() { 108return this._warningIconImageUrl;}, 109set_warningIconImageUrl : function(value) { 110if (this._warningIconImageUrl != value) { 111this._warningIconImageUrl = value;if (this.get_isInitialized()) { 112this._warningIconImage.src = value;} 113this.raisePropertyChanged("warningIconImageUrl");} 114}, 115get_closeImageUrl : function() { 116return this._closeImageUrl;}, 117set_closeImageUrl : function(value) { 118if (this._closeImageUrl != value) { 119this._closeImageUrl = value;if (this.get_isInitialized()) { 120this._closeImage.src = value;} 121this.raisePropertyChanged("closeImageUrl");} 122}, 123get_width : function() { 124return this._width;}, 125set_width : function(value) { 126if (this._width != value) { 127this._width = value;if (this.get_isInitialized()) { 128this._popupTable.style.width = _width;} 129this.raisePropertyChanged("width");} 130}, 131get_cssClass : function() { 132return this._cssClass;}, 133set_cssClass : function(value) { 134if (this._cssClass != value) { 135this._cssClass = value;this.raisePropertyChanged("cssClass");} 136}, 137get_highlightCssClass : function() { 138return this._highlightCssClass;}, 139set_highlightCssClass : function(value) { 140if (this._highlightCssClass != value) { 141this._highlightCssClass = value;this.raisePropertyChanged("highlightCssClass");} 142}, 143get_isOpen : function() { 144return this._isOpen;} 145} 146AjaxControlToolkit.ValidatorCalloutBehavior.registerClass('AjaxControlToolkit.ValidatorCalloutBehavior', AjaxControlToolkit.BehaviorBase);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.