Name MicrosoftAjax.debug.js
Name MicrosoftAjax.debug.js
js
// Assembly: AjaxControlToolkit
// Version: 4.1.51116.0
// FileVersion: 4.1.51116
// (c) 2010 CodePlex Foundation
(function(window, Sys) {
var check;
if (attachEvent) {
if ((window == window.top) && document.documentElement.doScroll) {
var timeout, er, el = createElement("div");
check = function() {
try {
el.doScroll("left");
}
catch (er) {
timeout = window.setTimeout(check, 0);
return;
}
el = null;
domReady();
}
check();
}
else {
listenOnce(document, null, "onreadystatechange", domReady,
true);
}
}
else if (document.addEventListener) {
listenOnce(document, "DOMContentLoaded", null, domReady);
}
},
_getById: function _getById(found, id, single, includeSelf, element,
filter) {
if (element) {
if (includeSelf && (element.id === id)) {
found.push(element);
}
else if (!filter) {
foreach(all("*", element), function(element) {
if (element.id === id) {
found.push(element);
return true;
}
});
}
}
else {
var e = document.getElementById(id);
if (e) found.push(e);
}
return found.length;
},
_getByClass: function _getByClass(found, targetClass, single, includeSelf,
element, filter) {
function pushIfMatch(element) {
var ret, className = element.className;
if (className && ((className === targetClass) ||
(className.indexOf(' ' + targetClass) >= 0) || (className.indexOf(targetClass + '
') >= 0))) {
found.push(element);
ret = true;
}
return ret;
}
var i, l, nodes;
if (includeSelf && pushIfMatch(element) && single) {
return true;
}
if (!filter) {
element = element || document;
var finder = element.querySelectorAll ||
element.getElementsByClassName;
if (finder) {
if (element.querySelectorAll) targetClass = "." + targetClass;
nodes = finder.call(element, targetClass);
for (i = 0, l = nodes.length; i < l; i++) {
found.push(nodes[i]);
if (single) return true;
}
}
else {
nodes = all("*", element);
for (i = 0, l = nodes.length; i < l; i++) {
if (pushIfMatch(nodes[i]) && single) {
return true;
}
}
}
}
},
query: function query(selector, context) {
/// <summary>Queries the DOM for a set of DOM elements.</summary>
/// <validationOptions enabled="false" />
/// <param name="selector">Selector for a set of DOM elements based on
id (#<id>), class (.<name>), or tag name (<tagname>). Also supports an
array of DOM elements or selectors. More complex selectors may be used if jQuery is
loaded.</param>
/// <param name="context" optional="true" mayBeNull="true">A DOM
element (exclusive), array of DOM elements (inclusive), or other Sys.ElementSet or
Sys.UI.TemplateContext (exclusive) to restrict the search within.</param>
/// <returns type="Sys.ElementSet">An object representing the set of
matching elements.</returns>
return new Sys.ElementSet(selector, context);
},
get: function get(selector, context) {
/// <summary>Queries the DOM for a single DOM element.</summary>
/// <validationOptions enabled="false" />
/// <param name="selector">
/// Selector for a DOM element based on id (#<id>), class
(.<name>), or tag name (<tagname>). More complex selectors may be used if
jQuery is loaded.
/// If multiple elements match the selector, the first one is returned.
/// </param>
/// <param name="context" optional="true" mayBeNull="true">An element,
array of elements, or Sys.UI.TemplateContext to restrict the query within.</param>
/// <returns>The matching element, or null if none match.</returns>
return (context && typeof(context.get) === "function") ?
context.get(selector) :
this._find(selector, context, true);
},
_find: function _find(selector, context, single, filter) {
var found = [],
selectors;
if (typeof(selector) === "string") {
selectors = [selector];
}
else {
selectors = selector;
}
var includeSelf = context instanceof Array,
simpleNonTag = /^([\$#\.])((\w|[$:\.\-])+)$/,
tag = /^((\w+)|\*)$/;
if ((typeof(context) === "string") || (context instanceof Array)) {
context = Sys._find(context);
}
if (context instanceof Sys.ElementSet) {
context = context.get();
}
foreach(selectors, function(selector) {
if (typeof(selector) !== "string") {
if (filter) {
if (contains(context, selector)) {
found.push(selector);
}
}
else {
found.push(selector);
}
}
else {
var match = simpleNonTag.exec(selector);
if (match && match.length === 4) {
selector = match[2];
var type = match[1];
if (type === "$") {
Sys._getComponent(found, selector, context);
}
else {
var finder = type === "#" ? Sys._getById :
Sys._getByClass;
if (context) {
foreach(context, function(node) {
if (node.nodeType === 1) {
return finder(found, selector, single,
includeSelf, node, filter);
}
});
}
else {
finder(found, selector, single);
}
}
}
else if (tag.test(selector)) {
if (context instanceof Array) {
foreach(context, function(node) {
if (node.nodeType === 1) {
if (includeSelf && (selector === "*" ||
(node.tagName.toLowerCase() === selector))) {
found.push(node);
if (single) return true;
}
if (!filter) {
if(!foreach(all(selector, node),
function(node) {
found.push(node);
if (single) return true;
})) {
return true;
}
}
}
});
}
else {
var nodes = all(selector, context);
if (single) {
if (nodes[0]) {
found.push(nodes[0]);
}
return true;
}
foreach(nodes, function(node) {
found.push(node);
});
}
}
else if (window.jQuery) {
if (!filter) {
found.push.apply(found, jQuery(selector,
context).get());
}
if (includeSelf) {
found.push.apply(found,
jQuery(context).filter(selector).get());
}
}
}
});
return found.length ? (single ? (found[0] || null) : found) : null;
},
onDomReady: function onDomReady(callback) {
/// <summary>Registers a function to be called when the DOM is
ready.</summary>
/// <validationOptions enabled="false" />
/// <param name="callback" type="Function"></param>
lazypush(this, "_domReadyQueue", callback);
raiseDomReady();
},
onReady: function onReady(callback) {
/// <summary>Registers a function to be called when the DOM is ready
and when all required resources have been loaded.</summary>
/// <validationOptions enabled="false" />
/// <param name="callback" type="Function"></param>
lazypush(this, "_readyQueue", callback);
raiseOnReady();
},
_set: function(instance, properties) {
forIn(properties, function(value, field) {
callIf(instance, "add_" + field, value) ||
callIf(instance, "set_" + field, value) ||
(instance[field] = value);
});
}
});
var obj;
if (!Sys.ElementSet) {
obj = Sys.ElementSet = function(selector, context) {
/// <summary>Represents a set of DOM elements.</summary>
/// <param name="selector">The DOM selector, array of DOM selectors, or array
of DOM elements to query the document for.</param>
/// <param name="context">A DOM selector (exclusive), A DOM element
(exclusive), array of DOM elements (inclusive), or other Sys.ElementSet (exclusive)
to restrict the search within.</param>
this._elements = ((typeof(context) === "object") && typeof(context.query) ===
"function") ?
context.query(selector).get() :
Sys._find(selector, context) || [];
}
obj.prototype = {
__class: true,
components: function(type, index) {
/// <summary>Gets the set of controls and behaviors associated with the
current DOM elements.</summary>
/// <param name="type" type="Function" mayBeNull="true"
optional="true">Type to limit the search to.</param>
/// <param name="index" type="Number" mayBeNull="true"
optional="true">Index of the component to limit to.</param>
/// <returns type="Sys.ComponentSet" />
var elementSet = new Sys.ElementSet(this.get());
return new Sys.ComponentSet(elementSet, type, index);
},
component: function(type, index) {
/// <summary>Get the first control or behavior associated with the current
set of DOM elements.</summary>
/// <param name="type" type="Function" mayBeNull="true"
optional="true">Type to limit the search to.</param>
/// <param name="index" type="Number" mayBeNull="true"
optional="true">Index of the component to return.</param>
/// <returns type="Object" mayBeNull="true" />
return this.components(type, index).get(0);
},
each: function(callback) {
/// <summary>Enumerates all the matched elements, calling the given
callback for each with the current element as the context.
/// The callback may return false to cancel enumeration.</summary>
/// <returns type="Sys.ElementSet"/>
var elements = this._elements;
for (var i = 0, l = elements.length; i < l; i++) {
if (callback.call(elements[i], i) === false) break;
}
return this;
},
get: function(index) {
/// <summary>Retrieves the element at the specified index.</summary>
/// <param name="index" type="Number">The index of the element to retrieve.
Omit to return all elements as an array.</param>
/// <returns isDomElement="true">The element at the given index, or an
array of all the matched elements.</returns>
var elements = this._elements;
return (typeof(index) === "undefined") ? (Array.apply(null, elements)) :
(elements[index] || null);
},
find: function(selector) {
/// <summary>Searches the current set of DOM elements with the given
selector, including descendents.</summary>
/// <param name="selector">DOM selector or array of DOM selectors to search
with.</param>
/// <returns type="Sys.ElementSet">A new element set with the matched
elements.</returns>
return new Sys.ElementSet(selector, this);
},
filter: function(selector) {
/// <summary>Filters the current set of DOM elements by the given selector,
excluding descendents.</summary>
/// <param name="selector">DOM selector or array of elements to filter
by.</param>
/// <returns type="Sys.ElementSet">A new element set with the matched
elements.</returns>
return new Sys.ElementSet(Sys._find(selector, this._elements, false,
true));
}
}
}
if (!Sys.ComponentSet) {
obj = Sys.ComponentSet = function ComponentSet(elementSet, query, index) {
/// <summary></summary>
/// <param name="elementSet" type="Sys.ElementSet" mayBeNull="true"
optional="true"></param>
/// <param name="query" mayBeNull="true" optional="true">The type of component
to filter by, or an array of components to include.</param>
/// <param name="index" type="Number" mayBeNull="true" optional="true">The
index of the component to retrieve from the filtered list.</param>
this._elementSet = elementSet || (elementSet = new Sys.ElementSet());
this._components = this._execute(elementSet, query, index);
}
obj.prototype = {
__class: true,
setProperties: function ComponentSet$setProperties(properties) {
/// <summary>Sets properties on the matched components.</summary>
/// <param name="properties" type="Object" mayBeNull="false">Object with
the names and values of the properties to set.</param>
/// <returns type="Sys.ComponentSet" />
return this.each(function() {
Sys._set(this, properties);
});
},
get: function ComponentSet$get(index) {
/// <summary>Returns the component at the specified index, or an array of
all matches if not specified.</summary>
/// <param name="index" type="Number" mayBeNull="true"
optional="true"></param>
/// <returns type="Object" mayBeNull="true"/>
var components = this._components;
return (typeof(index) === "undefined") ? (Array.apply(null, components)) :
(components[index || 0] || null);
},
each: function ComponentSet$each(callback) {
/// <summary>Enumerate all the found components. The index of the component
are passed as parameters to a callback. You may return 'false' to cancel the
enumeration.</summary>
/// <param name="callback" type="Function" mayBeNull="false">Function
called for each component.</param>
/// <returns type="Sys.ComponentSet" />
foreach(this._components, function(c, i) {
if (callback.call(c, i) === false) {
return true;
}
});
return this;
},
elements: function ComponentSet$elements() {
/// <summary>Returns the underlying set of elements this component
collection came from.</summary>
/// <returns type="Sys.ElementSet" />
return this._elementSet;
},
_execute: function ComponentSet$_execute(elementSet, query, index) {
var components = [];
function match(c) {
var ctor;
return (c instanceof query) ||
((ctor = c.constructor) && (
(ctor === query) ||
(ctor.inheritsFrom && ctor.inheritsFrom(query)) ||
(ctor.implementsInterface &&
ctor.implementsInterface(query))));
}
if (query instanceof Array) {
components.push.apply(components, query);
}
else {
elementSet.each(function() {
var c = this.control;
if (c && (!query || match(c))) {
components.push(c);
}
foreach(this._behaviors, function(b) {
if (!query || match(b)) {
components.push(b);
}
});
});
}
if ((typeof(index) !== "undefined")) {
if (components[index]) {
components = [components[index]];
}
else {
components = [];
}
}
return components;
}
}
}
obj = null;
}
var getCreate = function _getCreate(options, isPlugin) {
var body = [],
arglist = [],
type = options.type,
typeName = options.typeName || (type ? type.getName() : ""),
isBehavior = options._isBehavior,
description = (options && options.description) ||
(type && ("Creates an instance of the type '" + typeName
+ "' and sets the given properties.")) ||
"";
body.push("/// <summary>", description, "</summary>\n");
foreach(options && options.parameters, function(parameter) {
var name = parameter, type = '', desc = '';
if (typeof(parameter) !== "string") {
name = parameter.name;
type = parameter.type||'';
desc = parameter.description||'';
}
arglist.push(name);
body.push('/// <param name="', name, '"');
if (type) {
body.push(' type="', type, '"');
}
body.push('>', desc, '</param>\n');
});
var returnType;
if (!isPlugin) {
arglist.push("properties");
body.push('/// <param name="properties" type="Object" mayBeNull="true"
optional="true">Additional properties to set on the component.</param>\n');
returnType = isBehavior ? 'Sys.ComponentSet' : typeName;
}
else {
returnType = options.returnType;
}
if (returnType) {
body.push('/// <returns type="', returnType, '" />\n');
}
if (isPlugin) {
body.push('return Sys.plugins["', options.name, '"].plugin.apply(this,
arguments);');
}
else {
body.push('return Sys._createComp.call(this,
arguments.callee._component, arguments.callee._component.defaults, arguments);');
}
arglist.push(body.join(''));
}
Sys._getCreate = getCreate;
function execute() {
$type = Function;
$type.__typeName = 'Function';
$type.__class = true;
return function() {
var l = arguments.length;
if (l > 0) {
var args = [];
for (var i = 0; i < l; i++) {
args[i] = arguments[i];
}
args[l] = context;
return method.apply(this, args);
}
return method.call(this, context);
}
}
return function() {
return method.apply(instance, arguments);
}
}
if (error) {
var e = Error.parameterCount();
e.popStackFrame();
return e;
}
return null;
}
return null;
}
return null;
}
$type = Error;
$type.__typeName = 'Error';
$type.__class = true;
if (errorInfo) {
for (var v in errorInfo) {
err[v] = errorInfo[v];
}
}
err.popStackFrame();
return err;
}
if (paramName) {
displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
}
this.fileName = nextFrameParts[1];
this.lineNumber = parseInt(nextFrameParts[2]);
stackFrames.shift();
this.stack = stackFrames.join("\n");
}
$type = Object;
$type.__typeName = 'Object';
$type.__class = true;
i = close + 1;
}
return result;
}
$type = Boolean;
$type.__typeName = 'Boolean';
$type.__class = true;
$prototype = $type.prototype;
$prototype.callBaseMethod = function Type$callBaseMethod(instance, name,
baseArguments) {
/// <summary locid="M:J#Type.callBaseMethod"></summary>
/// <param name="instance">The instance for the base method. Usually
'this'.</param>
/// <param name="name" type="String">The name of the base method.</param>
/// <param name="baseArguments" type="Array" optional="true" mayBeNull="true"
elementMayBeNull="true">The arguments to pass to the base method.</param>
/// <returns>The return value of the base method.</returns>
var e = Function._validateParams(arguments, [
{name: "instance"},
{name: "name", type: String},
{name: "baseArguments", type: Array, mayBeNull: true, optional: true,
elementMayBeNull: true}
]);
if (e) throw e;
var baseMethod = Sys._getBaseMethod(this, instance, name);
if (!baseMethod) throw
Error.invalidOperation(String.format(Sys.Res.methodNotFound, name));
return baseArguments ? baseMethod.apply(instance, baseArguments) :
baseMethod.apply(instance);
}
baseType = baseType.__baseType;
}
this.resolveInheritance();
var baseType = this.__baseType;
if (baseType) {
baseArguments ? baseType.apply(instance, baseArguments) :
baseType.apply(instance);
}
return instance;
}
if (interfaceTypes) {
var interfaces = this.__interfaces = [];
this.resolveInheritance();
for (var i = 2, l = arguments.length; i < l; i++) {
var interfaceType = arguments[i];
if (!interfaceType.__interface) throw Error.argument('interfaceTypes['
+ (i - 2) + ']', Sys.Res.notAnInterface);
for (var methodName in interfaceType.prototype) {
var method = interfaceType.prototype[methodName];
if (!prototype[methodName]) {
prototype[methodName] = method;
}
}
interfaces.push(interfaceType);
}
}
Sys.__registeredTypes[typeName] = true;
return this;
}
var fn = Sys._getCreate(options),
target = isControlOrBehavior ? Sys.ElementSet.prototype : Sys.create;
target[name] = fn;
}
this.prototype.constructor = this;
this.__typeName = typeName;
this.__interface = true;
Sys.__registeredTypes[typeName] = true;
return this;
}
if (this.__basePrototypePending) {
var baseType = this.__baseType;
baseType.resolveInheritance();
var basePrototype = baseType.prototype,
thisPrototype = this.prototype;
for (var memberName in basePrototype) {
thisPrototype[memberName] = thisPrototype[memberName] ||
basePrototype[memberName];
}
delete this.__basePrototypePending;
}
}
$type._registerNamespace("Sys");
Sys.__upperCaseTypes = {};
Sys.__rootNamespaces = [Sys];
Sys.__registeredTypes = {};
foreach(Sys._ns, $type._registerNamespace);
delete Sys._ns;
$type = Array;
$type.__typeName = 'Array';
$type.__class = true;
array.push.apply(array, items);
}
$type.clear = function Array$clear(array) {
/// <summary locid="M:J#Array.clear">Clears the array of its
elements.</summary>
/// <param name="array" type="Array" elementMayBeNull="true">The array to
clear.</param>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true}
]);
if (e) throw e;
array.length = 0;
}
Type._registerScript._scripts = {
"MicrosoftAjaxCore.js": true,
"MicrosoftAjaxGlobalization.js": true,
"MicrosoftAjaxSerialization.js": true,
"MicrosoftAjaxComponentModel.js": true,
"MicrosoftAjaxHistory.js": true,
"MicrosoftAjaxNetwork.js" : true,
"MicrosoftAjaxWebServices.js": true };
$type.prototype = {
append: function StringBuilder$append(text) {
/// <summary locid="M:J#Sys.StringBuilder.append">Appends a new string at
the end of the StringBuilder.</summary>
/// <param name="text" mayBeNull="true">The string to append.</param>
/// <returns type="Sys.StringBuilder"></returns>
var e = Function._validateParams(arguments, [
{name: "text", mayBeNull: true}
]);
if (e) throw e;
this._parts.push(text);
return this;
},
this._cancel = false;
}
$type.prototype = {
get_cancel: function CancelEventArgs$get_cancel() {
/// <value type="Boolean" locid="P:J#Sys.CancelEventArgs.cancel"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._cancel;
},
set_cancel: function CancelEventArgs$set_cancel(value) {
var e = Function._validateParams(arguments, [{name: "value", type:
Boolean}]);
if (e) throw e;
this._cancel = value;
}
}
$type.registerClass('Sys.CancelEventArgs', Sys.EventArgs);
Type.registerNamespace('Sys.UI');
_getTrace: function() {
var traceElement = Sys.get('#TraceConsole');
return (traceElement && (traceElement.tagName.toUpperCase() ===
'TEXTAREA')) ? traceElement : null;
},
if (confirm(String.format(Sys.Res.breakIntoDebugger, message))) {
this.fail(message);
}
}
},
if (Sys.Browser.hasDebuggerStatement) {
window.eval('debugger');
}
},
function Sys$Enum$toString(value) {
/// <summary locid="M:J#Sys.Enum.toString">Converts the value of an enum
instance to its equivalent string representation.</summary>
/// <param name="value" optional="true" mayBeNull="true">The value of the enum
instance for which the string representation must be constructed.</param>
/// <returns type="String">The string representation of "value".</returns>
var e = Function._validateParams(arguments, [
{name: "value", mayBeNull: true, optional: true}
]);
if (e) throw e;
if ((typeof(value) === 'undefined') || (value === null)) return this.__string;
if ((typeof(value) != 'number') || ((value % 1) !== 0)) throw
Error.argumentType('value', Object.getType(value), this);
var values = this.prototype;
var i;
if (!this.__flags || (value === 0)) {
for (i in values) {
if (values[i] === value) {
return i;
}
}
}
else {
var sorted = this.__sortedValues;
if (!sorted) {
sorted = [];
for (i in values) {
sorted.push({key: i, value: values[i]});
}
sorted.sort(function(a, b) {
return a.value - b.value;
});
this.__sortedValues = sorted;
}
var parts = [];
var v = value;
for (i = sorted.length - 1; i >= 0; i--) {
var kvp = sorted[i];
var vali = kvp.value;
if (vali === 0) continue;
if ((vali & value) === vali) {
parts.push(kvp.key);
v -= vali;
if (v === 0) break;
}
}
if (parts.length && v === 0) return parts.reverse().join(', ');
}
throw Error.argumentOutOfRange('value', value,
String.format(Sys.Res.enumInvalidValue, value, this.__typeName));
}
$type = Type;
$type._observeMethods = {
add_propertyChanged: function(handler) {
Sys.Observer._addEventHandler(this, "propertyChanged", handler);
},
remove_propertyChanged: function(handler) {
Sys.Observer._removeEventHandler(this, "propertyChanged", handler);
},
addEventHandler: function(eventName, handler) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Adds an
observable event handler.</summary>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._addEventHandler(this, eventName, handler);
},
removeEventHandler: function(eventName, handler) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Removes an
observable event handler.</summary>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.Observer._removeEventHandler(this, eventName, handler);
},
clearEventHandlers: function(eventName) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Removes all
observable event handlers from the target.</summary>
/// <param name="target"></param>
/// <param name="eventName" type="String" mayBeNull="true"
optional="true">If not given, handlers for all events are removed.</param>
var e = Function._validateParams(arguments, [
{name: "target"},
{name: "eventName", type: String, mayBeNull: true, optional: true}
]);
if (e) throw e;
Sys.Observer._getContext(this, true).events._removeHandlers(eventName);
},
get_isUpdating: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged"></summary>
/// <returns type="Boolean"></returns>
return Sys.Observer.isUpdating(this);
},
beginUpdate: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged"></summary>
Sys.Observer.beginUpdate(this);
},
endUpdate: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged"></summary>
Sys.Observer.endUpdate(this);
},
setValue: function(name, value) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Sets a
property or field on the target in an observable manner.</summary>
/// <param name="name" type="String">The name of the property to field to
set.</param>
/// <param name="value" mayBeNull="true">The value to set.</param>
var e = Function._validateParams(arguments, [
{name: "name", type: String},
{name: "value", mayBeNull: true}
]);
if (e) throw e;
Sys.Observer._setValue(this, name, value);
},
raiseEvent: function(eventName, eventArgs) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Raises an
observable event.</summary>
/// <param name="eventName" type="String"></param>
/// <param name="eventArgs" optional="true" mayBeNull="true"></param>
Sys.Observer.raiseEvent(this, eventName, eventArgs||null);
},
raisePropertyChanged: function(name) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Raises a
change notification event.</summary>
/// <param name="name" type="String">The name of the property that
changed.</param>
Sys.Observer.raiseEvent(this, "propertyChanged", new
Sys.PropertyChangedEventArgs(name));
}
}
$type._arrayMethods = {
add_collectionChanged: function(handler) {
Sys.Observer._addEventHandler(this, "collectionChanged", handler);
},
remove_collectionChanged: function(handler) {
Sys.Observer._removeEventHandler(this, "collectionChanged", handler);
},
add: function(item) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Adds an item
to the collection in an observable manner.</summary>
/// <param name="item" mayBeNull="true">The item to add.</param>
Sys.Observer.add(this, item);
},
addRange: function(items) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Adds items to
the collection in an observable manner.</summary>
/// <param name="items" type="Array" elementMayBeNull="true">The array of
items to add.</param>
Sys.Observer.addRange(this, items);
},
clear: function() {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Clears the
array of its elements in an observable manner.</summary>
Sys.Observer.clear(this);
},
insert: function(index, item) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Inserts an
item at the specified index in an observable manner.</summary>
/// <param name="index" type="Number" integer="true">The index where the
item will be inserted.</param>
/// <param name="item" mayBeNull="true">The item to insert.</param>
Sys.Observer.insert(this, index, item);
},
remove: function(item) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Removes the
first occurence of an item from the array in an observable manner.</summary>
/// <param name="item" mayBeNull="true">The item to remove.</param>
/// <returns type="Boolean">True if the item was found.</returns>
return Sys.Observer.remove(this, item);
},
removeAt: function(index) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Removes the
item at the specified index from the array in an observable manner.</summary>
/// <param name="index" type="Number" integer="true">The index of the item
to remove.</param>
Sys.Observer.removeAt(this, index);
},
raiseCollectionChanged: function(changes) {
/// <summary locid="M:J#Sys.Observer.raiseCollectionChanged">Raises the
collectionChanged event.</summary>
/// <param name="changes" type="Array" elementType="Sys.CollectionChange">A
list of changes that were performed on the collection since the last event.</param>
Sys.Observer.raiseEvent(this, "collectionChanged", new
Sys.NotifyCollectionChangedEventArgs(changes));
}
}
$type._getContext = function Observer$_getContext(obj, create) {
var ctx = obj._observerContext;
if (ctx) return ctx();
if (create) {
return (obj._observerContext = this._createContext())();
}
return null;
}
$type._createContext = function Observer$_createContext() {
var ctx = {
events: new Sys.EventHandlerList()
};
return function() {
return ctx;
}
}
$type = Date;
$type._expandFormat = function Date$_expandFormat(dtf, format) {
format = format || "F";
var len = format.length;
if (len === 1) {
switch (format) {
case "d":
return dtf["ShortDatePattern"];
case "D":
return dtf["LongDatePattern"];
case "t":
return dtf["ShortTimePattern"];
case "T":
return dtf["LongTimePattern"];
case "f":
return dtf["LongDatePattern"] + " " + dtf["ShortTimePattern"];
case "F":
return dtf["FullDateTimePattern"];
case "M": case "m":
return dtf["MonthDayPattern"];
case "s":
return dtf["SortableDateTimePattern"];
case "Y": case "y":
return dtf["YearMonthPattern"];
default:
throw Error.format(Sys.Res.formatInvalidString);
}
}
else if ((len === 2) && (format.charAt(0) === "%")) {
format = format.charAt(1);
}
return format;
}
var m = match[0],
len = m.length,
add;
switch (m) {
case 'dddd': case 'ddd':
case 'MMMM': case 'MMM':
case 'gg': case 'g':
add = "(\\D+)";
break;
case 'tt': case 't':
add = "(\\D*)";
break;
case 'yyyy':
case 'fff':
case 'ff':
case 'f':
add = "(\\d{" + len + "})";
break;
case 'dd': case 'd':
case 'MM': case 'M':
case 'yy': case 'y':
case 'HH': case 'H':
case 'hh': case 'h':
case 'mm': case 'm':
case 'ss': case 's':
add = "(\\d\\d?)";
break;
case 'zzz':
add = "([+-]?\\d\\d?:\\d{2})";
break;
case 'zz': case 'z':
add = "([+-]?\\d\\d?)";
break;
case '/':
add = "(\\" + dtf.DateSeparator + ")";
break;
}
if (add) {
regexp.push(add);
}
groups.push(match[0]);
}
Sys._appendPreOrPostMatch(expFormat.slice(index), regexp);
regexp.push("$");
var regexpStr = regexp.join('').replace(/\s+/g, "\\s+");
var parseRegExp = {'regExp': regexpStr, 'groups': groups};
re[format] = parseRegExp;
return parseRegExp;
}
$prototype = $type.prototype;
$prototype.format = function Date$format(format) {
/// <summary locid="M:J#Date.format">Format a date using the invariant
culture.</summary>
/// <param name="format" type="String">Format string.</param>
/// <returns type="String">Formatted date.</returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture);
}
ret = [];
var hour;
var quoteCount = 0,
tokenRegExp = Date._getTokenRegExp(),
converted;
if (!sortable && convert) {
converted = convert.fromGregorian(this);
}
for (;;) {
var ar = tokenRegExp.exec(format);
if (!ar) break;
if (quoteCount % 2) {
ret.push(ar[0]);
continue;
}
switch (current) {
case "ddd":
case "dddd":
names = (clength === 3) ? dtf.AbbreviatedDayNames : dtf.DayNames;
ret.push(names[this.getDay()]);
break;
case "d":
case "dd":
foundDay = true;
ret.push(padZeros(getPart(this, 2), clength));
break;
case "MMM":
case "MMMM":
var namePrefix = (clength === 3 ? "Abbreviated" : ""),
genitiveNames = dtf[namePrefix + "MonthGenitiveNames"],
names = dtf[namePrefix + "MonthNames"],
part = getPart(this, 1);
ret.push((genitiveNames && hasDay())
? genitiveNames[part]
: names[part]);
break;
case "M":
case "MM":
ret.push(padZeros(getPart(this, 1) + 1, clength));
break;
case "y":
case "yy":
case "yyyy":
part = converted ? converted[0] : getEraYear(this, dtf, getEra(this,
eras), sortable);
if (clength < 4) {
part = part % 100;
}
ret.push(padZeros(part, clength));
break;
case "h":
case "hh":
hour = this.getHours() % 12;
if (hour === 0) hour = 12;
ret.push(padZeros(hour, clength));
break;
case "H":
case "HH":
ret.push(padZeros(this.getHours(), clength));
break;
case "m":
case "mm":
ret.push(padZeros(this.getMinutes(), clength));
break;
case "s":
case "ss":
ret.push(padZeros(this.getSeconds(), clength));
break;
case "t":
case "tt":
part = (this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator;
ret.push(clength === 1 ? part.charAt(0) : part);
break;
case "f":
case "ff":
case "fff":
ret.push(padZeros(this.getMilliseconds(), 3).substr(0, clength));
break;
case "z":
case "zz":
hour = this.getTimezoneOffset() / 60;
ret.push(((hour <= 0) ? '+' : '-') +
padZeros(Math.floor(Math.abs(hour)), clength));
break;
case "zzz":
hour = this.getTimezoneOffset() / 60;
ret.push(((hour <= 0) ? '+' : '-') +
padZeros(Math.floor(Math.abs(hour)), 2) +
":" + padZeros(Math.abs(this.getTimezoneOffset() % 60), 2));
break;
case "g":
case "gg":
if (dtf.eras) {
ret.push(dtf.eras[getEra(this, eras) + 1]);
}
break;
case "/":
ret.push(dtf.DateSeparator);
break;
}
}
return ret.join('');
}
String.localeFormat = function String$localeFormat(format, args) {
/// <summary locid="M:J#String.localeFormat">Replaces the format items in a
specified String with the text equivalents of the values of corresponding object
instances. The current culture will be used to format dates and numbers.</summary>
/// <param name="format" type="String">A format string.</param>
/// <param name="args" parameterArray="true" mayBeNull="true">The objects to
format.</param>
/// <returns type="String">A copy of format in which the format items have been
replaced by the string equivalent of the corresponding instances of object
arguments.</returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String},
{name: "args", mayBeNull: true, parameterArray: true}
]);
if (e) throw e;
return String._toFormattedString(true, arguments);
}
var formattingPatterns = {
P: ["Percent", ["-n %", "-n%", "-%n"], ["n %", "n%", "%n" ], 100],
N: ["Number",["(n)","-n","- n","n-","n -"], null, 1],
C: ["Currency",["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$
n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],["$n","n$","$ n","n $"], 1]
};
var l;
if (exponent > 0) {
right = zeroPad(right, exponent, false);
numberString += right.slice(0, exponent);
right = right.substr(exponent);
}
else if (exponent < 0) {
exponent = -exponent;
numberString = zeroPad(numberString, exponent+1, true);
right = numberString.slice(-exponent, numberString.length) + right;
numberString = numberString.slice(0, -exponent);
}
if (precision > 0) {
right = decimalChar +
((right.length > precision) ? right.slice(0, precision) :
zeroPad(right, precision, false));
}
else {
right = "";
}
stringIndex -= curSize;
var pattern,
current = format.charAt(0).toUpperCase();
switch (current) {
case "D":
pattern = 'n';
for (;;) {
var ar = regex.exec(pattern);
switch (ar[0]) {
case "n":
ret += number;
break;
case "$":
ret += nf.CurrencySymbol;
break;
case "-":
if (/[1-9]/.test(number)) {
ret += nf.NegativeSign;
}
break;
case "%":
ret += nf.PercentSymbol;
break;
}
}
return ret;
}
$type = Number;
$type.parseLocale = function Number$parseLocale(value) {
/// <summary locid="M:J#Number.parseLocale">Creates a number from its locale
string representation.</summary>
/// <param name="value" type="String">A string that can parse to a
number.</param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
], false);
if (e) throw e;
return Number._parse(value, Sys.CultureInfo.CurrentCulture);
}
$type.parseInvariant = function Number$parseInvariant(value) {
/// <summary locid="M:J#Number.parseInvariant">Creates a number from its string
representation.</summary>
/// <param name="value" type="String">A string that can parse to a
number.</param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "value", type: String}
], false);
if (e) throw e;
return Number._parse(value, Sys.CultureInfo.InvariantCulture);
}
$type._parse = function Number$_parse(value, cultureInfo) {
value = value.trim();
if (value.match(/^[+-]?infinity$/i)) {
return parseFloat(value);
}
if (value.match(/^0x[a-f0-9]+$/i)) {
return parseInt(value);
}
var numFormat = cultureInfo.numberFormat;
var signInfo = Number._parseNumberNegativePattern(value, numFormat,
numFormat.NumberNegativePattern);
var sign = signInfo[0];
var num = signInfo[1];
var exponent;
var intAndFraction;
var exponentPos = num.indexOf('e');
if (exponentPos < 0) exponentPos = num.indexOf('E');
if (exponentPos < 0) {
intAndFraction = num;
exponent = null;
}
else {
intAndFraction = num.substr(0, exponentPos);
exponent = num.substr(exponentPos + 1);
}
var integer;
var fraction;
var decSep = numFormat.NumberDecimalSeparator
var decimalPos = intAndFraction.indexOf(decSep);
if (decimalPos < 0) {
integer = intAndFraction;
fraction = null;
}
else {
integer = intAndFraction.substr(0, decimalPos);
fraction = intAndFraction.substr(decimalPos + decSep.length);
}
$prototype = $type.prototype;
$prototype.format = function Number$format(format) {
/// <summary locid="M:J#Number.format">Format a number using the invariant
culture.</summary>
/// <param name="format" type="String">Format string.</param>
/// <returns type="String">Formatted number.</returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return Sys._toFormattedString.call(this, format,
Sys.CultureInfo.InvariantCulture);
}
$prototype.localeFormat = function Number$localeFormat(format) {
/// <summary locid="M:J#Number.localeFormat">Format a number using the current
culture.</summary>
/// <param name="format" type="String">Format string.</param>
/// <returns type="String">Formatted number.</returns>
var e = Function._validateParams(arguments, [
{name: "format", type: String}
]);
if (e) throw e;
return Sys._toFormattedString.call(this, format,
Sys.CultureInfo.CurrentCulture);
}
function toUpper(value) {
return value.split("\u00A0").join(' ').toUpperCase();
}
function toUpperArray(arr) {
var result = [];
foreach(arr, function(value, i) {
result[i] = toUpper(value);
});
return result;
}
function clone(obj) {
var objNew = {};
forIn(obj, function(value, field) {
objNew[field] = (value instanceof Array) ? (value.length === 1 ? [value] :
Array.apply(null, value)) :
((typeof(value) === "object") ? clone(value) : value);
});
return objNew;
}
$type._parse = function(value) {
var dtf = value.dateTimeFormat;
if (dtf && !dtf.eras) {
dtf.eras = value.eras;
}
return new Sys.CultureInfo(value.name, value.numberFormat, dtf);
}
$type._setup = function() {
var cultureInfo = window.__cultureInfo,
monthNames =
["January","February","March","April","May","June","July","August","September","Oct
ober","November","December",""],
shortMonthNames =
["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],
invariant = {"name":"","numberFormat":
{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","CurrencyGroupSizes":
[3],"NumberGroupSizes":[3],"PercentGroupSizes":
[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\
u00A4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"Per
centPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-
Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","
NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Inf
inity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","P
ercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\
u2030","NativeDigits":
["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":
{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-
62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"Cale
ndarType":1,"Eras":
[1],"TwoDigitYearMax":2029},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRul
e":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd,
dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM
dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy
HH\':\'mm\':\'ss
\'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTi
mePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","Universal
SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd
HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":
["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":
["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":
["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"Abbreviat
edMonthNames":shortMonthNames,"MonthNames":monthNames,"NativeCalendarName":"Gregori
an
Calendar","AbbreviatedMonthGenitiveNames":Array.clone(shortMonthNames),"MonthGeniti
veNames":Array.clone(monthNames)},"eras":[1,"A.D.",null,0]};
this.InvariantCulture = this._parse(invariant);
switch(typeof(cultureInfo)) {
case "string":
cultureInfo = window.eval("(" + cultureInfo + ")");
case "object":
this.CurrentCulture = this._parse(cultureInfo);
delete __cultureInfo;
break;
default:
cultureInfo = clone(invariant);
cultureInfo.name = "en-US";
cultureInfo.numberFormat.CurrencySymbol = "$";
var dtf = cultureInfo.dateTimeFormat;
dtf.FullDatePattern = "dddd, MMMM dd, yyyy h:mm:ss tt";
dtf.LongDatePattern = "dddd, MMMM dd, yyyy";
dtf.LongTimePattern = "h:mm:ss tt";
dtf.ShortDatePattern = "M/d/yyyy";
dtf.ShortTimePattern = "h:mm tt";
dtf.YearMonthPattern = "MMMM, yyyy";
this.CurrentCulture = this._parse(cultureInfo);
break;
}
}
$type._setup();
Type.registerNamespace('Sys.Serialization');
$type._esc = {
charsRegExs: { '"': /\"/g, '\\': /\\/g }, /*"*/
chars: ['\\', '"'],
dateRegEx: /(^|[^\\])\"\\\/Date\((-?[0-9]+)(?:[a-zA-Z]|(?:\+|-)[0-9]
{4})?\)\\\/\"/g, /* " */
escapeChars: {'\\':'\\\\', '"':'\\"', "\b":"\\b", "\t":"\\t", "\n":"\\n", "\
f":"\\f", "\r":"\\r"},
escapeRegExG: /[\"\\\x00-\x1F]/g,
escapeRegEx: /[\"\\\x00-\x1F]/i,
jsonRegEx: /[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/g,
jsonStringRegEx: /\"(\\.|[^\"\\])*\"/g /*"*/
};
$type._init = function() {
var esc = this._esc,
toEsc = esc.chars,
toEscRE = esc.charsRegExs,
escChars = esc.escapeChars;
for (var i = 0; i < 32; i++) {
var c = String.fromCharCode(i);
toEsc[i+2] = c;
toEscRE[c] = new RegExp(c, 'g');
escChars[c] = escChars[c] || ("\\u" + ("000" + i.toString(16)).slice(-4));
}
this._load = true;
}
$type._serializeNumberWithBuilder = function(object, stringBuilder) {
if (!isFinite(object)) {
throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers);
}
stringBuilder.append(String(object));
}
$type._serializeStringWithBuilder = function(string, stringBuilder) {
stringBuilder.append('"');
var esc = this._esc;
if (esc.escapeRegEx.test(string)) {
if (!this._load) {
this._init();
}
if (string.length < 128) {
string = string.replace(esc.escapeRegExG,
function(x) { return esc.escapeChars[x]; });
}
else {
for (var i = 0; i < 34; i++) {
var c = esc.chars[i];
if (string.indexOf(c) !== -1) {
var escChar = esc.escapeChars[c];
string = (isBrowser("Opera") || isBrowser("Firefox")) ?
string.split(c).join(escChar) :
string.replace(esc.charsRegExs[c], escChar);
}
}
}
}
stringBuilder.append(string).append('"');
}
$type._serializeWithBuilder = function(object, stringBuilder, sort, prevObjects) {
var i;
switch (typeof object) {
case 'object':
if (object) {
if (prevObjects){
if (Sys._indexOf(prevObjects, object) !== -1) {
throw
Error.invalidOperation(Sys.Res.cannotSerializeObjectWithCycle);
}
}
else {
prevObjects = [];
}
try {
prevObjects.push(object);
if (Number.isInstanceOfType(object)) {
this._serializeNumberWithBuilder(object, stringBuilder);
}
else if (Boolean.isInstanceOfType(object)) {
stringBuilder.append(object);
}
else if (String.isInstanceOfType(object)) {
this._serializeStringWithBuilder(object, stringBuilder);
}
stringBuilder.append('{');
var needComma;
for (i=0; i < propertyCount; i++) {
var prop = properties[i], value = object[prop],
type = typeof(value);
if (type !== 'undefined' && type !== 'function') {
if (needComma) {
stringBuilder.append(',');
}
this._serializeWithBuilder(prop, stringBuilder, sort,
prevObjects);
stringBuilder.append(':');
this._serializeWithBuilder(value, stringBuilder, sort,
prevObjects);
needComma = true;
}
}
stringBuilder.append('}');
}
}
finally {
Array.removeAt(prevObjects, prevObjects.length - 1);
}
}
else {
stringBuilder.append('null');
}
break;
case 'number':
this._serializeNumberWithBuilder(object, stringBuilder);
break;
case 'string':
this._serializeStringWithBuilder(object, stringBuilder);
break;
case 'boolean':
stringBuilder.append(object);
break;
default:
stringBuilder.append('null');
break;
}
}
Type.registerNamespace('Sys.UI');
$type.prototype = {
_addHandler: function EventHandlerList$_addHandler(id, handler) {
Array.add(this._getEvent(id, true), handler);
},
addHandler: function EventHandlerList$addHandler(id, handler) {
/// <summary locid="M:J#Sys.EventHandlerList.addHandler">The addHandler
method adds a handler to the event identified by id.</summary>
/// <param name="id" type="String">The identifier for the event.</param>
/// <param name="handler" type="Function">The handler to add to the
event.</param>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
this._addHandler(id, handler);
},
_removeHandler: function EventHandlerList$_removeHandler(id, handler) {
var evt = this._getEvent(id);
if (!evt) return;
Array.remove(evt, handler);
},
_removeHandlers: function EventHandlerList$_removeHandlers(id) {
if (!id) {
this._list = {};
}
else {
var evt = this._getEvent(id);
if (!evt) return;
evt.length = 0;
}
},
removeHandler: function EventHandlerList$removeHandler(id, handler) {
/// <summary locid="M:J#Sys.EventHandlerList.removeHandler">The
removeHandler method removes a handler to the event identified by id.</summary>
/// <param name="id" type="String">The identifier for the event.</param>
/// <param name="handler" type="Function">The handler to remove from the
event.</param>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
this._removeHandler(id, handler);
},
getHandler: function EventHandlerList$getHandler(id) {
/// <summary locid="M:J#Sys.EventHandlerList.getHandler">The getHandler
method returns a single function that will call all handlers sequentially for the
specified event.</summary>
/// <param name="id" type="String">The identifier for the event.</param>
/// <returns type="Function">A function that will call each handler
sequentially.</returns>
var e = Function._validateParams(arguments, [
{name: "id", type: String}
]);
if (e) throw e;
var evt = this._getEvent(id);
if (!evt || !evt.length) return null;
evt = Array.clone(evt);
return function(source, args) {
for (var i = 0, l = evt.length; i < l; i++) {
evt[i](source, args);
}
};
},
_getEvent: function EventHandlerList$_getEvent(id, create) {
var e = this._list[id];
if (!e) {
if (!create) return null;
this._list[id] = e = [];
}
return e;
}
}
$type.registerClass('Sys.EventHandlerList');
$type = Sys.CommandEventArgs = function CommandEventArgs(commandName,
commandArgument, commandSource, commandEvent) {
/// <summary locid="M:J#Sys.CommandEventArgs.#ctor"></summary>
/// <param name="commandName" type="String">The command name.</param>
/// <param name="commandArgument" mayBeNull="true">The command
arguments.</param>
/// <param name="commandSource" mayBeNull="true">The command source.</param>
/// <param name="commandEvent" type="Sys.UI.DomEvent" mayBeNull="true"
optional="true">The DOM event that caused the command, if any.</param>
var e = Function._validateParams(arguments, [
{name: "commandName", type: String},
{name: "commandArgument", mayBeNull: true},
{name: "commandSource", mayBeNull: true},
{name: "commandEvent", type: Sys.UI.DomEvent, mayBeNull: true, optional:
true }
]);
if (e) throw e;
Sys.CommandEventArgs.initializeBase(this);
this._commandName = commandName;
this._commandArgument = commandArgument;
this._commandSource = commandSource;
this._commandEvent = commandEvent;
}
$type.prototype = {
get_commandName: function CommandEventArgs$get_commandName() {
/// <value type="String" locid="P:J#Sys.CommandEventArgs.commandName">The
command name.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandName || null;
},
get_commandArgument: function CommandEventArgs$get_commandArgument() {
/// <value mayBeNull="true"
locid="P:J#Sys.CommandEventArgs.commandArgument">The command arguments.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandArgument;
},
get_commandSource: function CommandEventArgs$get_commandSource() {
/// <value mayBeNull="true"
locid="P:J#Sys.CommandEventArgs.commandSource">The command source.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandSource || null;
},
get_commandEvent: function CommandEventArgs$get_commandEvent() {
/// <value mayBeNull="true" type="Sys.UI.DomEvent"
locid="P:J#Sys.CommandEventArgs.commandEvent">The DOM event that caused the
command, if any.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._commandEvent || null;
}
}
$type.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs);
$type = Sys.INotifyPropertyChange = function INotifyPropertyChange() {
/// <summary locid="M:J#Sys.INotifyPropertyChange.#ctor">Implement this
interface to become a provider of property change notifications.</summary>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
$type.prototype = {
add_propertyChanged: function
INotifyPropertyChange$add_propertyChanged(handler) {
/// <summary locid="E:J#Sys.INotifyPropertyChange.propertyChanged"></summary>
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
throw Error.notImplemented();
},
remove_propertyChanged: function
INotifyPropertyChange$remove_propertyChanged(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
throw Error.notImplemented();
}
}
$type.registerInterface('Sys.INotifyPropertyChange');
$type = Sys.PropertyChangedEventArgs = function
PropertyChangedEventArgs(propertyName) {
/// <summary locid="M:J#Sys.PropertyChangedEventArgs.#ctor">Describes property
changes.</summary>
/// <param name="propertyName" type="String">The name of the property that
changed.</param>
var e = Function._validateParams(arguments, [
{name: "propertyName", type: String}
]);
if (e) throw e;
Sys.PropertyChangedEventArgs.initializeBase(this);
this._propertyName = propertyName;
}
$type.prototype = {
get_propertyName: function PropertyChangedEventArgs$get_propertyName() {
/// <value type="String"
locid="P:J#Sys.PropertyChangedEventArgs.propertyName">The name of the property that
changed.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._propertyName;
}
}
$type.registerClass('Sys.PropertyChangedEventArgs', Sys.EventArgs);
$type = Sys.INotifyDisposing = function INotifyDisposing() {
/// <summary locid="M:J#Sys.INotifyDisposing.#ctor">Implement this interface if
the class exposes an event to notify when it's disposing.</summary>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
}
$type.prototype = {
add_disposing: function INotifyDisposing$add_disposing(handler) {
/// <summary locid="E:J#Sys.INotifyDisposing.disposing"></summary>
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
throw Error.notImplemented();
},
remove_disposing: function INotifyDisposing$remove_disposing(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
throw Error.notImplemented();
}
}
$type.registerInterface("Sys.INotifyDisposing");
$type = Sys.Component = function Component() {
/// <summary locid="M:J#Sys.Component.#ctor">Base class for Control, Behavior
and any object that wants its lifetime to be managed.</summary>
if (arguments.length !== 0) throw Error.parameterCount();
if (Sys.Application) Sys.Application.registerDisposableObject(this);
}
$type.prototype = {
_idSet: false,
get_events: function Component$get_events() {
/// <value type="Sys.EventHandlerList" locid="P:J#Sys.Component.events">The
collection of event handlers for this behavior. This property should only be used
by derived behaviors and should not be publicly called by other code.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return Sys.Observer._getContext(this, true).events;
},
get_id: function Component$get_id() {
/// <value type="String" locid="P:J#Sys.Component.id"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._id || null;
},
set_id: function Component$set_id(value) {
var e = Function._validateParams(arguments, [{name: "value", type:
String}]);
if (e) throw e;
if (this._idSet) throw
Error.invalidOperation(Sys.Res.componentCantSetIdTwice);
this._idSet = true;
var oldId = this.get_id();
if (oldId && Sys.Application.findComponent(oldId)) throw
Error.invalidOperation(Sys.Res.componentCantSetIdAfterAddedToApp);
this._id = value;
},
get_isInitialized: function Component$get_isInitialized() {
/// <value type="Boolean" locid="P:J#Sys.Component.isInitialized"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return !!this._initialized;
},
get_isUpdating: function Component$get_isUpdating() {
/// <value type="Boolean" locid="P:J#Sys.Component.isUpdating"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return !!this._updating;
},
add_disposing: function Component$add_disposing(handler) {
/// <summary locid="E:J#Sys.Component.disposing"></summary>
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
this._addHandler("disposing", handler);
},
remove_disposing: function Component$remove_disposing(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
this._removeHandler("disposing", handler);
},
add_propertyChanged: function Component$add_propertyChanged(handler) {
/// <summary locid="E:J#Sys.Component.propertyChanged"></summary>
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
this._addHandler("propertyChanged", handler);
},
remove_propertyChanged: function Component$remove_propertyChanged(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
this._removeHandler("propertyChanged", handler);
},
_addHandler: function Component$_addHandler(eventName, handler) {
Sys.Observer.addEventHandler(this, eventName, handler);
},
_removeHandler: function Component$_removeHandler(eventName, handler) {
Sys.Observer.removeEventHandler(this, eventName, handler);
},
beginUpdate: function Component$beginUpdate() {
this._updating = true;
},
dispose: function Component$dispose() {
Sys.Observer.raiseEvent(this, "disposing")
Sys.Observer.clearEventHandlers(this);
Sys.Application.unregisterDisposableObject(this);
Sys.Application.removeComponent(this);
},
endUpdate: function Component$endUpdate() {
this._updating = false;
if (!this._initialized) this.initialize();
this.updated();
},
initialize: function Component$initialize() {
this._initialized = true;
},
raisePropertyChanged: function Component$raisePropertyChanged(propertyName) {
/// <summary locid="M:J#Sys.Component.raisePropertyChanged">Raises a change
notification event.</summary>
/// <param name="propertyName" type="String">The name of the property that
changed.</param>
var e = Function._validateParams(arguments, [
{name: "propertyName", type: String}
]);
if (e) throw e;
Sys.Observer.raisePropertyChanged(this, propertyName);
},
updated: function Component$updated() {
}
}
$type.registerClass('Sys.Component', null, Sys.IDisposable,
Sys.INotifyPropertyChange, Sys.INotifyDisposing);
Sys.registerPlugin({
name: "addHandler",
dom: true,
returnType: "Sys.ElementSet",
description: "A cross-browser way to add a DOM event handler to an element.",
parameters: [
{name: "eventName", type: "String", description: "The name of the event. Do
not include the 'on' prefix, for example, 'click' instead of 'onclick'."},
{name: "handler", type: "Function", description: "The event handler to
add."},
{name: "autoRemove", type: "Boolean", description: "Whether the handler
should be removed automatically when the element is disposed of, such as when an
UpdatePanel refreshes, or Sys.Application.disposeElement is called."}
],
plugin: function (eventName, handler, autoRemove) {
Sys.UI.DomEvent.addHandler(this.get(), eventName, handler, autoRemove);
return this;
}
});
Sys.registerPlugin({
name: "addHandlers",
dom: true,
returnType: "Sys.ElementSet",
description: "Adds a list of event handlers to an element. If a handlerOwner is
specified, delegates are created with each of the handlers.",
parameters: [
{name: "events", type: "Object", description: "A dictionary of event
handlers."},
{name: "handlerOwner", description: "The owner of the event handlers that
will be the this pointer for the delegates that will be created from the
handlers."},
{name: "autoRemove", type: "Boolean", description: "Whether the handler
should be removed automatically when the element is disposed of, such as when an
UpdatePanel refreshes, or Sys.Application.disposeElement is called."}
],
plugin: function (events, handlerOwner, autoRemove) {
Sys.UI.DomEvent.addHandlers(this.get(), events, handlerOwner, autoRemove);
return this;
}
});
Sys.registerPlugin({
name: "clearHandlers",
dom: true,
returnType: "Sys.ElementSet",
description: "Clears all the event handlers that were added to the element or
array of elements.",
plugin: function() {
Sys.UI.DomEvent.clearHandlers(this.get());
return this;
}
});
Sys.registerPlugin({
name: "removeHandler",
dom: true,
returnType: "Sys.ElementSet",
description: "A cross-browser way to remove a DOM event handler from an
element.",
parameters: [
{name: "eventName", type: "String", description: "The name of the event. Do
not include the 'on' prefix, for example, 'click' instead of 'onclick'."},
{name: "handler", type: "Function", description: "The event handler to
remove."}
],
plugin: function (eventName, handler) {
Sys.UI.DomEvent.removeHandler(this.get(), eventName, handler);
return this;
}
});
if (document.documentElement.getBoundingClientRect) {
$type.getLocation = function DomElement$getLocation(element) {
/// <summary locid="M:J#Sys.UI.DomElement.getLocation">Gets the coordinates
of a DOM element.</summary>
/// <param name="element" domElement="true"></param>
/// <returns type="Sys.UI.Point">A Point object with two fields, x and y,
which contain the pixel coordinates of the element.</returns>
var e = Function._validateParams(arguments, [
{name: "element", domElement: true}
]);
if (e) throw e;
currentStyle = Sys.UI.DomElement._getCurrentStyle(element);
var elementPosition = currentStyle ? currentStyle.position : null;
if (elementPosition !== "absolute") {
for (parent = element.parentNode; parent; parent = parent.parentNode) {
tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
offsetX += parent.offsetLeft;
offsetY += parent.offsetTop;
}
currentStyle = Sys.UI.DomElement._getCurrentStyle(element);
var elementPosition = currentStyle ? currentStyle.position : null;
if (elementPosition !== "absolute") {
for (parent = element.parentNode; parent; parent = parent.parentNode) {
tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
if (currentStyle) {
offsetX += parseInt(currentStyle.borderLeftWidth) || 0;
offsetY += parseInt(currentStyle.borderTopWidth) || 0;
}
}
}
}
return new Sys.UI.Point(offsetX, offsetY);
}
}
Sys.registerPlugin({
name: "setCommand",
dom: true,
returnType: "Sys.ElementSet",
description: "Causes a DOM element to raise a bubble event when clicked.",
parameters: [
{name: "commandName", type:"String", description: "The name of the command
to raise."},
{name: "commandArgument", description: "Optional command argument."},
{name: "commandTarget", description: "DOM element from which the command
should start bubbling up."}
],
plugin: function(commandName, commandArgument, commandTarget) {
var e = Function._validateParams(arguments, [
{name: "commandName", type: String, mayBeNull: true},
{name: "commandArgument", mayBeNull: true, optional: true},
{name: "commandTarget", mayBeNull: true, optional: true}
]);
if (e) throw e;
return this.addHandler('click', function(ev) {
var source = commandTarget || this;
Sys.UI.DomElement.raiseBubbleEvent(source, new
Sys.CommandEventArgs(commandName, commandArgument, this, ev));
}, true /*autoRemove*/);
}
});
this._disposableObjects = [];
this._components = {};
this._createdComponents = [];
this._secondPassComponents = [];
this._unloadHandlerDelegate = Function.createDelegate(this,
this._unloadHandler);
Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate);
}
$type.prototype = {
_deleteCount: 0,
Sys.UI.DomEvent.removeHandler(window, "unload",
this._unloadHandlerDelegate);
if (Sys._ScriptLoader) {
var sl = Sys._ScriptLoader.getInstance();
if (sl) {
sl.dispose();
}
}
Sys._Application.callBaseMethod(this, 'dispose');
}
},
disposeElement: function _Application$disposeElement(element, childNodesOnly) {
/// <summary locid="M:J#Sys._Application.disposeElement">Disposes of
control and behavior resources associated with an element and its child
nodes.</summary>
/// <param name="element">The element to dispose.</param>
/// <param name="childNodesOnly" type="Boolean">Whether to dispose of the
element and its child nodes or only its child nodes.</param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "childNodesOnly", type: Boolean}
]);
if (e) throw e;
if (element.nodeType === 1) {
var d, c, i, list,
allElements = element.getElementsByTagName("*"),
length = allElements.length,
children = new Array(length);
for (i = 0; i < length; i++) {
children[i] = allElements[i];
}
for (i = length - 1; i >= 0; i--) {
var child = children[i];
d = child.dispose;
if (d && typeof(d) === "function") {
child.dispose();
}
else {
c = child.control;
if (c && typeof(c.dispose) === "function") {
c.dispose();
}
}
list = child._behaviors;
if (list) {
this._disposeComponents(list);
}
list = child._components;
if (list) {
this._disposeComponents(list);
child._components = null;
}
}
if (!childNodesOnly) {
d = element.dispose;
if (d && typeof(d) === "function") {
element.dispose();
}
else {
c = element.control;
if (c && typeof(c.dispose) === "function") {
c.dispose();
}
}
list = element._behaviors;
if (list) {
this._disposeComponents(list);
}
list = element._components;
if (list) {
this._disposeComponents(list);
element._components = null;
}
}
}
},
endCreateComponents: function _Application$endCreateComponents() {
/// <summary locid="M:J#Sys.Application.endCreateComponents"></summary>
if (arguments.length !== 0) throw Error.parameterCount();
var components = this._secondPassComponents;
for (var i = 0, l = components.length; i < l; i++) {
var entry = components[i],
component = entry.component;
Sys.Component._setReferences(component, entry.references);
component.endUpdate();
}
this._secondPassComponents = [];
this._creatingComponents = false;
},
findComponent: function _Application$findComponent(id, parent) {
/// <summary locid="M:J#Sys.Application.findComponent">Finds top-level
components that were added through addComponent if no parent is specified or
children of the specified parent. If parent is a component</summary>
/// <param name="id" type="String">The id of the component to find.</param>
/// <param name="parent" optional="true" mayBeNull="true">The component or
element that contains the component to find. If not specified or null, the search
is made on Application.</param>
/// <returns type="Sys.Component" mayBeNull="true">The component, or null
if it wasn't found.</returns>
var e = Function._validateParams(arguments, [
{name: "id", type: String},
{name: "parent", mayBeNull: true, optional: true}
]);
if (e) throw e;
return (parent ?
((Sys.IContainer.isInstanceOfType(parent)) ?
parent.findComponent(id) :
parent[id] || null) :
Sys.Application._components[id] || null);
},
getComponents: function _Application$getComponents() {
/// <summary locid="M:J#Sys.Application.getComponents"></summary>
/// <returns type="Array" elementType="Sys.Component"></returns>
if (arguments.length !== 0) throw Error.parameterCount();
var res = [];
var components = this._components;
for (var name in components) {
if (components.hasOwnProperty(name)) {
res.push(components[name]);
}
}
return res;
},
initialize: function _Application$initialize() {
/// <summary locid="M:J#Sys.Application.initialize"></summary>
if (arguments.length !== 0) throw Error.parameterCount();
window.setTimeout(Function.createDelegate(this, this._doInitialize), 0);
},
_doInitialize: function _Application$_doInitialize() {
if(!this.get_isInitialized() && !this._disposing) {
Sys._Application.callBaseMethod(this, 'initialize');
this._raiseInit();
if (this.get_stateString) {
if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
var prm = Sys.WebForms.PageRequestManager.getInstance();
this._beginRequestHandler = Function.createDelegate(this,
this._onPageRequestManagerBeginRequest);
prm.add_beginRequest(this._beginRequestHandler);
this._endRequestHandler = Function.createDelegate(this,
this._onPageRequestManagerEndRequest);
prm.add_endRequest(this._endRequestHandler);
}
var loadedEntry = this.get_stateString();
if (loadedEntry !== this._currentEntry) {
this._navigate(loadedEntry);
}
else {
this._ensureHistory();
}
}
this.raiseLoad();
}
},
notifyScriptLoaded: function _Application$notifyScriptLoaded() {
/// <summary locid="M:J#Sys.Application.notifyScriptLoaded">Called by
referenced scripts to indicate that they have completed loading.
[Obsolete]</summary>
if (arguments.length !== 0) throw Error.parameterCount();
},
registerDisposableObject: function
_Application$registerDisposableObject(object) {
/// <summary locid="M:J#Sys.Application.registerDisposableObject">Registers
a disposable object with the application.</summary>
/// <param name="object" type="Sys.IDisposable">The object to
register.</param>
var e = Function._validateParams(arguments, [
{name: "object", type: Sys.IDisposable}
]);
if (e) throw e;
if (!this._disposing) {
var objects = this._disposableObjects,
i = objects.length;
objects[i] = object;
object.__msdisposeindex = i;
}
},
raiseLoad: function _Application$raiseLoad() {
/// <summary locid="M:J#Sys.Application.raiseLoad"></summary>
if (arguments.length !== 0) throw Error.parameterCount();
var args = new
Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded);
this._loaded = true;
Sys.Observer.raiseEvent(this, "load", args);
if (window.pageLoad) {
window.pageLoad(this, args);
}
this._createdComponents = [];
},
removeComponent: function _Application$removeComponent(component) {
/// <summary locid="M:J#Sys.Application.removeComponent">Removes a top-
level component from the application.</summary>
/// <param name="component" type="Sys.Component">The component to
remove.</param>
var e = Function._validateParams(arguments, [
{name: "component", type: Sys.Component}
]);
if (e) throw e;
var id = component.get_id();
if (id) delete this._components[id];
},
unregisterDisposableObject: function
_Application$unregisterDisposableObject(object) {
/// <summary
locid="M:J#Sys.Application.unregisterDisposableObject">Unregisters a disposable
object from the application.</summary>
/// <param name="object" type="Sys.IDisposable">The object to
unregister.</param>
var e = Function._validateParams(arguments, [
{name: "object", type: Sys.IDisposable}
]);
if (e) throw e;
if (!this._disposing) {
var i = object.__msdisposeindex;
if (typeof(i) === "number") {
var disposableObjects = this._disposableObjects;
delete disposableObjects[i];
delete object.__msdisposeindex;
if (++this._deleteCount > 1000) {
var newArray = [];
for (var j = 0, l = disposableObjects.length; j < l; j++) {
object = disposableObjects[j];
if (typeof(object) !== "undefined") {
object.__msdisposeindex = newArray.length;
newArray.push(object);
}
}
this._disposableObjects = newArray;
this._deleteCount = 0;
}
}
}
},
_addComponentToSecondPass: function
_Application$_addComponentToSecondPass(component, references) {
this._secondPassComponents.push({component: component, references:
references});
},
_disposeComponents: function _Application$_disposeComponents(list) {
if (list) {
for (var i = list.length - 1; i >= 0; i--) {
var item = list[i];
if (typeof(item.dispose) === "function") {
item.dispose();
}
}
}
},
_raiseInit: function _Application$_raiseInit() {
this.beginCreateComponents();
Sys.Observer.raiseEvent(this, "init");
this.endCreateComponents();
},
_unloadHandler: function _Application$_unloadHandler(event) {
this.dispose();
}
}
$type.registerClass('Sys._Application', Sys.Component, Sys.IContainer);
Sys.onReady(function() {
Sys.Application._doInitialize();
});
this._element = element;
element.control = this;
var role = this.get_role();
if (role) {
element.setAttribute("role", role);
}
}
$type.prototype = {
_parent: null,
_visibilityMode: Sys.UI.VisibilityMode.hide,
$prototype = Sys._Application.prototype;
$prototype.get_stateString = function _Application$get_stateString() {
/// <summary locid="M:J#Sys._Application.get_stateString"></summary>
if (arguments.length !== 0) throw Error.parameterCount();
var hash = null;
if (isBrowser("Firefox")) {
var href = window.location.href;
var hashIndex = href.indexOf('#');
if (hashIndex !== -1) {
hash = href.substring(hashIndex + 1);
}
else {
hash = "";
}
return hash;
}
else {
hash = window.location.hash;
}
return hash;
};
$prototype._enableHistoryInScriptManager = function
_Application$_enableHistoryInScriptManager() {
this._enableHistory = true;
this._historyEnabledInScriptManager = true;
};
var e;
try {
this._initialState = this._deserializeState(this.get_stateString());
}
catch(e) {}
this._historyInitialized = true;
}
};
if (this._uniqueId) {
var oldServerEntry = this._state.__s || '';
var newServerEntry = state.__s || '';
if (newServerEntry !== oldServerEntry) {
this._updateHiddenField(newServerEntry);
__doPostBack(this._uniqueId, newServerEntry);
this._state = state;
return;
}
}
this._setState(entry);
this._state = state;
this._raiseNavigate();
};
$prototype._onPageRequestManagerBeginRequest = function
_Application$_onPageRequestManagerBeginRequest(sender, args) {
this._ignoreTimer = true;
this._originalTitle = document.title;
};
$prototype._onPageRequestManagerEndRequest = function
_Application$_onPageRequestManagerEndRequest(sender, args) {
var dataItem = args.get_dataItems()[this._clientId];
var originalTitle = this._originalTitle;
this._originalTitle = null;
Type.registerNamespace('Sys.Net');
$type.prototype = {
get_started: function WebRequestExecutor$get_started() {
/// <value type="Boolean"
locid="P:J#Sys.Net.WebRequestExecutor.started"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_responseAvailable: function WebRequestExecutor$get_responseAvailable() {
/// <value type="Boolean"
locid="P:J#Sys.Net.WebRequestExecutor.responseAvailable"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_timedOut: function WebRequestExecutor$get_timedOut() {
/// <value type="Boolean"
locid="P:J#Sys.Net.WebRequestExecutor.timedOut"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_aborted: function WebRequestExecutor$get_aborted() {
/// <value type="Boolean"
locid="P:J#Sys.Net.WebRequestExecutor.aborted"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_responseData: function WebRequestExecutor$get_responseData() {
/// <value type="String"
locid="P:J#Sys.Net.WebRequestExecutor.responseData"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_statusCode: function WebRequestExecutor$get_statusCode() {
/// <value type="Number"
locid="P:J#Sys.Net.WebRequestExecutor.statusCode"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_statusText: function WebRequestExecutor$get_statusText() {
/// <value type="String"
locid="P:J#Sys.Net.WebRequestExecutor.statusText"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
get_xml: function WebRequestExecutor$get_xml() {
/// <value locid="P:J#Sys.Net.WebRequestExecutor.xml"></value>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
executeRequest: function WebRequestExecutor$executeRequest() {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.executeRequest">Begins
execution of the request.</summary>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
abort: function WebRequestExecutor$abort() {
/// <summary locid="M:J#Sys.Net.WebRequestExecutor.abort">Aborts the
request.</summary>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
getAllResponseHeaders: function WebRequestExecutor$getAllResponseHeaders() {
/// <summary
locid="M:J#Sys.Net.WebRequestExecutor.getAllResponseHeaders">Returns all the
responses header.</summary>
if (arguments.length !== 0) throw Error.parameterCount();
throw Error.notImplemented();
},
getResponseHeader: function WebRequestExecutor$getResponseHeader(header) {
/// <summary
locid="M:J#Sys.Net.WebRequestExecutor.getResponseHeader">Returns a response
header.</summary>
/// <param name="header" type="String">The requested header.</param>
var e = Function._validateParams(arguments, [
{name: "header", type: String}
]);
if (e) throw e;
throw Error.notImplemented();
},
get_webRequest: function WebRequestExecutor$get_webRequest() {
/// <value type="Sys.Net.WebRequest"
locid="P:J#Sys.Net.WebRequestExecutor.webRequest"></value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._webRequest;
},
_set_webRequest: function WebRequestExecutor$_set_webRequest(value) {
if (this.get_started()) {
throw
Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted,
'set_webRequest'));
}
this._webRequest = value;
},
get_object: function WebRequestExecutor$get_object() {
/// <value locid="P:J#Sys.Net.WebRequestExecutor.object">The JSON eval'd
response.</value>
if (arguments.length !== 0) throw Error.parameterCount();
var result = this._resultObject;
if (!result) {
this._resultObject = result =
Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());
}
return result;
}
}
$type.registerClass('Sys.Net.WebRequestExecutor');
Sys.Net.XMLDOM = function XMLDOM(markup) {
/// <summary locid="M:J#Sys.Net.XMLDOM.#ctor">Creates an XML document from an
XML string.</summary>
/// <param name="markup" type="String">The XML string to parse.</param>
var e = Function._validateParams(arguments, [
{name: "markup", type: String}
]);
if (e) throw e;
if (!window.DOMParser) {
var ex, progIDs = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ];
for (var i = 0, l = progIDs.length; i < l; i++) {
try {
var xmlDOM = new ActiveXObject(progIDs[i]);
xmlDOM.async = false;
xmlDOM.loadXML(markup);
xmlDOM.setProperty('SelectionLanguage', 'XPath');
return xmlDOM;
}
catch (ex) {
}
}
}
else {
try {
var domParser = new window.DOMParser();
return domParser.parseFromString(markup, 'text/xml');
}
catch (ex) {
}
}
return null;
}
Sys.Net.XMLHttpExecutor.initializeBase(this);
this._onReadyStateChange = (function () {
/*
readyState values:
0 = uninitialized
1 = loading
2 = loaded
3 = interactive
4 = complete
*/
if (_this._xmlHttpRequest.readyState === 4 /*complete*/) {
try {
if (typeof(_this._xmlHttpRequest.status) === "undefined") {
return;
}
}
catch(ex) {
return;
}
_this._clearTimer();
_this._responseAvailable = true;
_this._webRequest.completed(Sys.EventArgs.Empty);
if (_this._xmlHttpRequest) {
_this._xmlHttpRequest.onreadystatechange =
Function.emptyMethod;
_this._xmlHttpRequest = null;
}
}
});
this._clearTimer = (function() {
if (_this._timer) {
window.clearTimeout(_this._timer);
_this._timer = null;
}
});
this._onTimeout = (function() {
if (!_this._responseAvailable) {
_this._clearTimer();
_this._timedOut = true;
var xhr = _this._xmlHttpRequest;
xhr.onreadystatechange = Function.emptyMethod;
xhr.abort();
_this._webRequest.completed(Sys.EventArgs.Empty);
_this._xmlHttpRequest = null;
}
});
$type.prototype = {
if (this._started) {
throw
Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted,
'executeRequest'));
}
if (!this._webRequest) {
throw Error.invalidOperation(Sys.Res.nullWebRequest);
}
return this._xmlHttpRequest.responseText;
},
xml = Sys.Net.XMLDOM(xhr.responseText);
if (!xml || !xml.documentElement)
return null;
}
else if (navigator.userAgent.indexOf('MSIE') !== -1) {
xml.setProperty('SelectionLanguage', 'XPath');
}
if (xml.documentElement.namespaceURI ===
"http://www.mozilla.org/newlayout/xml/parsererror.xml" &&
xml.documentElement.tagName === "parsererror") {
return null;
}
if (xml.documentElement.firstChild &&
xml.documentElement.firstChild.tagName === "parsererror") {
return null;
}
return xml;
},
this._aborted = true;
this._clearTimer();
var xhr = this._xmlHttpRequest;
if (xhr && !this._responseAvailable) {
xhr.onreadystatechange = Function.emptyMethod;
xhr.abort();
this._xmlHttpRequest = null;
this._webRequest.completed(Sys.EventArgs.Empty);
}
}
}
$type.registerClass('Sys.Net.XMLHttpExecutor', Sys.Net.WebRequestExecutor);
$type = Sys.Net._WebRequestManager = function _WebRequestManager() {
/// <summary locid="P:J#Sys.Net.WebRequestManager.#ctor"></summary>
if (arguments.length !== 0) throw Error.parameterCount();
this._defaultExecutorType = "Sys.Net.XMLHttpExecutor";
}
$type.prototype = {
add_invokingRequest: function _WebRequestManager$add_invokingRequest(handler) {
/// <summary
locid="E:J#Sys.Net.WebRequestManager.invokingRequest"></summary>
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
Sys.Observer.addEventHandler(this, "invokingRequest", handler);
},
remove_invokingRequest: function
_WebRequestManager$remove_invokingRequest(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
Sys.Observer.removeEventHandler(this, "invokingRequest", handler);
},
this._defaultTimeout = value;
},
if (failed || !Sys.Net.WebRequestExecutor.isInstanceOfType(executor)
|| !executor) {
throw Error.argument("defaultExecutorType",
String.format(Sys.Res.invalidExecutorType, this._defaultExecutorType));
}
webRequest.set_executor(executor);
}
if (!executor.get_aborted()) {
var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest);
Sys.Observer.raiseEvent(this, "invokingRequest", evArgs);
if (!evArgs.get_cancel()) {
executor.executeRequest();
}
}
}
}
$type.registerClass('Sys.Net._WebRequestManager');
$type.prototype = {
get_webRequest: function NetworkRequestEventArgs$get_webRequest() {
/// <value type="Sys.Net.WebRequest"
locid="P:J#Sys.Net.NetworkRequestEventArgs.webRequest">The request about to be
executed.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._webRequest;
}
}
$type.registerClass('Sys.Net.NetworkRequestEventArgs', Sys.CancelEventArgs);
$type = Sys.Net.WebRequest = function WebRequest() {
/// <summary locid="M:J#Sys.Net.WebRequest.#ctor">WebRequest class</summary>
if (arguments.length !== 0) throw Error.parameterCount();
this._url = "";
this._headers = { };
this._body = null;
this._userContext = null;
this._httpVerb = null;
}
$type.prototype = {
add_completed: function WebRequest$add_completed(handler) {
/// <summary locid="E:J#Sys.Net.WebRequest.completed"></summary>
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
Sys.Observer.addEventHandler(this, "completed", handler);
},
remove_completed: function WebRequest$remove_completed(handler) {
var e = Function._validateParams(arguments, [{name: "handler", type:
Function}]);
if (e) throw e;
Sys.Observer.removeEventHandler(this, "completed", handler);
},
completed: function WebRequest$completed(eventArgs) {
/// <summary locid="M:J#Sys.Net.WebRequest.completed">The completed method
should be called when the request is completed.</summary>
/// <param name="eventArgs" type="Sys.EventArgs">The event args to raise
the event with.</param>
var e = Function._validateParams(arguments, [
{name: "eventArgs", type: Sys.EventArgs}
]);
if (e) throw e;
function raise(source, sender, eventName) {
var handler = Sys.Observer._getContext(source,
true).events.getHandler(eventName);
if (handler) {
handler(sender, eventArgs);
}
}
raise(Sys.Net.WebRequestManager, this._executor, "completedRequest");
raise(this, this._executor, "completed");
Sys.Observer.clearEventHandlers(this, "completed");
},
if (!baseUrl || !baseUrl.length) {
var baseElement = Sys.get('base');
if (baseElement && baseElement.href && baseElement.href.length) {
baseUrl = baseElement.href;
}
else {
baseUrl = document.URL;
}
}
if (!url || !url.length) {
return baseUrl;
}
$type.registerClass('Sys.Net.WebRequest');
Type.registerNamespace('Sys.Net');
try {
var contentType = response.getResponseHeader("Content-Type");
isJson = contentType.startsWith("application/json");
result = isJson ? response.get_object() :
(contentType.startsWith("text/xml") ? response.get_xml() :
response.get_responseData());
}
catch (ex) {
}
return request;
}
$type._generateTypedConstructor = function
WebServiceProxy$_generateTypedConstructor(type) {
return function(properties) {
if (properties) {
for (var name in properties) {
this[name] = properties[name];
}
}
this.__type = type;
}
}
Sys._jsonp = 0;
$type._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;
$type.prototype = {
get_timedOut: function WebServiceError$get_timedOut() {
/// <value type="Boolean"
locid="P:J#Sys.Net.WebServiceError.timedOut">Whether the service failed due to
timeout.</value>
if (arguments.length !== 0) throw Error.parameterCount();
return this._timedOut;
},
Type.registerNamespace("Sys.Services");
var ns = Sys.Services;
var service = "Service",
role = "Role",
auth = "Authentication",
profile = "Profile";
function setPath(path) {
this._path = path;
}
ns[auth+service] = {
set_path: setPath,
_setAuthenticated: function(auth) {
this._auth = auth;
}
};
ns["_" + auth + service] = {};
Sys._domLoaded();
}
if (Sys.loader) {
Sys.loader.registerScript("MicrosoftAjax", null, execute);
}
else {
execute();
}
})(window, window.Sys);
var $get, $create, $addHandler, $addHandlers, $clearHandlers;
Type.registerNamespace('Sys');
Sys.Res={
"argumentInteger":"Value must be an integer.",
"argumentType":"Object cannot be converted to the required type.",
"argumentNull":"Value cannot be null.",
"scriptAlreadyLoaded":"The script \u0027{0}\u0027 has been referenced multiple
times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode
property of the ScriptManager to Explicit.",
"scriptDependencyNotFound":"The script \u0027{0}\u0027 failed to load because it is
dependent on script \u0027{1}\u0027.",
"formatBadFormatSpecifier":"Format specifier was invalid.",
"requiredScriptReferenceNotIncluded":"\u0027{0}\u0027 requires that you have
included a script reference to \u0027{1}\u0027.",
"webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.",
"argumentDomElement":"Value must be a DOM element.",
"actualValue":"Actual value was {0}.",
"enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.",
"scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.",
"parameterCount":"Parameter count mismatch.",
"cannotDeserializeEmptyString":"Cannot deserialize empty string.",
"formatInvalidString":"Input string was not in a correct format.",
"argument":"Value does not fall within the expected range.",
"cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to
valid JSON.",
"cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.",
"argumentUndefined":"Value cannot be undefined.",
"webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an
invalid type. Expected type: {1}",
"servicePathNotSet":"The path to the web service has not been set.",
"argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type
\u0027{1}\u0027.",
"paramName":"Parameter name: {0}",
"nullReferenceInPath":"Null reference while evaluating data path: \u0027{0}\
u0027.",
"format":"One of the identified items was in an invalid format.",
"assertFailedCaller":"Assertion Failed: {0}\r\nat {1}",
"argumentOutOfRange":"Specified argument was out of the range of valid values.",
"webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.",
"notImplemented":"The method or operation is not implemented.",
"assertFailed":"Assertion Failed: {0}",
"invalidOperation":"Operation is not valid due to the current state of the
object.",
"breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?",
"invokeCalledTwice":"Cannot call invoke more than once.",
"argumentTypeName":"Value is not the name of an existing type.",
"cantBeCalledAfterDispose":"Can\u0027t be called after dispose.",
"webServiceFailed":"The server method \u0027{0}\u0027 failed with the following
error: {1}",
"componentCantSetIdAfterAddedToApp":"The id property of a component can\u0027t be
set after it\u0027s been added to the Application object.",
"behaviorDuplicateName":"A behavior with name \u0027{0}\u0027 already exists or it
is the name of an existing property on the target element.",
"notATypeName":"Value is not a valid type name.",
"elementNotFound":"An element with id \u0027{0}\u0027 could not be found.",
"stateMustBeStringDictionary":"The state object can only have null and string
fields.",
"invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from:
{0}.",
"boolTrueOrFalse":"Value must be \u0027true\u0027 or \u0027false\u0027.",
"cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.",
"scriptLoadFailedNoHead":"ScriptLoader requires pages to contain a \u003chead\u003e
element.",
"stringFormatInvalid":"The format string is invalid.",
"referenceNotFound":"Component \u0027{0}\u0027 was not found.",
"enumReservedName":"\u0027{0}\u0027 is a reserved name that can\u0027t be used as
an enum value name.",
"circularParentChain":"The chain of control parents can\u0027t have circular
references.",
"namespaceContainsNonObject":"Object {0} already exists and is not an object.",
"undefinedEvent":"\u0027{0}\u0027 is not an event.",
"invalidTimeout":"Value must be greater than or equal to zero.",
"cannotAbortBeforeStart":"Cannot abort when executor has not started.",
"observableConflict":"Object already contains a member with the name \u0027{0}\
u0027.",
"invalidHttpVerb":"httpVerb cannot be set to an empty or null string.",
"nullWebRequest":"Cannot call executeRequest with a null webRequest.",
"historyCannotEnableHistory":"Cannot set enableHistory after initialization.",
"eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler
method.",
"scriptLoadFailedDebug":"The script \u0027{0}\u0027 failed to load. Check for:\r\n
Inaccessible path.\r\n Script errors. (IE) Enable \u0027Display a notification
about every script error\u0027 under advanced settings.",
"propertyNotWritable":"\u0027{0}\u0027 is not a writable property.",
"enumInvalidValueName":"\u0027{0}\u0027 is not a valid name for an enum value.",
"cannotCallOnceStarted":"Cannot call {0} once started.",
"controlAlreadyDefined":"A control is already associated with the element.",
"addHandlerCantBeUsedForError":"Can\u0027t add a handler for the error event using
this method. Please set the window.onerror property instead.",
"badBaseUrl1":"Base URL does not contain ://.",
"badBaseUrl2":"Base URL does not contain another /.",
"badBaseUrl3":"Cannot find last / in base URL.",
"setExecutorAfterActive":"Cannot set executor after it has become active.",
"cantAddNonFunctionhandler":"Can\u0027t add a handler that is not a function.",
"invalidNameSpace":"Value is not a valid namespace identifier.",
"notAnInterface":"Value is not a valid interface.",
"eventHandlerNotFunction":"Handler must be a function.",
"propertyNotAnArray":"\u0027{0}\u0027 is not an Array property.",
"namespaceContainsClass":"Object {0} already exists as a class, enum, or
interface.",
"typeRegisteredTwice":"Type {0} has already been registered. The type may be
defined multiple times or the script file that defines it may have already been
loaded. A possible cause is a change of settings during a partial update.",
"cantSetNameAfterInit":"The name property can\u0027t be set on this object after
initialization.",
"historyMissingFrame":"For the history feature to work in IE, the page must have an
iFrame element with id \u0027__historyFrame\u0027 pointed to a page that gets its
title from the \u0027title\u0027 query string parameter and calls
Sys.Application._onIFrameLoad() on the parent window. This can be done by setting
EnableHistory to true on ScriptManager.",
"appDuplicateComponent":"Two components with the same id \u0027{0}\u0027 can\u0027t
be added to the application.",
"historyCannotAddHistoryPointWithHistoryDisabled":"A history point can only be
added if enableHistory is set to true.",
"expectedElementOrId":"Value must be a DOM element or DOM element id.",
"selectorNotFound":"An element with selector \u0027{0}\u0027 could not be found.",
"cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.",
"methodNotFound":"No method found with name \u0027{0}\u0027.",
"arrayParseBadFormat":"Value must be a valid string representation for an array. It
must start with a \u0027[\u0027 and end with a \u0027]\u0027.",
"cannotSerializeObjectWithCycle":"Cannot serialize object with cyclic reference
within child properties.",
"stateFieldNameInvalid":"State field names must not contain any \u0027=\u0027
characters.",
"stringFormatBraceMismatch":"The format string contains an unmatched opening or
closing brace.",
"enumValueNotInteger":"An enumeration definition can only contain integer values.",
"propertyNullOrUndefined":"Cannot set the properties of \u0027{0}\u0027 because it
returned a null value.",
"expectedDomElementOrSelector":"\u0027{0}\u0027 must be a DOM element or DOM
element selector.",
"argumentDomNode":"Value must be a DOM element or a text node.",
"componentCantSetIdTwice":"The id property of a component can\u0027t be set more
than once.",
"createComponentOnDom":"Value must be null for Components that are not Controls or
Behaviors.",
"createNoDom":"Value must not be null for Controls and Behaviors.",
"cantAddWithoutId":"Can\u0027t add a component that doesn\u0027t have an id.",
"urlTooLong":"The history state must be small enough to not make the url larger
than {0} characters.",
"notObservable":"Instances of type \u0027{0}\u0027 cannot be observed.",
"badTypeName":"Value is not the name of the type being registered or the name is a
reserved word."
};