1Type.registerNamespace('AjaxControlToolkit');AjaxControlToolkit.PopupBehavior = function(element) { 2AjaxControlToolkit.PopupBehavior.initializeBase(this, [element]);this._x = 0;this._y = 0;this._positioningMode = AjaxControlToolkit.PositioningMode.Absolute;this._parentElement = null;this._parentElementID = null;this._moveHandler = null;this._firstPopup = true;this._originalParent = null;this._visible = false;this._onShow = null;this._onShowEndedHandler = null;this._onHide = null;this._onHideEndedHandler = null;} 3AjaxControlToolkit.PopupBehavior.prototype = { 4initialize : function() { 5AjaxControlToolkit.PopupBehavior.callBaseMethod(this, 'initialize');this._hidePopup();this.get_element().style.position = "absolute";this._onShowEndedHandler = Function.createDelegate(this, this._onShowEnded);this._onHideEndedHandler = Function.createDelegate(this, this._onHideEnded);}, 6dispose : function() { 7var element = this.get_element();if (element) { 8if (this._visible) { 9this.hide();} 10if (this._originalParent) { 11element.parentNode.removeChild(element);this._originalParent.appendChild(element);this._originalParent = null;} 12element._hideWindowedElementsIFrame = null;} 13this._parentElement = null;if (this._onShow && this._onShow.get_animation() && this._onShowEndedHandler) { 14this._onShow.get_animation().remove_ended(this._onShowEndedHandler);} 15this._onShowEndedHandler = null;this._onShow = null;if (this._onHide && this._onHide.get_animation() && this._onHideEndedHandler) { 16this._onHide.get_animation().remove_ended(this._onHideEndedHandler);} 17this._onHideEndedHandler = null;this._onHide = null;AjaxControlToolkit.PopupBehavior.callBaseMethod(this, 'dispose');}, 18show : function() { 19if (this._visible) { 20return;} 21var eventArgs = new Sys.CancelEventArgs();this.raiseShowing(eventArgs);if (eventArgs.get_cancel()) { 22return;} 23this._visible = true;var element = this.get_element();$common.setVisible(element, true);this.setupPopup();if (this._onShow) { 24$common.setVisible(element, false);this.onShow();} else { 25this.raiseShown(Sys.EventArgs.Empty);} 26}, 27hide : function() { 28if (!this._visible) { 29return;} 30var eventArgs = new Sys.CancelEventArgs();this.raiseHiding(eventArgs);if (eventArgs.get_cancel()) { 31return;} 32this._visible = false;if (this._onHide) { 33this.onHide();} else { 34this._hidePopup();this._hideCleanup();} 35}, 36getBounds : function() { 37var element = this.get_element();var offsetParent = element.offsetParent || document.documentElement;var diff;var parentBounds;if (this._parentElement) { 38parentBounds = $common.getBounds(this._parentElement);var offsetParentLocation = $common.getLocation(offsetParent);diff = {x: parentBounds.x - offsetParentLocation.x, y:parentBounds.y - offsetParentLocation.y};} else { 39parentBounds = $common.getBounds(offsetParent);diff = {x:0, y:0};} 40var width = element.offsetWidth - (element.clientLeft ? element.clientLeft * 2 : 0);var height = element.offsetHeight - (element.clientTop ? element.clientTop * 2 : 0);if (this._firstpopup) { 41element.style.width = width + "px";this._firstpopup = false;} 42var position;switch (this._positioningMode) { 43case AjaxControlToolkit.PositioningMode.Center: 44position = { 45x: Math.round(parentBounds.width / 2 - width / 2), 46y: Math.round(parentBounds.height / 2 - height / 2) 47};break;case AjaxControlToolkit.PositioningMode.BottomLeft: 48position = { 49x: 0, 50y: parentBounds.height 51};break;case AjaxControlToolkit.PositioningMode.BottomRight: 52position = { 53x: parentBounds.width - width, 54y: parentBounds.height 55};break;case AjaxControlToolkit.PositioningMode.TopLeft: 56position = { 57x: 0, 58y: -element.offsetHeight 59};break;case AjaxControlToolkit.PositioningMode.TopRight: 60position = { 61x: parentBounds.width - width, 62y: -element.offsetHeight 63};break;case AjaxControlToolkit.PositioningMode.Right: 64position = { 65x: parentBounds.width, 66y: 0 67};break;case AjaxControlToolkit.PositioningMode.Left: 68position = { 69x: -element.offsetWidth, 70y: 0 71};break;default: 72position = {x: 0, y: 0};} 73position.x += this._x + diff.x;position.y += this._y + diff.y;return new Sys.UI.Bounds(position.x, position.y, width, height);},
74adjustPopupPosition : function(bounds) { 75var element = this.get_element();if (!bounds) { 76bounds = this.getBounds();} 77var newPosition = $common.getBounds(element);var updateNeeded = false;if (newPosition.x < 0) { 78bounds.x -= newPosition.x;updateNeeded = true;} 79if (newPosition.y < 0) { 80bounds.y -= newPosition.y;updateNeeded = true;} 81if (updateNeeded) { 82$common.setLocation(element, bounds);} 83}, 84addBackgroundIFrame : function() { 85var element = this.get_element();if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) { 86var childFrame = element._hideWindowedElementsIFrame;if (!childFrame) { 87childFrame = document.createElement("iframe");childFrame.src = "javascript:'<html></html>';";childFrame.style.position = "absolute";childFrame.style.display = "none";childFrame.scrolling = "no";childFrame.frameBorder = "0";childFrame.tabIndex = "-1";childFrame.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";element.parentNode.insertBefore(childFrame, element);element._hideWindowedElementsIFrame = childFrame;this._moveHandler = Function.createDelegate(this, this._onMove);Sys.UI.DomEvent.addHandler(element, "move", this._moveHandler);} 88$common.setBounds(childFrame, $common.getBounds(element));childFrame.style.display = element.style.display;if (element.currentStyle && element.currentStyle.zIndex) { 89childFrame.style.zIndex = element.currentStyle.zIndex;} else if (element.style.zIndex) { 90childFrame.style.zIndex = element.style.zIndex;} 91} 92}, 93setupPopup : function() { 94var element = this.get_element();var bounds = this.getBounds();$common.setLocation(element, bounds);this.adjustPopupPosition(bounds);element.zIndex = 1000;this.addBackgroundIFrame();}, 95_hidePopup : function() { 96var element = this.get_element();$common.setVisible(element, false);if (element.originalWidth) { 97element.style.width = element.originalWidth + "px";element.originalWidth = null;} 98}, 99_hideCleanup : function() { 100var element = this.get_element();if (this._moveHandler) { 101Sys.UI.DomEvent.removeHandler(element, "move", this._moveHandler);this._moveHandler = null;} 102if (Sys.Browser.agent === Sys.Browser.InternetExplorer) { 103var childFrame = element._hideWindowedElementsIFrame;if (childFrame) { 104childFrame.style.display = "none";} 105} 106this.raiseHidden(Sys.EventArgs.Empty);}, 107_onMove : function() { 108var element = this.get_element();if (element._hideWindowedElementsIFrame) { 109element.parentNode.insertBefore(element._hideWindowedElementsIFrame, element);element._hideWindowedElementsIFrame.style.top = element.style.top;element._hideWindowedElementsIFrame.style.left = element.style.left;} 110}, 111get_onShow : function() { 112return this._onShow ? this._onShow.get_json() : null;}, 113set_onShow : function(value) { 114if (!this._onShow) { 115this._onShow = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());this._onShow.initialize();} 116this._onShow.set_json(value);var animation = this._onShow.get_animation();if (animation) { 117animation.add_ended(this._onShowEndedHandler);} 118this.raisePropertyChanged('onShow');}, 119get_onShowBehavior : function() { 120return this._onShow;}, 121onShow : function() { 122if (this._onShow) { 123if (this._onHide) { 124this._onHide.quit();} 125this._onShow.play();} 126}, 127_onShowEnded : function() { 128this.adjustPopupPosition();this.addBackgroundIFrame();this.raiseShown(Sys.EventArgs.Empty);}, 129get_onHide : function() { 130return this._onHide ? this._onHide.get_json() : null;}, 131set_onHide : function(value) { 132if (!this._onHide) { 133this._onHide = new AjaxControlToolkit.Animation.GenericAnimationBehavior(this.get_element());this._onHide.initialize();} 134this._onHide.set_json(value);var animation = this._onHide.get_animation();if (animation) { 135animation.add_ended(this._onHideEndedHandler);} 136this.raisePropertyChanged('onHide');}, 137get_onHideBehavior : function() { 138return this._onHide;}, 139onHide : function() { 140if (this._onHide) { 141if (this._onShow) { 142this._onShow.quit();} 143this._onHide.play();} 144}, 145_onHideEnded : function() { 146this._hideCleanup();}, 147get_parentElement : function() { 148if (!this._parentElement && this._parentElementID) { 149this.set_parentElement($get(this._parentElementID));Sys.Debug.assert(this._parentElement != null, String.format(AjaxControlToolkit.Resources.PopupExtender_NoParentElement, this._parentElementID));} 150return this._parentElement;}, 151set_parentElement : function(element) { 152this._parentElement = element;this.raisePropertyChanged('parentElement');}, 153get_parentElementID : function() { 154if (this._parentElement) { 155return this._parentElement.id 156} 157return this._parentElementID;}, 158set_parentElementID : function(elementID) { 159this._parentElementID = elementID;if (this.get_isInitialized()) { 160this.set_parentElement($get(elementID));} 161}, 162get_positioningMode : function() { 163return this._positioningMode;}, 164set_positioningMode : function(mode) { 165this._positioningMode = mode;this.raisePropertyChanged('positioningMode');}, 166get_x : function() { 167return this._x;}, 168set_x : function(value) { 169if (value != this._x) { 170this._x = value;if (this._visible) { 171this.setupPopup();} 172this.raisePropertyChanged('x');} 173}, 174get_y : function() { 175return this._y;}, 176set_y : function(value) { 177if (value != this._y) { 178this._y = value;if (this._visible) { 179this.setupPopup();} 180this.raisePropertyChanged('y');} 181}, 182get_visible : function() { 183return this._visible;}, 184add_showing : function(handler) { 185this.get_events().addHandler('showing', handler);}, 186remove_showing : function(handler) { 187this.get_events().removeHandler('showing', handler);}, 188raiseShowing : function(eventArgs) { 189var handler = this.get_events().getHandler('showing');if (handler) { 190handler(this, eventArgs);} 191}, 192add_shown : function(handler) { 193this.get_events().addHandler('shown', handler);}, 194remove_shown : function(handler) { 195this.get_events().removeHandler('shown', handler);}, 196raiseShown : function(eventArgs) { 197var handler = this.get_events().getHandler('shown');if (handler) { 198handler(this, eventArgs);} 199}, 200add_hiding : function(handler) { 201this.get_events().addHandler('hiding', handler);}, 202remove_hiding : function(handler) { 203this.get_events().removeHandler('hiding', handler);}, 204raiseHiding : function(eventArgs) { 205var handler = this.get_events().getHandler('hiding');if (handler) { 206handler(this, eventArgs);} 207}, 208add_hidden : function(handler) { 209this.get_events().addHandler('hidden', handler);}, 210remove_hidden : function(handler) { 211this.get_events().removeHandler('hidden', handler);}, 212raiseHidden : function(eventArgs) { 213var handler = this.get_events().getHandler('hidden');if (handler) { 214handler(this, eventArgs);} 215} 216}
217AjaxControlToolkit.PopupBehavior.registerClass('AjaxControlToolkit.PopupBehavior', AjaxControlToolkit.BehaviorBase);AjaxControlToolkit.PositioningMode = function() { 218throw Error.invalidOperation();} 219AjaxControlToolkit.PositioningMode.prototype = { 220Absolute: 0, 221Center: 1, 222BottomLeft: 2, 223BottomRight: 3, 224TopLeft: 4, 225TopRight: 5, 226Right: 6, 227Left: 7 228} 229AjaxControlToolkit.PositioningMode.registerEnum('AjaxControlToolkit.PositioningMode'); 230if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
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.