element to an animated image viewer
-// (c) 2012 lhp - http://codecanyon.net/user/lhp
-
-/*
- * ----------------------------------------------------------------------------
- * settings:
- * viewportWidth string (default: '100%'; accepted: string; Defines width of the area in which image will be displayed inside the outer div (myDiv). Size can be given in pixels, ems, percentages.)
- * viewportHeight string (default: '100%'; accepted: string; Defines height of the area in which image will be displayed inside the outer div (myDiv). Size can be given in pixels, ems, percentages.)
- * startScale number (default: 1; accepted: 0...1; Defines start scale.)
- * startX number (default: 0; accepted: integer; Defines start coordinate x in px, in the display object frame of reference, which will be moved to the center of the viewport, if it is possible.)
- * startY number (defaabout:startpageult: 0; accepted: integer; Defines start coordinate y in px, in the display object frame of reference, which will be moved to the center of the viewport, if it is possible.)
- * animTime number (default: 500; accepted: integer; Defines duration in ms of the scale and position animations.)
- * draggInertia number (default: 10; accepted: integer; Defines inertia after dragging.)
- * contentUrl string (default: ''; accepted: string; Defines a path for an image source. This param is optional. Instead you can use the HTML image tag (see DOC -> STEP 2B - ACTIVATE THE PLUGIN (IMAGE SOURCE FROM HTML)).)
- * intNavEnable boolean (default: true; accepted: true, false; Defines the navigation bar enabled/disabled. )
- * intNavPos string (default: 'T'; accepted: 'TL', 'T', 'TR', 'L', 'R', 'BL', 'B', 'BR', false; Defines the navigation bar position. )
- * intNavAutoHide boolean (default: false; accepted: true, false; Defines the navigation bar autohide. )
- * fitToViewportShortSide boolean (default: false; accepted: true, false; Shorter side of the displayed object will fit the viewport. )
- * contentSizeOver100 boolean (default: false; accepted: true, false; If the viewport size (width and height) is greater than the size of the displayed object, allow the object scaled over 100% to fit the viewport (zoom is disabled). )
- * ----------------------------------------------------------------------------
- */
-
-(function ($) {
-
- var pubMet, constSett, defaultSett;about:startpage
-
- constSett = {
- 'dragSmooth' : 8
- };
-
- defaultSett = {
- 'viewportWidth' : '100%',
- 'viewportHeight' : '100%',
- 'startScale' : 1,
- 'startX' : 0,
- 'startY' : 0,
- 'animTime' : 500,
- 'draggInertia' : 10,
- 'contentUrl' : '',
- 'intNavEnable' : true,
- 'intNavPos' : 'T',
- 'intNavAutoHide' : false,
- 'fitToViewportShortSide' : false,
- 'contentSizeOver100' : false
- };
-
- pubMet = {
- init : function (options) {
-
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV'), interImgs = $t.find('img'), sett = {};
- $.extend(sett, defaultSett, options);
- $.extend(sett, constSett);
-
- if (!data) {
-
- if(sett.draggInertia < 0) {
- sett.draggInertia = 0;
- }
-
- sett.animTime = parseInt(sabout:startpageett.animTime);
- if(sett.animTime < 0) {
- sett.animTime = 0;
- }
-
- /*img tag*/
- if(interImgs.length > 0) {
- sett.contentUrl = interImgs[0].src;
- interImgs.remove();
- }
-
- $t.data('lhpMIV', {});
- $t.data('lhpMIV').interImgsTmp = interImgs;
- $t.data('lhpMIV').lc = new LocationChanger(sett, $t);
- }
- });
- },
- /*
- * Sets the position and size of the displayed object. The second parameter is optional - if empty, the size remains unchanged.
- * @param {integer} x Coordinate x in px, in the display object frame of reference, which will be moved to the center of the viewport (if it is possible).
- * @param {integer} y Coordinate y in px, in the display object frame of reference, which will be moved to the center of the viewport (if it is possible).
- * @param {number} scale The size to which the display object will be scaled (if it is possible); optional.
- * @return {Object} Returns jQuery object.
- */
- setPosition : function (x, y, scale) {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.setProperties(x, y, scale);
- }
- });
- },
- /*about:startpage
- * Initializes the movement of the display object to the top, to the boundary of the viewport or untill the moveStop method is called.
- * @return {Object} Returns jQuery object.
- */
- moveUp : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.beginDirectMove('U');
- }
- });
- },
- /*
- * Initializes the movement of the display object to the bottom, to the boundary of the viewport or untill the moveStop method is called.
- * @return {Object} Returns jQuery object.
- */
- moveDown : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.beginDirectMove('D');
- }
- });
- },
- /*
- * Initializes the movement of the display object to the left, to the boundary of the viewport or untill the moveStop method is called.
- * @return {Object} Returns jQuery object.
- */
- moveLeft : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.beginDirectMove('L');
- }
- });
- },
- /*
- * Initializes the movement of the display object to the right, to the boundary of the viewport or untill the moveStop method is called.
- * @return {Object} Returns jQuery object.about:startpage
- */
- moveRight : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.beginDirectMove('R');
- }
- });
- },
- /*
- * Stops the movement of the display object.
- * @return {Object} Returns jQuery object.
- */
- moveStop : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.stopDirectMoving();
- }
- });
- },
- /*
- * Initializes the zooming of the display object up to 100% or untill the zoomStop method is called.
- * @return {Object} Returns jQuery object.
- */
- zoom : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.beginZooming('Z');
- }
- });
- },
- /*
- * Initializes the unzooming of the display object up to the viewport's size or untill the zoomStop method is called.about:startpage
- * @return {Object} Returns jQuery object.
- */
- unzoom : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.beginZooming('U');
- }
- });
- },
- /*
- * Stops the zooming/unzooming of the display object.
- * @return {Object} Returns jQuery object.
- */
- zoomStop : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.stopZooming();
- }
- });
- },
- /*
- * Fits the display obejct's size to the viewport size and moves the object to the center of the viewport.
- * @return {Object} Returns jQuery object.
- */
- fitToViewport : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.setProperties(null, null, 0.0001);
- }
- });
- },
- /*
- * Sets the initial size of the display object anabout:startpaged moves the object to the center of the viewport.
- * @return {Object} Returns jQuery object.
- */
- fullSize : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.setProperties(null, null, 1);
- }
- });
- },
- /*
- * Control the correct position and size of the object displayed inside the viewport.
- * @return {Object} Returns jQuery object.
- */
- adaptsToContainer : function () {
- return this.each(function () {
- var $t = $(this), data = $t.data('lhpMIV');
- if (data) {
- $t.data('lhpMIV').lc.adaptsToContainer();
- }
- });
- },
- /*
- * Destructor. Removes the viewer from the page. Restores the original appearance and functionality of the outer
'
- ).parent();
-
- } else {
- if (self.image_url == '') {
- $holder = $('#' + self.container);
- } else {
- $holder = self.$elem;
- }
- $holder.addClass('noSel smooth_zoom_preloader');
- self.locations = [];
- self.$loc_cont = $holder.find('.landmarks');
- if (self.$loc_cont[0]) {
- var locs = self.$loc_cont.children('.item');
- self.loc_clone = self.$loc_cont.clone();
- self.show_at_zoom = parseInt(self.$loc_cont.data('show-at-zoom'), 10) / 100;
- self.allow_scale = checkBoolean(self.$loc_cont.data('allow-scale'));
- self.allow_drag = checkBoolean(self.$loc_cont.data('allow-drag'));
- locs.each(function () {
- self.setLocation($(this));
- });
- }
- }
-
- $holder.css({
- 'position': 'relative',
- 'overflow': 'hidden',
- 'text-align': 'left',
- '-moz-user-select': 'none',
- '-khtml-user-select': 'none',
- '-webkit-user-select': 'none',
- 'user-select': 'none',
- '-webkit-touch-callout': 'none',
- '-webkit-tap-highlight-color': 'rgba(255, 255, 255, 0)',
- 'background-color': self.bg_color,
- 'background-position': 'center center',
- 'background-repeat': 'no-repeat'
- })
-
- self.$hitArea = $('').appendTo($holder);
-
- self.getContainerSize(self.sW, self.sH, $holder, self.w_max, self.h_max);
-
- if (self.responsive) {
- $(window).bind("orientationchange.sz" + self.id + " resize.sz" + self.id, { self: self }, self.resize);
- }
- var sW = self.sW;
- var sH = self.sH;
-
- //Add Image container properties
- $holder.css({
- 'width': sW,
- 'height': sH
- });
-
- //Add border if needed
- if (bord_size > 0) {
- border[0] = $('').css('opacity', self.bord_alpha);
- border[1] = $('').css('opacity', self.bord_alpha);
- border[2] = $('').css('opacity', self.bord_alpha);
- border[3] = $('').css('opacity', self.bord_alpha);
- $holder.append(border[0], border[1], border[2], border[3]);
- }
-
- //Get Image maps if exists
- if ($image.attr('usemap') != undefined) {
- self.mapAreas = $("map[name='" + ($image.attr('usemap').split('#').join('')) + "']").children('area');
- self.mapAreas.each(function (i) {
- var area = $(this);
- area.css('cursor', 'pointer');
- if (self.mouse_drag) {
- area.bind(self.event_down, { self: self }, self.mouseDown);
- }
- if (self.mouse_wheel) {
- area.bind('mousewheel.sz', { self: self }, self.mouseWheel);
- }
- self.map_coordinates.push(area.attr('coords').split(','));
- });
- }
-
- self.$holder = $holder;
- self.sW = sW;
- self.sH = sH;
- },
-
- getContainerSize: function (sW, sH, $holder, w_max, h_max) {
- if (sW === '' || sW === 0) {
- if (this.image_url == '') {
- sW = Math.max($holder.parent().width(), 100);
- } else {
- sW = Math.max($holder.width(), 100);
- }
-
- } else if (!isNaN(sW) || String(sW).indexOf('px') > -1) {
- sW = this.oW = parseInt(sW);
- if (this.responsive) {
- sW = Math.min($holder.parent().width(), sW);
- }
- } else if (String(sW).indexOf('%') > -1) {
- sW = $holder.parent().width() * (sW.split('%')[0] / 100);
- } else {
- sW = 100;
- }
- if (w_max !== 0 && w_max !== '') {
- sW = Math.min(sW, w_max);
- }
- if (sH === '' || sH === 0) {
- if (this.image_url == '') {
- sH = Math.max($holder.parent().height(), 100);
- } else {
- sH = Math.max($holder.height(), 100);
- }
- } else if (!isNaN(sH) || String(sH).indexOf('px') > -1) {
- sH = this.oH = parseInt(sH);
-
- } else if (String(sH).indexOf('%') > -1) {
- sH = $holder.parent().height() * (sH.split('%')[0] / 100);
- } else {
- sH = 100;
- }
- if (h_max !== 0 && h_max !== '') {
- sH = Math.min(sH, h_max);
- }
-
- if (this.oW && sW !== this.oW) {
- if (this.oH && this.maintain_ratio) {
- sH = sW / (this.oW / this.oH);
- }
- }
-
- this.sW = sW;
- this.sH = sH;
- },
-
-
- /*Each landmark / location / lable initiated here
- ***********************************************************************************************************************/
- setLocation: function (lc) {
- var self = this,
- ob = lc,
- w2, h2, pos, sc;
-
- if (prop_origin) {
- ob.css(prop_origin, '0 0');
- }
-
- ob.css({
- 'display': 'block',
- 'z-index': 2
- })
- if (self.use3D) {
- ob.css({
- '-webkit-backface-visibility': 'hidden',
- '-webkit-perspective': 1000
- });
- }
-
- w2 = ob.outerWidth() / 2;
- h2 = ob.outerHeight() / 2;
- pos = ob.data('position').split(',');
- sc = ob.data('allow-scale');
- if (sc == undefined) {
- sc = self.allow_scale;
- } else {
- sc = checkBoolean(sc);
- }
-
- if (ob.hasClass('mark')) {
- var imgw = ob.find('img').css('vertical-align', 'bottom').width();
- $(ob.children()[0]).css({
- 'position': 'absolute',
- 'left': (-ob.width() / 2),
- 'bottom': parseInt(ob.css('padding-bottom')) * 2
- });
- var txt = ob.find('.text');
- self.locations.push({
- ob: ob,
- x: parseInt(pos[0]),
- y: parseInt(pos[1]),
- w2: w2,
- h2: h2,
- w2pad: w2 + (txt[0] ? parseInt(txt.css('padding-left')) : 0),
- vis: false,
- lab: false,
- lpx: '0',
- lpy: '0',
- showAt: isNaN(ob.data('show-at-zoom')) ? self.show_at_zoom : parseInt(ob.data('show-at-zoom'), 10) / 100,
- scale: sc
- });
-
- } else if (ob.hasClass('lable')) {
- var bg = ob.data('bg-color'),
- opacity = ob.data('bg-opacity'),
- cont = $(ob.eq(0).children()[0])
- .css({
- 'position': 'absolute',
- 'z-index': 2,
- left: -w2,
- top: -h2
- });
-
- self.locations.push({
- ob: ob,
- x: parseInt(pos[0]),
- y: parseInt(pos[1]),
- w2: w2,
- h2: h2,
- w2pad: w2,
- vis: false,
- lab: true,
- lpx: '0',
- lpy: '0',
- showAt: isNaN(ob.data('show-at-zoom')) ? self.show_at_zoom : parseInt(ob.data('show-at-zoom'), 10) / 100,
- scale: sc
- });
-
- if (bg !== "") {
- if (!bg) {
- bg = "#000000";
- opacity = .7;
- }
- var bgob = $('').appendTo(ob);
- if (opacity) {
- bgob.css('opacity', opacity);
- }
- }
- }
- ob.hide();
- if (prop_transform) {
- ob.css('opacity', 0);
- }
- if (!self.allow_drag) {
- ob.bind(self.event_down, function (e) {
- //e.preventDefault();
- e.stopPropagation();
- })
- }
- },
-
- /*Storing the original style of image (needed only when destroying)
- ***********************************************************************************************************************/
- getStyle: function () {
- var el = this.$image;
- return {
- prop_origin: [prop_origin, prop_origin !== false && prop_origin !== undefined ? el.css(prop_origin) : null],
- prop_transform: [prop_transform, prop_transform !== false && prop_transform !== undefined ? el.css(prop_transform) : null],
- 'position': ['position', el.css('position')],
- 'z-index': ['z-index', el.css('z-index')],
- 'cursor': ['cursor', el.css('cursor')],
- 'left': ['left', el.css('left')],
- 'top': ['top', el.css('top')],
- 'width': ['width', el.css('width')],
- 'height': ['height', el.css('height')]
- };
- },
-
- /*Find the scale ratios
- ***********************************************************************************************************************/
- checkRatio: function (sW, sH, iW, iH, zoom_fit) {
- var rF;
- if (iW == sW && iH == sH) {
- rF = 1;
- } else if (iW < sW && iH < sH) {
- rF = sW / iW;
- if (zoom_fit) {
- if (rF * iH > sH) {
- rF = sH / iH;
- }
- } else {
- if (rF * iH < sH) {
- rF = sH / iH;
- }
- if (sW / iW !== sH / iH && this.mouse_drag) {
- this._moveCursor = true;
- this.$image.css('cursor', 'move');
- this.$hitArea.css('cursor', 'move');
- }
- }
- } else {
-
- rF = sW / iW;
- if (zoom_fit) {
- if (rF * iH > sH) {
- rF = sH / iH;
- }
- if (rF < this.init_zoom && this.mouse_drag) {
- this._moveCursor = true;
- this.$image.css('cursor', 'move');
- this.$hitArea.css('cursor', 'move');
- }
- } else {
- if (rF * iH < sH) {
- rF = sH / iH;
- }
- if (sW / iW !== sH / iH && this.mouse_drag) {
- this._moveCursor = true;
- this.$image.css('cursor', 'move');
- this.$hitArea.css('cursor', 'move');
- }
- }
- }
- return rF;
- },
-
-
- /*Returns distance between 2 points (used for touch gesture)
- ***********************************************************************************************************************/
- getDistance: function (x1, y1, x2, y2) {
- return Math.sqrt(Math.abs(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))));
- },
-
-
- /*Image Events for Dragging and Mouse Wheel
- ***********************************************************************************************************************/
- mouseDown: function (e) {
- var self = e.data.self;
- self._onfocus = self._dragging = false;
- if (self.cFlag._nd) {
- if (self.fixMoz) {
- self.correctTransValue();
- }
- self.samePointRelease = false;
- if (e.type == 'mousedown') {
- self.stX = e.pageX;
- self.stY = e.pageY;
- self.offX = e.pageX - self.$holder.offset().left - self.$image.position().left;
- self.offY = e.pageY - self.$holder.offset().top - self.$image.position().top;
- $(document).bind(self.event_move + self.id, { self: self }, self.mouseDrag);
- } else {
- var te = e.originalEvent;
- if (te.targetTouches.length > 1) {
- self._pinching = true;
- self._rA = self.rA;
- self.dStart = self.getDistance(te.touches[0].pageX, te.touches[0].pageY, te.touches[1].pageX, te.touches[1].pageY);
- } else {
- self.offX = te.touches[0].pageX - self.$holder.offset().left - self.$image.position().left;
- self.offY = te.touches[0].pageY - self.$holder.offset().top - self.$image.position().top;
- self.setDraggedPos(te.touches[0].pageX - self.$holder.offset().left - self.offX, te.touches[0].pageY - self.$holder.offset().top - self.offY, self._sc);
- self._recent = 'drag';
- self._dragging = true;
- }
- }
- self._onHitArea = true;
- }
- if (e.type == 'mousedown') {
- e.preventDefault();
- }
- },
-
-
- /*Mouse Drag / Touch swipe operations handled here
- ***********************************************************************************************************************/
- mouseDrag: function (e) {
- var self = e.data.self;
-
- //Mouse
- if (e.type == 'mousemove') {
- self.setDraggedPos(e.pageX - self.$holder.offset().left - self.offX, e.pageY - self.$holder.offset().top - self.offY, self._sc);
- self._recent = 'drag';
- self._dragging = true;
- if (!self._playing) {
- self.Animate();
- }
- return false;
-
- //Touch
- } else {
- if (self._dragging || self._pinching) {
- e.preventDefault();
- }
- if (self._onHitArea) {
- var touches = e.originalEvent.touches;
- if (self._pinching || touches.length > 1) {
- if (!self._pinching) {
- self._pinching = true;
- self._rA = self.rA;
- if (touches.length > 1) {
- self.dStart = self.getDistance(touches[0].pageX, touches[0].pageY, touches[1].pageX, touches[1].pageY);
- }
- }
- if (touches.length > 1) {
- self._centx = (touches[0].pageX + touches[1].pageX) / 2;
- self._centy = (touches[0].pageY + touches[1].pageY) / 2;
- self.focusOffX = self._centx - self.$holder.offset().left - (self.sW / 2);
- self.focusOffY = self._centy - self.$holder.offset().top - (self.sH / 2);
- self.changeOffset(true, true);
- self._wheel = true;
- self._dragging = false;
- if (self.zoom_single) {
- self.sRed = 300;
-
- } else {
- self.dEnd = self.getDistance(touches[0].pageX, touches[0].pageY, touches[1].pageX, touches[1].pageY);
- self.rA = self._rA * (self.dEnd / self.dStart);
- self.rA = self.rA > self.zoom_max ? self.zoom_max : self.rA;
- self.rA = self.rA < self.rF ? self.rF : self.rA;
- }
- if (self._sc < self.rA) {
- self.cFlag._zo = false;
- self.cFlag._zi = true;
- } else {
- self.cFlag._zi = false;
- self.cFlag._zo = true;
- }
- if (!self._playing) {
- self.Animate();
- }
- }
-
- } else if (self._dragging && touches.length < 2) {
- self.setDraggedPos(touches[0].pageX - self.$holder.offset().left - self.offX, touches[0].pageY - self.$holder.offset().top - self.offY, self._sc);
- self._recent = 'drag';
- if (!self._playing) {
- self.Animate();
- }
- }
- }
- }
- },
-
-
- /*Global Mouse Up / Touch End
- ***********************************************************************************************************************/
- mouseUp: function (e) {
- var self = e.data.self;
-
- //If one of the buttons released
- if (self._onButton) {
- self.$holder.find('#' + self.buttons[self.cButtId]._var + 'norm').show();
- self.$holder.find('#' + self.buttons[self.cButtId]._var + 'over').hide();
- if (self.cButtId !== 6) {
- self.cFlag[self.buttons[self.cButtId]._var] = false;
- }
- if (e.type == 'touchend' && self.buttons[self.cButtId].$ob.css('opacity') > .5) {
- self.buttons[self.cButtId].$ob.css('opacity', .7);
- }
- self._onButton = false;
- e.stopPropagation();
- return false;
-
- //If the mouse drag or touch swipe completed
- } else if (self._onHitArea) {
- if (self.mouse_drag || self.touch_drag) {
- //Mouse
- if (e.type == 'mouseup') {
- $(document).unbind(self.event_move + self.id);
- if (self.stX == e.pageX && self.stY == e.pageY) {
- self.samePointRelease = true;
- }
- self._recent = 'drag';
- self._dragging = false;
- if (!self._playing) {
- self.Animate();
- }
- self._onHitArea = false;
-
- //Touch
- } else {
- e.preventDefault();
- self._dragging = false;
- if (self._pinching) {
- self._pinching = false;
- self._wheel = false;
- self.cFlag._nd = true;
- self.cFlag._zi = false;
- self.cFlag._zo = false;
- } else {
- self._recent = 'drag';
- if (!self._playing) {
- self.Animate();
- }
- }
- self._onHitArea = false;
- }
- }
- }
- },
-
-
- /*Mouse wheel zoom in-out
- ***********************************************************************************************************************/
- mouseWheel: function (e, delta) {
- var self = e.data.self;
- self._onfocus = self._dragging = false;
- if (self.mouse_wheel_cur) {
- self.focusOffX = e.pageX - self.$holder.offset().left - (self.sW / 2);
- self.focusOffY = e.pageY - self.$holder.offset().top - (self.sH / 2);
- self.changeOffset(true, true);
- }
-
- self._dragging = false;
- if (delta > 0) {
- if (self.rA != self.zoom_max) {
- if (self.zoom_single) {
- if (!self._wheel) {
- self.sRed = 300;
- }
- } else {
- self.rA *= delta < 1 ? 1 + (.3 * delta) : 1.3;
- self.rA = self.rA > self.zoom_max ? self.zoom_max : self.rA;
- }
- self._wheel = true;
- self.cFlag._zi = true;
- clearTimeout(self.ani_timer);
- self._playing = true;
- self.Animate();
- self.cFlag._zi = false;
- }
- } else {
- if (self.rA != self.rF) {
- if (self.zoom_single) {
- if (!self._wheel) {
- self.sRed = 300;
- }
- } else {
- self.rA /= delta > -1 ? 1 + (.3 * -delta) : 1.3;
- self.rA = self.rA < self.rF ? self.rF : self.rA;
- }
- self._wheel = true;
- self.cFlag._zo = true;
- clearTimeout(self.ani_timer);
- self._playing = true;
- self.Animate();
- self.cFlag._zo = false;
- }
- }
- return false;
- },
-
-
- /*Control buttons Auto hide
- ***********************************************************************************************************************/
- autoHide: function (e) {
- var self = e.data.self;
-
- clearTimeout(self.auto_timer);
- self.auto_timer = setTimeout(function () {
- self.$controls.fadeOut(600);
- }, self.bu_delay);
-
- self.$holder.bind('mouseenter.sz', function (e) {
- clearTimeout(self.auto_timer);
- self.$controls.fadeIn(300);
- });
- },
-
-
- /*Mozilla works differently than others when getting translated positions. So this correction needed
- ***********************************************************************************************************************/
- correctTransValue: function () {
- var v = this.$image.css('-moz-transform').toString().replace(')', '').split(',');
- this.transOffX = parseInt(v[4]);
- this.transOffY = parseInt(v[5]);
- },
-
-
- /*Make sure the dragged position obeying limits
- ***********************************************************************************************************************/
- setDraggedPos: function (xp, yp, s) {
- var self = this;
-
- if (xp !== '') {
- self.dX = xp + self.transOffX;
- if (self.pan_limit) {
- self.dX = self.dX + (s * self.iW) < self.sW ? self.sW - (s * self.iW) : self.dX;
- self.dX = self.dX > 0 ? 0 : self.dX;
- if ((s * self.iW) < self.sW) {
- self.dX = (self.sW - (s * self.iW)) / 2;
- }
- } else {
- self.dX = self.dX + (s * self.iW) < self.sW / 2 ? (self.sW / 2) - (s * self.iW) : self.dX;
- self.dX = self.dX > self.sW / 2 ? self.sW / 2 : self.dX;
- }
- }
- if (yp !== '') {
- self.dY = yp + self.transOffY;
- if (self.pan_limit) {
- self.dY = self.dY + (s * self.iH) < self.sH ? self.sH - (s * self.iH) : self.dY;
- self.dY = self.dY > 0 ? 0 : self.dY;
- if ((s * self.iH) < self.sH) {
- self.dY = (self.sH - (s * self.iH)) / 2;
- }
- } else {
- self.dY = self.dY + (s * self.iH) < self.sH / 2 ? (self.sH / 2) - (s * self.iH) : self.dY;
- self.dY = self.dY > self.sH / 2 ? self.sH / 2 : self.dY;
- }
- }
- },
-
- /*Called to animate image transformation whenever the navigation events occur
- ***********************************************************************************************************************/
- Animate: function () {
-
- var self = this;
- var pixTol = .5;
-
- self.cFlag._nd = true;
- self.ani_end = false;
-
- //Zoom In
- if (self.cFlag._zi) {
- if (!self._wheel && !self.zoom_single) {
- self.rA *= self.zoom_speed;
- }
- if (self.rA > self.zoom_max) {
- self.rA = self.zoom_max;
- }
- self.cFlag._nd = false;
- self.cFlag._rs = false;
- self._recent = 'zoomIn';
- self._onfocus = self._dragging = false;
- }
-
- //Zoom Out
- if (self.cFlag._zo) {
- if (!self._wheel && !self.zoom_single) {
- self.rA /= self.zoom_speed;
- }
- if (self.zoom_min != 0) {
- if (self.rA < self.zoom_min) {
- self.rA = self.zoom_min;
- }
- } else {
- if (self.rA < self.rF) {
- self.rA = self.rF;
- }
- }
-
- self.cFlag._nd = false;
- self.cFlag._rs = false;
- self._recent = 'zoomOut';
- self._onfocus = self._dragging = false;
- }
-
- //Zoom In or Out - Single Step
- if (self.zoom_single && !self.cFlag._rs) {
- if (self._recent == 'zoomIn') {
- self.sRed += (10 - self.sRed) / 6;
- self.rA += (self.zoom_max - self.rA) / (((1 / (self.pan_speed_o + 1)) * self.sRed) + 1);
-
- } else if (self._recent == 'zoomOut') {
- self.sRed += (3 - self.sRed) / 3;
- self.rA += (self.rF - self.rA) / (((1 / self.pan_speed_o + 1) * self.sRed) + 1);
- }
- }
-
- //Pan speed needs to adjust according to application dimension and zoom level
- self.pan_speed = (Math.max(1, 1 + ((self.sW + self.sH) / 500)) + (self.pan_speed_o * self.pan_speed_o / 4)) / Math.max(1, self.rA / 2);
-
- //Move Left
- if (self.cFlag._ml) {
- self.oX -= self.pan_speed;
- self.cFlag._nd = false;
- self.cFlag._rs = false;
- self._recent = 'left';
- self._onfocus = self._dragging = false;
- }
-
- //Move Right
- if (self.cFlag._mr) {
- self.oX += self.pan_speed;
- self.cFlag._nd = false;
- self.cFlag._rs = false;
- self._recent = 'right';
- self._onfocus = self._dragging = false;
- }
-
- //Move Up
- if (self.cFlag._mu) {
- self.oY -= self.pan_speed;
- self.cFlag._nd = false;
- self.cFlag._rs = false;
- self._recent = 'up';
- self._onfocus = self._dragging = false;
- }
-
- //Move Down
- if (self.cFlag._md) {
- self.oY += self.pan_speed;
- self.cFlag._nd = false;
- self.cFlag._rs = false;
- self._recent = 'down';
- self._onfocus = self._dragging = false;
- }
-
- //Reset
- if (self.cFlag._rs) {
- self.oX += (self.fX - self.oX) / 8;
- self.oY += (self.fY - self.oY) / 8;
- self.cFlag._nd = false;
- self._recent = 'reset';
- self._onfocus = self._dragging = false;
- }
-
- //Find scale value, width and height
- //Case 1: Single Step Zoom
- if (self.zoom_single && (self._recent !== 'reset')) {
- if (self._onfocus) {
- self._sc += (self.rA - self._sc) / self.reduction;
- } else {
- self._sc = self.rA;
- }
-
- //Case 2: Normal Zoom
- } else {
- self._sc += (self.rA - self._sc) / (self.ani_smooth / (self._onfocus ? self.reduction : 1));
- }
-
- self._w = self._sc * self.iW;
- self._h = self._sc * self.iH;
-
- //Dragging
- if (self._dragging) {
- self.tX = self.dX;
- self.tY = self.dY;
- self.changeOffset(true, true);
- }
-
- //Check if Zoom In completed
- if (self._recent == "zoomIn") {
- if (self._w > (self.rA * self.iW) - pixTol && !self.zoom_single) {
- if (self.cFlag._nd) {
- self.ani_end = true;
- }
- self._sc = self.rA;
- } else if (self._w > (self.zoom_max * self.iW) - pixTol && self.zoom_single) {
- if (self.cFlag._nd) {
- self.ani_end = true;
- }
- self._sc = self.rA = self.zoom_max;
- }
- if (self.ani_end) {
- self._w = self._sc * self.iW;
- self._h = self._sc * self.iH;
- }
-
- //Check if Zoom Out completed
- } else if (self._recent == "zoomOut") {
- if (self._w < (self.rA * self.iW) + pixTol && !self.zoom_single) {
- if (self.cFlag._nd) {
- self.ani_end = true;
- }
- self._sc = self.rA;
- } else if (self._w < (self.rF * self.iW) + pixTol && self.zoom_single) {
- if (self.cFlag._nd) {
- self.ani_end = true;
- }
- self._sc = self.rA = self.rF;
- }
- if (self.ani_end) {
- self._w = self._sc * self.iW;
- self._h = self._sc * self.iH;
- }
- }
-
- //Move image according to boundary limits
- self.limitX = (((self._w - self.sW) / (self._w / self.sW)) / 2);
- self.limitY = (((self._h - self.sH) / (self._h / self.sH)) / 2);
-
- if (!self._dragging) {
- if (self.pan_limit) {
- if (self.oX < -self.limitX - self.focusOffX) {
- self.oX = -self.limitX - self.focusOffX;
- }
- if (self.oX > self.limitX - self.focusOffX) {
- self.oX = self.limitX - self.focusOffX;
- }
- if (self._w < self.sW) {
- self.tX = (self.sW - self._w) / 2;
- self.changeOffset(true, false);
- }
- if (self.oY < -self.limitY - self.focusOffY) {
- self.oY = -self.limitY - self.focusOffY;
- }
- if (self.oY > self.limitY - self.focusOffY) {
- self.oY = self.limitY - self.focusOffY;
- }
- if (self._h < self.sH) {
- self.tY = (self.sH - self._h) / 2;
- self.changeOffset(false, true);
- }
- } else {
- if (self.oX < -self.limitX - (self.focusOffX / self._w * self.sW) - ((self.sW / 2) / (self._w / self.sW))) {
- self.oX = -self.limitX - (self.focusOffX / self._w * self.sW) - ((self.sW / 2) / (self._w / self.sW));
- }
-
- if (self.oX > self.limitX - (self.focusOffX / self._w * self.sW) + ((self.sW / 2) / (self._w / self.sW))) {
- self.oX = self.limitX - (self.focusOffX / self._w * self.sW) + ((self.sW / 2) / (self._w / self.sW));
- }
-
- if (self.oY < -self.limitY - (self.focusOffY / self._h * self.sH) - (self.sH / (self._h / self.sH * 2))) {
- self.oY = -self.limitY - (self.focusOffY / self._h * self.sH) - (self.sH / (self._h / self.sH * 2));
- }
-
- if (self.oY > self.limitY - (self.focusOffY / self._h * self.sH) + (self.sH / (self._h / self.sH * 2))) {
- self.oY = self.limitY - (self.focusOffY / self._h * self.sH) + (self.sH / (self._h / self.sH * 2));
- }
- }
- }
- if (!self._dragging && self._recent != "drag") {
- self.tX = ((self.sW - self._w) / 2) + self.focusOffX + (self.oX * (self._w / self.sW));
- self.tY = ((self.sH - self._h) / 2) + self.focusOffY + (self.oY * (self._h / self.sH));
- if (self.ani_smooth === 1) {
- self.cFlag._nd = true;
- self.ani_end = true;
- }
- }
- if (self._recent == "zoomIn" || self._recent == "zoomOut" || self.cFlag._rs) {
- self._x = self.tX;
- self._y = self.tY;
- } else {
- self._x += (self.tX - self._x) / (self.ani_smooth / (self._onfocus ? self.reduction : 1));
- self._y += (self.tY - self._y) / (self.ani_smooth / (self._onfocus ? self.reduction : 1));
- }
-
- //Check if Left movement completed
- if (self._recent == "left") {
- if (self._x < self.tX + pixTol || self.ani_smooth === 1) {
- self.cFlag._nd ? self.ani_end = true : "";
- self._recent = '';
- self._x = self.tX;
- }
-
- //Check if Right movement completed
- } else if (self._recent == "right") {
- if (self._x > self.tX - pixTol || self.ani_smooth === 1) {
- self.cFlag._nd ? self.ani_end = true : "";
- self._recent = '';
- self._x = self.tX;
- }
-
- //Check if Up movement completed
- } else if (self._recent == "up") {
- if (self._y < self.tY + pixTol || self.ani_smooth === 1) {
- self.cFlag._nd ? self.ani_end = true : "";
- self._recent = '';
- self._y = self.tY;
- }
-
- //Check if Down movement completed
- } else if (self._recent == "down") {
- if (self._y > self.tY - pixTol || self.ani_smooth === 1) {
- self.cFlag._nd ? self.ani_end = true : "";
- self._recent = '';
- self._y = self.tY;
- }
-
- //Check if Dragging completed
- } else if (self._recent == "drag") {
- if (self._x + pixTol >= self.tX && self._x - pixTol <= self.tX && self._y + pixTol >= self.tY && self._y - pixTol <= self.tY || self.ani_smooth === 1) {
- if (self._onfocus) {
- self._dragging = false;
- }
- self.cFlag._nd ? self.ani_end = true : "";
- self._recent = '';
- self._x = self.tX;
- self._y = self.tY;
- }
- }
-
- //Check if Reset completed
- if (self.cFlag._rs && self._w + pixTol >= (self.rA * self.iW) && self._w - pixTol <= (self.rA * self.iW) && self.oX <= self.fX + pixTol && self.oX >= self.fX - pixTol && self.oY <= self.fY + pixTol && self.oY >= self.fY - pixTol) {
- self.ani_end = true;
- self._recent = '';
- self.cFlag._rs = false;
- self.cFlag._nd = true;
- self._x = self.tX;
- self._y = self.tY;
- self._sc = self.rA;
- self._w = self._sc * self.iW;
- self._h = self._sc * self.iH;
- }
-
- //When the image fits exactly to container size, disable the pan, zoom out and reset buttons
- if (self.rA == self.rF && self.iW * self.rA <= self.sW && self.iH * self.rA <= self.sH) {
- if (self.buttons[1].$ob.css('opacity') > .5) {
- if (self.rA >= self.rF && (self.init_zoom == '' || self.rA < self.init_zoom) && (self.zoom_min == '' || self.rA < self.zoom_min)) {
- if (self.pan_limit && self._moveCursor && !self._moveCursor) {
- self.$image.css('cursor', 'default');
- self.$hitArea.css('cursor', 'default');
- }
- for (var bEn = 1; bEn < (self.pan_limit && !self._moveCursor ? self.buttons_total : 2) ; bEn++) {
- self.buttons[bEn].$ob.css({
- 'opacity': .4
- });
- self._wheel = false;
- self.$holder.find('#' + self.buttons[bEn]._var + 'norm').show();
- self.$holder.find('#' + self.buttons[bEn]._var + 'over').hide();
- }
- }
- }
-
- } else {
- if (self.buttons[1].$ob.css('opacity') < .5) {
- if (self._moveCursor && self.mouse_drag) {
- self.$image.css('cursor', 'move');
- self.$hitArea.css('cursor', 'move');
- }
- for (var bEn = 1; bEn < self.buttons_total; bEn++) {
- self.buttons[bEn].$ob.css('opacity', .7);
- }
- }
- }
-
- //When the image reaches max zoom, disable the zoom button
- if (self.rA == self.zoom_max) {
- if (self.buttons[0].$ob.css('opacity') > .5) {
- self.buttons[0].$ob.css('opacity', .4);
- self._wheel = false;
- self.$holder.find('#' + self.buttons[0]._var + 'norm').show();
- self.$holder.find('#' + self.buttons[0]._var + 'over').hide();
- }
-
- } else {
- if (self.buttons[0].$ob.css('opacity') < .5) {
- self.buttons[0].$ob.css('opacity', .7);
- }
- }
-
- //Apply Scale and position to the image:
- if (prop_transform) {
- self.$image.css(prop_transform, 'translate(' + self._x.toFixed(14) + 'px,' + self._y.toFixed(14) + 'px) scale(' + self._sc + ')');
-
- } else {
- self.$image.css({
- left: self._x,
- top: self._y,
- width: self._w,
- height: self._h
- });
- }
-
- if (self.$loc_cont) {
- self.updateLocations(self._x, self._y, self._sc, self.locations);
- }
-
- //In case image Maps used, update them
- if (!prop_transform && self.map_coordinates.length > 0) {
- self.updateMap();
- }
- //If the animation completed, stop running; else continue
- if (self.ani_end && !self._dragging && self._recent != "drag") {
- self._playing = false;
- self._recent = '';
- self.cX = (-self._x + (self.sW / 2)) / self.rA;
- self.cY = (-self._y + (self.sH / 2)) / self.rA;
- if (self.onUPDATE) {
- self.onUPDATE(self.getZoomData(), false);
- }
- if (self.onZOOM_PAN) {
- self.onZOOM_PAN(self.getZoomData());
- }
- clearTimeout(self.ani_timer);
- } else {
- self._playing = true;
- if (self.onUPDATE) {
- self.onUPDATE(self.getZoomData(), true);
- }
- self.ani_timer = setTimeout(function () {
- self.Animate();
- }, 28);
- }
- },
-
-
- /*Relocate the landmarks according to main image's position
- ***********************************************************************************************************************/
- updateLocations: function (_x, _y, _sc, loc) {
-
- if (this.onLANDMARK !== '') {
- if (_sc >= this.show_at_zoom) {
- if (!this._landmark) {
- this._landmark = true
- this.onLANDMARK(true);
- }
- } else {
- if (this._landmark) {
- this._landmark = false;
- this.onLANDMARK(false);
- }
- }
- }
-
- for (var p = 0; p < loc.length; p++) {
- var wScaled,
- hScaled,
- lpx = (loc[p].x * _sc) + _x,
- lpy = (loc[p].y * _sc) + _y;
-
- if (_sc >= loc[p].showAt) {
- if (loc[p].scale && prop_transform) {
- wScaled = loc[p].w2pad * this._sc;
- hScaled = loc[p].h2 * this._sc;
- } else {
- wScaled = loc[p].w2pad;
- hScaled = loc[p].h2;
- }
- if (lpx > -wScaled && lpx < this.sW + wScaled && ((lpy > -hScaled && lpy < this.sH + hScaled && loc[p].lab) || (lpy > 0 && lpy < this.sH + (hScaled * 2) && !loc[p].lab))) {
- if (!loc[p].vis) {
- loc[p].vis = true;
- if (prop_transform) {
- loc[p].ob.stop()
- .css('display', 'block')
- .animate({
- opacity: 1
- }, 300);
- } else {
- loc[p].ob.show();
- }
- }
- } else {
- if (loc[p].vis) {
- loc[p].vis = false;
- if (prop_transform) {
- loc[p].ob.stop()
- .animate({
- opacity: 0
- }, 200, function () {
- $(this).hide();
- });
- } else {
- loc[p].ob.hide();
- }
- }
- }
- } else {
- if (loc[p].vis) {
- loc[p].vis = false;
- if (prop_transform) {
- loc[p].ob.stop()
- .animate({
- opacity: 0
- }, 200, function () {
- $(this).hide();
- });
- } else {
- loc[p].ob.hide();
- }
- }
- }
- if (lpx !== loc[p].lpx || lpy !== loc[p].lpy && loc[p].vis) {
- if (prop_transform) {
- loc[p].ob.css(prop_transform, 'translate(' + lpx.toFixed(14) + 'px,' + lpy.toFixed(14) + 'px)' + (loc[p].scale ? ' scale(' + this._sc + ')' : ''));
- } else {
- loc[p].ob.css({
- left: lpx,
- top: lpy
- });
- }
- }
- loc[p].lpx = lpx;
- loc[p].lpy = lpy;
- }
- },
-
-
- /*If the broswer doesn't supports css border radius, we need to go with old school png image for rounded corner
- ***********************************************************************************************************************/
- roundBG: function (el, _name, _w, _h, _r, _p, _c, _i, _z, _yoff) {
- var w = 50 / 2;
-
- el.append($(
- '\
- \
- \
- \
- \
- \
- '
- ));
- $('.bgi' + _name).css({
- position: 'absolute',
- width: _r,
- height: _r,
- 'background-image': 'url(' + _i + ')',
- 'background-repeat': 'no-repeat',
- '-ms-filter': 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)',
- 'filter': 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)',
- 'zoom': 1
- });
- $('.bgh' + _name).css({
- position: 'absolute',
- width: _w - _r * 2,
- height: _r,
- 'background-color': _c,
- left: _r
- });
- $('.bgc' + _name).css({
- position: 'absolute',
- width: _w,
- height: _h - _r * 2,
- 'background-color': _c,
- top: _r,
- left: 0
- });
- },
-
-
- /*To calibrate position offset when navigation events supposed to be overlapped
- ***********************************************************************************************************************/
- changeOffset: function (x, y) {
- if (x) this.oX = (this.tX - ((this.sW - this._w) / 2) - this.focusOffX) / (this._w / this.sW);
- if (y) this.oY = (this.tY - ((this.sH - this._h) / 2) - this.focusOffY) / (this._h / this.sH);
- },
-
-
- /*Transform Image Maps (hot spots) if any
- ***********************************************************************************************************************/
- updateMap: function () {
- var self = this,
- mapId = 0;
-
- self.mapAreas.each(function () {
- var new_vals = [];
- for (var i = 0; i < self.map_coordinates[mapId].length; i++) {
- new_vals[i] = self.map_coordinates[mapId][i] * self._sc;
- }
- new_vals = new_vals.join(",");
- $(this).attr('coords', new_vals);
- mapId++;
- });
- },
-
-
- /*To stop the timer loops immediatly
- ***********************************************************************************************************************/
- haltAnimation: function () {
- clearTimeout(this.ani_timer);
- this._playing = false;
- this._recent = '';
- },
-
-
- /*Method to Remove the plugin instance
- ***********************************************************************************************************************/
- destroy: function () {
- var self = this;
-
- if (self.assetsLoaded) {
- self.haltAnimation();
- for (prop in self.orig_style) {
- if (self.orig_style[prop][0] !== false && self.orig_style[prop][0] !== undefined) {
- if (self.orig_style[prop][0] === 'width' || self.orig_style[prop][0] === 'height') {
- if (parseInt(self.orig_style[prop][1]) !== 0) {
- self.$image.css(self.orig_style[prop][0], self.orig_style[prop][1]);
- }
- } else {
- self.$image.css(self.orig_style[prop][0], self.orig_style[prop][1]);
- }
- }
- }
- clearTimeout(self.auto_timer);
- $(document).unbind('.sz' + self.id);
- $(window).unbind('.sz' + self.id);
- self.$holder.unbind('.sz');
- self.$controls = undefined;
- } else {
- self.$image.show();
- }
-
- if (self.container == '') {
- if (self.image_url == '') {
- self.$image.insertBefore(self.$holder);
- if (self.$holder !== undefined) {
- self.$holder.remove();
- }
- } else {
- self.$elem.empty();
- if (self.$loc_cont[0]) {
- self.$elem.append(self.loc_clone);
- }
- }
- } else {
- self.$image.insertBefore(self.$holder);
- self.$holder.empty();
- self.$image.wrap(self.$holder);
- if (self.$loc_cont[0]) {
- self.$holder.append(self.loc_clone);
- }
- }
- self.$elem.removeData('smoothZoom');
- self.$holder = undefined;
- self.Buttons = undefined;
- self.op = undefined;
- self.$image = undefined;
- },
-
-
- /*Method to change focus point and level
- ***********************************************************************************************************************/
- focusTo: function (params) {
- var self = this;
-
- if (self.assetsLoaded) {
- if (params.zoom === undefined || params.zoom === '' || params.zoom == 0) {
- params.zoom = self.rA;
- } else {
- params.zoom /= 100;
- }
- self._onfocus = true;
- if (params.zoom > self.rA && self.rA != self.zoom_max) {
- self.rA = params.zoom;
- self.rA = self.rA > self.zoom_max ? self.zoom_max : self.rA;
- } else if (params.zoom < self.rA && self.rA != self.rF) {
- self.rA = params.zoom;
- self.rA = self.rA < self.rF ? self.rF : self.rA;
- }
- self.transOffX = self.transOffY = 0;
- self.setDraggedPos(params.x === undefined || params.x === '' ? "" : (-params.x * self.rA) + (self.sW / 2), params.y === undefined || params.y === '' ? "" : (-params.y * self.rA) + (self.sH / 2), self.rA);
- self.reduction = params.speed ? params.speed / 10 : self.focusSpeed;
- self._recent = 'drag';
- self._dragging = true;
- if (!self._playing) {
- self.Animate();
- }
- }
- },
-
- zoomIn: function (params) {
- this.buttons[0].$ob.trigger(this.event_down, {
- id: 0
- });
- },
-
- zoomOut: function (params) {
- this.buttons[1].$ob.trigger(this.event_down, {
- id: 1
- });
- },
-
- moveRight: function (params) {
- this.buttons[2].$ob.trigger(this.event_down, {
- id: 2
- });
- },
-
- moveLeft: function (params) {
- this.buttons[3].$ob.trigger(this.event_down, {
- id: 3
- });
- },
-
- moveUp: function (params) {
- this.buttons[4].$ob.trigger(this.event_down, {
- id: 4
- });
- },
-
- moveDown: function (params) {
- this.buttons[5].$ob.trigger(this.event_down, {
- id: 5
- });
- },
-
- Reset: function (params) {
- this.buttons[6].$ob.trigger(this.event_down, {
- id: 6
- });
- },
-
- getZoomData: function (params) {
- return {
- //x offset (without scale ratio multiplied)
- normX: (-this._x / this.rA).toFixed(14),
-
- //y offset (without scale ratio multiplied)
- normY: (-this._y / this.rA).toFixed(14),
-
- //Original image Width
- normWidth: this.iW,
-
- //Original image height
- normHeight: this.iH,
-
- //x offset (with scale ratio multiplied)
- scaledX: -this._x.toFixed(14),
-
- //y offset (with scale ratio multiplied)
- scaledY: -this._y.toFixed(14),
-
- //Scaled image width
- scaledWidth: this._w,
-
- //Scaled image height
- scaledHeight: this._h,
-
- //The X location on image which is currently on center of canvas
- centerX: (-this._x.toFixed(14) + (this.sW / 2)) / this.rA,
-
- //The Y location on image which is currently on center of canvas
- centerY: (-this._y.toFixed(14) + (this.sH / 2)) / this.rA,
-
- //Scale ratio
- ratio: this.rA
- };
- },
-
- addLandmark: function (loc) {
- if (this.$loc_cont) {
- var total = loc.length;
-
- for (var i = 0; i < total; i++) {
- var $loc = $(loc[i]);
- this.$loc_cont.append($loc);
- this.setLocation($loc);
- }
-
- if (total > 0) {
- this.updateLocations(this._x, this._y, this._sc, this.locations);
- }
- }
- },
-
- attachLandmark: function (loc) {
- if (this.$loc_cont) {
- var total = loc.length;
- for (var i = 0; i < total; i++) {
- this.setLocation(loc[i] instanceof jQuery ? loc[i] : $('#' + loc[i]));
- }
- if (total > 0) {
- this.updateLocations(this._x, this._y, this._sc, this.locations);
- }
- }
- },
-
- removeLandmark: function (loc) {
- if (this.$loc_cont) {
- if (loc) {
- var total = loc.length;
- for (var i = 0; i < total; i++) {
- for (var j = 0; j < this.locations.length; j++) {
- if ((loc[i] instanceof jQuery && this.locations[j].ob[0] == loc[i][0]) || (!(loc[i] instanceof jQuery) && this.locations[j].ob.attr('id') == loc[i])) {
- this.locations[j].ob.remove();
- this.locations.splice(j, 1);
- j--;
- }
- }
- }
- } else {
- if (this.locations.length > 0) {
- this.locations[this.locations.length - 1].ob.remove();
- this.locations.pop();
- }
- }
- if (total > 0) {
- this.updateLocations(this._x, this._y, this._sc, this.locations);
- }
- }
- },
-
- refreshAllLandmarks: function () {
- var self = this;
- var locs = self.$loc_cont.children('.item');
- self.show_at_zoom = parseInt(self.$loc_cont.data('show-at-zoom'), 10) / 100;
- self.allow_scale = checkBoolean(self.$loc_cont.data('allow-scale'));
- self.allow_drag = checkBoolean(self.$loc_cont.data('allow-drag'));
-
- //Step 1: Remove records for which the elements no longer exist
- for (var i = 0; i < self.locations.length; i++) {
- var exists = false;
- locs.each(function () {
- if (self.locations[i].ob[0] == $(this)[0]) {
- exists = true;
- }
- });
- if (!exists) {
- self.locations.splice(i, 1);
- i--;
- }
- }
-
- //Step 2: Add new elements to record
- locs.each(function () {
- var exists = false;
- for (var i = 0; i < self.locations.length; i++) {
- if (self.locations[i].ob[0] == $(this)[0]) {
- exists = true;
- break;
- }
- }
- if (!exists) {
- self.setLocation($(this));
- }
-
- });
- this.updateLocations(this._x, this._y, this._sc, this.locations);
- },
-
-
- /*On windows resize, adjust some defaults
- ***********************************************************************************************************************/
- resize: function (e) {
- var self;
-
- if (e.data) {
- e.preventDefault();
- self = e.data.self;
- var pw = self.$holder.parent().width();
- var ph = self.$holder.parent().height();
-
- if (self.oW) {
- pw = Math.min(pw, self.oW);
- }
- self.sW = pw;
-
- if (self.oH) {
- if (self.oW && self.maintain_ratio) {
- self.sH = pw / (self.oW / self.oH);
- }
- } else {
- self.sH = ph;
- }
-
-
- } else {
- self = this;
- if (e.width) {
- self.sW = e.width;
- }
- if (e.height) {
- self.sH = e.height;
- }
- if (e.max_WIDTH) {
- self.w_max = e.max_WIDTH;
- }
- if (e.max_HEIGHT) {
- self.h_max = e.max_HEIGHT;
- }
- }
- if (self.w_max !== 0 && self.w_max !== '') {
- self.sW = Math.min(self.sW, self.w_max);
- }
- if (self.h_max !== 0 && self.h_max !== '') {
- self.sH = Math.min(self.sH, self.h_max);
- }
- self.$holder.css({
- 'width': self.sW,
- 'height': self.sH
- });
- if (self.bord_size > 0) {
- self.border[0].height(self.sH);
- self.border[1].css({
- height: self.sH,
- left: self.sW - self.bord_size
- });
- self.border[2].width(self.sW - (self.bord_size * 2));
- self.border[3].css({
- width: self.sW - (self.bord_size * 2),
- top: self.sH - self.bord_size
- });
- }
- if (self.bu_align[1] == 'center') {
- self.$controls.css('left', parseInt((self.sW - self.cBW) / 2));
- }
- if (self.bu_align[0] == 'center') {
- self.$controls.css('top', parseInt((self.sH - self.cBH) / 2));
- }
- self.rF = self.rR = self.checkRatio(self.sW, self.sH, self.iW, self.iH, self.zoom_fit);
- if (self.zoom_min == 0) {
- if (self.rA < self.rF) {
- self.rA = self.rF;
- }
- }
-
- self.focusTo({
- x: self.cX,
- y: self.cY,
- zoom: '',
- speed: 10
- });
- }
- }
-
-
- $.fn.smoothZoom = function (params) {
- var self = this;
- var l = self.length;
-
- //For single or more than one plugin instance
- for (var i = 0; i < l; i++) {
- var $elem = $(self[i]);
- var instance = $elem.data('smoothZoom');
-
- // Case 1: Initiate the plugin if not already have an instance
- if (!instance) {
-
- if (typeof params === 'object' || !params) {
- $elem.data('smoothZoom', new Zoomer($elem, params));
- }
-
- // Case 2: If the instance already available - Check for method call
- } else {
-
- // getZoomData - Returns {sourceX, sourceY, sourceWidth, sourceHeight, distX, distY, distWidth, distHeight, centerX, centerY, ratio}
- if (params == "getZoomData") {
- return instance[params].apply(instance, Array.prototype.slice.call(arguments, 1));
-
- // destroy | focusTo | zoomIn | zoomOut | moveRight| moveLeft | moveUp | moveDown | Reset | addLandmark | removeLandmark | attachLandmark | refreshAllLandmarks
- } else if (instance[params]) {
- instance[params].apply(instance, Array.prototype.slice.call(arguments, 1));
- }
- }
- }
-
- //return for chainability for possible cases
- if (params !== "getZoomData") {
- return this;
- }
- };
-
- function checkBoolean(_var) {
- if (_var === true) {
- return true;
- } else if (_var) {
- _var = _var.toLowerCase();
- if (_var == 'yes' || _var == 'true') {
- return true;
- }
- }
- return false;
- }
-
-
- //...................................................................................................................
- //Using Modernizr to check browser capabilities and property names prefixed
-
- /* Modernizr 2.5.3 (Custom Build) | MIT & BSD
- * Build: http://www.modernizr.com/download/#-borderradius-csstransforms-csstransforms3d-touch-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes
- */
- var Modernizr = function (a, b, c) { function y(a) { i.cssText = a } function z(a, b) { return y(l.join(a + ";") + (b || "")) } function A(a, b) { return typeof a === b } function B(a, b) { return !!~("" + a).indexOf(b) } function C(a, b) { for (var d in a) if (i[a[d]] !== c) return b == "pfx" ? a[d] : !0; return !1 } function D(a, b, d) { for (var e in a) { var f = b[a[e]]; if (f !== c) return d === !1 ? a[e] : A(f, "function") ? f.bind(d || b) : f } return !1 } function E(a, b, c) { var d = a.charAt(0).toUpperCase() + a.substr(1), e = (a + " " + n.join(d + " ") + d).split(" "); return A(b, "string") || A(b, "undefined") ? C(e, b) : (e = (a + " " + o.join(d + " ") + d).split(" "), D(e, b, c)) } var d = "2.5.3", e = {}, f = b.documentElement, g = "modernizr", h = b.createElement(g), i = h.style, j, k = {}.toString, l = " -webkit- -moz- -o- -ms- ".split(" "), m = "Webkit Moz O ms", n = m.split(" "), o = m.toLowerCase().split(" "), p = {}, q = {}, r = {}, s = [], t = s.slice, u, v = function (a, c, d, e) { var h, i, j, k = b.createElement("div"), l = b.body, m = l ? l : b.createElement("body"); if (parseInt(d, 10)) while (d--) j = b.createElement("div"), j.id = e ? e[d] : g + (d + 1), k.appendChild(j); return h = ["", ""].join(""), k.id = g, (l ? k : m).innerHTML += h, m.appendChild(k), l || (m.style.background = "", f.appendChild(m)), i = c(k, a), l ? k.parentNode.removeChild(k) : m.parentNode.removeChild(m), !!i }, w = {}.hasOwnProperty, x; !A(w, "undefined") && !A(w.call, "undefined") ? x = function (a, b) { return w.call(a, b) } : x = function (a, b) { return b in a && A(a.constructor.prototype[b], "undefined") }, Function.prototype.bind || (Function.prototype.bind = function (b) { var c = this; if (typeof c != "function") throw new TypeError; var d = t.call(arguments, 1), e = function () { if (this instanceof e) { var a = function () { }; a.prototype = c.prototype; var f = new a, g = c.apply(f, d.concat(t.call(arguments))); return Object(g) === g ? g : f } return c.apply(b, d.concat(t.call(arguments))) }; return e }); var F = function (c, d) { var f = c.join(""), g = d.length; v(f, function (c, d) { var f = b.styleSheets[b.styleSheets.length - 1], h = f ? f.cssRules && f.cssRules[0] ? f.cssRules[0].cssText : f.cssText || "" : "", i = c.childNodes, j = {}; while (g--) j[i[g].id] = i[g]; e.touch = "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch || (j.touch && j.touch.offsetTop) === 9, e.csstransforms3d = (j.csstransforms3d && j.csstransforms3d.offsetLeft) === 9 && j.csstransforms3d.offsetHeight === 3 }, g, d) }([, ["@media (", l.join("touch-enabled),("), g, ")", "{#touch{top:9px;position:absolute}}"].join(""), ["@media (", l.join("transform-3d),("), g, ")", "{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")], [, "touch", "csstransforms3d"]); p.touch = function () { return e.touch }, p.borderradius = function () { return E("borderRadius") }, p.csstransforms = function () { return !!E("transform") }, p.csstransforms3d = function () { var a = !!E("perspective"); return a && "webkitPerspective" in f.style && (a = e.csstransforms3d), a }; for (var G in p) x(p, G) && (u = G.toLowerCase(), e[u] = p[G](), s.push((e[u] ? "" : "no-") + u)); return y(""), h = j = null, e._version = d, e._prefixes = l, e._domPrefixes = o, e._cssomPrefixes = n, e.testProp = function (a) { return C([a]) }, e.testAllProps = E, e.testStyles = v, e.prefixed = function (a, b, c) { return b ? E(a, b, c) : E(a, "pfx") }, e }(this, this.document);
-
- var prop_transform = Modernizr.prefixed('transform');
- var prop_origin = Modernizr.prefixed('transformOrigin');
- var prop_radius = Modernizr.prefixed('borderRadius');
- var supportsTrans3D = Modernizr.csstransforms3d;
- var supportsTouch = Modernizr.touch;
-
-})(jQuery, window, document);
-
-//End - smoothZoom
-
-//...................................................................................................................
-//For mouse wheel support
-
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- *
- * Requires: 1.2.2+
- */
-(function (a) { function d(b) { var c = b || window.event, d = [].slice.call(arguments, 1), e = 0, f = !0, g = 0, h = 0; return b = a.event.fix(c), b.type = "mousewheel", c.wheelDelta && (e = c.wheelDelta / 120), c.detail && (e = -c.detail / 3), h = e, c.axis !== undefined && c.axis === c.HORIZONTAL_AXIS && (h = 0, g = -1 * e), c.wheelDeltaY !== undefined && (h = c.wheelDeltaY / 120), c.wheelDeltaX !== undefined && (g = -1 * c.wheelDeltaX / 120), d.unshift(b, e, g, h), (a.event.dispatch || a.event.handle).apply(this, d) } var b = ["DOMMouseScroll", "mousewheel"]; if (a.event.fixHooks) for (var c = b.length; c;) a.event.fixHooks[b[--c]] = a.event.mouseHooks; a.event.special.mousewheel = { setup: function () { if (this.addEventListener) for (var a = b.length; a;) this.addEventListener(b[--a], d, !1); else this.onmousewheel = d }, teardown: function () { if (this.remove_eventListener) for (var a = b.length; a;) this.remove_eventListener(b[--a], d, !1); else this.onmousewheel = null } }, a.fn.extend({ mousewheel: function (a) { return a ? this.bind("mousewheel", a) : this.trigger("mousewheel") }, unmousewheel: function (a) { return this.unbind("mousewheel", a) } }) })(jQuery)
-
-//...................................................................................................................
\ No newline at end of file
diff --git a/NzbDrone.Web/Content2/bootstrap-metro.css b/NzbDrone.Web/Content2/bootstrap-metro.css
deleted file mode 100644
index 970f4c4f1..000000000
--- a/NzbDrone.Web/Content2/bootstrap-metro.css
+++ /dev/null
@@ -1,833 +0,0 @@
-/* === UTILS ==={ */
-/* }=== UTILS === */
-/* === COLOR - AZURE ==={ */
-/* }=== COLOR - AZURE === */
-/* === MADMIN MENU ==={ */
-/* general setup & list styles reset */
-.sidebar-menu,
-.sidebar-menu ul,
-.sidebar-menu li
-{
- position: relative;
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
- .sidebar-menu > li,
- .sidebar-menu > li > div
- {
- width: 220px;
- }
-
- .sidebar-menu li > a
- {
- white-space: nowrap;
- }
-/* drop sub-menu mix-in */
-/* main menu styles */
-.sidebar-menu
-{
- /* level 0 */
- /* levels 1+ */
-}
-
- .sidebar-menu > li > div
- {
- position: relative;
- }
-
- .sidebar-menu > li > div > a
- {
- display: block;
- height: 30px;
- padding: 10px;
- color: #ffffff;
- }
-
- .sidebar-menu > li > div > a > i
- {
- position: relative;
- top: 5px;
- margin-right: 10px;
- font-size: 30px;
- font-weight: normal;
- }
-
- .sidebar-menu > li:hover > div > a,
- .sidebar-menu > li.open > div > a
- {
- background: #6bbef6;
- }
-
- .sidebar-menu > li.parent > div > a > span:before
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #61b0e9 #61b0e9 #61b0e9 #ffffff;
- margin-right: 5px;
- }
-
- .sidebar-menu > li.parent:hover > div > a > span:before,
- .sidebar-menu > li.parent.open > div > a > span:before
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #6bbef6 #6bbef6 #6bbef6 #ffffff;
- }
-
- .sidebar-menu > li.active > div > a
- {
- background: #ffffff;
- color: #20202f;
- }
-
- .sidebar-menu > li.parent.active > div > a > span:before
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #20202f #ffffff #ffffff #ffffff;
- position: relative;
- top: 1px;
- }
-
- .sidebar-menu ul
- {
- display: none;
- }
-
- .sidebar-menu ul > li > a
- {
- display: block;
- height: 20px;
- padding: 5px;
- }
- /* drop-right */
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul,
- .sidebar-menu > li.parent.inactive.open > div > ul
- {
- display: block;
- position: absolute;
- top: 0 !important;
- left: 100% !important;
- padding: 10px 0;
- background: #6bbef6;
- }
-
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul > li a,
- .sidebar-menu > li.parent.inactive.open > div > ul > li a
- {
- padding: 5px 16px;
- height: 20px;
- color: #ffffff;
- }
-
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul > li:hover a,
- .sidebar-menu > li.parent.inactive.open > div > ul > li:hover a,
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul > li.active a,
- .sidebar-menu > li.parent.inactive.open > div > ul > li.active a,
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul > li.active a:hover,
- .sidebar-menu > li.parent.inactive.open > div > ul > li.active a:hover
- {
- padding-left: 8px;
- border-left: 8px solid #aedcfb;
- }
-
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul > li.active a,
- .sidebar-menu > li.parent.inactive.open > div > ul > li.active a,
- .sidebar-menu.on-hover > li.parent.inactive:hover > div > ul > li.active a:hover,
- .sidebar-menu > li.parent.inactive.open > div > ul > li.active a:hover
- {
- color: #20202f;
- border-color: #20202f;
- }
-/* maximized sidebar - active's item submenu */
-.sidebar-max .sidebar-menu .active ul
-{
- display: block;
- padding-bottom: 10px;
- background: #ffffff;
-}
-
- .sidebar-max .sidebar-menu .active ul > li > a
- {
- margin-left: 72px;
- color: #61b0e9;
- border-color: #61b0e9;
- }
-
- .sidebar-max .sidebar-menu .active ul > li > a:hover,
- .sidebar-max .sidebar-menu .active ul > li.active > a
- {
- border-left: 8px solid;
- padding-left: 7px;
- margin-left: 62px;
- }
-
- .sidebar-max .sidebar-menu .active ul > li.active > a
- {
- color: #20202f;
- border-color: #20202f;
- }
-/* minimized sidebar */
-.sidebar-min .sidebar-menu > li
-{
- width: 60px;
- overflow: hidden;
-}
-
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul
- {
- display: block;
- position: absolute;
- top: 50px !important;
- left: 60px !important;
- padding: 10px 0;
- background: #6bbef6;
- min-width: 160px;
- padding-top: 0 !important;
- }
-
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul > li a,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul > li a
- {
- padding: 5px 16px;
- height: 20px;
- color: #ffffff;
- }
-
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul > li:hover a,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul > li:hover a,
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul > li.active a,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul > li.active a,
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul > li.active a:hover,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul > li.active a:hover
- {
- padding-left: 8px;
- border-left: 8px solid #aedcfb;
- }
-
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul > li.active a,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul > li.active a,
- .sidebar-min .sidebar-menu > li.parent > div.sidebar-menu-item-wrapper > ul > li.active a:hover,
- .sidebar-min .sidebar-menu > li.parent.active > div.sidebar-menu-item-wrapper > ul > li.active a:hover
- {
- color: #20202f;
- border-color: #20202f;
- }
-
- .sidebar-min .sidebar-menu.on-hover > li:hover,
- .sidebar-min .sidebar-menu > li.open
- {
- overflow: visible;
- }
-
- .sidebar-min .sidebar-menu.on-hover > li:hover > div > a,
- .sidebar-min .sidebar-menu > li.open > div > a
- {
- background: #6bbef6;
- }
-
- .sidebar-min .sidebar-menu.on-hover > li.parent.active:hover > div > a > span:before,
- .sidebar-min .sidebar-menu > li.parent.active.open > div > a > span:before
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #20202f #6bbef6 #6bbef6 #6bbef6;
- position: relative;
- top: 1px;
- }
-
- .sidebar-min .sidebar-menu.on-hover > li.parent:hover > div > a > span:before,
- .sidebar-min .sidebar-menu > li.parent.open > div > a > span:before
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #ffffff #6bbef6 #6bbef6 #6bbef6;
- position: relative;
- top: 1px;
- }
-/* }=== MADMIN MENU === */
-/* === LAYOUT ==={ */
-body
-{
- padding: 30px 0 40px 0;
-}
-
- body.help-page
- {
- padding: 0;
- }
-
-.row-fluid
-{
- position: relative;
-}
-
-#topbar
-{
- position: fixed;
- top: 0;
- width: 100%;
- height: 30px;
- padding: 0 3px;
- border: 0;
- margin: 0;
- text-align: center;
- z-index: 5000;
-}
-
- #topbar > li
- {
- display: inline-block;
- position: relative;
- }
-
-#sidebar
-{
- position: absolute;
- width: 220px;
- padding: 10px 0 70px 0;
- z-index: 1000;
-}
-
- #sidebar.fixed
- {
- position: fixed !important;
- top: 30px;
- left: 0;
- bottom: 0;
- }
-
-.sidebar-min #sidebar
-{
- width: 60px;
-}
-
-.sidebar-min #content
-{
- left: 0;
- margin-left: 80px;
-}
-
-#container
-{
- padding: 0;
-}
-
-#content
-{
- position: absolute;
- top: 20px;
- left: 240px;
- right: 20px;
- width: auto;
- min-width: 600px;
- margin: 0;
-}
-
-.page.hidden
-{
- position: absolute;
- left: -10000px;
- top: -10000px;
-}
-
-.panel
-{
- margin: 0 auto 20px auto;
-}
-
- .panel header
- {
- padding: 0 10px;
- height: 30px;
- }
-
- .panel header i
- {
- position: relative;
- top: 5px;
- margin-right: 5px;
- }
-
- .panel header span
- {
- position: relative;
- top: 5px;
- }
-
- .panel .content
- {
- padding: 10px;
- }
-
-#panel-login
-{
- width: 345px;
-}
-
- #panel-login .content
- {
- padding: 30px;
- }
-/* }=== LAYOUT === */
-/* === LOOKS ==={ */
-body.help-page
-{
- background-color: #FDFCE4;
-}
-
-.hero-unit,
-input,
-button,
-select,
-textarea
-{
- border-radius: 0 !important;
-}
-/* Top Bar */
-#topbar
-{
- background: #3a4450;
- color: #ffffff;
-}
-
- #topbar h1
- {
- position: relative;
- top: -6px;
- font-size: 14px;
- font-weight: normal;
- }
-
- #topbar h1 i
- {
- position: relative;
- top: 3px;
- margin-right: 5px;
- font-size: 20px;
- color: #6ac8fb;
- }
-
- #topbar h1 a
- {
- color: #ffffff;
- }
-
- #topbar h1 a:hover
- {
- text-decoration: none;
- }
-
- #topbar > li > a
- {
- display: inline-block;
- padding: 6px 10px 0 10px;
- font-size: 11px;
- font-weight: bold;
- text-transform: uppercase;
- color: #ffffff;
- height: 24px;
- line-height: 20px;
- }
-
- #topbar > li > a:hover
- {
- text-decoration: none;
- background: #4b5867;
- }
-
- #topbar > li.pull-right > a
- {
- margin-left: 10px;
- }
-
- #topbar > li.parent > a > span:after
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #ffffff #3a4450 #3a4450 #3a4450;
- position: relative;
- top: 1px;
- position: relative;
- top: 2px;
- margin-left: 5px;
- }
-
- #topbar > li.parent > a:hover > span:after
- {
- content: "";
- display: inline-block;
- width: 0px;
- height: 0px;
- border-width: 5px;
- border-style: solid;
- border-color: #ffffff #4b5867 #4b5867 #4b5867;
- position: relative;
- top: 1px;
- position: relative;
- top: 2px;
- margin-left: 5px;
- }
-
- #topbar .dropdown-menu
- {
- top: 98%;
- right: 0;
- padding: 0 0 0 0;
- background: #3a4450;
- border: 0;
- border-radius: 0;
- box-shadow: none;
- text-align: left;
- }
-
- #topbar .dropdown-menu *
- {
- color: #ffffff;
- }
-
- #topbar .dropdown-menu > li > a
- {
- height: 24px;
- }
-
- #topbar .dropdown-menu > li > a:hover
- {
- background: #4b5867;
- }
-
- #topbar .dropdown-menu > li.divider
- {
- background: none;
- border-bottom-color: #4b5867;
- }
-/* Bootstrap drop-downs behavior enhancement */
-ul.on-hover > li.parent:hover > .dropdown-menu
-{
- display: block;
-}
-/* Sidebar Resizer */
-#sidebar-resizer
-{
- display: block;
- position: absolute;
- bottom: 0;
- padding: 10px;
- width: 200px;
- height: 30px;
- text-align: center;
- font-size: 32px;
- color: #20202f;
- margin: 10px 0 10px 0;
-}
-
- #sidebar-resizer:hover
- {
- text-decoration: none;
- }
-
- #sidebar-resizer i.max
- {
- display: none;
- }
-
-.sidebar-min #sidebar-resizer
-{
- width: 40px;
-}
-
- .sidebar-min #sidebar-resizer i.max
- {
- display: inline-block;
- }
-
- .sidebar-min #sidebar-resizer i.min
- {
- display: none;
- }
-/* Sidebar Mini-Search */
-.search-mini
-{
- position: relative;
- margin: 10px 0 20px 0;
-}
-
- .search-mini input
- {
- border: 0;
- margin: 0 10px;
- width: 192px;
- height: 22px;
- background: #3a4450;
- color: #ffffff;
- }
-
- .search-mini button
- {
- position: absolute;
- width: 30px;
- height: 30px;
- padding: 0;
- border: 0;
- margin: 0;
- background: #3a4450;
- color: #ffffff;
- top: 0;
- right: 10px;
- font-size: 18px;
- }
-
-.sidebar-min .search-mini input
-{
- width: 32px;
-}
-
-.sidebar-min .search-mini :-webkit-input-placeholder,
-.sidebar-min .search-mini :-moz-placeholder
-{
- display: none;
-}
-
-.sidebar-min .search-mini button
-{
- right: 24.5%;
-}
-
-.sidebar-min .search-mini:hover input
-{
- width: 162px;
-}
-
-.sidebar-min .search-mini:hover button
-{
- left: 162px;
-}
-/* Panels */
-.panel header,
-.accordion-heading
-{
- background: #3a4450;
-}
-
- .panel header *,
- .accordion-heading *,
- .panel header a:hover,
- .accordion-heading a:hover
- {
- color: #ffffff;
- text-decoration: none;
- }
-
-.panel .content
-{
- background: #f7f7fd;
- color: #3a4450;
- border: 1px solid #f0f0fb;
-}
-
-.hero-unit,
-.form-actions
-{
- background: #f7f7fd;
-}
-/* Table of Key Numbers */
-.table-key-numbers
-{
- width: 100%;
- text-align: center;
-}
-
- .table-key-numbers td
- {
- font-size: 30px;
- font-weight: bold;
- line-height: 1.6em;
- color: #20202f;
- }
-
- .table-key-numbers th
- {
- color: #666;
- font-weight: normal;
- color: #8b9198;
- }
-/* Demo Charts */
-#stats-area-chart,
-#dashboard-dynamic-chart,
-#stats-pie-chart
-{
- margin: 10px;
- height: 200px;
-}
-
-#stats-pie-chart
-{
- margin: 10px auto 10px auto;
- width: 400px;
- overflow: hidden;
-}
-/* Sidebar */
-#sidebar
-{
- background: #61b0e9;
-}
-/* Tablesorter Plugin */
-table.tablesorter thead tr .headerSortDown,
-table.tablesorter thead tr .headerSortUp
-{
- background-color: #aedcfb;
-}
-
-table.tablesorter thead tr th,
-table.tablesorter tfoot tr th
-{
- background-color: #61b0e9;
-}
-
-table.tablesorter
-{
- background-color: #f7f7fd;
-}
-/* Accordions */
-.accordion-group,
-.accordion-inner
-{
- border: 0;
-}
-
-.sidebar-menu a:hover
-{
- text-decoration: none;
-}
-
-.sidebar-menu > li > div > a
-{
- font-weight: bold;
- text-transform: uppercase;
- font-size: 12px;
-}
-
-.hero-unit h1
-{
- margin-bottom: 0.15em;
-}
-/* }=== TYPO === */
-/* === FORMS ==={ */
-/* }=== FORMS === */
-/* === BUTTONS ==={ */
-.btn
-{
- filter: none;
- border-radius: 0;
-}
-
-.btn-madmin.btn.btn-primary
-{
- background: #61b0e9;
- color: #ffffff;
- text-transform: uppercase;
- font-size: 14px;
- border-color: #389ae2;
- text-shadow: none;
-}
-
- .btn-madmin.btn.btn-primary:hover
- {
- border-color: #6bbef6;
- background: #6bbef6;
- color: #ffffff;
- }
-
- .btn-madmin.btn.btn-primary.btn-large
- {
- font-size: 16px;
- }
-
- .btn-madmin.btn.btn-primary.btn-small
- {
- font-size: 12px;
- }
-
- .btn-madmin.btn.btn-primary.btn-mini
- {
- font-size: 10px;
- }
-
-.btn-madmin.btn
-{
- background: #DCE0F1;
- text-shadow: none;
- border-color: #C1C1E3;
-}
-
- .btn-madmin.btn:hover
- {
- background: #E3EAF9;
- border-color: #CECEF4;
- }
-/* Tile buttons */
-.tile-btn
-{
- display: inline-block;
- width: 105px;
- height: 85px;
- margin: 5px;
- background: #61b0e9;
- color: #ffffff;
- text-align: center;
-}
-
- .tile-btn:hover
- {
- text-decoration: none;
- background: #6bbef6;
- color: #ffffff;
- }
-
- .tile-btn i
- {
- display: block;
- font-size: 32px;
- margin-top: 20px;
- }
-
- .tile-btn span
- {
- display: block;
- margin-top: 10px;
- }
-
-.tiles-container
-{
- text-align: center;
-}
-/* }=== BUTTONS === */
-/* === FIXES ==={ */
-/* }=== FIXES === */
diff --git a/NzbDrone.Web/Content2/bootstrap-overrides.css b/NzbDrone.Web/Content2/bootstrap-overrides.css
deleted file mode 100644
index 13dd4416f..000000000
--- a/NzbDrone.Web/Content2/bootstrap-overrides.css
+++ /dev/null
@@ -1,83 +0,0 @@
-body {
- padding-top: 0px;
- color: #57606b;
-}
-
-div, table, ul {
- -moz-border-radius: 0 !important;
- -webkit-border-radius: 0 !important;
- border-radius: 0 !important;
-}
-
-table {
- font-size: 16px;
-}
-
- table th, .table th {
- font-size: 20px;
- font-weight: 100;
- text-transform: lowercase;
- }
-
-h1 {
- font-size: 60px;
- padding-bottom: 50px;
-}
-
-h2 {
- font-size: 40px;
-}
-
-h3 {
- font-size: 30px;
-}
-
-h1, h2, h3 {
- text-transform: lowercase;
-}
-
-input,
-textarea,
-.uneditable-input {
- width: 400px;
-}
-
-.field-validation-error {
- color: rgb(207, 27, 27);
-}
-
-.alert-error ul {
- margin: 0px;
- list-style-type: none;
-}
-
-:not([class^="alert-"]:before),
-:not([class*="alert-"]:before),
-[class^="icon-"]:before,
-[class*=" icon-"]:before {
- color: #57606b;
-}
-
-[class^="icon-"]:before,
-[class*=" icon-"]:before {
- margin-right: 7px;
-}
-
-
-form input[type=submit] {
- margin-top: 30px;
-}
-
-.btn {
- margin-right: 10px;
-}
-
-.btn-hover {
- padding: 7px 15px;
-}
-
- .btn-hover:hover {
- background: white;
- color: #57606b;
- text-decoration: none;
- }
diff --git a/NzbDrone.Web/Content2/file-browser.css b/NzbDrone.Web/Content2/file-browser.css
deleted file mode 100644
index 0ca22fbb6..000000000
--- a/NzbDrone.Web/Content2/file-browser.css
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
-[class^="icon-"]:before,
-[class*=" icon-"]:before {
- font-size: 30px;
-}
-*/
-
-
-#main > .icon-folder-open, .icon-file, .icon-download-alt {
- font-size: 25px;
-}
-
-.link-download {
- margin-right: 10px;
-}
-
-.file-browser-message {
- text-align: center;
-}
diff --git a/NzbDrone.Web/Content2/metro.blue.css b/NzbDrone.Web/Content2/metro.blue.css
deleted file mode 100644
index 664408b6f..000000000
--- a/NzbDrone.Web/Content2/metro.blue.css
+++ /dev/null
@@ -1,830 +0,0 @@
-.accent {
- color: #1ba1e2;
-}
-
-.white {
- color: #fff;
-}
-
-.black {
- color: #000;
-}
-
-.blue {
- color: #1ba1e2;
-}
-
-.brown {
- color: #a05000;
-}
-
-.green {
- color: #393;
-}
-
-.lime {
- color: #8cbf26;
-}
-
-.magenta {
- color: #ff0097;
-}
-
-.orange {
- color: #f09609;
-}
-
-.pink {
- color: #e671b8;
-}
-
-.purple {
- color: #a200ff;
-}
-
-.red {
- color: #e51400;
-}
-
-.teal {
- color: #00aba9;
-}
-
-.whitebg {
- background-color: #fff;
-}
-
-.blackbg {
- background-color: #000;
-}
-
-.bluebg {
- background-color: #1ba1e2;
-}
-
-.brownbg {
- background-color: #a05000;
-}
-
-.greenbg {
- background-color: #393;
-}
-
-.limebg {
- background-color: #8cbf26;
-}
-
-.magentabg {
- background-color: #ff0097;
-}
-
-.orangebg {
- background-color: #f09609;
-}
-
-.pinkbg {
- background-color: #e671b8;
-}
-
-.purplebg {
- background-color: #a200ff;
-}
-
-.redbg {
- background-color: #e51400;
-}
-
-.tealbg {
- background-color: #00aba9;
-}
-
-@font-face {
- font-family: 'RobotoRegular';
- src: url('../fonts/Roboto-Regular-webfont.eot');
- src: url('../fonts/Roboto-Regular-webfont.eot?#iefix') format('embedded-opentype'),url('../fonts/Roboto-Regular-webfont.woff') format('woff'),url('../fonts/Roboto-Regular-webfont.ttf') format('truetype'),url('../fonts/Roboto-Regular-webfont.svg#RobotoRegular') format('svg');
- font-weight: normal;
- font-style: normal;
-}
-
-@font-face {
- font-family: 'RobotoLight';
- src: url('../fonts/Roboto-Light-webfont.eot');
- src: url('../fonts/Roboto-Light-webfont.eot?#iefix') format('embedded-opentype'),url('../fonts/Roboto-Light-webfont.woff') format('woff'),url('../fonts/Roboto-Light-webfont.ttf') format('truetype'),url('../fonts/Roboto-Light-webfont.svg#RobotoLight') format('svg');
- font-weight: normal;
- font-style: normal;
-}
-
-#headingstyles {
- font-family: "Segoe UI Light","Helvetica Neue",'RobotoLight',"Segoe UI","Segoe WP",sans-serif;
- font-weight: 100;
- margin-top: 5px;
- margin-bottom: 0px;
- text-transform: lowercase;
-}
-
-body {
- font-family: "Segoe UI","Segoe WP","Helvetica Neue",'RobotoRegular',sans-serif;
- font-size: 14px;
-}
-
-h1, h2, h3, h4, h5, h6 {
- font-family: "Segoe UI Light","Helvetica Neue",'RobotoLight',"Segoe UI","Segoe WP",sans-serif;
- font-weight: 100;
- margin-top: 5px;
- margin-bottom: 0px;
- text-transform: lowercase;
-}
-
-h1 {
- font-size: 56px;
-}
-
-h2 {
- font-size: 42px;
-}
-
-h3 {
- font-size: 28px;
-}
-
-h4, h5, h6 {
- font-weight: normal;
- text-transform: uppercase;
-}
-
-ul.metro-list, ol.metro-list {
- padding: 0;
-}
-
- ul.metro-list li, ol.metro-list li {
- display: block;
- list-style-type: none;
- border-left: solid 30px #1ba1e2;
- height: 20px;
- list-style-position: inside;
- margin: 10px 0;
- padding: 5px;
- }
-
-ul.metro-list {
- overflow: hidden;
-}
-
-ol.metro-list {
- text-indent: -25px;
- counter-reset: item;
-}
-
- ol.metro-list li:before {
- color: white;
- margin-right: 25px;
- content: counter(item) " ";
- counter-increment: item;
- }
-
-.tile {
- -webkit-perspective: 0;
- -webkit-transform-style: preserve- 3 d;
- -webkit-transition: -webkit-transform 0.2s;
- float: left;
- margin-right: 10px;
- margin-bottom: 10px;
- text-align: center;
- padding: 5px;
- opacity: 0.75;
-}
-
- .tile h1, .tile h2, .tile h3, .tile h4, .tile h5, .tile h6 {
- color: #fff;
- -webkit-user-select: none;
- }
-
- .tile h2 {
- font-size: 1.75em;
- margin-top: -10px;
- margin-left: 0px;
- }
-
- .tile a:hover {
- text-decoration: none;
- }
-
- .tile img {
- border: 0;
- }
-
- .tile:hover {
- opacity: 1;
- }
-
-.tiles {
- clear: both;
-}
-
-.tilerow {
- float: left;
- -webkit-perspective: 0;
- -webkit-transform-style: preserve- 3 d;
- -webkit-user-select: none;
-}
-
-.one {
- width: 130px;
- height: 130px;
-}
-
-.two-h {
- width: 280px;
- height: 130px;
-}
-
-.two-v {
- width: 130px;
- height: 280px;
-}
-
-.firstcol, .secondcol, .thirdcol, .fourthcol, .fifthcol {
- position: absolute;
-}
-
-.secondcol {
- margin-left: 150px;
-}
-
-.thirdcol {
- margin-left: 300px;
-}
-
-.fourthcol {
- margin-left: 450px;
-}
-
-.fifthcol {
- margin-left: 600px;
-}
-
-metro-pivot .headers {
- clear: both;
- display: block;
- white-space: nowrap;
-}
-
-.metro-pivot .pivot-item h3, .metro-pivot .headers .header {
- font-family: "Segoe UI Light","Helvetica Neue",'RobotoLight',"Segoe UI","Segoe WP",sans-serif;
- font-weight: 100;
- margin-top: 5px;
- margin-bottom: 0px;
- text-transform: lowercase;
- cursor: pointer;
- display: inline-block;
- font-size: 42px;
- margin-right: 24px;
- padding: 0;
- vertical-align: top;
-}
-
-.metro-pivot .headers {
- white-space: nowrap;
- display: block;
- clear: both;
-}
-
- .metro-pivot .pivot-item h3, .metro-pivot .headers .header {
- font-family: "Segoe UI Light","Helvetica Neue",'RobotoLight',"Segoe UI","Segoe WP",sans-serif;
- font-weight: 100;
- margin-top: 5px;
- margin-bottom: 0px;
- text-transform: lowercase;
- font-size: 42px;
- display: inline-block;
- vertical-align: top;
- padding: 0;
- cursor: pointer;
- margin-right: 24px;
- }
-
-.metro-pivot .items {
- position: relative;
-}
-
- .metro-pivot .items .pivotItem {
- display: block;
- white-space: normal;
- text-align: justify;
- width: 100%;
- }
-
-article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
- display: block;
-}
-
-audio, canvas, video {
- display: inline-block;
- *display: inline;
- *zoom: 1;
-}
-
- audio:not([controls]) {
- display: none;
- }
-
-html {
- font-size: 100%;
- -webkit-text-size-adjust: 100%;
- -ms-text-size-adjust: 100%;
-}
-
-a:focus {
- outline: thin dotted;
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
-
-a:hover, a:active {
- outline: 0;
-}
-
-sub, sup {
- position: relative;
- font-size: 75%;
- line-height: 0;
- vertical-align: baseline;
-}
-
-sup {
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-img {
- max-width: 100%;
- height: auto;
- border: 0;
- -ms-interpolation-mode: bicubic;
-}
-
-button, input, select, textarea {
- margin: 0;
- font-size: 100%;
- vertical-align: middle;
-}
-
-button, input {
- *overflow: visible;
- line-height: normal;
-}
-
- button::-moz-focus-inner, input::-moz-focus-inner {
- padding: 0;
- border: 0;
- }
-
- button, input[type="button"], input[type="reset"], input[type="submit"] {
- cursor: pointer;
- -webkit-appearance: button;
- }
-
- input[type="search"] {
- -webkit-appearance: textfield;
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
- }
-
- input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button {
- -webkit-appearance: none;
- }
-
-textarea {
- overflow: auto;
- vertical-align: top;
-}
-
-.container {
- width: 940px;
- margin-left: auto;
- margin-right: auto;
- *zoom: 1;
-}
-
- .container:before, .container:after {
- display: table;
- content: "";
- }
-
- .container:after {
- clear: both;
- }
-
-.container-fluid {
- padding-left: 20px;
- padding-right: 20px;
- *zoom: 1;
-}
-
- .container-fluid:before, .container-fluid:after {
- display: table;
- content: "";
- }
-
- .container-fluid:after {
- clear: both;
- }
-
-.row {
- margin-left: -20px;
- *zoom: 1;
-}
-
- .row:before, .row:after {
- display: table;
- content: "";
- }
-
- .row:after {
- clear: both;
- }
-
-[class*="span"] {
- float: left;
- margin-left: 20px;
-}
-
-.span1 {
- width: 60px;
-}
-
-.span2 {
- width: 140px;
-}
-
-.span3 {
- width: 220px;
-}
-
-.span4 {
- width: 300px;
-}
-
-.span5 {
- width: 380px;
-}
-
-.span6 {
- width: 460px;
-}
-
-.span7 {
- width: 540px;
-}
-
-.span8 {
- width: 620px;
-}
-
-.span9 {
- width: 700px;
-}
-
-.span10 {
- width: 780px;
-}
-
-.span11 {
- width: 860px;
-}
-
-.span12, .container {
- width: 940px;
-}
-
-.offset1 {
- margin-left: 100px;
-}
-
-.offset2 {
- margin-left: 180px;
-}
-
-.offset3 {
- margin-left: 260px;
-}
-
-.offset4 {
- margin-left: 340px;
-}
-
-.offset5 {
- margin-left: 420px;
-}
-
-.offset6 {
- margin-left: 500px;
-}
-
-.offset7 {
- margin-left: 580px;
-}
-
-.offset8 {
- margin-left: 660px;
-}
-
-.offset9 {
- margin-left: 740px;
-}
-
-.offset10 {
- margin-left: 820px;
-}
-
-.offset11 {
- margin-left: 900px;
-}
-
-.row-fluid {
- width: 100%;
- *zoom: 1;
-}
-
- .row-fluid:before, .row-fluid:after {
- display: table;
- content: "";
- }
-
- .row-fluid:after {
- clear: both;
- }
-
- .row-fluid > [class*="span"] {
- float: left;
- margin-left: 2.13%;
- }
-
- .row-fluid > [class*="span"]:first-child {
- margin-left: 0;
- }
-
- .row-fluid .span1 {
- width: 6.38%;
- }
-
- .row-fluid .span2 {
- width: 14.89%;
- }
-
- .row-fluid .span3 {
- width: 23.4%;
- }
-
- .row-fluid .span4 {
- width: 31.91%;
- }
-
- .row-fluid .span5 {
- width: 40.43%;
- }
-
- .row-fluid .span6 {
- width: 48.94%;
- }
-
- .row-fluid .span7 {
- width: 57.45%;
- }
-
- .row-fluid .span8 {
- width: 65.96%;
- }
-
- .row-fluid .span9 {
- width: 74.47%;
- }
-
- .row-fluid .span10 {
- width: 82.98%;
- }
-
- .row-fluid .span11 {
- width: 91.49%;
- }
-
- .row-fluid .span12 {
- width: 100%;
- }
-
-@-webkit-keyframes progress-bar-stripes {
- from {
- background-position: 0 0;
- }
-
- to {
- background-position: 40px 0;
- }
-}
-
-@-moz-keyframes progress-bar-stripes {
- from {
- background-position: 0 0;
- }
-
- to {
- background-position: 40px 0;
- }
-}
-
-@keyframes progress-bar-stripes {
- from {
- background-position: 0 0;
- }
-
- to {
- background-position: 40px 0;
- }
-}
-
-.progress {
- overflow: hidden;
- height: 18px;
- margin-bottom: 18px;
- background-color: #f7f7f7;
- background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));
- background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9);
- background-image: linear-gradient(top, #f5f5f5, #f9f9f9);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);
- -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
- .progress .bar {
- width: 0%;
- height: 18px;
- color: #fff;
- font-size: 12px;
- text-align: center;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
- background-color: #5ebdeb;
- background-image: -moz-linear-gradient(top, #8bd0f1, #1ba1e2);
- background-image: -ms-linear-gradient(top, #8bd0f1, #1ba1e2);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#8bd0f1), to(#1ba1e2));
- background-image: -webkit-linear-gradient(top, #8bd0f1, #1ba1e2);
- background-image: -o-linear-gradient(top, #8bd0f1, #1ba1e2);
- background-image: linear-gradient(top, #8bd0f1, #1ba1e2);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#8bd0f1', endColorstr='#1ba1e2', GradientType=0);
- -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-transition: width 0.6s ease;
- -moz-transition: width 0.6s ease;
- -ms-transition: width 0.6s ease;
- -o-transition: width 0.6s ease;
- transition: width 0.6s ease;
- }
-
-.progress-striped .bar {
- background-color: #1ba1e2;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- -webkit-background-size: 40px 40px;
- -moz-background-size: 40px 40px;
- -o-background-size: 40px 40px;
- background-size: 40px 40px;
-}
-
-.progress.active .bar {
- -webkit-animation: progress-bar-stripes 2s linear infinite;
- -moz-animation: progress-bar-stripes 2s linear infinite;
- animation: progress-bar-stripes 2s linear infinite;
-}
-
-.progress-danger .bar {
- background-color: #dd514c;
- background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));
- background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
- background-image: linear-gradient(top, #ee5f5b, #c43c35);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);
-}
-
-.progress-danger.progress-striped .bar {
- background-color: #ee5f5b;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-success .bar {
- background-color: #5eb95e;
- background-image: -moz-linear-gradient(top, #62c462, #57a957);
- background-image: -ms-linear-gradient(top, #62c462, #57a957);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));
- background-image: -webkit-linear-gradient(top, #62c462, #57a957);
- background-image: -o-linear-gradient(top, #62c462, #57a957);
- background-image: linear-gradient(top, #62c462, #57a957);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);
-}
-
-.progress-success.progress-striped .bar {
- background-color: #62c462;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.progress-info .bar {
- background-color: #4bb1cf;
- background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));
- background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
- background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
- background-image: linear-gradient(top, #5bc0de, #339bb9);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);
-}
-
-.progress-info.progress-striped .bar {
- background-color: #5bc0de;
- background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));
- background-image: -webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
- background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
-}
-
-.pull-right {
- float: right;
-}
-
-.pull-left {
- float: left;
-}
-
-.hide {
- display: none;
-}
-
-.show {
- display: block;
-}
-
-.invisible {
- visibility: hidden;
-}
-
-a {
- color: #1ba1e2;
- text-decoration: none;
-}
-
- a:hover {
- color: #13709e;
- text-decoration: underline;
- }
-
-pre {
- padding: 15px;
- border: 1px solid #aaa;
- background: #fafafa;
-}
-
-code {
- background: #fafafa;
- border: 1px solid #aaa;
- padding-left: 5px;
- padding-right: 5px;
-}
-
-.clear {
- clear: both;
-}
diff --git a/NzbDrone.Web/Content2/metro.css b/NzbDrone.Web/Content2/metro.css
deleted file mode 100644
index 2d6de616b..000000000
--- a/NzbDrone.Web/Content2/metro.css
+++ /dev/null
@@ -1,160 +0,0 @@
-body>h1{
- font:60px 'Ubuntu Condensed', sans-serif;
- font-weight:lighter;
- color:#fff;
- cursor:default;
- margin:40px 0 0 5%;
-}
-
-#center{
- margin:0 auto;
- width:2100px;
- padding:50px;
-}
-
-#center a:focus{ outline:0 }
-
-#center section{
- width:910px;
- display:inline-block;
- margin-right:100px;
-}
-
-#center a{
- display:block;
- float:left;
- margin:4px;
- height:100px;
- width:250px;
- padding:25px;
- background:#5fbfbf;
- z-index:0;
- color:#fff;
- font-size:18px;
- font:18px 'Cantarell', sans-serif;
- text-decoration:none;
-
-}
-#center a span{
- letter-spacing:-3px;
- font-size:50px;
- text-transform:uppercase
-}
-
-#center a img{
- display:inline;
- margin:-25px 0 0 -25px
-}
-
-#center a.normal, #center a.numbers{
- background: #479ea8;
- background: -moz-linear-gradient(left, #479ea8 1%, #53b6bc 98%);
- background: -webkit-gradient(linear, left top, right top, color-stop(1%,#479ea8), color-stop(98%,#53b6bc));
- background: -webkit-linear-gradient(left, #479ea8 1%,#53b6bc 98%);
- background: -o-linear-gradient(left, #479ea8 1%,#53b6bc 98%);
- background: -ms-linear-gradient(left, #479ea8 1%,#53b6bc 98%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#479ea8', endColorstr='#53b6bc',GradientType=1 );
- background: linear-gradient(left, #479ea8 1%,#53b6bc 98%);
- border:1px solid #59b0b6
-}
-#center a.normal:hover, #center a.numbers:hover{
- background:#53b6bc;
-}
-#center a.fulltext{
- background: #de8211; /* Old browsers */
- background: -moz-linear-gradient(left, #de8211 0%, #e3a419 94%);
- background: -webkit-gradient(linear, left top, right top, color-stop(0%,#de8211), color-stop(94%,#e3a419));
- background: -webkit-linear-gradient(left, #de8211 0%,#e3a419 94%);
- background: -o-linear-gradient(left, #de8211 0%,#e3a419 94%);
- background: -ms-linear-gradient(left, #de8211 0%,#e3a419 94%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#de8211', endColorstr='#e3a419',GradientType=1 );
- background: linear-gradient(left, #de8211 0%,#e3a419 94%);
- border:1px solid #d8923d;
- font-size:16px;
-}
-#center a.fulltext:hover{
- background:#e3a419;
-}
-#center a.icon{
- background: #7ca024;
- background: -moz-linear-gradient(left, #7ca024 3%, #9ab92f 98%);
- background: -webkit-gradient(linear, left top, right top, color-stop(3%,#7ca024), color-stop(98%,#9ab92f));
- background: -webkit-linear-gradient(left, #7ca024 3%,#9ab92f 98%);
- background: -o-linear-gradient(left, #7ca024 3%,#9ab92f 98%);
- background: -ms-linear-gradient(left, #7ca024 3%,#9ab92f 98%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7ca024', endColorstr='#9ab92f',GradientType=1 );
- background: linear-gradient(left, #7ca024 3%,#9ab92f 98%);
- width:100px;
- border:1px solid #aab662
-}
-#center a.icon:hover{
- background:#9ab92f;
-}
-
-#center a.preview{
- background: #c74430; /* Old browsers */
- background: -moz-linear-gradient(left, #c74430 0%, #d85636 95%);
- background: -webkit-gradient(linear, left top, right top, color-stop(0%,#c74430), color-stop(95%,#d85636));
- background: -webkit-linear-gradient(left, #c74430 0%,#d85636 95%);
- background: -o-linear-gradient(left, #c74430 0%,#d85636 95%);
- background: -ms-linear-gradient(left, #c74430 0%,#d85636 95%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#c74430', endColorstr='#d85636',GradientType=1 );
- background: linear-gradient(left, #c74430 0%,#d85636 95%);
- font-size:30px;
- border:1px solid #d55b46;
- border-top:0
-}
-#center a.preview:hover{
- background:#d85636;
-}
-#center a.preview img{
- display:block;
- margin-bottom:5px
-}
-
-#center a.search{
- background: #631254; /* Old browsers */
- background: -moz-linear-gradient(left, #631254 4%, #7c1d6e 98%);
- background: -webkit-gradient(linear, left top, right top, color-stop(4%,#631254), color-stop(98%,#7c1d6e));
- background: -webkit-linear-gradient(left, #631254 4%,#7c1d6e 98%);
- background: -o-linear-gradient(left, #631254 4%,#7c1d6e 98%);
- background: -ms-linear-gradient(left, #631254 4%,#7c1d6e 98%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#631254', endColorstr='#7c1d6e',GradientType=1 );
- background: linear-gradient(left, #631254 4%,#7c1d6e 98%);
- border:1px solid #7b387f;
- width:100px;
-}
-#center a.search:hover{
- background:#7c1d6e;
-}
-
-#center a.twitter{
- background: #652d9a;
- background: -moz-linear-gradient(left, #652d9a 3%, #7f37b5 98%);
- background: -webkit-gradient(linear, left top, right top, color-stop(3%,#652d9a), color-stop(98%,#7f37b5));
- background: -webkit-linear-gradient(left, #652d9a 3%,#7f37b5 98%);
- background: -o-linear-gradient(left, #652d9a 3%,#7f37b5 98%);
- background: -ms-linear-gradient(left, #652d9a 3%,#7f37b5 98%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#652d9a', endColorstr='#7f37b5',GradientType=1 );
- background: linear-gradient(left, #652d9a 3%,#7f37b5 98%);
- border:1px solid #8148b1;
- font-size:16px;
- text-shadow:1px 1px 2px ##652d9a;
- width:260px;
- height:110px;
- padding-top:15px;
- padding-left:15px;
-}
-#center a.twitter:hover{background:#7f37b5}
-#center a.twitter>span{font-size:20px;letter-spacing:-3px}
-#center a.twitter>i{font-size:.9em;font-style:italic;}
-#center a.twitter>img{
- float:left;
- margin:0 5px 0 0;
-}
-
-#center a.images{
- padding:0;
- width:302px;
- height:152px;
-}
\ No newline at end of file
diff --git a/NzbDrone.Web/Content2/stats.css b/NzbDrone.Web/Content2/stats.css
deleted file mode 100644
index 4a5eb7ff5..000000000
--- a/NzbDrone.Web/Content2/stats.css
+++ /dev/null
@@ -1,36 +0,0 @@
-.stat-item {
- background: whiteSmoke;
- font-weight: 100;
-}
-
-
-.user-stats {
- margin-bottom: 30px;
-}
-
-.stat-value {
- font-size: 50px;
- padding-bottom: 20px;
- padding-left: 5px;
- border-bottom-style: solid;
- border-bottom-width: 10px;
-}
-
-.stat-size {
- color: #1081CD;
-}
-
-.stat-count {
- color: #8EBD40;
-}
-
-.stat-last-backup {
- color: #988CC3;
-}
-
-.stat-lable {
- color: #57606B;
- margin-bottom: 15px;
- padding-left: 5px;
-
-}
diff --git a/NzbDrone.Web/Controllers/V2Controller.cs b/NzbDrone.Web/Controllers/V2Controller.cs
new file mode 100644
index 000000000..70f9a8c9d
--- /dev/null
+++ b/NzbDrone.Web/Controllers/V2Controller.cs
@@ -0,0 +1,21 @@
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Mvc;
+
+namespace NzbDrone.Web.Controllers
+{
+ public class V2Controller : Controller
+ {
+ //
+ // GET: /V2/
+
+ public ActionResult Index()
+ {
+ return View();
+ }
+
+ }
+}
diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj
index 9d7286f95..abaf1c5f5 100644
--- a/NzbDrone.Web/NzbDrone.Web.csproj
+++ b/NzbDrone.Web/NzbDrone.Web.csproj
@@ -182,102 +182,91 @@
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mixins.less
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -386,36 +375,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/NzbDrone.Web/Scripts2/Metro/jquery.metro.js b/NzbDrone.Web/Scripts2/Metro/jquery.metro.js
deleted file mode 100644
index 9ddbafa96..000000000
--- a/NzbDrone.Web/Scripts2/Metro/jquery.metro.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/**
- * jqMetro
- * JQUERY PLUGIN FOR METRO UI CONTROLS
- *
- * Copyright (c) 2011 Mohammad Valipour (http://manorey.net/mohblog)
- * Licensed under the MIT License:
- * http://www.opensource.org/licenses/mit-license.php
- *
- */
-
-;(function ($) {
- var defaults = {
- animationDuration: 150,
- headerOpacity: 0.5,
- fixedHeaders: false,
- headerSelector: function (item) { return item.children("h3").first(); },
- itemSelector: function (item) { return item.children(".pivot-item"); },
- headerItemTemplate: function () { return $(""); },
- pivotItemTemplate: function () { return $(""); },
- itemsTemplate: function () { return $(""); },
- headersTemplate: function () { return $(""); },
- controlInitialized: undefined,
- selectedItemChanged: undefined
- };
-
- $.fn.metroPivot = function (settings) {
- if(this.length > 1)
- {
- return this.each(function(index, el){ $(el).wp7Pivot(settings); });
- }
-
- $.extend(this, defaults, settings);
- $.extend(this,{
- animating : false,
- headers : undefined,
- items : undefined,
- goToNext: function(){
- if(this.animating) return;
- this.headers.children(".current").next().trigger("click");
- },
- goToPrevious: function(){
- if(this.animating) return;
- this.headers.children(".header").last().trigger("click");
- },
- goToItemByName:function(header){
- if(this.animating) return;
- this.headers.children(":contains("+header+")").first().trigger("click");
- },
- goToItemByIndex:function(index){
- if(this.animating) return;
- this.headers.children().eq(index).trigger("click");
- },
- initialize : function () {
- var pivot = this;
- // define sections
-
- var headers = pivot.headersTemplate();
- var items = pivot.itemsTemplate();
-
- pivot.itemSelector(pivot).each(function (index, el) {
- el = $(el);
-
- var h3Element = pivot.headerSelector(el);
- if (h3Element.length == 0) return;
-
- var headerItem = pivot.headerItemTemplate().html(h3Element.html()).fadeTo(0, pivot.headerOpacity);
- var pivotItem = pivot.pivotItemTemplate().append(el).hide();
-
- if (index == 0) {
- headerItem.addClass("current").fadeTo(0, 1);
- pivotItem.addClass("current").show();
- }
- headerItem.attr("index", index);
- headerItem.click(function() { pivot.pivotHeader_Click($(this)); });
-
- headers.append(headerItem);
- items.append(pivotItem);
-
- h3Element.remove();
- });
-
- pivot.append(headers).append(items);
- pivot.headers = headers;
- pivot.items = items;
-
- this.data("controller", pivot);
-
- if(this.controlInitialized != undefined)
- {
- this.controlInitialized();
- }
- },
- setCurrentHeader: function(header){
- var pivot = this;
-
- // make current header a normal one
- this.headers.children(".header.current").removeClass("current").fadeTo(0, this.headerOpacity);
-
- // make selected header to current
- header.addClass("current").fadeTo(0, 1);
-
- if(pivot.fixedHeaders == false)
- {
- // create a copy for fadeout navigation
- var copy = header.prevAll().clone();
- // detach items to move to end of headers
- var detached = $(header.prevAll().detach().toArray().reverse());
-
- // copy animation items to beginning and animate them
- $("").append(copy).prependTo(pivot.headers).animate({ width: 0, opacity: 0 }, pivot.animationDuration, function () {
- // when finished: delete animation objects
- $(this).remove();
-
- // and attach detached items to the end of headers
- detached.fadeTo(0, 0).appendTo(pivot.headers).fadeTo(200, pivot.headerOpacity);
- });
- }
- },
- setCurrentItem: function(item, index){
- var pivot = this;
-
- // hide current item immediately
- pivot.items.children(".pivotItem.current").hide().removeClass("current");
-
- // after a little delay
- setTimeout(function () {
- // move the item to far right and make it visible
- item.css({ marginLeft: item.outerWidth() }).show().addClass("current");
-
- // animate it to left
- item.animate( { marginLeft: 0 }, pivot.animationDuration, function() { pivot.currentItemChanged(index);});
-
- }, 200);
- },
- currentItemChanged: function(index) {
- this.animating = false;
- if(this.selectedItemChanged != undefined)
- {
- this.selectedItemChanged(index);
- }
- },
- pivotHeader_Click : function (me) {
- // ignore if already current
- if (me.is(".current")) return;
-
- // ignore if still animating
- if (this.animating) return;
- this.animating = true;
-
- // set current header
- this.setCurrentHeader(me);
-
- var index = me.attr("index");
- // find and set current item
- var item = this.items.children(".pivotItem:nth(" + index + ")");
- this.setCurrentItem(item, index);
- },
- });
-
- return this.initialize();
- };
-})(jQuery);
\ No newline at end of file
diff --git a/NzbDrone.Web/Scripts2/Metro/tilt.js b/NzbDrone.Web/Scripts2/Metro/tilt.js
deleted file mode 100644
index fc77a4666..000000000
--- a/NzbDrone.Web/Scripts2/Metro/tilt.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- Base off Tim Holman's tile tilt: http://tholman.com/experiments/css3/metro-tiles/
-*/
-
-function addTileTilt()
-{
- var tile = this;
- var mouse = {x: 0, y: 0, down: false};
- var maxRotation = 16;
-
- var setRotation = function(){
- var width = tile.offsetWidth;
- var height = tile.offsetHeight;
- //Rotations as percentages
- var yRotation = (mouse.x - (width / 2)) / (width / 2);
- var xRotation = (mouse.y - (height / 2)) / (height / 2);
-
- tile.style.webkitTransform = "rotateX(" + -xRotation * maxRotation + "deg)" +
- " rotateY(" + yRotation * maxRotation + "deg)";
-
- tile.style.mozTransform = "rotateX(" + -xRotation * maxRotation + "deg)" +
- " rotateY(" + yRotation * maxRotation + "deg)";
-
- tile.style.transform = "rotateX(" + -xRotation * maxRotation + "deg)" +
- " rotateY(" + yRotation * maxRotation + "deg)";
- }
-
- var MouseDown = function(e){
- mouse.x = e.offsetX;
- mouse.y = e.offsetY;
- mouse.down = true;
- setRotation();
- }
-
- var MouseUp = function(e){
- mouse.down = false;
- tile.style.webkitTransform = "rotateX(0deg)" +
- " rotateY(0deg)";
-
- tile.style.mozTransform = "rotateX(0deg)" +
- " rotateY(0deg)";
-
- tile.style.transform = "rotateX(0deg)" +
- " rotateY(0deg)";
- }
-
- var MouseMove = function(e){
- mouse.x = e.offsetX;
- mouse.y = e.offsetY;
- if (mouse.down == true){
- setRotation();
- }
- }
-
-
- tile.addEventListener('mousemove', MouseMove, false);
- tile.addEventListener('mousedown', MouseDown, false);
- tile.addEventListener('mouseup', MouseUp, false);
- tile.addEventListener('mouseout', MouseUp, false);
-}
\ No newline at end of file
diff --git a/NzbDrone.Web/Scripts2/MicrosoftAjax.debug.js b/NzbDrone.Web/Scripts2/MicrosoftAjax.debug.js
deleted file mode 100644
index a5f7942ef..000000000
--- a/NzbDrone.Web/Scripts2/MicrosoftAjax.debug.js
+++ /dev/null
@@ -1,7117 +0,0 @@
-// Name: MicrosoftAjax.debug.js
-// Assembly: System.Web.Extensions
-// Version: 4.0.0.0
-// FileVersion: 4.0.20526.0
-//-----------------------------------------------------------------------
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------
-// MicrosoftAjax.js
-// Microsoft AJAX Framework.
-
-Function.__typeName = 'Function';
-Function.__class = true;
-Function.createCallback = function Function$createCallback(method, context) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "method", type: Function},
- {name: "context", mayBeNull: true}
- ]);
- if (e) throw e;
- 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);
- }
-}
-Function.createDelegate = function Function$createDelegate(instance, method) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance", mayBeNull: true},
- {name: "method", type: Function}
- ]);
- if (e) throw e;
- return function() {
- return method.apply(instance, arguments);
- }
-}
-Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() {
- ///
-}
-Function.validateParameters = function Function$validateParameters(parameters, expectedParameters, validateParameterCount) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "parameters"},
- {name: "expectedParameters"},
- {name: "validateParameterCount", type: Boolean, optional: true}
- ]);
- if (e) throw e;
- return Function._validateParams(parameters, expectedParameters, validateParameterCount);
-}
-Function._validateParams = function Function$_validateParams(params, expectedParams, validateParameterCount) {
- var e, expectedLength = expectedParams.length;
- validateParameterCount = validateParameterCount || (typeof(validateParameterCount) === "undefined");
- e = Function._validateParameterCount(params, expectedParams, validateParameterCount);
- if (e) {
- e.popStackFrame();
- return e;
- }
- for (var i = 0, l = params.length; i < l; i++) {
- var expectedParam = expectedParams[Math.min(i, expectedLength - 1)],
- paramName = expectedParam.name;
- if (expectedParam.parameterArray) {
- paramName += "[" + (i - expectedLength + 1) + "]";
- }
- else if (!validateParameterCount && (i >= expectedLength)) {
- break;
- }
- e = Function._validateParameter(params[i], expectedParam, paramName);
- if (e) {
- e.popStackFrame();
- return e;
- }
- }
- return null;
-}
-Function._validateParameterCount = function Function$_validateParameterCount(params, expectedParams, validateParameterCount) {
- var i, error,
- expectedLen = expectedParams.length,
- actualLen = params.length;
- if (actualLen < expectedLen) {
- var minParams = expectedLen;
- for (i = 0; i < expectedLen; i++) {
- var param = expectedParams[i];
- if (param.optional || param.parameterArray) {
- minParams--;
- }
- }
- if (actualLen < minParams) {
- error = true;
- }
- }
- else if (validateParameterCount && (actualLen > expectedLen)) {
- error = true;
- for (i = 0; i < expectedLen; i++) {
- if (expectedParams[i].parameterArray) {
- error = false;
- break;
- }
- }
- }
- if (error) {
- var e = Error.parameterCount();
- e.popStackFrame();
- return e;
- }
- return null;
-}
-Function._validateParameter = function Function$_validateParameter(param, expectedParam, paramName) {
- var e,
- expectedType = expectedParam.type,
- expectedInteger = !!expectedParam.integer,
- expectedDomElement = !!expectedParam.domElement,
- mayBeNull = !!expectedParam.mayBeNull;
- e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName);
- if (e) {
- e.popStackFrame();
- return e;
- }
- var expectedElementType = expectedParam.elementType,
- elementMayBeNull = !!expectedParam.elementMayBeNull;
- if (expectedType === Array && typeof(param) !== "undefined" && param !== null &&
- (expectedElementType || !elementMayBeNull)) {
- var expectedElementInteger = !!expectedParam.elementInteger,
- expectedElementDomElement = !!expectedParam.elementDomElement;
- for (var i=0; i < param.length; i++) {
- var elem = param[i];
- e = Function._validateParameterType(elem, expectedElementType,
- expectedElementInteger, expectedElementDomElement, elementMayBeNull,
- paramName + "[" + i + "]");
- if (e) {
- e.popStackFrame();
- return e;
- }
- }
- }
- return null;
-}
-Function._validateParameterType = function Function$_validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) {
- var e, i;
- if (typeof(param) === "undefined") {
- if (mayBeNull) {
- return null;
- }
- else {
- e = Error.argumentUndefined(paramName);
- e.popStackFrame();
- return e;
- }
- }
- if (param === null) {
- if (mayBeNull) {
- return null;
- }
- else {
- e = Error.argumentNull(paramName);
- e.popStackFrame();
- return e;
- }
- }
- if (expectedType && expectedType.__enum) {
- if (typeof(param) !== 'number') {
- e = Error.argumentType(paramName, Object.getType(param), expectedType);
- e.popStackFrame();
- return e;
- }
- if ((param % 1) === 0) {
- var values = expectedType.prototype;
- if (!expectedType.__flags || (param === 0)) {
- for (i in values) {
- if (values[i] === param) return null;
- }
- }
- else {
- var v = param;
- for (i in values) {
- var vali = values[i];
- if (vali === 0) continue;
- if ((vali & param) === vali) {
- v -= vali;
- }
- if (v === 0) return null;
- }
- }
- }
- e = Error.argumentOutOfRange(paramName, param, String.format(Sys.Res.enumInvalidValue, param, expectedType.getName()));
- e.popStackFrame();
- return e;
- }
- if (expectedDomElement && (!Sys._isDomElement(param) || (param.nodeType === 3))) {
- e = Error.argument(paramName, Sys.Res.argumentDomElement);
- e.popStackFrame();
- return e;
- }
- if (expectedType && !Sys._isInstanceOfType(expectedType, param)) {
- e = Error.argumentType(paramName, Object.getType(param), expectedType);
- e.popStackFrame();
- return e;
- }
- if (expectedType === Number && expectedInteger) {
- if ((param % 1) !== 0) {
- e = Error.argumentOutOfRange(paramName, param, Sys.Res.argumentInteger);
- e.popStackFrame();
- return e;
- }
- }
- return null;
-}
-
-Error.__typeName = 'Error';
-Error.__class = true;
-Error.create = function Error$create(message, errorInfo) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "message", type: String, mayBeNull: true, optional: true},
- {name: "errorInfo", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var err = new Error(message);
- err.message = message;
- if (errorInfo) {
- for (var v in errorInfo) {
- err[v] = errorInfo[v];
- }
- }
- err.popStackFrame();
- return err;
-}
-Error.argument = function Error$argument(paramName, message) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "paramName", type: String, mayBeNull: true, optional: true},
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.ArgumentException: " + (message ? message : Sys.Res.argument);
- if (paramName) {
- displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
- }
- var err = Error.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName });
- err.popStackFrame();
- return err;
-}
-Error.argumentNull = function Error$argumentNull(paramName, message) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "paramName", type: String, mayBeNull: true, optional: true},
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.ArgumentNullException: " + (message ? message : Sys.Res.argumentNull);
- if (paramName) {
- displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
- }
- var err = Error.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName });
- err.popStackFrame();
- return err;
-}
-Error.argumentOutOfRange = function Error$argumentOutOfRange(paramName, actualValue, message) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "paramName", type: String, mayBeNull: true, optional: true},
- {name: "actualValue", mayBeNull: true, optional: true},
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : Sys.Res.argumentOutOfRange);
- if (paramName) {
- displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
- }
- if (typeof(actualValue) !== "undefined" && actualValue !== null) {
- displayMessage += "\n" + String.format(Sys.Res.actualValue, actualValue);
- }
- var err = Error.create(displayMessage, {
- name: "Sys.ArgumentOutOfRangeException",
- paramName: paramName,
- actualValue: actualValue
- });
- err.popStackFrame();
- return err;
-}
-Error.argumentType = function Error$argumentType(paramName, actualType, expectedType, message) {
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "paramName", type: String, mayBeNull: true, optional: true},
- {name: "actualType", type: Type, mayBeNull: true, optional: true},
- {name: "expectedType", type: Type, mayBeNull: true, optional: true},
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.ArgumentTypeException: ";
- if (message) {
- displayMessage += message;
- }
- else if (actualType && expectedType) {
- displayMessage +=
- String.format(Sys.Res.argumentTypeWithTypes, actualType.getName(), expectedType.getName());
- }
- else {
- displayMessage += Sys.Res.argumentType;
- }
- if (paramName) {
- displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
- }
- var err = Error.create(displayMessage, {
- name: "Sys.ArgumentTypeException",
- paramName: paramName,
- actualType: actualType,
- expectedType: expectedType
- });
- err.popStackFrame();
- return err;
-}
-Error.argumentUndefined = function Error$argumentUndefined(paramName, message) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "paramName", type: String, mayBeNull: true, optional: true},
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : Sys.Res.argumentUndefined);
- if (paramName) {
- displayMessage += "\n" + String.format(Sys.Res.paramName, paramName);
- }
- var err = Error.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName });
- err.popStackFrame();
- return err;
-}
-Error.format = function Error$format(message) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.FormatException: " + (message ? message : Sys.Res.format);
- var err = Error.create(displayMessage, {name: 'Sys.FormatException'});
- err.popStackFrame();
- return err;
-}
-Error.invalidOperation = function Error$invalidOperation(message) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.InvalidOperationException: " + (message ? message : Sys.Res.invalidOperation);
- var err = Error.create(displayMessage, {name: 'Sys.InvalidOperationException'});
- err.popStackFrame();
- return err;
-}
-Error.notImplemented = function Error$notImplemented(message) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.NotImplementedException: " + (message ? message : Sys.Res.notImplemented);
- var err = Error.create(displayMessage, {name: 'Sys.NotImplementedException'});
- err.popStackFrame();
- return err;
-}
-Error.parameterCount = function Error$parameterCount(message) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "message", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var displayMessage = "Sys.ParameterCountException: " + (message ? message : Sys.Res.parameterCount);
- var err = Error.create(displayMessage, {name: 'Sys.ParameterCountException'});
- err.popStackFrame();
- return err;
-}
-Error.prototype.popStackFrame = function Error$popStackFrame() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (typeof(this.stack) === "undefined" || this.stack === null ||
- typeof(this.fileName) === "undefined" || this.fileName === null ||
- typeof(this.lineNumber) === "undefined" || this.lineNumber === null) {
- return;
- }
- var stackFrames = this.stack.split("\n");
- var currentFrame = stackFrames[0];
- var pattern = this.fileName + ":" + this.lineNumber;
- while(typeof(currentFrame) !== "undefined" &&
- currentFrame !== null &&
- currentFrame.indexOf(pattern) === -1) {
- stackFrames.shift();
- currentFrame = stackFrames[0];
- }
- var nextFrame = stackFrames[1];
- if (typeof(nextFrame) === "undefined" || nextFrame === null) {
- return;
- }
- var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/);
- if (typeof(nextFrameParts) === "undefined" || nextFrameParts === null) {
- return;
- }
- this.fileName = nextFrameParts[1];
- this.lineNumber = parseInt(nextFrameParts[2]);
- stackFrames.shift();
- this.stack = stackFrames.join("\n");
-}
-
-Object.__typeName = 'Object';
-Object.__class = true;
-Object.getType = function Object$getType(instance) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance"}
- ]);
- if (e) throw e;
- var ctor = instance.constructor;
- if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) {
- return Object;
- }
- return ctor;
-}
-Object.getTypeName = function Object$getTypeName(instance) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance"}
- ]);
- if (e) throw e;
- return Object.getType(instance).getName();
-}
-
-String.__typeName = 'String';
-String.__class = true;
-String.prototype.endsWith = function String$endsWith(suffix) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "suffix", type: String}
- ]);
- if (e) throw e;
- return (this.substr(this.length - suffix.length) === suffix);
-}
-String.prototype.startsWith = function String$startsWith(prefix) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "prefix", type: String}
- ]);
- if (e) throw e;
- return (this.substr(0, prefix.length) === prefix);
-}
-String.prototype.trim = function String$trim() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this.replace(/^\s+|\s+$/g, '');
-}
-String.prototype.trimEnd = function String$trimEnd() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this.replace(/\s+$/, '');
-}
-String.prototype.trimStart = function String$trimStart() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this.replace(/^\s+/, '');
-}
-String.format = function String$format(format, args) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "format", type: String},
- {name: "args", mayBeNull: true, parameterArray: true}
- ]);
- if (e) throw e;
- return String._toFormattedString(false, arguments);
-}
-String._toFormattedString = function String$_toFormattedString(useLocale, args) {
- var result = '';
- var format = args[0];
- for (var i=0;;) {
- var open = format.indexOf('{', i);
- var close = format.indexOf('}', i);
- if ((open < 0) && (close < 0)) {
- result += format.slice(i);
- break;
- }
- if ((close > 0) && ((close < open) || (open < 0))) {
- if (format.charAt(close + 1) !== '}') {
- throw Error.argument('format', Sys.Res.stringFormatBraceMismatch);
- }
- result += format.slice(i, close + 1);
- i = close + 2;
- continue;
- }
- result += format.slice(i, open);
- i = open + 1;
- if (format.charAt(i) === '{') {
- result += '{';
- i++;
- continue;
- }
- if (close < 0) throw Error.argument('format', Sys.Res.stringFormatBraceMismatch);
- var brace = format.substring(i, close);
- var colonIndex = brace.indexOf(':');
- var argNumber = parseInt((colonIndex < 0)? brace : brace.substring(0, colonIndex), 10) + 1;
- if (isNaN(argNumber)) throw Error.argument('format', Sys.Res.stringFormatInvalid);
- var argFormat = (colonIndex < 0)? '' : brace.substring(colonIndex + 1);
- var arg = args[argNumber];
- if (typeof(arg) === "undefined" || arg === null) {
- arg = '';
- }
- if (arg.toFormattedString) {
- result += arg.toFormattedString(argFormat);
- }
- else if (useLocale && arg.localeFormat) {
- result += arg.localeFormat(argFormat);
- }
- else if (arg.format) {
- result += arg.format(argFormat);
- }
- else
- result += arg.toString();
- i = close + 1;
- }
- return result;
-}
-
-Boolean.__typeName = 'Boolean';
-Boolean.__class = true;
-Boolean.parse = function Boolean$parse(value) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String}
- ], false);
- if (e) throw e;
- var v = value.trim().toLowerCase();
- if (v === 'false') return false;
- if (v === 'true') return true;
- throw Error.argumentOutOfRange('value', value, Sys.Res.boolTrueOrFalse);
-}
-
-Date.__typeName = 'Date';
-Date.__class = true;
-
-Number.__typeName = 'Number';
-Number.__class = true;
-
-RegExp.__typeName = 'RegExp';
-RegExp.__class = true;
-
-if (!window) this.window = this;
-window.Type = Function;
-Type.__fullyQualifiedIdentifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]([^ \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*[^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\])?$", "i");
-Type.__identifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\][^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*$", "i");
-Type.prototype.callBaseMethod = function Type$callBaseMethod(instance, name, baseArguments) {
- ///
- ///
- ///
- ///
- ///
- 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));
- if (!baseArguments) {
- return baseMethod.apply(instance);
- }
- else {
- return baseMethod.apply(instance, baseArguments);
- }
-}
-Type.prototype.getBaseMethod = function Type$getBaseMethod(instance, name) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance"},
- {name: "name", type: String}
- ]);
- if (e) throw e;
- return Sys._getBaseMethod(this, instance, name);
-}
-Type.prototype.getBaseType = function Type$getBaseType() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return (typeof(this.__baseType) === "undefined") ? null : this.__baseType;
-}
-Type.prototype.getInterfaces = function Type$getInterfaces() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var result = [];
- var type = this;
- while(type) {
- var interfaces = type.__interfaces;
- if (interfaces) {
- for (var i = 0, l = interfaces.length; i < l; i++) {
- var interfaceType = interfaces[i];
- if (!Array.contains(result, interfaceType)) {
- result[result.length] = interfaceType;
- }
- }
- }
- type = type.__baseType;
- }
- return result;
-}
-Type.prototype.getName = function Type$getName() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return (typeof(this.__typeName) === "undefined") ? "" : this.__typeName;
-}
-Type.prototype.implementsInterface = function Type$implementsInterface(interfaceType) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "interfaceType", type: Type}
- ]);
- if (e) throw e;
- this.resolveInheritance();
- var interfaceName = interfaceType.getName();
- var cache = this.__interfaceCache;
- if (cache) {
- var cacheEntry = cache[interfaceName];
- if (typeof(cacheEntry) !== 'undefined') return cacheEntry;
- }
- else {
- cache = this.__interfaceCache = {};
- }
- var baseType = this;
- while (baseType) {
- var interfaces = baseType.__interfaces;
- if (interfaces) {
- if (Array.indexOf(interfaces, interfaceType) !== -1) {
- return cache[interfaceName] = true;
- }
- }
- baseType = baseType.__baseType;
- }
- return cache[interfaceName] = false;
-}
-Type.prototype.inheritsFrom = function Type$inheritsFrom(parentType) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "parentType", type: Type}
- ]);
- if (e) throw e;
- this.resolveInheritance();
- var baseType = this.__baseType;
- while (baseType) {
- if (baseType === parentType) {
- return true;
- }
- baseType = baseType.__baseType;
- }
- return false;
-}
-Type.prototype.initializeBase = function Type$initializeBase(instance, baseArguments) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance"},
- {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true}
- ]);
- if (e) throw e;
- if (!Sys._isInstanceOfType(this, instance)) throw Error.argumentType('instance', Object.getType(instance), this);
- this.resolveInheritance();
- if (this.__baseType) {
- if (!baseArguments) {
- this.__baseType.apply(instance);
- }
- else {
- this.__baseType.apply(instance, baseArguments);
- }
- }
- return instance;
-}
-Type.prototype.isImplementedBy = function Type$isImplementedBy(instance) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance", mayBeNull: true}
- ]);
- if (e) throw e;
- if (typeof(instance) === "undefined" || instance === null) return false;
- var instanceType = Object.getType(instance);
- return !!(instanceType.implementsInterface && instanceType.implementsInterface(this));
-}
-Type.prototype.isInstanceOfType = function Type$isInstanceOfType(instance) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "instance", mayBeNull: true}
- ]);
- if (e) throw e;
- return Sys._isInstanceOfType(this, instance);
-}
-Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "typeName", type: String},
- {name: "baseType", type: Type, mayBeNull: true, optional: true},
- {name: "interfaceTypes", type: Type, parameterArray: true}
- ]);
- if (e) throw e;
- if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName);
- var parsedName;
- try {
- parsedName = eval(typeName);
- }
- catch(e) {
- throw Error.argument('typeName', Sys.Res.argumentTypeName);
- }
- if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName);
- if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName));
- if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType');
- if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass);
- this.prototype.constructor = this;
- this.__typeName = typeName;
- this.__class = true;
- if (baseType) {
- this.__baseType = baseType;
- this.__basePrototypePending = true;
- }
- Sys.__upperCaseTypes[typeName.toUpperCase()] = this;
- if (interfaceTypes) {
- 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 (!this.prototype[methodName]) {
- this.prototype[methodName] = method;
- }
- }
- this.__interfaces.push(interfaceType);
- }
- }
- Sys.__registeredTypes[typeName] = true;
- return this;
-}
-Type.prototype.registerInterface = function Type$registerInterface(typeName) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "typeName", type: String}
- ]);
- if (e) throw e;
- if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName);
- var parsedName;
- try {
- parsedName = eval(typeName);
- }
- catch(e) {
- throw Error.argument('typeName', Sys.Res.argumentTypeName);
- }
- if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName);
- if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName));
- Sys.__upperCaseTypes[typeName.toUpperCase()] = this;
- this.prototype.constructor = this;
- this.__typeName = typeName;
- this.__interface = true;
- Sys.__registeredTypes[typeName] = true;
- return this;
-}
-Type.prototype.resolveInheritance = function Type$resolveInheritance() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this.__basePrototypePending) {
- var baseType = this.__baseType;
- baseType.resolveInheritance();
- for (var memberName in baseType.prototype) {
- var memberValue = baseType.prototype[memberName];
- if (!this.prototype[memberName]) {
- this.prototype[memberName] = memberValue;
- }
- }
- delete this.__basePrototypePending;
- }
-}
-Type.getRootNamespaces = function Type$getRootNamespaces() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return Array.clone(Sys.__rootNamespaces);
-}
-Type.isClass = function Type$isClass(type) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "type", mayBeNull: true}
- ]);
- if (e) throw e;
- if ((typeof(type) === 'undefined') || (type === null)) return false;
- return !!type.__class;
-}
-Type.isInterface = function Type$isInterface(type) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "type", mayBeNull: true}
- ]);
- if (e) throw e;
- if ((typeof(type) === 'undefined') || (type === null)) return false;
- return !!type.__interface;
-}
-Type.isNamespace = function Type$isNamespace(object) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "object", mayBeNull: true}
- ]);
- if (e) throw e;
- if ((typeof(object) === 'undefined') || (object === null)) return false;
- return !!object.__namespace;
-}
-Type.parse = function Type$parse(typeName, ns) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "typeName", type: String, mayBeNull: true},
- {name: "ns", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var fn;
- if (ns) {
- fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + '.' + typeName.toUpperCase()];
- return fn || null;
- }
- if (!typeName) return null;
- if (!Type.__htClasses) {
- Type.__htClasses = {};
- }
- fn = Type.__htClasses[typeName];
- if (!fn) {
- fn = eval(typeName);
- if (typeof(fn) !== 'function') throw Error.argument('typeName', Sys.Res.notATypeName);
- Type.__htClasses[typeName] = fn;
- }
- return fn;
-}
-Type.registerNamespace = function Type$registerNamespace(namespacePath) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "namespacePath", type: String}
- ]);
- if (e) throw e;
- Type._registerNamespace(namespacePath);
-}
-Type._registerNamespace = function Type$_registerNamespace(namespacePath) {
- if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace);
- var rootObject = window;
- var namespaceParts = namespacePath.split('.');
- for (var i = 0; i < namespaceParts.length; i++) {
- var currentPart = namespaceParts[i];
- var ns = rootObject[currentPart];
- var nsType = typeof(ns);
- if ((nsType !== "undefined") && (ns !== null)) {
- if (nsType === "function") {
- throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsClass, namespaceParts.splice(0, i + 1).join('.')));
- }
- if ((typeof(ns) !== "object") || (ns instanceof Array)) {
- throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsNonObject, namespaceParts.splice(0, i + 1).join('.')));
- }
- }
- if (!ns) {
- ns = rootObject[currentPart] = {};
- }
- if (!ns.__namespace) {
- if ((i === 0) && (namespacePath !== "Sys")) {
- Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns;
- }
- ns.__namespace = true;
- ns.__typeName = namespaceParts.slice(0, i + 1).join('.');
- var parsedName;
- try {
- parsedName = eval(ns.__typeName);
- }
- catch(e) {
- parsedName = null;
- }
- if (parsedName !== ns) {
- delete rootObject[currentPart];
- throw Error.argument('namespacePath', Sys.Res.invalidNameSpace);
- }
- ns.getName = function ns$getName() {return this.__typeName;}
- }
- rootObject = ns;
- }
-}
-Type._checkDependency = function Type$_checkDependency(dependency, featureName) {
- var scripts = Type._registerScript._scripts, isDependent = (scripts ? (!!scripts[dependency]) : false);
- if ((typeof(featureName) !== 'undefined') && !isDependent) {
- throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded,
- featureName, dependency));
- }
- return isDependent;
-}
-Type._registerScript = function Type$_registerScript(scriptName, dependencies) {
- var scripts = Type._registerScript._scripts;
- if (!scripts) {
- Type._registerScript._scripts = scripts = {};
- }
- if (scripts[scriptName]) {
- throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, scriptName));
- }
- scripts[scriptName] = true;
- if (dependencies) {
- for (var i = 0, l = dependencies.length; i < l; i++) {
- var dependency = dependencies[i];
- if (!Type._checkDependency(dependency)) {
- throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, scriptName, dependency));
- }
- }
- }
-}
-Type._registerNamespace("Sys");
-Sys.__upperCaseTypes = {};
-Sys.__rootNamespaces = [Sys];
-Sys.__registeredTypes = {};
-Sys._isInstanceOfType = function Sys$_isInstanceOfType(type, instance) {
- if (typeof(instance) === "undefined" || instance === null) return false;
- if (instance instanceof type) return true;
- var instanceType = Object.getType(instance);
- return !!(instanceType === type) ||
- (instanceType.inheritsFrom && instanceType.inheritsFrom(type)) ||
- (instanceType.implementsInterface && instanceType.implementsInterface(type));
-}
-Sys._getBaseMethod = function Sys$_getBaseMethod(type, instance, name) {
- if (!Sys._isInstanceOfType(type, instance)) throw Error.argumentType('instance', Object.getType(instance), type);
- var baseType = type.getBaseType();
- if (baseType) {
- var baseMethod = baseType.prototype[name];
- return (baseMethod instanceof Function) ? baseMethod : null;
- }
- return null;
-}
-Sys._isDomElement = function Sys$_isDomElement(obj) {
- var val = false;
- if (typeof (obj.nodeType) !== 'number') {
- var doc = obj.ownerDocument || obj.document || obj;
- if (doc != obj) {
- var w = doc.defaultView || doc.parentWindow;
- val = (w != obj);
- }
- else {
- val = (typeof (doc.body) === 'undefined');
- }
- }
- return !val;
-}
-
-Array.__typeName = 'Array';
-Array.__class = true;
-Array.add = Array.enqueue = function Array$enqueue(array, item) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- array[array.length] = item;
-}
-Array.addRange = function Array$addRange(array, items) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "items", type: Array, elementMayBeNull: true}
- ]);
- if (e) throw e;
- array.push.apply(array, items);
-}
-Array.clear = function Array$clear(array) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true}
- ]);
- if (e) throw e;
- array.length = 0;
-}
-Array.clone = function Array$clone(array) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true}
- ]);
- if (e) throw e;
- if (array.length === 1) {
- return [array[0]];
- }
- else {
- return Array.apply(null, array);
- }
-}
-Array.contains = function Array$contains(array, item) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- return (Sys._indexOf(array, item) >= 0);
-}
-Array.dequeue = function Array$dequeue(array) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true}
- ]);
- if (e) throw e;
- return array.shift();
-}
-Array.forEach = function Array$forEach(array, method, instance) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "method", type: Function},
- {name: "instance", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- for (var i = 0, l = array.length; i < l; i++) {
- var elt = array[i];
- if (typeof(elt) !== 'undefined') method.call(instance, elt, i, array);
- }
-}
-Array.indexOf = function Array$indexOf(array, item, start) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "item", mayBeNull: true, optional: true},
- {name: "start", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- return Sys._indexOf(array, item, start);
-}
-Array.insert = function Array$insert(array, index, item) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "index", mayBeNull: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- array.splice(index, 0, item);
-}
-Array.parse = function Array$parse(value) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String, mayBeNull: true}
- ]);
- if (e) throw e;
- if (!value) return [];
- var v = eval(value);
- if (!Array.isInstanceOfType(v)) throw Error.argument('value', Sys.Res.arrayParseBadFormat);
- return v;
-}
-Array.remove = function Array$remove(array, item) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- var index = Sys._indexOf(array, item);
- if (index >= 0) {
- array.splice(index, 1);
- }
- return (index >= 0);
-}
-Array.removeAt = function Array$removeAt(array, index) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "array", type: Array, elementMayBeNull: true},
- {name: "index", mayBeNull: true}
- ]);
- if (e) throw e;
- array.splice(index, 1);
-}
-Sys._indexOf = function Sys$_indexOf(array, item, start) {
- if (typeof(item) === "undefined") return -1;
- var length = array.length;
- if (length !== 0) {
- start = start - 0;
- if (isNaN(start)) {
- start = 0;
- }
- else {
- if (isFinite(start)) {
- start = start - (start % 1);
- }
- if (start < 0) {
- start = Math.max(0, length + start);
- }
- }
- for (var i = start; i < length; i++) {
- if ((typeof(array[i]) !== "undefined") && (array[i] === item)) {
- return i;
- }
- }
- }
- return -1;
-}
-Type._registerScript._scripts = {
- "MicrosoftAjaxCore.js": true,
- "MicrosoftAjaxGlobalization.js": true,
- "MicrosoftAjaxSerialization.js": true,
- "MicrosoftAjaxComponentModel.js": true,
- "MicrosoftAjaxHistory.js": true,
- "MicrosoftAjaxNetwork.js" : true,
- "MicrosoftAjaxWebServices.js": true };
-
-Sys.IDisposable = function Sys$IDisposable() {
- throw Error.notImplemented();
-}
- function Sys$IDisposable$dispose() {
- throw Error.notImplemented();
- }
-Sys.IDisposable.prototype = {
- dispose: Sys$IDisposable$dispose
-}
-Sys.IDisposable.registerInterface('Sys.IDisposable');
-
-Sys.StringBuilder = function Sys$StringBuilder(initialText) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "initialText", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- this._parts = (typeof(initialText) !== 'undefined' && initialText !== null && initialText !== '') ?
- [initialText.toString()] : [];
- this._value = {};
- this._len = 0;
-}
- function Sys$StringBuilder$append(text) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "text", mayBeNull: true}
- ]);
- if (e) throw e;
- this._parts[this._parts.length] = text;
- }
- function Sys$StringBuilder$appendLine(text) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "text", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- this._parts[this._parts.length] =
- ((typeof(text) === 'undefined') || (text === null) || (text === '')) ?
- '\r\n' : text + '\r\n';
- }
- function Sys$StringBuilder$clear() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._parts = [];
- this._value = {};
- this._len = 0;
- }
- function Sys$StringBuilder$isEmpty() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this._parts.length === 0) return true;
- return this.toString() === '';
- }
- function Sys$StringBuilder$toString(separator) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "separator", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- separator = separator || '';
- var parts = this._parts;
- if (this._len !== parts.length) {
- this._value = {};
- this._len = parts.length;
- }
- var val = this._value;
- if (typeof(val[separator]) === 'undefined') {
- if (separator !== '') {
- for (var i = 0; i < parts.length;) {
- if ((typeof(parts[i]) === 'undefined') || (parts[i] === '') || (parts[i] === null)) {
- parts.splice(i, 1);
- }
- else {
- i++;
- }
- }
- }
- val[separator] = this._parts.join(separator);
- }
- return val[separator];
- }
-Sys.StringBuilder.prototype = {
- append: Sys$StringBuilder$append,
- appendLine: Sys$StringBuilder$appendLine,
- clear: Sys$StringBuilder$clear,
- isEmpty: Sys$StringBuilder$isEmpty,
- toString: Sys$StringBuilder$toString
-}
-Sys.StringBuilder.registerClass('Sys.StringBuilder');
-
-Sys.Browser = {};
-Sys.Browser.InternetExplorer = {};
-Sys.Browser.Firefox = {};
-Sys.Browser.Safari = {};
-Sys.Browser.Opera = {};
-Sys.Browser.agent = null;
-Sys.Browser.hasDebuggerStatement = false;
-Sys.Browser.name = navigator.appName;
-Sys.Browser.version = parseFloat(navigator.appVersion);
-Sys.Browser.documentMode = 0;
-if (navigator.userAgent.indexOf(' MSIE ') > -1) {
- Sys.Browser.agent = Sys.Browser.InternetExplorer;
- Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);
- if (Sys.Browser.version >= 8) {
- if (document.documentMode >= 7) {
- Sys.Browser.documentMode = document.documentMode;
- }
- }
- Sys.Browser.hasDebuggerStatement = true;
-}
-else if (navigator.userAgent.indexOf(' Firefox/') > -1) {
- Sys.Browser.agent = Sys.Browser.Firefox;
- Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Firefox\/(\d+\.\d+)/)[1]);
- Sys.Browser.name = 'Firefox';
- Sys.Browser.hasDebuggerStatement = true;
-}
-else if (navigator.userAgent.indexOf(' AppleWebKit/') > -1) {
- Sys.Browser.agent = Sys.Browser.Safari;
- Sys.Browser.version = parseFloat(navigator.userAgent.match(/ AppleWebKit\/(\d+(\.\d+)?)/)[1]);
- Sys.Browser.name = 'Safari';
-}
-else if (navigator.userAgent.indexOf('Opera/') > -1) {
- Sys.Browser.agent = Sys.Browser.Opera;
-}
-
-Sys.EventArgs = function Sys$EventArgs() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
-}
-Sys.EventArgs.registerClass('Sys.EventArgs');
-Sys.EventArgs.Empty = new Sys.EventArgs();
-
-Sys.CancelEventArgs = function Sys$CancelEventArgs() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- Sys.CancelEventArgs.initializeBase(this);
- this._cancel = false;
-}
- function Sys$CancelEventArgs$get_cancel() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._cancel;
- }
- function Sys$CancelEventArgs$set_cancel(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
- if (e) throw e;
- this._cancel = value;
- }
-Sys.CancelEventArgs.prototype = {
- get_cancel: Sys$CancelEventArgs$get_cancel,
- set_cancel: Sys$CancelEventArgs$set_cancel
-}
-Sys.CancelEventArgs.registerClass('Sys.CancelEventArgs', Sys.EventArgs);
-Type.registerNamespace('Sys.UI');
-
-Sys._Debug = function Sys$_Debug() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
-}
- function Sys$_Debug$_appendConsole(text) {
- if ((typeof(Debug) !== 'undefined') && Debug.writeln) {
- Debug.writeln(text);
- }
- if (window.console && window.console.log) {
- window.console.log(text);
- }
- if (window.opera) {
- window.opera.postError(text);
- }
- if (window.debugService) {
- window.debugService.trace(text);
- }
- }
- function Sys$_Debug$_appendTrace(text) {
- var traceElement = document.getElementById('TraceConsole');
- if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) {
- traceElement.value += text + '\n';
- }
- }
- function Sys$_Debug$assert(condition, message, displayCaller) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "condition", type: Boolean},
- {name: "message", type: String, mayBeNull: true, optional: true},
- {name: "displayCaller", type: Boolean, optional: true}
- ]);
- if (e) throw e;
- if (!condition) {
- message = (displayCaller && this.assert.caller) ?
- String.format(Sys.Res.assertFailedCaller, message, this.assert.caller) :
- String.format(Sys.Res.assertFailed, message);
- if (confirm(String.format(Sys.Res.breakIntoDebugger, message))) {
- this.fail(message);
- }
- }
- }
- function Sys$_Debug$clearTrace() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var traceElement = document.getElementById('TraceConsole');
- if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) {
- traceElement.value = '';
- }
- }
- function Sys$_Debug$fail(message) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "message", type: String, mayBeNull: true}
- ]);
- if (e) throw e;
- this._appendConsole(message);
- if (Sys.Browser.hasDebuggerStatement) {
- eval('debugger');
- }
- }
- function Sys$_Debug$trace(text) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "text"}
- ]);
- if (e) throw e;
- this._appendConsole(text);
- this._appendTrace(text);
- }
- function Sys$_Debug$traceDump(object, name) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "object", mayBeNull: true},
- {name: "name", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var text = this._traceDump(object, name, true);
- }
- function Sys$_Debug$_traceDump(object, name, recursive, indentationPadding, loopArray) {
- name = name? name : 'traceDump';
- indentationPadding = indentationPadding? indentationPadding : '';
- if (object === null) {
- this.trace(indentationPadding + name + ': null');
- return;
- }
- switch(typeof(object)) {
- case 'undefined':
- this.trace(indentationPadding + name + ': Undefined');
- break;
- case 'number': case 'string': case 'boolean':
- this.trace(indentationPadding + name + ': ' + object);
- break;
- default:
- if (Date.isInstanceOfType(object) || RegExp.isInstanceOfType(object)) {
- this.trace(indentationPadding + name + ': ' + object.toString());
- break;
- }
- if (!loopArray) {
- loopArray = [];
- }
- else if (Array.contains(loopArray, object)) {
- this.trace(indentationPadding + name + ': ...');
- return;
- }
- Array.add(loopArray, object);
- if ((object == window) || (object === document) ||
- (window.HTMLElement && (object instanceof HTMLElement)) ||
- (typeof(object.nodeName) === 'string')) {
- var tag = object.tagName? object.tagName : 'DomElement';
- if (object.id) {
- tag += ' - ' + object.id;
- }
- this.trace(indentationPadding + name + ' {' + tag + '}');
- }
- else {
- var typeName = Object.getTypeName(object);
- this.trace(indentationPadding + name + (typeof(typeName) === 'string' ? ' {' + typeName + '}' : ''));
- if ((indentationPadding === '') || recursive) {
- indentationPadding += " ";
- var i, length, properties, p, v;
- if (Array.isInstanceOfType(object)) {
- length = object.length;
- for (i = 0; i < length; i++) {
- this._traceDump(object[i], '[' + i + ']', recursive, indentationPadding, loopArray);
- }
- }
- else {
- for (p in object) {
- v = object[p];
- if (!Function.isInstanceOfType(v)) {
- this._traceDump(v, p, recursive, indentationPadding, loopArray);
- }
- }
- }
- }
- }
- Array.remove(loopArray, object);
- }
- }
-Sys._Debug.prototype = {
- _appendConsole: Sys$_Debug$_appendConsole,
- _appendTrace: Sys$_Debug$_appendTrace,
- assert: Sys$_Debug$assert,
- clearTrace: Sys$_Debug$clearTrace,
- fail: Sys$_Debug$fail,
- trace: Sys$_Debug$trace,
- traceDump: Sys$_Debug$traceDump,
- _traceDump: Sys$_Debug$_traceDump
-}
-Sys._Debug.registerClass('Sys._Debug');
-Sys.Debug = new Sys._Debug();
- Sys.Debug.isDebug = true;
-
-function Sys$Enum$parse(value, ignoreCase) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String},
- {name: "ignoreCase", type: Boolean, optional: true}
- ]);
- if (e) throw e;
- var values, parsed, val;
- if (ignoreCase) {
- values = this.__lowerCaseValues;
- if (!values) {
- this.__lowerCaseValues = values = {};
- var prototype = this.prototype;
- for (var name in prototype) {
- values[name.toLowerCase()] = prototype[name];
- }
- }
- }
- else {
- values = this.prototype;
- }
- if (!this.__flags) {
- val = (ignoreCase ? value.toLowerCase() : value);
- parsed = values[val.trim()];
- if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value, this.__typeName));
- return parsed;
- }
- else {
- var parts = (ignoreCase ? value.toLowerCase() : value).split(',');
- var v = 0;
- for (var i = parts.length - 1; i >= 0; i--) {
- var part = parts[i].trim();
- parsed = values[part];
- if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value.split(',')[i].trim(), this.__typeName));
- v |= parsed;
- }
- return v;
- }
-}
-function Sys$Enum$toString(value) {
- ///
- ///
- ///
- 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[sorted.length] = {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[parts.length] = 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.prototype.registerEnum = function Type$registerEnum(name, flags) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "name", type: String},
- {name: "flags", type: Boolean, optional: true}
- ]);
- if (e) throw e;
- if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName);
- var parsedName;
- try {
- parsedName = eval(name);
- }
- catch(e) {
- throw Error.argument('name', Sys.Res.argumentTypeName);
- }
- if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName);
- if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name));
- for (var j in this.prototype) {
- var val = this.prototype[j];
- if (!Type.__identifierRegExp.test(j)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, j));
- if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger);
- if (typeof(this[j]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, j));
- }
- Sys.__upperCaseTypes[name.toUpperCase()] = this;
- for (var i in this.prototype) {
- this[i] = this.prototype[i];
- }
- this.__typeName = name;
- this.parse = Sys$Enum$parse;
- this.__string = this.toString();
- this.toString = Sys$Enum$toString;
- this.__flags = flags;
- this.__enum = true;
- Sys.__registeredTypes[name] = true;
-}
-Type.isEnum = function Type$isEnum(type) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "type", mayBeNull: true}
- ]);
- if (e) throw e;
- if ((typeof(type) === 'undefined') || (type === null)) return false;
- return !!type.__enum;
-}
-Type.isFlags = function Type$isFlags(type) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "type", mayBeNull: true}
- ]);
- if (e) throw e;
- if ((typeof(type) === 'undefined') || (type === null)) return false;
- return !!type.__flags;
-}
-Sys.CollectionChange = function Sys$CollectionChange(action, newItems, newStartingIndex, oldItems, oldStartingIndex) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "action", type: Sys.NotifyCollectionChangedAction},
- {name: "newItems", mayBeNull: true, optional: true},
- {name: "newStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true},
- {name: "oldItems", mayBeNull: true, optional: true},
- {name: "oldStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true}
- ]);
- if (e) throw e;
- this.action = action;
- if (newItems) {
- if (!(newItems instanceof Array)) {
- newItems = [newItems];
- }
- }
- this.newItems = newItems || null;
- if (typeof newStartingIndex !== "number") {
- newStartingIndex = -1;
- }
- this.newStartingIndex = newStartingIndex;
- if (oldItems) {
- if (!(oldItems instanceof Array)) {
- oldItems = [oldItems];
- }
- }
- this.oldItems = oldItems || null;
- if (typeof oldStartingIndex !== "number") {
- oldStartingIndex = -1;
- }
- this.oldStartingIndex = oldStartingIndex;
-}
-Sys.CollectionChange.registerClass("Sys.CollectionChange");
-Sys.NotifyCollectionChangedAction = function Sys$NotifyCollectionChangedAction() {
- ///
- ///
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
-Sys.NotifyCollectionChangedAction.prototype = {
- add: 0,
- remove: 1,
- reset: 2
-}
-Sys.NotifyCollectionChangedAction.registerEnum('Sys.NotifyCollectionChangedAction');
-Sys.NotifyCollectionChangedEventArgs = function Sys$NotifyCollectionChangedEventArgs(changes) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "changes", type: Array, elementType: Sys.CollectionChange}
- ]);
- if (e) throw e;
- this._changes = changes;
- Sys.NotifyCollectionChangedEventArgs.initializeBase(this);
-}
- function Sys$NotifyCollectionChangedEventArgs$get_changes() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._changes || [];
- }
-Sys.NotifyCollectionChangedEventArgs.prototype = {
- get_changes: Sys$NotifyCollectionChangedEventArgs$get_changes
-}
-Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs);
-Sys.Observer = function Sys$Observer() {
- throw Error.invalidOperation();
-}
-Sys.Observer.registerClass("Sys.Observer");
-Sys.Observer.makeObservable = function Sys$Observer$makeObservable(target) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"}
- ]);
- if (e) throw e;
- var isArray = target instanceof Array,
- o = Sys.Observer;
- Sys.Observer._ensureObservable(target);
- if (target.setValue === o._observeMethods.setValue) return target;
- o._addMethods(target, o._observeMethods);
- if (isArray) {
- o._addMethods(target, o._arrayMethods);
- }
- return target;
-}
-Sys.Observer._ensureObservable = function Sys$Observer$_ensureObservable(target) {
- var type = typeof target;
- if ((type === "string") || (type === "number") || (type === "boolean") || (type === "date")) {
- throw Error.invalidOperation(String.format(Sys.Res.notObservable, type));
- }
-}
-Sys.Observer._addMethods = function Sys$Observer$_addMethods(target, methods) {
- for (var m in methods) {
- if (target[m] && (target[m] !== methods[m])) {
- throw Error.invalidOperation(String.format(Sys.Res.observableConflict, m));
- }
- target[m] = methods[m];
- }
-}
-Sys.Observer._addEventHandler = function Sys$Observer$_addEventHandler(target, eventName, handler) {
- Sys.Observer._getContext(target, true).events._addHandler(eventName, handler);
-}
-Sys.Observer.addEventHandler = function Sys$Observer$addEventHandler(target, eventName, handler) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "eventName", type: String},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- Sys.Observer._addEventHandler(target, eventName, handler);
-}
-Sys.Observer._removeEventHandler = function Sys$Observer$_removeEventHandler(target, eventName, handler) {
- Sys.Observer._getContext(target, true).events._removeHandler(eventName, handler);
-}
-Sys.Observer.removeEventHandler = function Sys$Observer$removeEventHandler(target, eventName, handler) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "eventName", type: String},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- Sys.Observer._removeEventHandler(target, eventName, handler);
-}
-Sys.Observer.raiseEvent = function Sys$Observer$raiseEvent(target, eventName, eventArgs) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "eventName", type: String},
- {name: "eventArgs", type: Sys.EventArgs}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- var ctx = Sys.Observer._getContext(target);
- if (!ctx) return;
- var handler = ctx.events.getHandler(eventName);
- if (handler) {
- handler(target, eventArgs);
- }
-}
-Sys.Observer.addPropertyChanged = function Sys$Observer$addPropertyChanged(target, handler) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- Sys.Observer._addEventHandler(target, "propertyChanged", handler);
-}
-Sys.Observer.removePropertyChanged = function Sys$Observer$removePropertyChanged(target, handler) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- Sys.Observer._removeEventHandler(target, "propertyChanged", handler);
-}
-Sys.Observer.beginUpdate = function Sys$Observer$beginUpdate(target) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- Sys.Observer._getContext(target, true).updating = true;
-}
-Sys.Observer.endUpdate = function Sys$Observer$endUpdate(target) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- var ctx = Sys.Observer._getContext(target);
- if (!ctx || !ctx.updating) return;
- ctx.updating = false;
- var dirty = ctx.dirty;
- ctx.dirty = false;
- if (dirty) {
- if (target instanceof Array) {
- var changes = ctx.changes;
- ctx.changes = null;
- Sys.Observer.raiseCollectionChanged(target, changes);
- }
- Sys.Observer.raisePropertyChanged(target, "");
- }
-}
-Sys.Observer.isUpdating = function Sys$Observer$isUpdating(target) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- var ctx = Sys.Observer._getContext(target);
- return ctx ? ctx.updating : false;
-}
-Sys.Observer._setValue = function Sys$Observer$_setValue(target, propertyName, value) {
- var getter, setter, mainTarget = target, path = propertyName.split('.');
- for (var i = 0, l = (path.length - 1); i < l ; i++) {
- var name = path[i];
- getter = target["get_" + name];
- if (typeof (getter) === "function") {
- target = getter.call(target);
- }
- else {
- target = target[name];
- }
- var type = typeof (target);
- if ((target === null) || (type === "undefined")) {
- throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, propertyName));
- }
- }
- var currentValue, lastPath = path[l];
- getter = target["get_" + lastPath];
- setter = target["set_" + lastPath];
- if (typeof(getter) === 'function') {
- currentValue = getter.call(target);
- }
- else {
- currentValue = target[lastPath];
- }
- if (typeof(setter) === 'function') {
- setter.call(target, value);
- }
- else {
- target[lastPath] = value;
- }
- if (currentValue !== value) {
- var ctx = Sys.Observer._getContext(mainTarget);
- if (ctx && ctx.updating) {
- ctx.dirty = true;
- return;
- };
- Sys.Observer.raisePropertyChanged(mainTarget, path[0]);
- }
-}
-Sys.Observer.setValue = function Sys$Observer$setValue(target, propertyName, value) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "propertyName", type: String},
- {name: "value", mayBeNull: true}
- ]);
- if (e) throw e;
- Sys.Observer._ensureObservable(target);
- Sys.Observer._setValue(target, propertyName, value);
-}
-Sys.Observer.raisePropertyChanged = function Sys$Observer$raisePropertyChanged(target, propertyName) {
- ///
- ///
- ///
- Sys.Observer.raiseEvent(target, "propertyChanged", new Sys.PropertyChangedEventArgs(propertyName));
-}
-Sys.Observer.addCollectionChanged = function Sys$Observer$addCollectionChanged(target, handler) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._addEventHandler(target, "collectionChanged", handler);
-}
-Sys.Observer.removeCollectionChanged = function Sys$Observer$removeCollectionChanged(target, handler) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._removeEventHandler(target, "collectionChanged", handler);
-}
-Sys.Observer._collectionChange = function Sys$Observer$_collectionChange(target, change) {
- var ctx = Sys.Observer._getContext(target);
- if (ctx && ctx.updating) {
- ctx.dirty = true;
- var changes = ctx.changes;
- if (!changes) {
- ctx.changes = changes = [change];
- }
- else {
- changes.push(change);
- }
- }
- else {
- Sys.Observer.raiseCollectionChanged(target, [change]);
- Sys.Observer.raisePropertyChanged(target, 'length');
- }
-}
-Sys.Observer.add = function Sys$Observer$add(target, item) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], target.length);
- Array.add(target, item);
- Sys.Observer._collectionChange(target, change);
-}
-Sys.Observer.addRange = function Sys$Observer$addRange(target, items) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "items", type: Array, elementMayBeNull: true}
- ]);
- if (e) throw e;
- var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, items, target.length);
- Array.addRange(target, items);
- Sys.Observer._collectionChange(target, change);
-}
-Sys.Observer.clear = function Sys$Observer$clear(target) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true}
- ]);
- if (e) throw e;
- var oldItems = Array.clone(target);
- Array.clear(target);
- Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset, null, -1, oldItems, 0));
-}
-Sys.Observer.insert = function Sys$Observer$insert(target, index, item) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "index", type: Number, integer: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- Array.insert(target, index, item);
- Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], index));
-}
-Sys.Observer.remove = function Sys$Observer$remove(target, item) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "item", mayBeNull: true}
- ]);
- if (e) throw e;
- var index = Array.indexOf(target, item);
- if (index !== -1) {
- Array.remove(target, item);
- Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index));
- return true;
- }
- return false;
-}
-Sys.Observer.removeAt = function Sys$Observer$removeAt(target, index) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target", type: Array, elementMayBeNull: true},
- {name: "index", type: Number, integer: true}
- ]);
- if (e) throw e;
- if ((index > -1) && (index < target.length)) {
- var item = target[index];
- Array.removeAt(target, index);
- Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index));
- }
-}
-Sys.Observer.raiseCollectionChanged = function Sys$Observer$raiseCollectionChanged(target, changes) {
- ///
- ///
- ///
- Sys.Observer.raiseEvent(target, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes));
-}
-Sys.Observer._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) {
- ///
- ///
- ///
- 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) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "eventName", type: String},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.Observer._removeEventHandler(this, eventName, handler);
- },
- get_isUpdating: function() {
- ///
- ///
- return Sys.Observer.isUpdating(this);
- },
- beginUpdate: function() {
- ///
- Sys.Observer.beginUpdate(this);
- },
- endUpdate: function() {
- ///
- Sys.Observer.endUpdate(this);
- },
- setValue: function(name, value) {
- ///
- ///
- ///
- 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) {
- ///
- ///
- ///
- Sys.Observer.raiseEvent(this, eventName, eventArgs);
- },
- raisePropertyChanged: function(name) {
- ///
- ///
- Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(name));
- }
-}
-Sys.Observer._arrayMethods = {
- add_collectionChanged: function(handler) {
- Sys.Observer._addEventHandler(this, "collectionChanged", handler);
- },
- remove_collectionChanged: function(handler) {
- Sys.Observer._removeEventHandler(this, "collectionChanged", handler);
- },
- add: function(item) {
- ///
- ///
- Sys.Observer.add(this, item);
- },
- addRange: function(items) {
- ///
- ///
- Sys.Observer.addRange(this, items);
- },
- clear: function() {
- ///
- Sys.Observer.clear(this);
- },
- insert: function(index, item) {
- ///
- ///
- ///
- Sys.Observer.insert(this, index, item);
- },
- remove: function(item) {
- ///
- ///
- ///
- return Sys.Observer.remove(this, item);
- },
- removeAt: function(index) {
- ///
- ///
- Sys.Observer.removeAt(this, index);
- },
- raiseCollectionChanged: function(changes) {
- ///
- ///
- Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes));
- }
-}
-Sys.Observer._getContext = function Sys$Observer$_getContext(obj, create) {
- var ctx = obj._observerContext;
- if (ctx) return ctx();
- if (create) {
- return (obj._observerContext = Sys.Observer._createContext())();
- }
- return null;
-}
-Sys.Observer._createContext = function Sys$Observer$_createContext() {
- var ctx = {
- events: new Sys.EventHandlerList()
- };
- return function() {
- return ctx;
- }
-}
-Date._appendPreOrPostMatch = function Date$_appendPreOrPostMatch(preMatch, strBuilder) {
- var quoteCount = 0;
- var escaped = false;
- for (var i = 0, il = preMatch.length; i < il; i++) {
- var c = preMatch.charAt(i);
- switch (c) {
- case '\'':
- if (escaped) strBuilder.append("'");
- else quoteCount++;
- escaped = false;
- break;
- case '\\':
- if (escaped) strBuilder.append("\\");
- escaped = !escaped;
- break;
- default:
- strBuilder.append(c);
- escaped = false;
- break;
- }
- }
- return quoteCount;
-}
-Date._expandFormat = function Date$_expandFormat(dtf, format) {
- if (!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;
-}
-Date._expandYear = function Date$_expandYear(dtf, year) {
- var now = new Date(),
- era = Date._getEra(now);
- if (year < 100) {
- var curr = Date._getEraYear(now, dtf, era);
- year += curr - (curr % 100);
- if (year > dtf.Calendar.TwoDigitYearMax) {
- year -= 100;
- }
- }
- return year;
-}
-Date._getEra = function Date$_getEra(date, eras) {
- if (!eras) return 0;
- var start, ticks = date.getTime();
- for (var i = 0, l = eras.length; i < l; i += 4) {
- start = eras[i+2];
- if ((start === null) || (ticks >= start)) {
- return i;
- }
- }
- return 0;
-}
-Date._getEraYear = function Date$_getEraYear(date, dtf, era, sortable) {
- var year = date.getFullYear();
- if (!sortable && dtf.eras) {
- year -= dtf.eras[era + 3];
- }
- return year;
-}
-Date._getParseRegExp = function Date$_getParseRegExp(dtf, format) {
- if (!dtf._parseRegExp) {
- dtf._parseRegExp = {};
- }
- else if (dtf._parseRegExp[format]) {
- return dtf._parseRegExp[format];
- }
- var expFormat = Date._expandFormat(dtf, format);
- expFormat = expFormat.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1");
- var regexp = new Sys.StringBuilder("^");
- var groups = [];
- var index = 0;
- var quoteCount = 0;
- var tokenRegExp = Date._getTokenRegExp();
- var match;
- while ((match = tokenRegExp.exec(expFormat)) !== null) {
- var preMatch = expFormat.slice(index, match.index);
- index = tokenRegExp.lastIndex;
- quoteCount += Date._appendPreOrPostMatch(preMatch, regexp);
- if ((quoteCount%2) === 1) {
- regexp.append(match[0]);
- continue;
- }
- switch (match[0]) {
- case 'dddd': case 'ddd':
- case 'MMMM': case 'MMM':
- case 'gg': case 'g':
- regexp.append("(\\D+)");
- break;
- case 'tt': case 't':
- regexp.append("(\\D*)");
- break;
- case 'yyyy':
- regexp.append("(\\d{4})");
- break;
- case 'fff':
- regexp.append("(\\d{3})");
- break;
- case 'ff':
- regexp.append("(\\d{2})");
- break;
- case 'f':
- regexp.append("(\\d)");
- 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':
- regexp.append("(\\d\\d?)");
- break;
- case 'zzz':
- regexp.append("([+-]?\\d\\d?:\\d{2})");
- break;
- case 'zz': case 'z':
- regexp.append("([+-]?\\d\\d?)");
- break;
- case '/':
- regexp.append("(\\" + dtf.DateSeparator + ")");
- break;
- default:
- Sys.Debug.fail("Invalid date format pattern");
- }
- Array.add(groups, match[0]);
- }
- Date._appendPreOrPostMatch(expFormat.slice(index), regexp);
- regexp.append("$");
- var regexpStr = regexp.toString().replace(/\s+/g, "\\s+");
- var parseRegExp = {'regExp': regexpStr, 'groups': groups};
- dtf._parseRegExp[format] = parseRegExp;
- return parseRegExp;
-}
-Date._getTokenRegExp = function Date$_getTokenRegExp() {
- return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g;
-}
-Date.parseLocale = function Date$parseLocale(value, formats) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String},
- {name: "formats", mayBeNull: true, optional: true, parameterArray: true}
- ]);
- if (e) throw e;
- return Date._parse(value, Sys.CultureInfo.CurrentCulture, arguments);
-}
-Date.parseInvariant = function Date$parseInvariant(value, formats) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String},
- {name: "formats", mayBeNull: true, optional: true, parameterArray: true}
- ]);
- if (e) throw e;
- return Date._parse(value, Sys.CultureInfo.InvariantCulture, arguments);
-}
-Date._parse = function Date$_parse(value, cultureInfo, args) {
- var i, l, date, format, formats, custom = false;
- for (i = 1, l = args.length; i < l; i++) {
- format = args[i];
- if (format) {
- custom = true;
- date = Date._parseExact(value, format, cultureInfo);
- if (date) return date;
- }
- }
- if (! custom) {
- formats = cultureInfo._getDateTimeFormats();
- for (i = 0, l = formats.length; i < l; i++) {
- date = Date._parseExact(value, formats[i], cultureInfo);
- if (date) return date;
- }
- }
- return null;
-}
-Date._parseExact = function Date$_parseExact(value, format, cultureInfo) {
- value = value.trim();
- var dtf = cultureInfo.dateTimeFormat,
- parseInfo = Date._getParseRegExp(dtf, format),
- match = new RegExp(parseInfo.regExp).exec(value);
- if (match === null) return null;
-
- var groups = parseInfo.groups,
- era = null, year = null, month = null, date = null, weekDay = null,
- hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null,
- pmHour = false;
- for (var j = 0, jl = groups.length; j < jl; j++) {
- var matchGroup = match[j+1];
- if (matchGroup) {
- switch (groups[j]) {
- case 'dd': case 'd':
- date = parseInt(matchGroup, 10);
- if ((date < 1) || (date > 31)) return null;
- break;
- case 'MMMM':
- month = cultureInfo._getMonthIndex(matchGroup);
- if ((month < 0) || (month > 11)) return null;
- break;
- case 'MMM':
- month = cultureInfo._getAbbrMonthIndex(matchGroup);
- if ((month < 0) || (month > 11)) return null;
- break;
- case 'M': case 'MM':
- month = parseInt(matchGroup, 10) - 1;
- if ((month < 0) || (month > 11)) return null;
- break;
- case 'y': case 'yy':
- year = Date._expandYear(dtf,parseInt(matchGroup, 10));
- if ((year < 0) || (year > 9999)) return null;
- break;
- case 'yyyy':
- year = parseInt(matchGroup, 10);
- if ((year < 0) || (year > 9999)) return null;
- break;
- case 'h': case 'hh':
- hour = parseInt(matchGroup, 10);
- if (hour === 12) hour = 0;
- if ((hour < 0) || (hour > 11)) return null;
- break;
- case 'H': case 'HH':
- hour = parseInt(matchGroup, 10);
- if ((hour < 0) || (hour > 23)) return null;
- break;
- case 'm': case 'mm':
- min = parseInt(matchGroup, 10);
- if ((min < 0) || (min > 59)) return null;
- break;
- case 's': case 'ss':
- sec = parseInt(matchGroup, 10);
- if ((sec < 0) || (sec > 59)) return null;
- break;
- case 'tt': case 't':
- var upperToken = matchGroup.toUpperCase();
- pmHour = (upperToken === dtf.PMDesignator.toUpperCase());
- if (!pmHour && (upperToken !== dtf.AMDesignator.toUpperCase())) return null;
- break;
- case 'f':
- msec = parseInt(matchGroup, 10) * 100;
- if ((msec < 0) || (msec > 999)) return null;
- break;
- case 'ff':
- msec = parseInt(matchGroup, 10) * 10;
- if ((msec < 0) || (msec > 999)) return null;
- break;
- case 'fff':
- msec = parseInt(matchGroup, 10);
- if ((msec < 0) || (msec > 999)) return null;
- break;
- case 'dddd':
- weekDay = cultureInfo._getDayIndex(matchGroup);
- if ((weekDay < 0) || (weekDay > 6)) return null;
- break;
- case 'ddd':
- weekDay = cultureInfo._getAbbrDayIndex(matchGroup);
- if ((weekDay < 0) || (weekDay > 6)) return null;
- break;
- case 'zzz':
- var offsets = matchGroup.split(/:/);
- if (offsets.length !== 2) return null;
- hourOffset = parseInt(offsets[0], 10);
- if ((hourOffset < -12) || (hourOffset > 13)) return null;
- var minOffset = parseInt(offsets[1], 10);
- if ((minOffset < 0) || (minOffset > 59)) return null;
- tzMinOffset = (hourOffset * 60) + (matchGroup.startsWith('-')? -minOffset : minOffset);
- break;
- case 'z': case 'zz':
- hourOffset = parseInt(matchGroup, 10);
- if ((hourOffset < -12) || (hourOffset > 13)) return null;
- tzMinOffset = hourOffset * 60;
- break;
- case 'g': case 'gg':
- var eraName = matchGroup;
- if (!eraName || !dtf.eras) return null;
- eraName = eraName.toLowerCase().trim();
- for (var i = 0, l = dtf.eras.length; i < l; i += 4) {
- if (eraName === dtf.eras[i + 1].toLowerCase()) {
- era = i;
- break;
- }
- }
- if (era === null) return null;
- break;
- }
- }
- }
- var result = new Date(), defaults, convert = dtf.Calendar.convert;
- if (convert) {
- defaults = convert.fromGregorian(result);
- }
- if (!convert) {
- defaults = [result.getFullYear(), result.getMonth(), result.getDate()];
- }
- if (year === null) {
- year = defaults[0];
- }
- else if (dtf.eras) {
- year += dtf.eras[(era || 0) + 3];
- }
- if (month === null) {
- month = defaults[1];
- }
- if (date === null) {
- date = defaults[2];
- }
- if (convert) {
- result = convert.toGregorian(year, month, date);
- if (result === null) return null;
- }
- else {
- result.setFullYear(year, month, date);
- if (result.getDate() !== date) return null;
- if ((weekDay !== null) && (result.getDay() !== weekDay)) {
- return null;
- }
- }
- if (pmHour && (hour < 12)) {
- hour += 12;
- }
- result.setHours(hour, min, sec, msec);
- if (tzMinOffset !== null) {
- var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset());
- result.setHours(result.getHours() + parseInt(adjustedMin/60, 10), adjustedMin%60);
- }
- return result;
-}
-Date.prototype.format = function Date$format(format) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "format", type: String}
- ]);
- if (e) throw e;
- return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture);
-}
-Date.prototype.localeFormat = function Date$localeFormat(format) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "format", type: String}
- ]);
- if (e) throw e;
- return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture);
-}
-Date.prototype._toFormattedString = function Date$_toFormattedString(format, cultureInfo) {
- var dtf = cultureInfo.dateTimeFormat,
- convert = dtf.Calendar.convert;
- if (!format || !format.length || (format === 'i')) {
- if (cultureInfo && cultureInfo.name.length) {
- if (convert) {
- return this._toFormattedString(dtf.FullDateTimePattern, cultureInfo);
- }
- else {
- var eraDate = new Date(this.getTime());
- var era = Date._getEra(this, dtf.eras);
- eraDate.setFullYear(Date._getEraYear(this, dtf, era));
- return eraDate.toLocaleString();
- }
- }
- else {
- return this.toString();
- }
- }
- var eras = dtf.eras,
- sortable = (format === "s");
- format = Date._expandFormat(dtf, format);
- var ret = new Sys.StringBuilder();
- var hour;
- function addLeadingZero(num) {
- if (num < 10) {
- return '0' + num;
- }
- return num.toString();
- }
- function addLeadingZeros(num) {
- if (num < 10) {
- return '00' + num;
- }
- if (num < 100) {
- return '0' + num;
- }
- return num.toString();
- }
- function padYear(year) {
- if (year < 10) {
- return '000' + year;
- }
- else if (year < 100) {
- return '00' + year;
- }
- else if (year < 1000) {
- return '0' + year;
- }
- return year.toString();
- }
-
- var foundDay, checkedDay, dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g;
- function hasDay() {
- if (foundDay || checkedDay) {
- return foundDay;
- }
- foundDay = dayPartRegExp.test(format);
- checkedDay = true;
- return foundDay;
- }
-
- var quoteCount = 0,
- tokenRegExp = Date._getTokenRegExp(),
- converted;
- if (!sortable && convert) {
- converted = convert.fromGregorian(this);
- }
- for (;;) {
- var index = tokenRegExp.lastIndex;
- var ar = tokenRegExp.exec(format);
- var preMatch = format.slice(index, ar ? ar.index : format.length);
- quoteCount += Date._appendPreOrPostMatch(preMatch, ret);
- if (!ar) break;
- if ((quoteCount%2) === 1) {
- ret.append(ar[0]);
- continue;
- }
-
- function getPart(date, part) {
- if (converted) {
- return converted[part];
- }
- switch (part) {
- case 0: return date.getFullYear();
- case 1: return date.getMonth();
- case 2: return date.getDate();
- }
- }
- switch (ar[0]) {
- case "dddd":
- ret.append(dtf.DayNames[this.getDay()]);
- break;
- case "ddd":
- ret.append(dtf.AbbreviatedDayNames[this.getDay()]);
- break;
- case "dd":
- foundDay = true;
- ret.append(addLeadingZero(getPart(this, 2)));
- break;
- case "d":
- foundDay = true;
- ret.append(getPart(this, 2));
- break;
- case "MMMM":
- ret.append((dtf.MonthGenitiveNames && hasDay())
- ? dtf.MonthGenitiveNames[getPart(this, 1)]
- : dtf.MonthNames[getPart(this, 1)]);
- break;
- case "MMM":
- ret.append((dtf.AbbreviatedMonthGenitiveNames && hasDay())
- ? dtf.AbbreviatedMonthGenitiveNames[getPart(this, 1)]
- : dtf.AbbreviatedMonthNames[getPart(this, 1)]);
- break;
- case "MM":
- ret.append(addLeadingZero(getPart(this, 1) + 1));
- break;
- case "M":
- ret.append(getPart(this, 1) + 1);
- break;
- case "yyyy":
- ret.append(padYear(converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)));
- break;
- case "yy":
- ret.append(addLeadingZero((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100));
- break;
- case "y":
- ret.append((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100);
- break;
- case "hh":
- hour = this.getHours() % 12;
- if (hour === 0) hour = 12;
- ret.append(addLeadingZero(hour));
- break;
- case "h":
- hour = this.getHours() % 12;
- if (hour === 0) hour = 12;
- ret.append(hour);
- break;
- case "HH":
- ret.append(addLeadingZero(this.getHours()));
- break;
- case "H":
- ret.append(this.getHours());
- break;
- case "mm":
- ret.append(addLeadingZero(this.getMinutes()));
- break;
- case "m":
- ret.append(this.getMinutes());
- break;
- case "ss":
- ret.append(addLeadingZero(this.getSeconds()));
- break;
- case "s":
- ret.append(this.getSeconds());
- break;
- case "tt":
- ret.append((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator);
- break;
- case "t":
- ret.append(((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator).charAt(0));
- break;
- case "f":
- ret.append(addLeadingZeros(this.getMilliseconds()).charAt(0));
- break;
- case "ff":
- ret.append(addLeadingZeros(this.getMilliseconds()).substr(0, 2));
- break;
- case "fff":
- ret.append(addLeadingZeros(this.getMilliseconds()));
- break;
- case "z":
- hour = this.getTimezoneOffset() / 60;
- ret.append(((hour <= 0) ? '+' : '-') + Math.floor(Math.abs(hour)));
- break;
- case "zz":
- hour = this.getTimezoneOffset() / 60;
- ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))));
- break;
- case "zzz":
- hour = this.getTimezoneOffset() / 60;
- ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))) +
- ":" + addLeadingZero(Math.abs(this.getTimezoneOffset() % 60)));
- break;
- case "g":
- case "gg":
- if (dtf.eras) {
- ret.append(dtf.eras[Date._getEra(this, eras) + 1]);
- }
- break;
- case "/":
- ret.append(dtf.DateSeparator);
- break;
- default:
- Sys.Debug.fail("Invalid date format pattern");
- }
- }
- return ret.toString();
-}
-String.localeFormat = function String$localeFormat(format, args) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "format", type: String},
- {name: "args", mayBeNull: true, parameterArray: true}
- ]);
- if (e) throw e;
- return String._toFormattedString(true, arguments);
-}
-Number.parseLocale = function Number$parseLocale(value) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String}
- ], false);
- if (e) throw e;
- return Number._parse(value, Sys.CultureInfo.CurrentCulture);
-}
-Number.parseInvariant = function Number$parseInvariant(value) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String}
- ], false);
- if (e) throw e;
- return Number._parse(value, Sys.CultureInfo.InvariantCulture);
-}
-Number._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];
-
- if ((sign === '') && (numFormat.NumberNegativePattern !== 1)) {
- signInfo = Number._parseNumberNegativePattern(value, numFormat, 1);
- sign = signInfo[0];
- num = signInfo[1];
- }
- if (sign === '') sign = '+';
-
- 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 decimalPos = intAndFraction.indexOf(numFormat.NumberDecimalSeparator);
- if (decimalPos < 0) {
- integer = intAndFraction;
- fraction = null;
- }
- else {
- integer = intAndFraction.substr(0, decimalPos);
- fraction = intAndFraction.substr(decimalPos + numFormat.NumberDecimalSeparator.length);
- }
-
- integer = integer.split(numFormat.NumberGroupSeparator).join('');
- var altNumGroupSeparator = numFormat.NumberGroupSeparator.replace(/\u00A0/g, " ");
- if (numFormat.NumberGroupSeparator !== altNumGroupSeparator) {
- integer = integer.split(altNumGroupSeparator).join('');
- }
-
- var p = sign + integer;
- if (fraction !== null) {
- p += '.' + fraction;
- }
- if (exponent !== null) {
- var expSignInfo = Number._parseNumberNegativePattern(exponent, numFormat, 1);
- if (expSignInfo[0] === '') {
- expSignInfo[0] = '+';
- }
- p += 'e' + expSignInfo[0] + expSignInfo[1];
- }
- if (p.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) {
- return parseFloat(p);
- }
- return Number.NaN;
-}
-Number._parseNumberNegativePattern = function Number$_parseNumberNegativePattern(value, numFormat, numberNegativePattern) {
- var neg = numFormat.NegativeSign;
- var pos = numFormat.PositiveSign;
- switch (numberNegativePattern) {
- case 4:
- neg = ' ' + neg;
- pos = ' ' + pos;
- case 3:
- if (value.endsWith(neg)) {
- return ['-', value.substr(0, value.length - neg.length)];
- }
- else if (value.endsWith(pos)) {
- return ['+', value.substr(0, value.length - pos.length)];
- }
- break;
- case 2:
- neg += ' ';
- pos += ' ';
- case 1:
- if (value.startsWith(neg)) {
- return ['-', value.substr(neg.length)];
- }
- else if (value.startsWith(pos)) {
- return ['+', value.substr(pos.length)];
- }
- break;
- case 0:
- if (value.startsWith('(') && value.endsWith(')')) {
- return ['-', value.substr(1, value.length - 2)];
- }
- break;
- default:
- Sys.Debug.fail("");
- }
- return ['', value];
-}
-Number.prototype.format = function Number$format(format) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "format", type: String}
- ]);
- if (e) throw e;
- return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture);
-}
-Number.prototype.localeFormat = function Number$localeFormat(format) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "format", type: String}
- ]);
- if (e) throw e;
- return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture);
-}
-Number.prototype._toFormattedString = function Number$_toFormattedString(format, cultureInfo) {
- if (!format || (format.length === 0) || (format === 'i')) {
- if (cultureInfo && (cultureInfo.name.length > 0)) {
- return this.toLocaleString();
- }
- else {
- return this.toString();
- }
- }
-
- var _percentPositivePattern = ["n %", "n%", "%n" ];
- var _percentNegativePattern = ["-n %", "-n%", "-%n"];
- var _numberNegativePattern = ["(n)","-n","- n","n-","n -"];
- var _currencyPositivePattern = ["$n","n$","$ n","n $"];
- var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];
- function zeroPad(str, count, left) {
- for (var l=str.length; l < count; l++) {
- str = (left ? ('0' + str) : (str + '0'));
- }
- return str;
- }
-
- function expandNumber(number, precision, groupSizes, sep, decimalChar) {
- Sys.Debug.assert(groupSizes.length > 0, "groupSizes must be an array of at least 1");
- var curSize = groupSizes[0];
- var curGroupIndex = 1;
- var factor = Math.pow(10, precision);
- var rounded = (Math.round(number * factor) / factor);
- if (!isFinite(rounded)) {
- rounded = number;
- }
- number = rounded;
-
- var numberString = number.toString();
- var right = "";
- var exponent;
-
-
- var split = numberString.split(/e/i);
- numberString = split[0];
- exponent = (split.length > 1 ? parseInt(split[1]) : 0);
- split = numberString.split('.');
- numberString = split[0];
- right = split.length > 1 ? split[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) {
- if (right.length > precision) {
- right = right.slice(0, precision);
- }
- else {
- right = zeroPad(right, precision, false);
- }
- right = decimalChar + right;
- }
- else {
- right = "";
- }
- var stringIndex = numberString.length-1;
- var ret = "";
- while (stringIndex >= 0) {
- if (curSize === 0 || curSize > stringIndex) {
- if (ret.length > 0)
- return numberString.slice(0, stringIndex + 1) + sep + ret + right;
- else
- return numberString.slice(0, stringIndex + 1) + right;
- }
- if (ret.length > 0)
- ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1) + sep + ret;
- else
- ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1);
- stringIndex -= curSize;
- if (curGroupIndex < groupSizes.length) {
- curSize = groupSizes[curGroupIndex];
- curGroupIndex++;
- }
- }
- return numberString.slice(0, stringIndex + 1) + sep + ret + right;
- }
- var nf = cultureInfo.numberFormat;
- var number = Math.abs(this);
- if (!format)
- format = "D";
- var precision = -1;
- if (format.length > 1) precision = parseInt(format.slice(1), 10);
- var pattern;
- switch (format.charAt(0)) {
- case "d":
- case "D":
- pattern = 'n';
- if (precision !== -1) {
- number = zeroPad(""+number, precision, true);
- }
- if (this < 0) number = -number;
- break;
- case "c":
- case "C":
- if (this < 0) pattern = _currencyNegativePattern[nf.CurrencyNegativePattern];
- else pattern = _currencyPositivePattern[nf.CurrencyPositivePattern];
- if (precision === -1) precision = nf.CurrencyDecimalDigits;
- number = expandNumber(Math.abs(this), precision, nf.CurrencyGroupSizes, nf.CurrencyGroupSeparator, nf.CurrencyDecimalSeparator);
- break;
- case "n":
- case "N":
- if (this < 0) pattern = _numberNegativePattern[nf.NumberNegativePattern];
- else pattern = 'n';
- if (precision === -1) precision = nf.NumberDecimalDigits;
- number = expandNumber(Math.abs(this), precision, nf.NumberGroupSizes, nf.NumberGroupSeparator, nf.NumberDecimalSeparator);
- break;
- case "p":
- case "P":
- if (this < 0) pattern = _percentNegativePattern[nf.PercentNegativePattern];
- else pattern = _percentPositivePattern[nf.PercentPositivePattern];
- if (precision === -1) precision = nf.PercentDecimalDigits;
- number = expandNumber(Math.abs(this) * 100, precision, nf.PercentGroupSizes, nf.PercentGroupSeparator, nf.PercentDecimalSeparator);
- break;
- default:
- throw Error.format(Sys.Res.formatBadFormatSpecifier);
- }
- var regex = /n|\$|-|%/g;
- var ret = "";
- for (;;) {
- var index = regex.lastIndex;
- var ar = regex.exec(pattern);
- ret += pattern.slice(index, ar ? ar.index : pattern.length);
- if (!ar)
- break;
- 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;
- default:
- Sys.Debug.fail("Invalid number format pattern");
- }
- }
- return ret;
-}
-
-Sys.CultureInfo = function Sys$CultureInfo(name, numberFormat, dateTimeFormat) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "name", type: String},
- {name: "numberFormat", type: Object},
- {name: "dateTimeFormat", type: Object}
- ]);
- if (e) throw e;
- this.name = name;
- this.numberFormat = numberFormat;
- this.dateTimeFormat = dateTimeFormat;
-}
- function Sys$CultureInfo$_getDateTimeFormats() {
- if (! this._dateTimeFormats) {
- var dtf = this.dateTimeFormat;
- this._dateTimeFormats =
- [ dtf.MonthDayPattern,
- dtf.YearMonthPattern,
- dtf.ShortDatePattern,
- dtf.ShortTimePattern,
- dtf.LongDatePattern,
- dtf.LongTimePattern,
- dtf.FullDateTimePattern,
- dtf.RFC1123Pattern,
- dtf.SortableDateTimePattern,
- dtf.UniversalSortableDateTimePattern ];
- }
- return this._dateTimeFormats;
- }
- function Sys$CultureInfo$_getIndex(value, a1, a2) {
- var upper = this._toUpper(value),
- i = Array.indexOf(a1, upper);
- if (i === -1) {
- i = Array.indexOf(a2, upper);
- }
- return i;
- }
- function Sys$CultureInfo$_getMonthIndex(value) {
- if (!this._upperMonths) {
- this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames);
- this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames);
- }
- return this._getIndex(value, this._upperMonths, this._upperMonthsGenitive);
- }
- function Sys$CultureInfo$_getAbbrMonthIndex(value) {
- if (!this._upperAbbrMonths) {
- this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);
- this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames);
- }
- return this._getIndex(value, this._upperAbbrMonths, this._upperAbbrMonthsGenitive);
- }
- function Sys$CultureInfo$_getDayIndex(value) {
- if (!this._upperDays) {
- this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames);
- }
- return Array.indexOf(this._upperDays, this._toUpper(value));
- }
- function Sys$CultureInfo$_getAbbrDayIndex(value) {
- if (!this._upperAbbrDays) {
- this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);
- }
- return Array.indexOf(this._upperAbbrDays, this._toUpper(value));
- }
- function Sys$CultureInfo$_toUpperArray(arr) {
- var result = [];
- for (var i = 0, il = arr.length; i < il; i++) {
- result[i] = this._toUpper(arr[i]);
- }
- return result;
- }
- function Sys$CultureInfo$_toUpper(value) {
- return value.split("\u00A0").join(' ').toUpperCase();
- }
-Sys.CultureInfo.prototype = {
- _getDateTimeFormats: Sys$CultureInfo$_getDateTimeFormats,
- _getIndex: Sys$CultureInfo$_getIndex,
- _getMonthIndex: Sys$CultureInfo$_getMonthIndex,
- _getAbbrMonthIndex: Sys$CultureInfo$_getAbbrMonthIndex,
- _getDayIndex: Sys$CultureInfo$_getDayIndex,
- _getAbbrDayIndex: Sys$CultureInfo$_getAbbrDayIndex,
- _toUpperArray: Sys$CultureInfo$_toUpperArray,
- _toUpper: Sys$CultureInfo$_toUpper
-}
-Sys.CultureInfo.registerClass('Sys.CultureInfo');
-Sys.CultureInfo._parse = function Sys$CultureInfo$_parse(value) {
- var dtf = value.dateTimeFormat;
- if (dtf && !dtf.eras) {
- dtf.eras = value.eras;
- }
- return new Sys.CultureInfo(value.name, value.numberFormat, dtf);
-}
-Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse({"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00A4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","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,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":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","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"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"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]},"eras":[1,"A.D.",null,0]});
-if (typeof(__cultureInfo) === "object") {
- Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo);
- delete __cultureInfo;
-}
-else {
- Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","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,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]},"eras":[1,"A.D.",null,0]});
-}
-Type.registerNamespace('Sys.Serialization');
-Sys.Serialization.JavaScriptSerializer = function Sys$Serialization$JavaScriptSerializer() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
-}
-Sys.Serialization.JavaScriptSerializer.registerClass('Sys.Serialization.JavaScriptSerializer');
-Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = [];
-Sys.Serialization.JavaScriptSerializer._charsToEscape = [];
-Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', 'g');
-Sys.Serialization.JavaScriptSerializer._escapeChars = {};
-Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]', 'i');
-Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]', 'g');
-Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp('[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]', 'g');
-Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g');
-Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = '__type';
-Sys.Serialization.JavaScriptSerializer._init = function Sys$Serialization$JavaScriptSerializer$_init() {
- var replaceChars = ['\\u0000','\\u0001','\\u0002','\\u0003','\\u0004','\\u0005','\\u0006','\\u0007',
- '\\b','\\t','\\n','\\u000b','\\f','\\r','\\u000e','\\u000f','\\u0010','\\u0011',
- '\\u0012','\\u0013','\\u0014','\\u0015','\\u0016','\\u0017','\\u0018','\\u0019',
- '\\u001a','\\u001b','\\u001c','\\u001d','\\u001e','\\u001f'];
- Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = '\\';
- Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['\\'] = new RegExp('\\\\', 'g');
- Sys.Serialization.JavaScriptSerializer._escapeChars['\\'] = '\\\\';
- Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"';
- Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"', 'g');
- Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"';
- for (var i = 0; i < 32; i++) {
- var c = String.fromCharCode(i);
- Sys.Serialization.JavaScriptSerializer._charsToEscape[i+2] = c;
- Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c] = new RegExp(c, 'g');
- Sys.Serialization.JavaScriptSerializer._escapeChars[c] = replaceChars[i];
- }
-}
-Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeBooleanWithBuilder(object, stringBuilder) {
- stringBuilder.append(object.toString());
-}
-Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeNumberWithBuilder(object, stringBuilder) {
- if (isFinite(object)) {
- stringBuilder.append(String(object));
- }
- else {
- throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers);
- }
-}
-Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(string, stringBuilder) {
- stringBuilder.append('"');
- if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(string)) {
- if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0) {
- Sys.Serialization.JavaScriptSerializer._init();
- }
- if (string.length < 128) {
- string = string.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,
- function(x) { return Sys.Serialization.JavaScriptSerializer._escapeChars[x]; });
- }
- else {
- for (var i = 0; i < 34; i++) {
- var c = Sys.Serialization.JavaScriptSerializer._charsToEscape[i];
- if (string.indexOf(c) !== -1) {
- if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox) {
- string = string.split(c).join(Sys.Serialization.JavaScriptSerializer._escapeChars[c]);
- }
- else {
- string = string.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c],
- Sys.Serialization.JavaScriptSerializer._escapeChars[c]);
- }
- }
- }
- }
- }
- stringBuilder.append(string);
- stringBuilder.append('"');
-}
-Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeWithBuilder(object, stringBuilder, sort, prevObjects) {
- var i;
- switch (typeof object) {
- case 'object':
- if (object) {
- if (prevObjects){
- for( var j = 0; j < prevObjects.length; j++) {
- if (prevObjects[j] === object) {
- throw Error.invalidOperation(Sys.Res.cannotSerializeObjectWithCycle);
- }
- }
- }
- else {
- prevObjects = new Array();
- }
- try {
- Array.add(prevObjects, object);
-
- if (Number.isInstanceOfType(object)){
- Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder);
- }
- else if (Boolean.isInstanceOfType(object)){
- Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder);
- }
- else if (String.isInstanceOfType(object)){
- Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder);
- }
-
- else if (Array.isInstanceOfType(object)) {
- stringBuilder.append('[');
-
- for (i = 0; i < object.length; ++i) {
- if (i > 0) {
- stringBuilder.append(',');
- }
- Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object[i], stringBuilder,false,prevObjects);
- }
- stringBuilder.append(']');
- }
- else {
- if (Date.isInstanceOfType(object)) {
- stringBuilder.append('"\\/Date(');
- stringBuilder.append(object.getTime());
- stringBuilder.append(')\\/"');
- break;
- }
- var properties = [];
- var propertyCount = 0;
- for (var name in object) {
- if (name.startsWith('$')) {
- continue;
- }
- if (name === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && propertyCount !== 0){
- properties[propertyCount++] = properties[0];
- properties[0] = name;
- }
- else{
- properties[propertyCount++] = name;
- }
- }
- if (sort) properties.sort();
- stringBuilder.append('{');
- var needComma = false;
-
- for (i=0; i
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "object", mayBeNull: true}
- ]);
- if (e) throw e;
- var stringBuilder = new Sys.StringBuilder();
- Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object, stringBuilder, false);
- return stringBuilder.toString();
-}
-Sys.Serialization.JavaScriptSerializer.deserialize = function Sys$Serialization$JavaScriptSerializer$deserialize(data, secure) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "data", type: String},
- {name: "secure", type: Boolean, optional: true}
- ]);
- if (e) throw e;
-
- if (data.length === 0) throw Error.argument('data', Sys.Res.cannotDeserializeEmptyString);
- try {
- var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)");
-
- if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(
- exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, ''))) throw null;
- return eval('(' + exp + ')');
- }
- catch (e) {
- throw Error.argument('data', Sys.Res.cannotDeserializeInvalidJson);
- }
-}
-Type.registerNamespace('Sys.UI');
-
-Sys.EventHandlerList = function Sys$EventHandlerList() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._list = {};
-}
- function Sys$EventHandlerList$_addHandler(id, handler) {
- Array.add(this._getEvent(id, true), handler);
- }
- function Sys$EventHandlerList$addHandler(id, handler) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "id", type: String},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- this._addHandler(id, handler);
- }
- function Sys$EventHandlerList$_removeHandler(id, handler) {
- var evt = this._getEvent(id);
- if (!evt) return;
- Array.remove(evt, handler);
- }
- function Sys$EventHandlerList$removeHandler(id, handler) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "id", type: String},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- this._removeHandler(id, handler);
- }
- function Sys$EventHandlerList$getHandler(id) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "id", type: String}
- ]);
- if (e) throw e;
- var evt = this._getEvent(id);
- if (!evt || (evt.length === 0)) return null;
- evt = Array.clone(evt);
- return function(source, args) {
- for (var i = 0, l = evt.length; i < l; i++) {
- evt[i](source, args);
- }
- };
- }
- function Sys$EventHandlerList$_getEvent(id, create) {
- if (!this._list[id]) {
- if (!create) return null;
- this._list[id] = [];
- }
- return this._list[id];
- }
-Sys.EventHandlerList.prototype = {
- _addHandler: Sys$EventHandlerList$_addHandler,
- addHandler: Sys$EventHandlerList$addHandler,
- _removeHandler: Sys$EventHandlerList$_removeHandler,
- removeHandler: Sys$EventHandlerList$removeHandler,
- getHandler: Sys$EventHandlerList$getHandler,
- _getEvent: Sys$EventHandlerList$_getEvent
-}
-Sys.EventHandlerList.registerClass('Sys.EventHandlerList');
-Sys.CommandEventArgs = function Sys$CommandEventArgs(commandName, commandArgument, commandSource) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "commandName", type: String},
- {name: "commandArgument", mayBeNull: true},
- {name: "commandSource", mayBeNull: true}
- ]);
- if (e) throw e;
- Sys.CommandEventArgs.initializeBase(this);
- this._commandName = commandName;
- this._commandArgument = commandArgument;
- this._commandSource = commandSource;
-}
- function Sys$CommandEventArgs$get_commandName() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._commandName;
- }
- function Sys$CommandEventArgs$get_commandArgument() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._commandArgument;
- }
- function Sys$CommandEventArgs$get_commandSource() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._commandSource;
- }
-Sys.CommandEventArgs.prototype = {
- _commandName: null,
- _commandArgument: null,
- _commandSource: null,
- get_commandName: Sys$CommandEventArgs$get_commandName,
- get_commandArgument: Sys$CommandEventArgs$get_commandArgument,
- get_commandSource: Sys$CommandEventArgs$get_commandSource
-}
-Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs);
-
-Sys.INotifyPropertyChange = function Sys$INotifyPropertyChange() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
- function Sys$INotifyPropertyChange$add_propertyChanged(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- throw Error.notImplemented();
- }
- function Sys$INotifyPropertyChange$remove_propertyChanged(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- throw Error.notImplemented();
- }
-Sys.INotifyPropertyChange.prototype = {
- add_propertyChanged: Sys$INotifyPropertyChange$add_propertyChanged,
- remove_propertyChanged: Sys$INotifyPropertyChange$remove_propertyChanged
-}
-Sys.INotifyPropertyChange.registerInterface('Sys.INotifyPropertyChange');
-
-Sys.PropertyChangedEventArgs = function Sys$PropertyChangedEventArgs(propertyName) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "propertyName", type: String}
- ]);
- if (e) throw e;
- Sys.PropertyChangedEventArgs.initializeBase(this);
- this._propertyName = propertyName;
-}
-
- function Sys$PropertyChangedEventArgs$get_propertyName() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._propertyName;
- }
-Sys.PropertyChangedEventArgs.prototype = {
- get_propertyName: Sys$PropertyChangedEventArgs$get_propertyName
-}
-Sys.PropertyChangedEventArgs.registerClass('Sys.PropertyChangedEventArgs', Sys.EventArgs);
-
-Sys.INotifyDisposing = function Sys$INotifyDisposing() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
- function Sys$INotifyDisposing$add_disposing(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- throw Error.notImplemented();
- }
- function Sys$INotifyDisposing$remove_disposing(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- throw Error.notImplemented();
- }
-Sys.INotifyDisposing.prototype = {
- add_disposing: Sys$INotifyDisposing$add_disposing,
- remove_disposing: Sys$INotifyDisposing$remove_disposing
-}
-Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");
-
-Sys.Component = function Sys$Component() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (Sys.Application) Sys.Application.registerDisposableObject(this);
-}
- function Sys$Component$get_events() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._events) {
- this._events = new Sys.EventHandlerList();
- }
- return this._events;
- }
- function Sys$Component$get_id() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._id;
- }
- function Sys$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;
- }
- function Sys$Component$get_isInitialized() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._initialized;
- }
- function Sys$Component$get_isUpdating() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._updating;
- }
- function Sys$Component$add_disposing(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().addHandler("disposing", handler);
- }
- function Sys$Component$remove_disposing(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().removeHandler("disposing", handler);
- }
- function Sys$Component$add_propertyChanged(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().addHandler("propertyChanged", handler);
- }
- function Sys$Component$remove_propertyChanged(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().removeHandler("propertyChanged", handler);
- }
- function Sys$Component$beginUpdate() {
- this._updating = true;
- }
- function Sys$Component$dispose() {
- if (this._events) {
- var handler = this._events.getHandler("disposing");
- if (handler) {
- handler(this, Sys.EventArgs.Empty);
- }
- }
- delete this._events;
- Sys.Application.unregisterDisposableObject(this);
- Sys.Application.removeComponent(this);
- }
- function Sys$Component$endUpdate() {
- this._updating = false;
- if (!this._initialized) this.initialize();
- this.updated();
- }
- function Sys$Component$initialize() {
- this._initialized = true;
- }
- function Sys$Component$raisePropertyChanged(propertyName) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "propertyName", type: String}
- ]);
- if (e) throw e;
- if (!this._events) return;
- var handler = this._events.getHandler("propertyChanged");
- if (handler) {
- handler(this, new Sys.PropertyChangedEventArgs(propertyName));
- }
- }
- function Sys$Component$updated() {
- }
-Sys.Component.prototype = {
- _id: null,
- _idSet: false,
- _initialized: false,
- _updating: false,
- get_events: Sys$Component$get_events,
- get_id: Sys$Component$get_id,
- set_id: Sys$Component$set_id,
- get_isInitialized: Sys$Component$get_isInitialized,
- get_isUpdating: Sys$Component$get_isUpdating,
- add_disposing: Sys$Component$add_disposing,
- remove_disposing: Sys$Component$remove_disposing,
- add_propertyChanged: Sys$Component$add_propertyChanged,
- remove_propertyChanged: Sys$Component$remove_propertyChanged,
- beginUpdate: Sys$Component$beginUpdate,
- dispose: Sys$Component$dispose,
- endUpdate: Sys$Component$endUpdate,
- initialize: Sys$Component$initialize,
- raisePropertyChanged: Sys$Component$raisePropertyChanged,
- updated: Sys$Component$updated
-}
-Sys.Component.registerClass('Sys.Component', null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing);
-function Sys$Component$_setProperties(target, properties) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "target"},
- {name: "properties"}
- ]);
- if (e) throw e;
- var current;
- var targetType = Object.getType(target);
- var isObject = (targetType === Object) || (targetType === Sys.UI.DomElement);
- var isComponent = Sys.Component.isInstanceOfType(target) && !target.get_isUpdating();
- if (isComponent) target.beginUpdate();
- for (var name in properties) {
- var val = properties[name];
- var getter = isObject ? null : target["get_" + name];
- if (isObject || typeof(getter) !== 'function') {
- var targetVal = target[name];
- if (!isObject && typeof(targetVal) === 'undefined') throw Error.invalidOperation(String.format(Sys.Res.propertyUndefined, name));
- if (!val || (typeof(val) !== 'object') || (isObject && !targetVal)) {
- target[name] = val;
- }
- else {
- Sys$Component$_setProperties(targetVal, val);
- }
- }
- else {
- var setter = target["set_" + name];
- if (typeof(setter) === 'function') {
- setter.apply(target, [val]);
- }
- else if (val instanceof Array) {
- current = getter.apply(target);
- if (!(current instanceof Array)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNotAnArray, name));
- for (var i = 0, j = current.length, l= val.length; i < l; i++, j++) {
- current[j] = val[i];
- }
- }
- else if ((typeof(val) === 'object') && (Object.getType(val) === Object)) {
- current = getter.apply(target);
- if ((typeof(current) === 'undefined') || (current === null)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNullOrUndefined, name));
- Sys$Component$_setProperties(current, val);
- }
- else {
- throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name));
- }
- }
- }
- if (isComponent) target.endUpdate();
-}
-function Sys$Component$_setReferences(component, references) {
- for (var name in references) {
- var setter = component["set_" + name];
- var reference = $find(references[name]);
- if (typeof(setter) !== 'function') throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name));
- if (!reference) throw Error.invalidOperation(String.format(Sys.Res.referenceNotFound, references[name]));
- setter.apply(component, [reference]);
- }
-}
-var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "type", type: Type},
- {name: "properties", mayBeNull: true, optional: true},
- {name: "events", mayBeNull: true, optional: true},
- {name: "references", mayBeNull: true, optional: true},
- {name: "element", mayBeNull: true, domElement: true, optional: true}
- ]);
- if (e) throw e;
- if (!type.inheritsFrom(Sys.Component)) {
- throw Error.argument('type', String.format(Sys.Res.createNotComponent, type.getName()));
- }
- if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) {
- if (!element) throw Error.argument('element', Sys.Res.createNoDom);
- }
- else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom);
- var component = (element ? new type(element): new type());
- var app = Sys.Application;
- var creatingComponents = app.get_isCreatingComponents();
- component.beginUpdate();
- if (properties) {
- Sys$Component$_setProperties(component, properties);
- }
- if (events) {
- for (var name in events) {
- if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name));
- if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction);
- component["add_" + name](events[name]);
- }
- }
- if (component.get_id()) {
- app.addComponent(component);
- }
- if (creatingComponents) {
- app._createdComponents[app._createdComponents.length] = component;
- if (references) {
- app._addComponentToSecondPass(component, references);
- }
- else {
- component.endUpdate();
- }
- }
- else {
- if (references) {
- Sys$Component$_setReferences(component, references);
- }
- component.endUpdate();
- }
- return component;
-}
-
-Sys.UI.MouseButton = function Sys$UI$MouseButton() {
- ///
- ///
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
-Sys.UI.MouseButton.prototype = {
- leftButton: 0,
- middleButton: 1,
- rightButton: 2
-}
-Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");
-
-Sys.UI.Key = function Sys$UI$Key() {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
-Sys.UI.Key.prototype = {
- backspace: 8,
- tab: 9,
- enter: 13,
- esc: 27,
- space: 32,
- pageUp: 33,
- pageDown: 34,
- end: 35,
- home: 36,
- left: 37,
- up: 38,
- right: 39,
- down: 40,
- del: 127
-}
-Sys.UI.Key.registerEnum("Sys.UI.Key");
-
-Sys.UI.Point = function Sys$UI$Point(x, y) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "x", type: Number, integer: true},
- {name: "y", type: Number, integer: true}
- ]);
- if (e) throw e;
- this.x = x;
- this.y = y;
-}
-Sys.UI.Point.registerClass('Sys.UI.Point');
-
-Sys.UI.Bounds = function Sys$UI$Bounds(x, y, width, height) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "x", type: Number, integer: true},
- {name: "y", type: Number, integer: true},
- {name: "width", type: Number, integer: true},
- {name: "height", type: Number, integer: true}
- ]);
- if (e) throw e;
- this.x = x;
- this.y = y;
- this.height = height;
- this.width = width;
-}
-Sys.UI.Bounds.registerClass('Sys.UI.Bounds');
-
-Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "eventObject"}
- ]);
- if (e) throw e;
- var ev = eventObject;
- var etype = this.type = ev.type.toLowerCase();
- this.rawEvent = ev;
- this.altKey = ev.altKey;
- if (typeof(ev.button) !== 'undefined') {
- this.button = (typeof(ev.which) !== 'undefined') ? ev.button :
- (ev.button === 4) ? Sys.UI.MouseButton.middleButton :
- (ev.button === 2) ? Sys.UI.MouseButton.rightButton :
- Sys.UI.MouseButton.leftButton;
- }
- if (etype === 'keypress') {
- this.charCode = ev.charCode || ev.keyCode;
- }
- else if (ev.keyCode && (ev.keyCode === 46)) {
- this.keyCode = 127;
- }
- else {
- this.keyCode = ev.keyCode;
- }
- this.clientX = ev.clientX;
- this.clientY = ev.clientY;
- this.ctrlKey = ev.ctrlKey;
- this.target = ev.target ? ev.target : ev.srcElement;
- if (!etype.startsWith('key')) {
- if ((typeof(ev.offsetX) !== 'undefined') && (typeof(ev.offsetY) !== 'undefined')) {
- this.offsetX = ev.offsetX;
- this.offsetY = ev.offsetY;
- }
- else if (this.target && (this.target.nodeType !== 3) && (typeof(ev.clientX) === 'number')) {
- var loc = Sys.UI.DomElement.getLocation(this.target);
- var w = Sys.UI.DomElement._getWindow(this.target);
- this.offsetX = (w.pageXOffset || 0) + ev.clientX - loc.x;
- this.offsetY = (w.pageYOffset || 0) + ev.clientY - loc.y;
- }
- }
- this.screenX = ev.screenX;
- this.screenY = ev.screenY;
- this.shiftKey = ev.shiftKey;
-}
- function Sys$UI$DomEvent$preventDefault() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this.rawEvent.preventDefault) {
- this.rawEvent.preventDefault();
- }
- else if (window.event) {
- this.rawEvent.returnValue = false;
- }
- }
- function Sys$UI$DomEvent$stopPropagation() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this.rawEvent.stopPropagation) {
- this.rawEvent.stopPropagation();
- }
- else if (window.event) {
- this.rawEvent.cancelBubble = true;
- }
- }
-Sys.UI.DomEvent.prototype = {
- preventDefault: Sys$UI$DomEvent$preventDefault,
- stopPropagation: Sys$UI$DomEvent$stopPropagation
-}
-Sys.UI.DomEvent.registerClass('Sys.UI.DomEvent');
-var $addHandler = Sys.UI.DomEvent.addHandler = function Sys$UI$DomEvent$addHandler(element, eventName, handler, autoRemove) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element"},
- {name: "eventName", type: String},
- {name: "handler", type: Function},
- {name: "autoRemove", type: Boolean, optional: true}
- ]);
- if (e) throw e;
- Sys.UI.DomEvent._ensureDomNode(element);
- if (eventName === "error") throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError);
- if (!element._events) {
- element._events = {};
- }
- var eventCache = element._events[eventName];
- if (!eventCache) {
- element._events[eventName] = eventCache = [];
- }
- var browserHandler;
- if (element.addEventListener) {
- browserHandler = function(e) {
- return handler.call(element, new Sys.UI.DomEvent(e));
- }
- element.addEventListener(eventName, browserHandler, false);
- }
- else if (element.attachEvent) {
- browserHandler = function() {
- var e = {};
- try {e = Sys.UI.DomElement._getWindow(element).event} catch(ex) {}
- return handler.call(element, new Sys.UI.DomEvent(e));
- }
- element.attachEvent('on' + eventName, browserHandler);
- }
- eventCache[eventCache.length] = {handler: handler, browserHandler: browserHandler, autoRemove: autoRemove };
- if (autoRemove) {
- var d = element.dispose;
- if (d !== Sys.UI.DomEvent._disposeHandlers) {
- element.dispose = Sys.UI.DomEvent._disposeHandlers;
- if (typeof(d) !== "undefined") {
- element._chainDispose = d;
- }
- }
- }
-}
-var $addHandlers = Sys.UI.DomEvent.addHandlers = function Sys$UI$DomEvent$addHandlers(element, events, handlerOwner, autoRemove) {
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element"},
- {name: "events", type: Object},
- {name: "handlerOwner", optional: true},
- {name: "autoRemove", type: Boolean, optional: true}
- ]);
- if (e) throw e;
- Sys.UI.DomEvent._ensureDomNode(element);
- for (var name in events) {
- var handler = events[name];
- if (typeof(handler) !== 'function') throw Error.invalidOperation(Sys.Res.cantAddNonFunctionhandler);
- if (handlerOwner) {
- handler = Function.createDelegate(handlerOwner, handler);
- }
- $addHandler(element, name, handler, autoRemove || false);
- }
-}
-var $clearHandlers = Sys.UI.DomEvent.clearHandlers = function Sys$UI$DomEvent$clearHandlers(element) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element"}
- ]);
- if (e) throw e;
- Sys.UI.DomEvent._ensureDomNode(element);
- Sys.UI.DomEvent._clearHandlers(element, false);
-}
-Sys.UI.DomEvent._clearHandlers = function Sys$UI$DomEvent$_clearHandlers(element, autoRemoving) {
- if (element._events) {
- var cache = element._events;
- for (var name in cache) {
- var handlers = cache[name];
- for (var i = handlers.length - 1; i >= 0; i--) {
- var entry = handlers[i];
- if (!autoRemoving || entry.autoRemove) {
- $removeHandler(element, name, entry.handler);
- }
- }
- }
- element._events = null;
- }
-}
-Sys.UI.DomEvent._disposeHandlers = function Sys$UI$DomEvent$_disposeHandlers() {
- Sys.UI.DomEvent._clearHandlers(this, true);
- var d = this._chainDispose, type = typeof(d);
- if (type !== "undefined") {
- this.dispose = d;
- this._chainDispose = null;
- if (type === "function") {
- this.dispose();
- }
- }
-}
-var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element"},
- {name: "eventName", type: String},
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- Sys.UI.DomEvent._removeHandler(element, eventName, handler);
-}
-Sys.UI.DomEvent._removeHandler = function Sys$UI$DomEvent$_removeHandler(element, eventName, handler) {
- Sys.UI.DomEvent._ensureDomNode(element);
- var browserHandler = null;
- if ((typeof(element._events) !== 'object') || !element._events) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
- var cache = element._events[eventName];
- if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
- for (var i = 0, l = cache.length; i < l; i++) {
- if (cache[i].handler === handler) {
- browserHandler = cache[i].browserHandler;
- break;
- }
- }
- if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
- if (element.removeEventListener) {
- element.removeEventListener(eventName, browserHandler, false);
- }
- else if (element.detachEvent) {
- element.detachEvent('on' + eventName, browserHandler);
- }
- cache.splice(i, 1);
-}
-Sys.UI.DomEvent._ensureDomNode = function Sys$UI$DomEvent$_ensureDomNode(element) {
- if (element.tagName && (element.tagName.toUpperCase() === "SCRIPT")) return;
-
- var doc = element.ownerDocument || element.document || element;
- if ((typeof(element.document) !== 'object') && (element != doc) && (typeof(element.nodeType) !== 'number')) {
- throw Error.argument("element", Sys.Res.argumentDomNode);
- }
-}
-
-Sys.UI.DomElement = function Sys$UI$DomElement() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
-Sys.UI.DomElement.registerClass('Sys.UI.DomElement');
-Sys.UI.DomElement.addCssClass = function Sys$UI$DomElement$addCssClass(element, className) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "className", type: String}
- ]);
- if (e) throw e;
- if (!Sys.UI.DomElement.containsCssClass(element, className)) {
- if (element.className === '') {
- element.className = className;
- }
- else {
- element.className += ' ' + className;
- }
- }
-}
-Sys.UI.DomElement.containsCssClass = function Sys$UI$DomElement$containsCssClass(element, className) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "className", type: String}
- ]);
- if (e) throw e;
- return Array.contains(element.className.split(' '), className);
-}
-Sys.UI.DomElement.getBounds = function Sys$UI$DomElement$getBounds(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- var offset = Sys.UI.DomElement.getLocation(element);
- return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
-}
-var $get = Sys.UI.DomElement.getElementById = function Sys$UI$DomElement$getElementById(id, element) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "id", type: String},
- {name: "element", mayBeNull: true, domElement: true, optional: true}
- ]);
- if (e) throw e;
- if (!element) return document.getElementById(id);
- if (element.getElementById) return element.getElementById(id);
- var nodeQueue = [];
- var childNodes = element.childNodes;
- for (var i = 0; i < childNodes.length; i++) {
- var node = childNodes[i];
- if (node.nodeType == 1) {
- nodeQueue[nodeQueue.length] = node;
- }
- }
- while (nodeQueue.length) {
- node = nodeQueue.shift();
- if (node.id == id) {
- return node;
- }
- childNodes = node.childNodes;
- for (i = 0; i < childNodes.length; i++) {
- node = childNodes[i];
- if (node.nodeType == 1) {
- nodeQueue[nodeQueue.length] = node;
- }
- }
- }
- return null;
-}
-if (document.documentElement.getBoundingClientRect) {
- Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0);
- var clientRect = element.getBoundingClientRect();
- if (!clientRect) {
- return new Sys.UI.Point(0,0);
- }
- var documentElement = element.ownerDocument.documentElement,
- offsetX = Math.floor(clientRect.left + 0.5) + documentElement.scrollLeft,
- offsetY = Math.floor(clientRect.top + 0.5) + documentElement.scrollTop;
- if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
- try {
- var f = element.ownerDocument.parentWindow.frameElement || null;
- if (f) {
- var offset = (f.frameBorder === "0" || f.frameBorder === "no") ? 2 : 0;
- offsetX += offset;
- offsetY += offset;
- }
- }
- catch(ex) {
- }
- if (Sys.Browser.version <= 7) {
-
- var multiplier, before, rect, d = document.createElement("div");
- d.style.cssText = "position:absolute !important;left:0px !important;right:0px !important;height:0px !important;width:1px !important;display:hidden !important";
- try {
- before = document.body.childNodes[0];
- document.body.insertBefore(d, before);
- rect = d.getBoundingClientRect();
- document.body.removeChild(d);
- multiplier = (rect.right - rect.left);
- }
- catch (e) {
- }
- if (multiplier && (multiplier !== 1)) {
- offsetX = Math.floor(offsetX / multiplier);
- offsetY = Math.floor(offsetY / multiplier);
- }
- }
- if ((document.documentMode || 0) < 8) {
- offsetX -= 2;
- offsetY -= 2;
- }
- }
- return new Sys.UI.Point(offsetX, offsetY);
- }
-}
-else if (Sys.Browser.agent === Sys.Browser.Safari) {
- Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0);
- var offsetX = 0, offsetY = 0,
- parent,
- previous = null,
- previousStyle = null,
- currentStyle;
- for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) {
- currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
- var tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
- if ((parent.offsetLeft || parent.offsetTop) &&
- ((tagName !== "BODY") || (!previousStyle || previousStyle.position !== "absolute"))) {
- offsetX += parent.offsetLeft;
- offsetY += parent.offsetTop;
- }
- if (previous && Sys.Browser.version >= 3) {
- offsetX += parseInt(currentStyle.borderLeftWidth);
- offsetY += parseInt(currentStyle.borderTopWidth);
- }
- }
- currentStyle = Sys.UI.DomElement._getCurrentStyle(element);
- var elementPosition = currentStyle ? currentStyle.position : null;
- if (!elementPosition || (elementPosition !== "absolute")) {
- for (parent = element.parentNode; parent; parent = parent.parentNode) {
- tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
- if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) {
- offsetX -= (parent.scrollLeft || 0);
- offsetY -= (parent.scrollTop || 0);
- }
- currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
- var parentPosition = currentStyle ? currentStyle.position : null;
- if (parentPosition && (parentPosition === "absolute")) break;
- }
- }
- return new Sys.UI.Point(offsetX, offsetY);
- }
-}
-else {
- Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0);
- var offsetX = 0, offsetY = 0,
- parent,
- previous = null,
- previousStyle = null,
- currentStyle = null;
- for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) {
- var tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
- currentStyle = Sys.UI.DomElement._getCurrentStyle(parent);
- if ((parent.offsetLeft || parent.offsetTop) &&
- !((tagName === "BODY") &&
- (!previousStyle || previousStyle.position !== "absolute"))) {
- offsetX += parent.offsetLeft;
- offsetY += parent.offsetTop;
- }
- if (previous !== null && currentStyle) {
- if ((tagName !== "TABLE") && (tagName !== "TD") && (tagName !== "HTML")) {
- offsetX += parseInt(currentStyle.borderLeftWidth) || 0;
- offsetY += parseInt(currentStyle.borderTopWidth) || 0;
- }
- if (tagName === "TABLE" &&
- (currentStyle.position === "relative" || currentStyle.position === "absolute")) {
- offsetX += parseInt(currentStyle.marginLeft) || 0;
- offsetY += parseInt(currentStyle.marginTop) || 0;
- }
- }
- }
- currentStyle = Sys.UI.DomElement._getCurrentStyle(element);
- var elementPosition = currentStyle ? currentStyle.position : null;
- if (!elementPosition || (elementPosition !== "absolute")) {
- for (parent = element.parentNode; parent; parent = parent.parentNode) {
- tagName = parent.tagName ? parent.tagName.toUpperCase() : null;
- if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) {
- offsetX -= (parent.scrollLeft || 0);
- offsetY -= (parent.scrollTop || 0);
- 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.UI.DomElement.isDomElement = function Sys$UI$DomElement$isDomElement(obj) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "obj"}
- ]);
- if (e) throw e;
- return Sys._isDomElement(obj);
-}
-Sys.UI.DomElement.removeCssClass = function Sys$UI$DomElement$removeCssClass(element, className) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "className", type: String}
- ]);
- if (e) throw e;
- var currentClassName = ' ' + element.className + ' ';
- var index = currentClassName.indexOf(' ' + className + ' ');
- if (index >= 0) {
- element.className = (currentClassName.substr(0, index) + ' ' +
- currentClassName.substring(index + className.length + 1, currentClassName.length)).trim();
- }
-}
-Sys.UI.DomElement.resolveElement = function Sys$UI$DomElement$resolveElement(elementOrElementId, containerElement) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "elementOrElementId", mayBeNull: true},
- {name: "containerElement", mayBeNull: true, domElement: true, optional: true}
- ]);
- if (e) throw e;
- var el = elementOrElementId;
- if (!el) return null;
- if (typeof(el) === "string") {
- el = Sys.UI.DomElement.getElementById(el, containerElement);
- if (!el) {
- throw Error.argument("elementOrElementId", String.format(Sys.Res.elementNotFound, elementOrElementId));
- }
- }
- else if(!Sys.UI.DomElement.isDomElement(el)) {
- throw Error.argument("elementOrElementId", Sys.Res.expectedElementOrId);
- }
- return el;
-}
-Sys.UI.DomElement.raiseBubbleEvent = function Sys$UI$DomElement$raiseBubbleEvent(source, args) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "source", domElement: true},
- {name: "args", type: Sys.EventArgs}
- ]);
- if (e) throw e;
- var target = source;
- while (target) {
- var control = target.control;
- if (control && control.onBubbleEvent && control.raiseBubbleEvent) {
- Sys.UI.DomElement._raiseBubbleEventFromControl(control, source, args);
- return;
- }
- target = target.parentNode;
- }
-}
-Sys.UI.DomElement._raiseBubbleEventFromControl = function Sys$UI$DomElement$_raiseBubbleEventFromControl(control, source, args) {
- if (!control.onBubbleEvent(source, args)) {
- control._raiseBubbleEvent(source, args);
- }
-}
-Sys.UI.DomElement.setLocation = function Sys$UI$DomElement$setLocation(element, x, y) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "x", type: Number, integer: true},
- {name: "y", type: Number, integer: true}
- ]);
- if (e) throw e;
- var style = element.style;
- style.position = 'absolute';
- style.left = x + "px";
- style.top = y + "px";
-}
-Sys.UI.DomElement.toggleCssClass = function Sys$UI$DomElement$toggleCssClass(element, className) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "className", type: String}
- ]);
- if (e) throw e;
- if (Sys.UI.DomElement.containsCssClass(element, className)) {
- Sys.UI.DomElement.removeCssClass(element, className);
- }
- else {
- Sys.UI.DomElement.addCssClass(element, className);
- }
-}
-Sys.UI.DomElement.getVisibilityMode = function Sys$UI$DomElement$getVisibilityMode(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- return (element._visibilityMode === Sys.UI.VisibilityMode.hide) ?
- Sys.UI.VisibilityMode.hide :
- Sys.UI.VisibilityMode.collapse;
-}
-Sys.UI.DomElement.setVisibilityMode = function Sys$UI$DomElement$setVisibilityMode(element, value) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "value", type: Sys.UI.VisibilityMode}
- ]);
- if (e) throw e;
- Sys.UI.DomElement._ensureOldDisplayMode(element);
- if (element._visibilityMode !== value) {
- element._visibilityMode = value;
- if (Sys.UI.DomElement.getVisible(element) === false) {
- if (element._visibilityMode === Sys.UI.VisibilityMode.hide) {
- element.style.display = element._oldDisplayMode;
- }
- else {
- element.style.display = 'none';
- }
- }
- element._visibilityMode = value;
- }
-}
-Sys.UI.DomElement.getVisible = function Sys$UI$DomElement$getVisible(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element);
- if (!style) return true;
- return (style.visibility !== 'hidden') && (style.display !== 'none');
-}
-Sys.UI.DomElement.setVisible = function Sys$UI$DomElement$setVisible(element, value) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "value", type: Boolean}
- ]);
- if (e) throw e;
- if (value !== Sys.UI.DomElement.getVisible(element)) {
- Sys.UI.DomElement._ensureOldDisplayMode(element);
- element.style.visibility = value ? 'visible' : 'hidden';
- if (value || (element._visibilityMode === Sys.UI.VisibilityMode.hide)) {
- element.style.display = element._oldDisplayMode;
- }
- else {
- element.style.display = 'none';
- }
- }
-}
-Sys.UI.DomElement._ensureOldDisplayMode = function Sys$UI$DomElement$_ensureOldDisplayMode(element) {
- if (!element._oldDisplayMode) {
- var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element);
- element._oldDisplayMode = style ? style.display : null;
- if (!element._oldDisplayMode || element._oldDisplayMode === 'none') {
- switch(element.tagName.toUpperCase()) {
- case 'DIV': case 'P': case 'ADDRESS': case 'BLOCKQUOTE': case 'BODY': case 'COL':
- case 'COLGROUP': case 'DD': case 'DL': case 'DT': case 'FIELDSET': case 'FORM':
- case 'H1': case 'H2': case 'H3': case 'H4': case 'H5': case 'H6': case 'HR':
- case 'IFRAME': case 'LEGEND': case 'OL': case 'PRE': case 'TABLE': case 'TD':
- case 'TH': case 'TR': case 'UL':
- element._oldDisplayMode = 'block';
- break;
- case 'LI':
- element._oldDisplayMode = 'list-item';
- break;
- default:
- element._oldDisplayMode = 'inline';
- }
- }
- }
-}
-Sys.UI.DomElement._getWindow = function Sys$UI$DomElement$_getWindow(element) {
- var doc = element.ownerDocument || element.document || element;
- return doc.defaultView || doc.parentWindow;
-}
-Sys.UI.DomElement._getCurrentStyle = function Sys$UI$DomElement$_getCurrentStyle(element) {
- if (element.nodeType === 3) return null;
- var w = Sys.UI.DomElement._getWindow(element);
- if (element.documentElement) element = element.documentElement;
- var computedStyle = (w && (element !== w) && w.getComputedStyle) ?
- w.getComputedStyle(element, null) :
- element.currentStyle || element.style;
- if (!computedStyle && (Sys.Browser.agent === Sys.Browser.Safari) && element.style) {
- var oldDisplay = element.style.display;
- var oldPosition = element.style.position;
- element.style.position = 'absolute';
- element.style.display = 'block';
- var style = w.getComputedStyle(element, null);
- element.style.display = oldDisplay;
- element.style.position = oldPosition;
- computedStyle = {};
- for (var n in style) {
- computedStyle[n] = style[n];
- }
- computedStyle.display = 'none';
- }
- return computedStyle;
-}
-
-Sys.IContainer = function Sys$IContainer() {
- throw Error.notImplemented();
-}
- function Sys$IContainer$addComponent(component) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "component", type: Sys.Component}
- ]);
- if (e) throw e;
- throw Error.notImplemented();
- }
- function Sys$IContainer$removeComponent(component) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "component", type: Sys.Component}
- ]);
- if (e) throw e;
- throw Error.notImplemented();
- }
- function Sys$IContainer$findComponent(id) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "id", type: String}
- ]);
- if (e) throw e;
- throw Error.notImplemented();
- }
- function Sys$IContainer$getComponents() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
-Sys.IContainer.prototype = {
- addComponent: Sys$IContainer$addComponent,
- removeComponent: Sys$IContainer$removeComponent,
- findComponent: Sys$IContainer$findComponent,
- getComponents: Sys$IContainer$getComponents
-}
-Sys.IContainer.registerInterface("Sys.IContainer");
-
-Sys.ApplicationLoadEventArgs = function Sys$ApplicationLoadEventArgs(components, isPartialLoad) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "components", type: Array, elementType: Sys.Component},
- {name: "isPartialLoad", type: Boolean}
- ]);
- if (e) throw e;
- Sys.ApplicationLoadEventArgs.initializeBase(this);
- this._components = components;
- this._isPartialLoad = isPartialLoad;
-}
-
- function Sys$ApplicationLoadEventArgs$get_components() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._components;
- }
- function Sys$ApplicationLoadEventArgs$get_isPartialLoad() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._isPartialLoad;
- }
-Sys.ApplicationLoadEventArgs.prototype = {
- get_components: Sys$ApplicationLoadEventArgs$get_components,
- get_isPartialLoad: Sys$ApplicationLoadEventArgs$get_isPartialLoad
-}
-Sys.ApplicationLoadEventArgs.registerClass('Sys.ApplicationLoadEventArgs', Sys.EventArgs);
-
-Sys._Application = function Sys$_Application() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- Sys._Application.initializeBase(this);
- this._disposableObjects = [];
- this._components = {};
- this._createdComponents = [];
- this._secondPassComponents = [];
- this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler);
- Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate);
- this._domReady();
-}
- function Sys$_Application$get_isCreatingComponents() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._creatingComponents;
- }
- function Sys$_Application$get_isDisposing() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._disposing;
- }
- function Sys$_Application$add_init(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- if (this._initialized) {
- handler(this, Sys.EventArgs.Empty);
- }
- else {
- this.get_events().addHandler("init", handler);
- }
- }
- function Sys$_Application$remove_init(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().removeHandler("init", handler);
- }
- function Sys$_Application$add_load(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().addHandler("load", handler);
- }
- function Sys$_Application$remove_load(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().removeHandler("load", handler);
- }
- function Sys$_Application$add_unload(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().addHandler("unload", handler);
- }
- function Sys$_Application$remove_unload(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this.get_events().removeHandler("unload", handler);
- }
- function Sys$_Application$addComponent(component) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "component", type: Sys.Component}
- ]);
- if (e) throw e;
- var id = component.get_id();
- if (!id) throw Error.invalidOperation(Sys.Res.cantAddWithoutId);
- if (typeof(this._components[id]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id));
- this._components[id] = component;
- }
- function Sys$_Application$beginCreateComponents() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._creatingComponents = true;
- }
- function Sys$_Application$dispose() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._disposing) {
- this._disposing = true;
- if (this._timerCookie) {
- window.clearTimeout(this._timerCookie);
- delete this._timerCookie;
- }
- if (this._endRequestHandler) {
- Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);
- delete this._endRequestHandler;
- }
- if (this._beginRequestHandler) {
- Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);
- delete this._beginRequestHandler;
- }
- if (window.pageUnload) {
- window.pageUnload(this, Sys.EventArgs.Empty);
- }
- var unloadHandler = this.get_events().getHandler("unload");
- if (unloadHandler) {
- unloadHandler(this, Sys.EventArgs.Empty);
- }
- var disposableObjects = Array.clone(this._disposableObjects);
- for (var i = 0, l = disposableObjects.length; i < l; i++) {
- var object = disposableObjects[i];
- if (typeof(object) !== "undefined") {
- object.dispose();
- }
- }
- Array.clear(this._disposableObjects);
- 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');
- }
- }
- function Sys$_Application$disposeElement(element, childNodesOnly) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element"},
- {name: "childNodesOnly", type: Boolean}
- ]);
- if (e) throw e;
- if (element.nodeType === 1) {
- var children = element.getElementsByTagName("*");
- for (var i = children.length - 1; i >= 0; i--) {
- this._disposeElementInternal(children[i]);
- }
- if (!childNodesOnly) {
- this._disposeElementInternal(element);
- }
- }
- }
- function Sys$_Application$endCreateComponents() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var components = this._secondPassComponents;
- for (var i = 0, l = components.length; i < l; i++) {
- var component = components[i].component;
- Sys$Component$_setReferences(component, components[i].references);
- component.endUpdate();
- }
- this._secondPassComponents = [];
- this._creatingComponents = false;
- }
- function Sys$_Application$findComponent(id, parent) {
- ///
- ///
- ///
- ///
- 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);
- }
- function Sys$_Application$getComponents() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var res = [];
- var components = this._components;
- for (var name in components) {
- res[res.length] = components[name];
- }
- return res;
- }
- function Sys$_Application$initialize() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if(!this.get_isInitialized() && !this._disposing) {
- Sys._Application.callBaseMethod(this, 'initialize');
- this._raiseInit();
- if (this.get_stateString) {
- if (Sys.WebForms && Sys.WebForms.PageRequestManager) {
- this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest);
- Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);
- this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest);
- Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler);
- }
- var loadedEntry = this.get_stateString();
- if (loadedEntry !== this._currentEntry) {
- this._navigate(loadedEntry);
- }
- else {
- this._ensureHistory();
- }
- }
- this.raiseLoad();
- }
- }
- function Sys$_Application$notifyScriptLoaded() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- }
- function Sys$_Application$registerDisposableObject(object) {
- ///
- ///
- 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;
- }
- }
- function Sys$_Application$raiseLoad() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var h = this.get_events().getHandler("load");
- var args = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded);
- this._loaded = true;
- if (h) {
- h(this, args);
- }
- if (window.pageLoad) {
- window.pageLoad(this, args);
- }
- this._createdComponents = [];
- }
- function Sys$_Application$removeComponent(component) {
- ///
- ///
- 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];
- }
- function Sys$_Application$unregisterDisposableObject(object) {
- ///
- ///
- 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;
- }
- }
- }
- }
- function Sys$_Application$_addComponentToSecondPass(component, references) {
- this._secondPassComponents[this._secondPassComponents.length] = {component: component, references: references};
- }
- function Sys$_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();
- }
- }
- }
- }
- function Sys$_Application$_disposeElementInternal(element) {
- var d = element.dispose;
- if (d && typeof(d) === "function") {
- element.dispose();
- }
- else {
- var c = element.control;
- if (c && typeof(c.dispose) === "function") {
- c.dispose();
- }
- }
- var list = element._behaviors;
- if (list) {
- this._disposeComponents(list);
- }
- list = element._components;
- if (list) {
- this._disposeComponents(list);
- element._components = null;
- }
- }
- function Sys$_Application$_domReady() {
- var check, er, app = this;
- function init() { app.initialize(); }
- var onload = function() {
- Sys.UI.DomEvent.removeHandler(window, "load", onload);
- init();
- }
- Sys.UI.DomEvent.addHandler(window, "load", onload);
-
- if (document.addEventListener) {
- try {
- document.addEventListener("DOMContentLoaded", check = function() {
- document.removeEventListener("DOMContentLoaded", check, false);
- init();
- }, false);
- }
- catch (er) { }
- }
- else if (document.attachEvent) {
- if ((window == window.top) && document.documentElement.doScroll) {
- var timeout, el = document.createElement("div");
- check = function() {
- try {
- el.doScroll("left");
- }
- catch (er) {
- timeout = window.setTimeout(check, 0);
- return;
- }
- el = null;
- init();
- }
- check();
- }
- else {
- document.attachEvent("onreadystatechange", check = function() {
- if (document.readyState === "complete") {
- document.detachEvent("onreadystatechange", check);
- init();
- }
- });
- }
- }
- }
- function Sys$_Application$_raiseInit() {
- var handler = this.get_events().getHandler("init");
- if (handler) {
- this.beginCreateComponents();
- handler(this, Sys.EventArgs.Empty);
- this.endCreateComponents();
- }
- }
- function Sys$_Application$_unloadHandler(event) {
- this.dispose();
- }
-Sys._Application.prototype = {
- _creatingComponents: false,
- _disposing: false,
- _deleteCount: 0,
- get_isCreatingComponents: Sys$_Application$get_isCreatingComponents,
- get_isDisposing: Sys$_Application$get_isDisposing,
- add_init: Sys$_Application$add_init,
- remove_init: Sys$_Application$remove_init,
- add_load: Sys$_Application$add_load,
- remove_load: Sys$_Application$remove_load,
- add_unload: Sys$_Application$add_unload,
- remove_unload: Sys$_Application$remove_unload,
- addComponent: Sys$_Application$addComponent,
- beginCreateComponents: Sys$_Application$beginCreateComponents,
- dispose: Sys$_Application$dispose,
- disposeElement: Sys$_Application$disposeElement,
- endCreateComponents: Sys$_Application$endCreateComponents,
- findComponent: Sys$_Application$findComponent,
- getComponents: Sys$_Application$getComponents,
- initialize: Sys$_Application$initialize,
- notifyScriptLoaded: Sys$_Application$notifyScriptLoaded,
- registerDisposableObject: Sys$_Application$registerDisposableObject,
- raiseLoad: Sys$_Application$raiseLoad,
- removeComponent: Sys$_Application$removeComponent,
- unregisterDisposableObject: Sys$_Application$unregisterDisposableObject,
- _addComponentToSecondPass: Sys$_Application$_addComponentToSecondPass,
- _disposeComponents: Sys$_Application$_disposeComponents,
- _disposeElementInternal: Sys$_Application$_disposeElementInternal,
- _domReady: Sys$_Application$_domReady,
- _raiseInit: Sys$_Application$_raiseInit,
- _unloadHandler: Sys$_Application$_unloadHandler
-}
-Sys._Application.registerClass('Sys._Application', Sys.Component, Sys.IContainer);
-Sys.Application = new Sys._Application();
-var $find = Sys.Application.findComponent;
-
-Sys.UI.Behavior = function Sys$UI$Behavior(element) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- Sys.UI.Behavior.initializeBase(this);
- this._element = element;
- var behaviors = element._behaviors;
- if (!behaviors) {
- element._behaviors = [this];
- }
- else {
- behaviors[behaviors.length] = this;
- }
-}
- function Sys$UI$Behavior$get_element() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._element;
- }
- function Sys$UI$Behavior$get_id() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var baseId = Sys.UI.Behavior.callBaseMethod(this, 'get_id');
- if (baseId) return baseId;
- if (!this._element || !this._element.id) return '';
- return this._element.id + '$' + this.get_name();
- }
- function Sys$UI$Behavior$get_name() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this._name) return this._name;
- var name = Object.getTypeName(this);
- var i = name.lastIndexOf('.');
- if (i !== -1) name = name.substr(i + 1);
- if (!this.get_isInitialized()) this._name = name;
- return name;
- }
- function Sys$UI$Behavior$set_name(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- if ((value === '') || (value.charAt(0) === ' ') || (value.charAt(value.length - 1) === ' '))
- throw Error.argument('value', Sys.Res.invalidId);
- if (typeof(this._element[value]) !== 'undefined')
- throw Error.invalidOperation(String.format(Sys.Res.behaviorDuplicateName, value));
- if (this.get_isInitialized()) throw Error.invalidOperation(Sys.Res.cantSetNameAfterInit);
- this._name = value;
- }
- function Sys$UI$Behavior$initialize() {
- Sys.UI.Behavior.callBaseMethod(this, 'initialize');
- var name = this.get_name();
- if (name) this._element[name] = this;
- }
- function Sys$UI$Behavior$dispose() {
- Sys.UI.Behavior.callBaseMethod(this, 'dispose');
- var e = this._element;
- if (e) {
- var name = this.get_name();
- if (name) {
- e[name] = null;
- }
- var behaviors = e._behaviors;
- Array.remove(behaviors, this);
- if (behaviors.length === 0) {
- e._behaviors = null;
- }
- delete this._element;
- }
- }
-Sys.UI.Behavior.prototype = {
- _name: null,
- get_element: Sys$UI$Behavior$get_element,
- get_id: Sys$UI$Behavior$get_id,
- get_name: Sys$UI$Behavior$get_name,
- set_name: Sys$UI$Behavior$set_name,
- initialize: Sys$UI$Behavior$initialize,
- dispose: Sys$UI$Behavior$dispose
-}
-Sys.UI.Behavior.registerClass('Sys.UI.Behavior', Sys.Component);
-Sys.UI.Behavior.getBehaviorByName = function Sys$UI$Behavior$getBehaviorByName(element, name) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "name", type: String}
- ]);
- if (e) throw e;
- var b = element[name];
- return (b && Sys.UI.Behavior.isInstanceOfType(b)) ? b : null;
-}
-Sys.UI.Behavior.getBehaviors = function Sys$UI$Behavior$getBehaviors(element) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- if (!element._behaviors) return [];
- return Array.clone(element._behaviors);
-}
-Sys.UI.Behavior.getBehaviorsByType = function Sys$UI$Behavior$getBehaviorsByType(element, type) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true},
- {name: "type", type: Type}
- ]);
- if (e) throw e;
- var behaviors = element._behaviors;
- var results = [];
- if (behaviors) {
- for (var i = 0, l = behaviors.length; i < l; i++) {
- if (type.isInstanceOfType(behaviors[i])) {
- results[results.length] = behaviors[i];
- }
- }
- }
- return results;
-}
-
-Sys.UI.VisibilityMode = function Sys$UI$VisibilityMode() {
- ///
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
-}
-Sys.UI.VisibilityMode.prototype = {
- hide: 0,
- collapse: 1
-}
-Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");
-
-Sys.UI.Control = function Sys$UI$Control(element) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "element", domElement: true}
- ]);
- if (e) throw e;
- if (typeof(element.control) !== 'undefined') throw Error.invalidOperation(Sys.Res.controlAlreadyDefined);
- Sys.UI.Control.initializeBase(this);
- this._element = element;
- element.control = this;
- var role = this.get_role();
- if (role) {
- element.setAttribute("role", role);
- }
-}
- function Sys$UI$Control$get_element() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._element;
- }
- function Sys$UI$Control$get_id() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._element) return '';
- return this._element.id;
- }
- function Sys$UI$Control$set_id(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- throw Error.invalidOperation(Sys.Res.cantSetId);
- }
- function Sys$UI$Control$get_parent() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this._parent) return this._parent;
- if (!this._element) return null;
-
- var parentElement = this._element.parentNode;
- while (parentElement) {
- if (parentElement.control) {
- return parentElement.control;
- }
- parentElement = parentElement.parentNode;
- }
- return null;
- }
- function Sys$UI$Control$set_parent(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.Control}]);
- if (e) throw e;
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- var parents = [this];
- var current = value;
- while (current) {
- if (Array.contains(parents, current)) throw Error.invalidOperation(Sys.Res.circularParentChain);
- parents[parents.length] = current;
- current = current.get_parent();
- }
- this._parent = value;
- }
- function Sys$UI$Control$get_role() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return null;
- }
- function Sys$UI$Control$get_visibilityMode() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- return Sys.UI.DomElement.getVisibilityMode(this._element);
- }
- function Sys$UI$Control$set_visibilityMode(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.VisibilityMode}]);
- if (e) throw e;
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- Sys.UI.DomElement.setVisibilityMode(this._element, value);
- }
- function Sys$UI$Control$get_visible() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- return Sys.UI.DomElement.getVisible(this._element);
- }
- function Sys$UI$Control$set_visible(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
- if (e) throw e;
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- Sys.UI.DomElement.setVisible(this._element, value)
- }
- function Sys$UI$Control$addCssClass(className) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "className", type: String}
- ]);
- if (e) throw e;
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- Sys.UI.DomElement.addCssClass(this._element, className);
- }
- function Sys$UI$Control$dispose() {
- Sys.UI.Control.callBaseMethod(this, 'dispose');
- if (this._element) {
- this._element.control = null;
- delete this._element;
- }
- if (this._parent) delete this._parent;
- }
- function Sys$UI$Control$onBubbleEvent(source, args) {
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "source"},
- {name: "args", type: Sys.EventArgs}
- ]);
- if (e) throw e;
- return false;
- }
- function Sys$UI$Control$raiseBubbleEvent(source, args) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "source"},
- {name: "args", type: Sys.EventArgs}
- ]);
- if (e) throw e;
- this._raiseBubbleEvent(source, args);
- }
- function Sys$UI$Control$_raiseBubbleEvent(source, args) {
- var currentTarget = this.get_parent();
- while (currentTarget) {
- if (currentTarget.onBubbleEvent(source, args)) {
- return;
- }
- currentTarget = currentTarget.get_parent();
- }
- }
- function Sys$UI$Control$removeCssClass(className) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "className", type: String}
- ]);
- if (e) throw e;
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- Sys.UI.DomElement.removeCssClass(this._element, className);
- }
- function Sys$UI$Control$toggleCssClass(className) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "className", type: String}
- ]);
- if (e) throw e;
- if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose);
- Sys.UI.DomElement.toggleCssClass(this._element, className);
- }
-Sys.UI.Control.prototype = {
- _parent: null,
- _visibilityMode: Sys.UI.VisibilityMode.hide,
- get_element: Sys$UI$Control$get_element,
- get_id: Sys$UI$Control$get_id,
- set_id: Sys$UI$Control$set_id,
- get_parent: Sys$UI$Control$get_parent,
- set_parent: Sys$UI$Control$set_parent,
- get_role: Sys$UI$Control$get_role,
- get_visibilityMode: Sys$UI$Control$get_visibilityMode,
- set_visibilityMode: Sys$UI$Control$set_visibilityMode,
- get_visible: Sys$UI$Control$get_visible,
- set_visible: Sys$UI$Control$set_visible,
- addCssClass: Sys$UI$Control$addCssClass,
- dispose: Sys$UI$Control$dispose,
- onBubbleEvent: Sys$UI$Control$onBubbleEvent,
- raiseBubbleEvent: Sys$UI$Control$raiseBubbleEvent,
- _raiseBubbleEvent: Sys$UI$Control$_raiseBubbleEvent,
- removeCssClass: Sys$UI$Control$removeCssClass,
- toggleCssClass: Sys$UI$Control$toggleCssClass
-}
-Sys.UI.Control.registerClass('Sys.UI.Control', Sys.Component);
-Sys.HistoryEventArgs = function Sys$HistoryEventArgs(state) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "state", type: Object}
- ]);
- if (e) throw e;
- Sys.HistoryEventArgs.initializeBase(this);
- this._state = state;
-}
- function Sys$HistoryEventArgs$get_state() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._state;
- }
-Sys.HistoryEventArgs.prototype = {
- get_state: Sys$HistoryEventArgs$get_state
-}
-Sys.HistoryEventArgs.registerClass('Sys.HistoryEventArgs', Sys.EventArgs);
-Sys.Application._appLoadHandler = null;
-Sys.Application._beginRequestHandler = null;
-Sys.Application._clientId = null;
-Sys.Application._currentEntry = '';
-Sys.Application._endRequestHandler = null;
-Sys.Application._history = null;
-Sys.Application._enableHistory = false;
-Sys.Application._historyEnabledInScriptManager = false;
-Sys.Application._historyFrame = null;
-Sys.Application._historyInitialized = false;
-Sys.Application._historyPointIsNew = false;
-Sys.Application._ignoreTimer = false;
-Sys.Application._initialState = null;
-Sys.Application._state = {};
-Sys.Application._timerCookie = 0;
-Sys.Application._timerHandler = null;
-Sys.Application._uniqueId = null;
-Sys._Application.prototype.get_stateString = function Sys$_Application$get_stateString() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- var hash = null;
-
- if (Sys.Browser.agent === Sys.Browser.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;
- }
-
- if ((hash.length > 0) && (hash.charAt(0) === '#')) {
- hash = hash.substring(1);
- }
- return hash;
-};
-Sys._Application.prototype.get_enableHistory = function Sys$_Application$get_enableHistory() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._enableHistory;
-};
-Sys._Application.prototype.set_enableHistory = function Sys$_Application$set_enableHistory(value) {
- if (this._initialized && !this._initializing) {
- throw Error.invalidOperation(Sys.Res.historyCannotEnableHistory);
- }
- else if (this._historyEnabledInScriptManager && !value) {
- throw Error.invalidOperation(Sys.Res.invalidHistorySettingCombination);
- }
- this._enableHistory = value;
-};
-Sys._Application.prototype.add_navigate = function Sys$_Application$add_navigate(handler) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- this.get_events().addHandler("navigate", handler);
-};
-Sys._Application.prototype.remove_navigate = function Sys$_Application$remove_navigate(handler) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "handler", type: Function}
- ]);
- if (e) throw e;
- this.get_events().removeHandler("navigate", handler);
-};
-Sys._Application.prototype.addHistoryPoint = function Sys$_Application$addHistoryPoint(state, title) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "state", type: Object},
- {name: "title", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- if (!this._enableHistory) throw Error.invalidOperation(Sys.Res.historyCannotAddHistoryPointWithHistoryDisabled);
- for (var n in state) {
- var v = state[n];
- var t = typeof(v);
- if ((v !== null) && ((t === 'object') || (t === 'function') || (t === 'undefined'))) {
- throw Error.argument('state', Sys.Res.stateMustBeStringDictionary);
- }
- }
- this._ensureHistory();
- var initialState = this._state;
- for (var key in state) {
- var value = state[key];
- if (value === null) {
- if (typeof(initialState[key]) !== 'undefined') {
- delete initialState[key];
- }
- }
- else {
- initialState[key] = value;
- }
- }
- var entry = this._serializeState(initialState);
- this._historyPointIsNew = true;
- this._setState(entry, title);
- this._raiseNavigate();
-};
-Sys._Application.prototype.setServerId = function Sys$_Application$setServerId(clientId, uniqueId) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "clientId", type: String},
- {name: "uniqueId", type: String}
- ]);
- if (e) throw e;
- this._clientId = clientId;
- this._uniqueId = uniqueId;
-};
-Sys._Application.prototype.setServerState = function Sys$_Application$setServerState(value) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "value", type: String}
- ]);
- if (e) throw e;
- this._ensureHistory();
- this._state.__s = value;
- this._updateHiddenField(value);
-};
-Sys._Application.prototype._deserializeState = function Sys$_Application$_deserializeState(entry) {
- var result = {};
- entry = entry || '';
- var serverSeparator = entry.indexOf('&&');
- if ((serverSeparator !== -1) && (serverSeparator + 2 < entry.length)) {
- result.__s = entry.substr(serverSeparator + 2);
- entry = entry.substr(0, serverSeparator);
- }
- var tokens = entry.split('&');
- for (var i = 0, l = tokens.length; i < l; i++) {
- var token = tokens[i];
- var equal = token.indexOf('=');
- if ((equal !== -1) && (equal + 1 < token.length)) {
- var name = token.substr(0, equal);
- var value = token.substr(equal + 1);
- result[name] = decodeURIComponent(value);
- }
- }
- return result;
-};
-Sys._Application.prototype._enableHistoryInScriptManager = function Sys$_Application$_enableHistoryInScriptManager() {
- this._enableHistory = true;
- this._historyEnabledInScriptManager = true;
-};
-Sys._Application.prototype._ensureHistory = function Sys$_Application$_ensureHistory() {
- if (!this._historyInitialized && this._enableHistory) {
- if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.documentMode < 8)) {
- this._historyFrame = document.getElementById('__historyFrame');
- if (!this._historyFrame) throw Error.invalidOperation(Sys.Res.historyMissingFrame);
- this._ignoreIFrame = true;
- }
- this._timerHandler = Function.createDelegate(this, this._onIdle);
- this._timerCookie = window.setTimeout(this._timerHandler, 100);
-
- try {
- this._initialState = this._deserializeState(this.get_stateString());
- } catch(e) {}
-
- this._historyInitialized = true;
- }
-};
-Sys._Application.prototype._navigate = function Sys$_Application$_navigate(entry) {
- this._ensureHistory();
- var state = this._deserializeState(entry);
-
- 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();
-};
-Sys._Application.prototype._onIdle = function Sys$_Application$_onIdle() {
- delete this._timerCookie;
-
- var entry = this.get_stateString();
- if (entry !== this._currentEntry) {
- if (!this._ignoreTimer) {
- this._historyPointIsNew = false;
- this._navigate(entry);
- }
- }
- else {
- this._ignoreTimer = false;
- }
- this._timerCookie = window.setTimeout(this._timerHandler, 100);
-};
-Sys._Application.prototype._onIFrameLoad = function Sys$_Application$_onIFrameLoad(entry) {
- this._ensureHistory();
- if (!this._ignoreIFrame) {
- this._historyPointIsNew = false;
- this._navigate(entry);
- }
- this._ignoreIFrame = false;
-};
-Sys._Application.prototype._onPageRequestManagerBeginRequest = function Sys$_Application$_onPageRequestManagerBeginRequest(sender, args) {
- this._ignoreTimer = true;
-};
-Sys._Application.prototype._onPageRequestManagerEndRequest = function Sys$_Application$_onPageRequestManagerEndRequest(sender, args) {
- var dataItem = args.get_dataItems()[this._clientId];
- var eventTarget = document.getElementById("__EVENTTARGET");
- if (eventTarget && eventTarget.value === this._uniqueId) {
- eventTarget.value = '';
- }
- if (typeof(dataItem) !== 'undefined') {
- this.setServerState(dataItem);
- this._historyPointIsNew = true;
- }
- else {
- this._ignoreTimer = false;
- }
- var entry = this._serializeState(this._state);
- if (entry !== this._currentEntry) {
- this._ignoreTimer = true;
- this._setState(entry);
- this._raiseNavigate();
- }
-};
-Sys._Application.prototype._raiseNavigate = function Sys$_Application$_raiseNavigate() {
- var h = this.get_events().getHandler("navigate");
- var stateClone = {};
- for (var key in this._state) {
- if (key !== '__s') {
- stateClone[key] = this._state[key];
- }
- }
- var args = new Sys.HistoryEventArgs(stateClone);
- if (h) {
- h(this, args);
- }
- var err;
- try {
- if ((Sys.Browser.agent === Sys.Browser.Firefox) && window.location.hash &&
- (!window.frameElement || window.top.location.hash)) {
- window.history.go(0);
- }
- }
- catch(err) {
- }
-};
-Sys._Application.prototype._serializeState = function Sys$_Application$_serializeState(state) {
- var serialized = [];
- for (var key in state) {
- var value = state[key];
- if (key === '__s') {
- var serverState = value;
- }
- else {
- if (key.indexOf('=') !== -1) throw Error.argument('state', Sys.Res.stateFieldNameInvalid);
- serialized[serialized.length] = key + '=' + encodeURIComponent(value);
- }
- }
- return serialized.join('&') + (serverState ? '&&' + serverState : '');
-};
-Sys._Application.prototype._setState = function Sys$_Application$_setState(entry, title) {
- if (this._enableHistory) {
- entry = entry || '';
- if (entry !== this._currentEntry) {
- if (window.theForm) {
- var action = window.theForm.action;
- var hashIndex = action.indexOf('#');
- window.theForm.action = ((hashIndex !== -1) ? action.substring(0, hashIndex) : action) + '#' + entry;
- }
-
- if (this._historyFrame && this._historyPointIsNew) {
- this._ignoreIFrame = true;
- var frameDoc = this._historyFrame.contentWindow.document;
- frameDoc.open("javascript:''");
- frameDoc.write("" + (title || document.title) +
- "parent.Sys.Application._onIFrameLoad(" +
- Sys.Serialization.JavaScriptSerializer.serialize(entry) +
- ");");
- frameDoc.close();
- }
- this._ignoreTimer = false;
- this._currentEntry = entry;
- if (this._historyFrame || this._historyPointIsNew) {
- var currentHash = this.get_stateString();
- if (entry !== currentHash) {
- var loc = document.location;
- if (loc.href.length - loc.hash.length + entry.length > 1024) {
- throw Error.invalidOperation(Sys.Res.urlMustBeLessThan1024chars);
- }
- window.location.hash = entry;
- this._currentEntry = this.get_stateString();
- if ((typeof(title) !== 'undefined') && (title !== null)) {
- document.title = title;
- }
- }
- }
- this._historyPointIsNew = false;
- }
- }
-};
-Sys._Application.prototype._updateHiddenField = function Sys$_Application$_updateHiddenField(value) {
- if (this._clientId) {
- var serverStateField = document.getElementById(this._clientId);
- if (serverStateField) {
- serverStateField.value = value;
- }
- }
-};
-
-if (!window.XMLHttpRequest) {
- window.XMLHttpRequest = function window$XMLHttpRequest() {
- var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ];
- for (var i = 0, l = progIDs.length; i < l; i++) {
- try {
- return new ActiveXObject(progIDs[i]);
- }
- catch (ex) {
- }
- }
- return null;
- }
-}
-Type.registerNamespace('Sys.Net');
-
-Sys.Net.WebRequestExecutor = function Sys$Net$WebRequestExecutor() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._webRequest = null;
- this._resultObject = null;
-}
- function Sys$Net$WebRequestExecutor$get_webRequest() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._webRequest;
- }
- function Sys$Net$WebRequestExecutor$_set_webRequest(value) {
- if (this.get_started()) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'set_webRequest'));
- }
- this._webRequest = value;
- }
- function Sys$Net$WebRequestExecutor$get_started() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_responseAvailable() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_timedOut() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_aborted() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_responseData() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_statusCode() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_statusText() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_xml() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$get_object() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._resultObject) {
- this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());
- }
- return this._resultObject;
- }
- function Sys$Net$WebRequestExecutor$executeRequest() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$abort() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$getResponseHeader(header) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "header", type: String}
- ]);
- if (e) throw e;
- throw Error.notImplemented();
- }
- function Sys$Net$WebRequestExecutor$getAllResponseHeaders() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- throw Error.notImplemented();
- }
-Sys.Net.WebRequestExecutor.prototype = {
- get_webRequest: Sys$Net$WebRequestExecutor$get_webRequest,
- _set_webRequest: Sys$Net$WebRequestExecutor$_set_webRequest,
- get_started: Sys$Net$WebRequestExecutor$get_started,
- get_responseAvailable: Sys$Net$WebRequestExecutor$get_responseAvailable,
- get_timedOut: Sys$Net$WebRequestExecutor$get_timedOut,
- get_aborted: Sys$Net$WebRequestExecutor$get_aborted,
- get_responseData: Sys$Net$WebRequestExecutor$get_responseData,
- get_statusCode: Sys$Net$WebRequestExecutor$get_statusCode,
- get_statusText: Sys$Net$WebRequestExecutor$get_statusText,
- get_xml: Sys$Net$WebRequestExecutor$get_xml,
- get_object: Sys$Net$WebRequestExecutor$get_object,
- executeRequest: Sys$Net$WebRequestExecutor$executeRequest,
- abort: Sys$Net$WebRequestExecutor$abort,
- getResponseHeader: Sys$Net$WebRequestExecutor$getResponseHeader,
- getAllResponseHeaders: Sys$Net$WebRequestExecutor$getAllResponseHeaders
-}
-Sys.Net.WebRequestExecutor.registerClass('Sys.Net.WebRequestExecutor');
-
-Sys.Net.XMLDOM = function Sys$Net$XMLDOM(markup) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "markup", type: String}
- ]);
- if (e) throw e;
- if (!window.DOMParser) {
- var 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 = function Sys$Net$XMLHttpExecutor() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- Sys.Net.XMLHttpExecutor.initializeBase(this);
- var _this = this;
- this._xmlHttpRequest = null;
- this._webRequest = null;
- this._responseAvailable = false;
- this._timedOut = false;
- this._timer = null;
- this._aborted = false;
- this._started = false;
- this._onReadyStateChange = (function () {
-
- if (_this._xmlHttpRequest.readyState === 4 ) {
- 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 != null) {
- _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
- _this._xmlHttpRequest = null;
- }
- }
- });
- this._clearTimer = (function() {
- if (_this._timer != null) {
- window.clearTimeout(_this._timer);
- _this._timer = null;
- }
- });
- this._onTimeout = (function() {
- if (!_this._responseAvailable) {
- _this._clearTimer();
- _this._timedOut = true;
- _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
- _this._xmlHttpRequest.abort();
- _this._webRequest.completed(Sys.EventArgs.Empty);
- _this._xmlHttpRequest = null;
- }
- });
-}
- function Sys$Net$XMLHttpExecutor$get_timedOut() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._timedOut;
- }
- function Sys$Net$XMLHttpExecutor$get_started() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._started;
- }
- function Sys$Net$XMLHttpExecutor$get_responseAvailable() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._responseAvailable;
- }
- function Sys$Net$XMLHttpExecutor$get_aborted() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._aborted;
- }
- function Sys$Net$XMLHttpExecutor$executeRequest() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._webRequest = this.get_webRequest();
- if (this._started) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'executeRequest'));
- }
- if (this._webRequest === null) {
- throw Error.invalidOperation(Sys.Res.nullWebRequest);
- }
- var body = this._webRequest.get_body();
- var headers = this._webRequest.get_headers();
- this._xmlHttpRequest = new XMLHttpRequest();
- this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange;
- var verb = this._webRequest.get_httpVerb();
- this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true );
- this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- if (headers) {
- for (var header in headers) {
- var val = headers[header];
- if (typeof(val) !== "function")
- this._xmlHttpRequest.setRequestHeader(header, val);
- }
- }
- if (verb.toLowerCase() === "post") {
- if ((headers === null) || !headers['Content-Type']) {
- this._xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
- }
- if (!body) {
- body = "";
- }
- }
- var timeout = this._webRequest.get_timeout();
- if (timeout > 0) {
- this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), timeout);
- }
- this._xmlHttpRequest.send(body);
- this._started = true;
- }
- function Sys$Net$XMLHttpExecutor$getResponseHeader(header) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "header", type: String}
- ]);
- if (e) throw e;
- if (!this._responseAvailable) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getResponseHeader'));
- }
- if (!this._xmlHttpRequest) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getResponseHeader'));
- }
- var result;
- try {
- result = this._xmlHttpRequest.getResponseHeader(header);
- } catch (e) {
- }
- if (!result) result = "";
- return result;
- }
- function Sys$Net$XMLHttpExecutor$getAllResponseHeaders() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._responseAvailable) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getAllResponseHeaders'));
- }
- if (!this._xmlHttpRequest) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getAllResponseHeaders'));
- }
- return this._xmlHttpRequest.getAllResponseHeaders();
- }
- function Sys$Net$XMLHttpExecutor$get_responseData() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._responseAvailable) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_responseData'));
- }
- if (!this._xmlHttpRequest) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_responseData'));
- }
- return this._xmlHttpRequest.responseText;
- }
- function Sys$Net$XMLHttpExecutor$get_statusCode() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._responseAvailable) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusCode'));
- }
- if (!this._xmlHttpRequest) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusCode'));
- }
- var result = 0;
- try {
- result = this._xmlHttpRequest.status;
- }
- catch(ex) {
- }
- return result;
- }
- function Sys$Net$XMLHttpExecutor$get_statusText() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._responseAvailable) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusText'));
- }
- if (!this._xmlHttpRequest) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusText'));
- }
- return this._xmlHttpRequest.statusText;
- }
- function Sys$Net$XMLHttpExecutor$get_xml() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._responseAvailable) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_xml'));
- }
- if (!this._xmlHttpRequest) {
- throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_xml'));
- }
- var xml = this._xmlHttpRequest.responseXML;
- if (!xml || !xml.documentElement) {
- xml = Sys.Net.XMLDOM(this._xmlHttpRequest.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;
- }
- function Sys$Net$XMLHttpExecutor$abort() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (!this._started) {
- throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart);
- }
- if (this._aborted || this._responseAvailable || this._timedOut)
- return;
- this._aborted = true;
- this._clearTimer();
- if (this._xmlHttpRequest && !this._responseAvailable) {
- this._xmlHttpRequest.onreadystatechange = Function.emptyMethod;
- this._xmlHttpRequest.abort();
-
- this._xmlHttpRequest = null;
- this._webRequest.completed(Sys.EventArgs.Empty);
- }
- }
-Sys.Net.XMLHttpExecutor.prototype = {
- get_timedOut: Sys$Net$XMLHttpExecutor$get_timedOut,
- get_started: Sys$Net$XMLHttpExecutor$get_started,
- get_responseAvailable: Sys$Net$XMLHttpExecutor$get_responseAvailable,
- get_aborted: Sys$Net$XMLHttpExecutor$get_aborted,
- executeRequest: Sys$Net$XMLHttpExecutor$executeRequest,
- getResponseHeader: Sys$Net$XMLHttpExecutor$getResponseHeader,
- getAllResponseHeaders: Sys$Net$XMLHttpExecutor$getAllResponseHeaders,
- get_responseData: Sys$Net$XMLHttpExecutor$get_responseData,
- get_statusCode: Sys$Net$XMLHttpExecutor$get_statusCode,
- get_statusText: Sys$Net$XMLHttpExecutor$get_statusText,
- get_xml: Sys$Net$XMLHttpExecutor$get_xml,
- abort: Sys$Net$XMLHttpExecutor$abort
-}
-Sys.Net.XMLHttpExecutor.registerClass('Sys.Net.XMLHttpExecutor', Sys.Net.WebRequestExecutor);
-
-Sys.Net._WebRequestManager = function Sys$Net$_WebRequestManager() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._defaultTimeout = 0;
- this._defaultExecutorType = "Sys.Net.XMLHttpExecutor";
-}
- function Sys$Net$_WebRequestManager$add_invokingRequest(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this._get_eventHandlerList().addHandler("invokingRequest", handler);
- }
- function Sys$Net$_WebRequestManager$remove_invokingRequest(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this._get_eventHandlerList().removeHandler("invokingRequest", handler);
- }
- function Sys$Net$_WebRequestManager$add_completedRequest(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this._get_eventHandlerList().addHandler("completedRequest", handler);
- }
- function Sys$Net$_WebRequestManager$remove_completedRequest(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this._get_eventHandlerList().removeHandler("completedRequest", handler);
- }
- function Sys$Net$_WebRequestManager$_get_eventHandlerList() {
- if (!this._events) {
- this._events = new Sys.EventHandlerList();
- }
- return this._events;
- }
- function Sys$Net$_WebRequestManager$get_defaultTimeout() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._defaultTimeout;
- }
- function Sys$Net$_WebRequestManager$set_defaultTimeout(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Number}]);
- if (e) throw e;
- if (value < 0) {
- throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout);
- }
- this._defaultTimeout = value;
- }
- function Sys$Net$_WebRequestManager$get_defaultExecutorType() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._defaultExecutorType;
- }
- function Sys$Net$_WebRequestManager$set_defaultExecutorType(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- this._defaultExecutorType = value;
- }
- function Sys$Net$_WebRequestManager$executeRequest(webRequest) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "webRequest", type: Sys.Net.WebRequest}
- ]);
- if (e) throw e;
- var executor = webRequest.get_executor();
- if (!executor) {
- var failed = false;
- try {
- var executorType = eval(this._defaultExecutorType);
- executor = new executorType();
- } catch (e) {
- failed = true;
- }
- 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()) {
- return;
- }
- var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest);
- var handler = this._get_eventHandlerList().getHandler("invokingRequest");
- if (handler) {
- handler(this, evArgs);
- }
- if (!evArgs.get_cancel()) {
- executor.executeRequest();
- }
- }
-Sys.Net._WebRequestManager.prototype = {
- add_invokingRequest: Sys$Net$_WebRequestManager$add_invokingRequest,
- remove_invokingRequest: Sys$Net$_WebRequestManager$remove_invokingRequest,
- add_completedRequest: Sys$Net$_WebRequestManager$add_completedRequest,
- remove_completedRequest: Sys$Net$_WebRequestManager$remove_completedRequest,
- _get_eventHandlerList: Sys$Net$_WebRequestManager$_get_eventHandlerList,
- get_defaultTimeout: Sys$Net$_WebRequestManager$get_defaultTimeout,
- set_defaultTimeout: Sys$Net$_WebRequestManager$set_defaultTimeout,
- get_defaultExecutorType: Sys$Net$_WebRequestManager$get_defaultExecutorType,
- set_defaultExecutorType: Sys$Net$_WebRequestManager$set_defaultExecutorType,
- executeRequest: Sys$Net$_WebRequestManager$executeRequest
-}
-Sys.Net._WebRequestManager.registerClass('Sys.Net._WebRequestManager');
-Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager();
-
-Sys.Net.NetworkRequestEventArgs = function Sys$Net$NetworkRequestEventArgs(webRequest) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "webRequest", type: Sys.Net.WebRequest}
- ]);
- if (e) throw e;
- Sys.Net.NetworkRequestEventArgs.initializeBase(this);
- this._webRequest = webRequest;
-}
- function Sys$Net$NetworkRequestEventArgs$get_webRequest() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._webRequest;
- }
-Sys.Net.NetworkRequestEventArgs.prototype = {
- get_webRequest: Sys$Net$NetworkRequestEventArgs$get_webRequest
-}
-Sys.Net.NetworkRequestEventArgs.registerClass('Sys.Net.NetworkRequestEventArgs', Sys.CancelEventArgs);
-
-Sys.Net.WebRequest = function Sys$Net$WebRequest() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._url = "";
- this._headers = { };
- this._body = null;
- this._userContext = null;
- this._httpVerb = null;
- this._executor = null;
- this._invokeCalled = false;
- this._timeout = 0;
-}
- function Sys$Net$WebRequest$add_completed(handler) {
- ///
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this._get_eventHandlerList().addHandler("completed", handler);
- }
- function Sys$Net$WebRequest$remove_completed(handler) {
- var e = Function._validateParams(arguments, [{name: "handler", type: Function}]);
- if (e) throw e;
- this._get_eventHandlerList().removeHandler("completed", handler);
- }
- function Sys$Net$WebRequest$completed(eventArgs) {
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "eventArgs", type: Sys.EventArgs}
- ]);
- if (e) throw e;
- var handler = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");
- if (handler) {
- handler(this._executor, eventArgs);
- }
- handler = this._get_eventHandlerList().getHandler("completed");
- if (handler) {
- handler(this._executor, eventArgs);
- }
- }
- function Sys$Net$WebRequest$_get_eventHandlerList() {
- if (!this._events) {
- this._events = new Sys.EventHandlerList();
- }
- return this._events;
- }
- function Sys$Net$WebRequest$get_url() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._url;
- }
- function Sys$Net$WebRequest$set_url(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- this._url = value;
- }
- function Sys$Net$WebRequest$get_headers() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._headers;
- }
- function Sys$Net$WebRequest$get_httpVerb() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this._httpVerb === null) {
- if (this._body === null) {
- return "GET";
- }
- return "POST";
- }
- return this._httpVerb;
- }
- function Sys$Net$WebRequest$set_httpVerb(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- if (value.length === 0) {
- throw Error.argument('value', Sys.Res.invalidHttpVerb);
- }
- this._httpVerb = value;
- }
- function Sys$Net$WebRequest$get_body() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._body;
- }
- function Sys$Net$WebRequest$set_body(value) {
- var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]);
- if (e) throw e;
- this._body = value;
- }
- function Sys$Net$WebRequest$get_userContext() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._userContext;
- }
- function Sys$Net$WebRequest$set_userContext(value) {
- var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]);
- if (e) throw e;
- this._userContext = value;
- }
- function Sys$Net$WebRequest$get_executor() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._executor;
- }
- function Sys$Net$WebRequest$set_executor(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Sys.Net.WebRequestExecutor}]);
- if (e) throw e;
- if (this._executor !== null && this._executor.get_started()) {
- throw Error.invalidOperation(Sys.Res.setExecutorAfterActive);
- }
- this._executor = value;
- this._executor._set_webRequest(this);
- }
- function Sys$Net$WebRequest$get_timeout() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this._timeout === 0) {
- return Sys.Net.WebRequestManager.get_defaultTimeout();
- }
- return this._timeout;
- }
- function Sys$Net$WebRequest$set_timeout(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Number}]);
- if (e) throw e;
- if (value < 0) {
- throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout);
- }
- this._timeout = value;
- }
- function Sys$Net$WebRequest$getResolvedUrl() {
- ///
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return Sys.Net.WebRequest._resolveUrl(this._url);
- }
- function Sys$Net$WebRequest$invoke() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- if (this._invokeCalled) {
- throw Error.invalidOperation(Sys.Res.invokeCalledTwice);
- }
- Sys.Net.WebRequestManager.executeRequest(this);
- this._invokeCalled = true;
- }
-Sys.Net.WebRequest.prototype = {
- add_completed: Sys$Net$WebRequest$add_completed,
- remove_completed: Sys$Net$WebRequest$remove_completed,
- completed: Sys$Net$WebRequest$completed,
- _get_eventHandlerList: Sys$Net$WebRequest$_get_eventHandlerList,
- get_url: Sys$Net$WebRequest$get_url,
- set_url: Sys$Net$WebRequest$set_url,
- get_headers: Sys$Net$WebRequest$get_headers,
- get_httpVerb: Sys$Net$WebRequest$get_httpVerb,
- set_httpVerb: Sys$Net$WebRequest$set_httpVerb,
- get_body: Sys$Net$WebRequest$get_body,
- set_body: Sys$Net$WebRequest$set_body,
- get_userContext: Sys$Net$WebRequest$get_userContext,
- set_userContext: Sys$Net$WebRequest$set_userContext,
- get_executor: Sys$Net$WebRequest$get_executor,
- set_executor: Sys$Net$WebRequest$set_executor,
- get_timeout: Sys$Net$WebRequest$get_timeout,
- set_timeout: Sys$Net$WebRequest$set_timeout,
- getResolvedUrl: Sys$Net$WebRequest$getResolvedUrl,
- invoke: Sys$Net$WebRequest$invoke
-}
-Sys.Net.WebRequest._resolveUrl = function Sys$Net$WebRequest$_resolveUrl(url, baseUrl) {
- if (url && url.indexOf('://') !== -1) {
- return url;
- }
- if (!baseUrl || baseUrl.length === 0) {
- var baseElement = document.getElementsByTagName('base')[0];
- if (baseElement && baseElement.href && baseElement.href.length > 0) {
- baseUrl = baseElement.href;
- }
- else {
- baseUrl = document.URL;
- }
- }
- var qsStart = baseUrl.indexOf('?');
- if (qsStart !== -1) {
- baseUrl = baseUrl.substr(0, qsStart);
- }
- qsStart = baseUrl.indexOf('#');
- if (qsStart !== -1) {
- baseUrl = baseUrl.substr(0, qsStart);
- }
- baseUrl = baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1);
- if (!url || url.length === 0) {
- return baseUrl;
- }
- if (url.charAt(0) === '/') {
- var slashslash = baseUrl.indexOf('://');
- if (slashslash === -1) {
- throw Error.argument("baseUrl", Sys.Res.badBaseUrl1);
- }
- var nextSlash = baseUrl.indexOf('/', slashslash + 3);
- if (nextSlash === -1) {
- throw Error.argument("baseUrl", Sys.Res.badBaseUrl2);
- }
- return baseUrl.substr(0, nextSlash) + url;
- }
- else {
- var lastSlash = baseUrl.lastIndexOf('/');
- if (lastSlash === -1) {
- throw Error.argument("baseUrl", Sys.Res.badBaseUrl3);
- }
- return baseUrl.substr(0, lastSlash+1) + url;
- }
-}
-Sys.Net.WebRequest._createQueryString = function Sys$Net$WebRequest$_createQueryString(queryString, encodeMethod, addParams) {
- encodeMethod = encodeMethod || encodeURIComponent;
- var i = 0, obj, val, arg, sb = new Sys.StringBuilder();
- if (queryString) {
- for (arg in queryString) {
- obj = queryString[arg];
- if (typeof(obj) === "function") continue;
- val = Sys.Serialization.JavaScriptSerializer.serialize(obj);
- if (i++) {
- sb.append('&');
- }
- sb.append(arg);
- sb.append('=');
- sb.append(encodeMethod(val));
- }
- }
- if (addParams) {
- if (i) {
- sb.append('&');
- }
- sb.append(addParams);
- }
- return sb.toString();
-}
-Sys.Net.WebRequest._createUrl = function Sys$Net$WebRequest$_createUrl(url, queryString, addParams) {
- if (!queryString && !addParams) {
- return url;
- }
- var qs = Sys.Net.WebRequest._createQueryString(queryString, null, addParams);
- return qs.length
- ? url + ((url && url.indexOf('?') >= 0) ? "&" : "?") + qs
- : url;
-}
-Sys.Net.WebRequest.registerClass('Sys.Net.WebRequest');
-
-Sys._ScriptLoaderTask = function Sys$_ScriptLoaderTask(scriptElement, completedCallback) {
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "scriptElement", domElement: true},
- {name: "completedCallback", type: Function}
- ]);
- if (e) throw e;
- this._scriptElement = scriptElement;
- this._completedCallback = completedCallback;
-}
- function Sys$_ScriptLoaderTask$get_scriptElement() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._scriptElement;
- }
- function Sys$_ScriptLoaderTask$dispose() {
- if(this._disposed) {
- return;
- }
- this._disposed = true;
- this._removeScriptElementHandlers();
- Sys._ScriptLoaderTask._clearScript(this._scriptElement);
- this._scriptElement = null;
- }
- function Sys$_ScriptLoaderTask$execute() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- this._addScriptElementHandlers();
- var headElements = document.getElementsByTagName('head');
- if (headElements.length === 0) {
- throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead);
- }
- else {
- headElements[0].appendChild(this._scriptElement);
- }
- }
- function Sys$_ScriptLoaderTask$_addScriptElementHandlers() {
- this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler);
-
- if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) {
- this._scriptElement.readyState = 'loaded';
- $addHandler(this._scriptElement, 'load', this._scriptLoadDelegate);
- }
- else {
- $addHandler(this._scriptElement, 'readystatechange', this._scriptLoadDelegate);
- }
- if (this._scriptElement.addEventListener) {
- this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler);
- this._scriptElement.addEventListener('error', this._scriptErrorDelegate, false);
- }
- }
- function Sys$_ScriptLoaderTask$_removeScriptElementHandlers() {
- if(this._scriptLoadDelegate) {
- var scriptElement = this.get_scriptElement();
- if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) {
- $removeHandler(scriptElement, 'load', this._scriptLoadDelegate);
- }
- else {
- $removeHandler(scriptElement, 'readystatechange', this._scriptLoadDelegate);
- }
- if (this._scriptErrorDelegate) {
- this._scriptElement.removeEventListener('error', this._scriptErrorDelegate, false);
- this._scriptErrorDelegate = null;
- }
- this._scriptLoadDelegate = null;
- }
- }
- function Sys$_ScriptLoaderTask$_scriptErrorHandler() {
- if(this._disposed) {
- return;
- }
-
- this._completedCallback(this.get_scriptElement(), false);
- }
- function Sys$_ScriptLoaderTask$_scriptLoadHandler() {
- if(this._disposed) {
- return;
- }
- var scriptElement = this.get_scriptElement();
- if ((scriptElement.readyState !== 'loaded') &&
- (scriptElement.readyState !== 'complete')) {
- return;
- }
-
- this._completedCallback(scriptElement, true);
- }
-Sys._ScriptLoaderTask.prototype = {
- get_scriptElement: Sys$_ScriptLoaderTask$get_scriptElement,
- dispose: Sys$_ScriptLoaderTask$dispose,
- execute: Sys$_ScriptLoaderTask$execute,
- _addScriptElementHandlers: Sys$_ScriptLoaderTask$_addScriptElementHandlers,
- _removeScriptElementHandlers: Sys$_ScriptLoaderTask$_removeScriptElementHandlers,
- _scriptErrorHandler: Sys$_ScriptLoaderTask$_scriptErrorHandler,
- _scriptLoadHandler: Sys$_ScriptLoaderTask$_scriptLoadHandler
-}
-Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable);
-Sys._ScriptLoaderTask._clearScript = function Sys$_ScriptLoaderTask$_clearScript(scriptElement) {
- if (!Sys.Debug.isDebug) {
- scriptElement.parentNode.removeChild(scriptElement);
- }
-}
-Type.registerNamespace('Sys.Net');
-
-Sys.Net.WebServiceProxy = function Sys$Net$WebServiceProxy() {
-}
- function Sys$Net$WebServiceProxy$get_timeout() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._timeout || 0;
- }
- function Sys$Net$WebServiceProxy$set_timeout(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Number}]);
- if (e) throw e;
- if (value < 0) { throw Error.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); }
- this._timeout = value;
- }
- function Sys$Net$WebServiceProxy$get_defaultUserContext() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return (typeof(this._userContext) === "undefined") ? null : this._userContext;
- }
- function Sys$Net$WebServiceProxy$set_defaultUserContext(value) {
- var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]);
- if (e) throw e;
- this._userContext = value;
- }
- function Sys$Net$WebServiceProxy$get_defaultSucceededCallback() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._succeeded || null;
- }
- function Sys$Net$WebServiceProxy$set_defaultSucceededCallback(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]);
- if (e) throw e;
- this._succeeded = value;
- }
- function Sys$Net$WebServiceProxy$get_defaultFailedCallback() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._failed || null;
- }
- function Sys$Net$WebServiceProxy$set_defaultFailedCallback(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]);
- if (e) throw e;
- this._failed = value;
- }
- function Sys$Net$WebServiceProxy$get_enableJsonp() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return !!this._jsonp;
- }
- function Sys$Net$WebServiceProxy$set_enableJsonp(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]);
- if (e) throw e;
- this._jsonp = value;
- }
- function Sys$Net$WebServiceProxy$get_path() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._path || null;
- }
- function Sys$Net$WebServiceProxy$set_path(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- this._path = value;
- }
- function Sys$Net$WebServiceProxy$get_jsonpCallbackParameter() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._callbackParameter || "callback";
- }
- function Sys$Net$WebServiceProxy$set_jsonpCallbackParameter(value) {
- var e = Function._validateParams(arguments, [{name: "value", type: String}]);
- if (e) throw e;
- this._callbackParameter = value;
- }
- function Sys$Net$WebServiceProxy$_invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "servicePath", type: String},
- {name: "methodName", type: String},
- {name: "useGet", type: Boolean},
- {name: "params"},
- {name: "onSuccess", type: Function, mayBeNull: true, optional: true},
- {name: "onFailure", type: Function, mayBeNull: true, optional: true},
- {name: "userContext", mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- onSuccess = onSuccess || this.get_defaultSucceededCallback();
- onFailure = onFailure || this.get_defaultFailedCallback();
- if (userContext === null || typeof userContext === 'undefined') userContext = this.get_defaultUserContext();
- return Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter());
- }
-Sys.Net.WebServiceProxy.prototype = {
- get_timeout: Sys$Net$WebServiceProxy$get_timeout,
- set_timeout: Sys$Net$WebServiceProxy$set_timeout,
- get_defaultUserContext: Sys$Net$WebServiceProxy$get_defaultUserContext,
- set_defaultUserContext: Sys$Net$WebServiceProxy$set_defaultUserContext,
- get_defaultSucceededCallback: Sys$Net$WebServiceProxy$get_defaultSucceededCallback,
- set_defaultSucceededCallback: Sys$Net$WebServiceProxy$set_defaultSucceededCallback,
- get_defaultFailedCallback: Sys$Net$WebServiceProxy$get_defaultFailedCallback,
- set_defaultFailedCallback: Sys$Net$WebServiceProxy$set_defaultFailedCallback,
- get_enableJsonp: Sys$Net$WebServiceProxy$get_enableJsonp,
- set_enableJsonp: Sys$Net$WebServiceProxy$set_enableJsonp,
- get_path: Sys$Net$WebServiceProxy$get_path,
- set_path: Sys$Net$WebServiceProxy$set_path,
- get_jsonpCallbackParameter: Sys$Net$WebServiceProxy$get_jsonpCallbackParameter,
- set_jsonpCallbackParameter: Sys$Net$WebServiceProxy$set_jsonpCallbackParameter,
- _invoke: Sys$Net$WebServiceProxy$_invoke
-}
-Sys.Net.WebServiceProxy.registerClass('Sys.Net.WebServiceProxy');
-Sys.Net.WebServiceProxy.invoke = function Sys$Net$WebServiceProxy$invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, timeout, enableJsonp, jsonpCallbackParameter) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "servicePath", type: String},
- {name: "methodName", type: String, mayBeNull: true, optional: true},
- {name: "useGet", type: Boolean, optional: true},
- {name: "params", mayBeNull: true, optional: true},
- {name: "onSuccess", type: Function, mayBeNull: true, optional: true},
- {name: "onFailure", type: Function, mayBeNull: true, optional: true},
- {name: "userContext", mayBeNull: true, optional: true},
- {name: "timeout", type: Number, optional: true},
- {name: "enableJsonp", type: Boolean, mayBeNull: true, optional: true},
- {name: "jsonpCallbackParameter", type: String, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- var schemeHost = (enableJsonp !== false) ? Sys.Net.WebServiceProxy._xdomain.exec(servicePath) : null,
- tempCallback, jsonp = schemeHost && (schemeHost.length === 3) &&
- ((schemeHost[1] !== location.protocol) || (schemeHost[2] !== location.host));
- useGet = jsonp || useGet;
- if (jsonp) {
- jsonpCallbackParameter = jsonpCallbackParameter || "callback";
- tempCallback = "_jsonp" + Sys._jsonp++;
- }
- if (!params) params = {};
- var urlParams = params;
- if (!useGet || !urlParams) urlParams = {};
- var script, error, timeoutcookie = null, loader, body = null,
- url = Sys.Net.WebRequest._createUrl(methodName
- ? (servicePath+"/"+encodeURIComponent(methodName))
- : servicePath, urlParams, jsonp ? (jsonpCallbackParameter + "=Sys." + tempCallback) : null);
- if (jsonp) {
- script = document.createElement("script");
- script.src = url;
- loader = new Sys._ScriptLoaderTask(script, function(script, loaded) {
- if (!loaded || tempCallback) {
- jsonpComplete({ Message: String.format(Sys.Res.webServiceFailedNoMsg, methodName) }, -1);
- }
- });
- function jsonpComplete(data, statusCode) {
- if (timeoutcookie !== null) {
- window.clearTimeout(timeoutcookie);
- timeoutcookie = null;
- }
- loader.dispose();
- delete Sys[tempCallback];
- tempCallback = null;
- if ((typeof(statusCode) !== "undefined") && (statusCode !== 200)) {
- if (onFailure) {
- error = new Sys.Net.WebServiceError(false,
- data.Message || String.format(Sys.Res.webServiceFailedNoMsg, methodName),
- data.StackTrace || null,
- data.ExceptionType || null,
- data);
- error._statusCode = statusCode;
- onFailure(error, userContext, methodName);
- }
- else {
- if (data.StackTrace && data.Message) {
- error = data.StackTrace + "-- " + data.Message;
- }
- else {
- error = data.StackTrace || data.Message;
- }
- error = String.format(error ? Sys.Res.webServiceFailed : Sys.Res.webServiceFailedNoMsg, methodName, error);
- throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error));
- }
- }
- else if (onSuccess) {
- onSuccess(data, userContext, methodName);
- }
- }
- Sys[tempCallback] = jsonpComplete;
- loader.execute();
- return null;
- }
- var request = new Sys.Net.WebRequest();
- request.set_url(url);
- request.get_headers()['Content-Type'] = 'application/json; charset=utf-8';
- if (!useGet) {
- body = Sys.Serialization.JavaScriptSerializer.serialize(params);
- if (body === "{}") body = "";
- }
- request.set_body(body);
- request.add_completed(onComplete);
- if (timeout && timeout > 0) request.set_timeout(timeout);
- request.invoke();
-
- function onComplete(response, eventArgs) {
- if (response.get_responseAvailable()) {
- var statusCode = response.get_statusCode();
- var result = null;
-
- try {
- var contentType = response.getResponseHeader("Content-Type");
- if (contentType.startsWith("application/json")) {
- result = response.get_object();
- }
- else if (contentType.startsWith("text/xml")) {
- result = response.get_xml();
- }
- else {
- result = response.get_responseData();
- }
- } catch (ex) {
- }
- var error = response.getResponseHeader("jsonerror");
- var errorObj = (error === "true");
- if (errorObj) {
- if (result) {
- result = new Sys.Net.WebServiceError(false, result.Message, result.StackTrace, result.ExceptionType, result);
- }
- }
- else if (contentType.startsWith("application/json")) {
- result = (!result || (typeof(result.d) === "undefined")) ? result : result.d;
- }
- if (((statusCode < 200) || (statusCode >= 300)) || errorObj) {
- if (onFailure) {
- if (!result || !errorObj) {
- result = new Sys.Net.WebServiceError(false , String.format(Sys.Res.webServiceFailedNoMsg, methodName));
- }
- result._statusCode = statusCode;
- onFailure(result, userContext, methodName);
- }
- else {
- if (result && errorObj) {
- error = result.get_exceptionType() + "-- " + result.get_message();
- }
- else {
- error = response.get_responseData();
- }
- throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error));
- }
- }
- else if (onSuccess) {
- onSuccess(result, userContext, methodName);
- }
- }
- else {
- var msg;
- if (response.get_timedOut()) {
- msg = String.format(Sys.Res.webServiceTimedOut, methodName);
- }
- else {
- msg = String.format(Sys.Res.webServiceFailedNoMsg, methodName)
- }
- if (onFailure) {
- onFailure(new Sys.Net.WebServiceError(response.get_timedOut(), msg, "", ""), userContext, methodName);
- }
- else {
- throw Sys.Net.WebServiceProxy._createFailedError(methodName, msg);
- }
- }
- }
- return request;
-}
-Sys.Net.WebServiceProxy._createFailedError = function Sys$Net$WebServiceProxy$_createFailedError(methodName, errorMessage) {
- var displayMessage = "Sys.Net.WebServiceFailedException: " + errorMessage;
- var e = Error.create(displayMessage, { 'name': 'Sys.Net.WebServiceFailedException', 'methodName': methodName });
- e.popStackFrame();
- return e;
-}
-Sys.Net.WebServiceProxy._defaultFailedCallback = function Sys$Net$WebServiceProxy$_defaultFailedCallback(err, methodName) {
- var error = err.get_exceptionType() + "-- " + err.get_message();
- throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error));
-}
-Sys.Net.WebServiceProxy._generateTypedConstructor = function Sys$Net$WebServiceProxy$_generateTypedConstructor(type) {
- return function(properties) {
- if (properties) {
- for (var name in properties) {
- this[name] = properties[name];
- }
- }
- this.__type = type;
- }
-}
-Sys._jsonp = 0;
-Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;
-
-Sys.Net.WebServiceError = function Sys$Net$WebServiceError(timedOut, message, stackTrace, exceptionType, errorObject) {
- ///
- ///
- ///
- ///
- ///
- ///
- var e = Function._validateParams(arguments, [
- {name: "timedOut", type: Boolean},
- {name: "message", type: String, mayBeNull: true},
- {name: "stackTrace", type: String, mayBeNull: true, optional: true},
- {name: "exceptionType", type: String, mayBeNull: true, optional: true},
- {name: "errorObject", type: Object, mayBeNull: true, optional: true}
- ]);
- if (e) throw e;
- this._timedOut = timedOut;
- this._message = message;
- this._stackTrace = stackTrace;
- this._exceptionType = exceptionType;
- this._errorObject = errorObject;
- this._statusCode = -1;
-}
- function Sys$Net$WebServiceError$get_timedOut() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._timedOut;
- }
- function Sys$Net$WebServiceError$get_statusCode() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._statusCode;
- }
- function Sys$Net$WebServiceError$get_message() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._message;
- }
- function Sys$Net$WebServiceError$get_stackTrace() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._stackTrace || "";
- }
- function Sys$Net$WebServiceError$get_exceptionType() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._exceptionType || "";
- }
- function Sys$Net$WebServiceError$get_errorObject() {
- ///
- if (arguments.length !== 0) throw Error.parameterCount();
- return this._errorObject || null;
- }
-Sys.Net.WebServiceError.prototype = {
- get_timedOut: Sys$Net$WebServiceError$get_timedOut,
- get_statusCode: Sys$Net$WebServiceError$get_statusCode,
- get_message: Sys$Net$WebServiceError$get_message,
- get_stackTrace: Sys$Net$WebServiceError$get_stackTrace,
- get_exceptionType: Sys$Net$WebServiceError$get_exceptionType,
- get_errorObject: Sys$Net$WebServiceError$get_errorObject
-}
-Sys.Net.WebServiceError.registerClass('Sys.Net.WebServiceError');
-
-
-Type.registerNamespace('Sys');
-
-Sys.Res={
-'urlMustBeLessThan1024chars':'The history state must be small enough to not make the url larger than 1024 characters.',
-'argumentTypeName':'Value is not the name of an existing type.',
-'cantBeCalledAfterDispose':'Can\'t be called after dispose.',
-'componentCantSetIdAfterAddedToApp':'The id property of a component can\'t be set after it\'s been added to the Application object.',
-'behaviorDuplicateName':'A behavior with name \'{0}\' 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 \'{0}\' could not be found.',
-'stateMustBeStringDictionary':'The state object can only have null and string fields.',
-'boolTrueOrFalse':'Value must be \'true\' or \'false\'.',
-'scriptLoadFailedNoHead':'ScriptLoader requires pages to contain a element.',
-'stringFormatInvalid':'The format string is invalid.',
-'referenceNotFound':'Component \'{0}\' was not found.',
-'enumReservedName':'\'{0}\' is a reserved name that can\'t be used as an enum value name.',
-'circularParentChain':'The chain of control parents can\'t have circular references.',
-'namespaceContainsNonObject':'Object {0} already exists and is not an object.',
-'undefinedEvent':'\'{0}\' is not an event.',
-'propertyUndefined':'\'{0}\' is not a property or an existing field.',
-'observableConflict':'Object already contains a member with the name \'{0}\'.',
-'historyCannotEnableHistory':'Cannot set enableHistory after initialization.',
-'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.',
-'scriptLoadFailedDebug':'The script \'{0}\' failed to load. Check for:\r\n Inaccessible path.\r\n Script errors. (IE) Enable \'Display a notification about every script error\' under advanced settings.',
-'propertyNotWritable':'\'{0}\' is not a writable property.',
-'enumInvalidValueName':'\'{0}\' is not a valid name for an enum value.',
-'controlAlreadyDefined':'A control is already associated with the element.',
-'addHandlerCantBeUsedForError':'Can\'t add a handler for the error event using this method. Please set the window.onerror property instead.',
-'cantAddNonFunctionhandler':'Can\'t 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':'\'{0}\' 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\'t 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 \'__historyFrame\' pointed to a page that gets its title from the \'title\' 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 \'{0}\' can\'t be added to the application.',
-'historyCannotAddHistoryPointWithHistoryDisabled':'A history point can only be added if enableHistory is set to true.',
-'baseNotAClass':'Value is not a class.',
-'expectedElementOrId':'Value must be a DOM element or DOM element Id.',
-'methodNotFound':'No method found with name \'{0}\'.',
-'arrayParseBadFormat':'Value must be a valid string representation for an array. It must start with a \'[\' and end with a \']\'.',
-'stateFieldNameInvalid':'State field names must not contain any \'=\' characters.',
-'cantSetId':'The id property can\'t be set on this object.',
-'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 \'{0}\' because it returned a null value.',
-'argumentDomNode':'Value must be a DOM element or a text node.',
-'componentCantSetIdTwice':'The id property of a component can\'t be set more than once.',
-'createComponentOnDom':'Value must be null for Components that are not Controls or Behaviors.',
-'createNotComponent':'{0} does not derive from Sys.Component.',
-'createNoDom':'Value must not be null for Controls and Behaviors.',
-'cantAddWithoutId':'Can\'t add a component that doesn\'t have an id.',
-'notObservable':'Instances of type \'{0}\' cannot be observed.',
-'badTypeName':'Value is not the name of the type being registered or the name is a reserved word.',
-'argumentInteger':'Value must be an integer.',
-'invokeCalledTwice':'Cannot call invoke more than once.',
-'webServiceFailed':'The server method \'{0}\' failed with the following error: {1}',
-'argumentType':'Object cannot be converted to the required type.',
-'argumentNull':'Value cannot be null.',
-'scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.',
-'scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.',
-'formatBadFormatSpecifier':'Format specifier was invalid.',
-'requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.',
-'webServiceFailedNoMsg':'The server method \'{0}\' failed.',
-'argumentDomElement':'Value must be a DOM element.',
-'invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.',
-'cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.',
-'actualValue':'Actual value was {0}.',
-'enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.',
-'scriptLoadFailed':'The script \'{0}\' could not be loaded.',
-'parameterCount':'Parameter count mismatch.',
-'cannotDeserializeEmptyString':'Cannot deserialize empty string.',
-'formatInvalidString':'Input string was not in a correct format.',
-'invalidTimeout':'Value must be greater than or equal to zero.',
-'cannotAbortBeforeStart':'Cannot abort when executor has not started.',
-'argument':'Value does not fall within the expected range.',
-'cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.',
-'invalidHttpVerb':'httpVerb cannot be set to an empty or null string.',
-'nullWebRequest':'Cannot call executeRequest with a null webRequest.',
-'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.',
-'cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.',
-'argumentUndefined':'Value cannot be undefined.',
-'webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}',
-'servicePathNotSet':'The path to the web service has not been set.',
-'argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.',
-'cannotCallOnceStarted':'Cannot call {0} once started.',
-'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.',
-'paramName':'Parameter name: {0}',
-'nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.',
-'cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.',
-'cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.',
-'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 \'{0}\' 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?'
-};
diff --git a/NzbDrone.Web/Scripts2/MicrosoftAjax.js b/NzbDrone.Web/Scripts2/MicrosoftAjax.js
deleted file mode 100644
index 52e6626a0..000000000
--- a/NzbDrone.Web/Scripts2/MicrosoftAjax.js
+++ /dev/null
@@ -1,6 +0,0 @@
-//----------------------------------------------------------
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//----------------------------------------------------------
-// MicrosoftAjax.js
-Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(eb){c=true;for(a=0;a0&&(d=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i-1&&ac.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");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":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":q=parseInt(a,10);if(q<0||q>59)return null;break;case "s":case "ss":r=parseInt(a,10);if(r<0||r>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var o=parseInt(u[1],10);if(o<0||o>59)return null;n=h*60+(a.startsWith("-")?-o:o);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;n=h*60;break;case "g":case "gg":var p=a;if(!p||!g.eras)return null;p=p.toLowerCase().trim();for(var s=0,F=g.eras.length;s0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;d=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;d=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c=0;c--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};Sys.UI.DomEvent._removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(d,e)};else Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,a,i=null,g=null,b=null;for(a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)};Sys.UI.DomElement.isDomElement=function(a){return Sys._isDomElement(a)};Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,f=b.length;a=0;b--)this._disposeElementInternal(c[b]);if(!d)this._disposeElementInternal(a)}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a1000){var c=[];for(var d=0,f=b.length;d=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_disposeElementInternal:function(a){var d=a.dispose;if(d&&typeof d==="function")a.dispose();else{var c=a.control;if(c&&typeof c.dispose==="function")c.dispose()}var b=a._behaviors;if(b)this._disposeComponents(b);b=a._components;if(b){this._disposeComponents(b);a._components=null}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!==-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.addHistoryPoint=function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2'");c.write(""+(b||document.title)+"parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var f=this.get_stateString();if(a!==f){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;this._completedCallback(a,true)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=b||this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace||""},get_exceptionType:function(){return this._exceptionType||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");
-Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.','scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.','formatBadFormatSpecifier':'Format specifier was invalid.','requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.','webServiceFailedNoMsg':'The server method \'{0}\' failed.','argumentDomElement':'Value must be a DOM element.','invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.','cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.','actualValue':'Actual value was {0}.','enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' could not be loaded.','parameterCount':'Parameter count mismatch.','cannotDeserializeEmptyString':'Cannot deserialize empty string.','formatInvalidString':'Input string was not in a correct format.','invalidTimeout':'Value must be greater than or equal to zero.','cannotAbortBeforeStart':'Cannot abort when executor has not started.','argument':'Value does not fall within the expected range.','cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.','invalidHttpVerb':'httpVerb cannot be set to an empty or null string.','nullWebRequest':'Cannot call executeRequest with a null webRequest.','eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.','cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.','argumentUndefined':'Value cannot be undefined.','webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','cannotCallOnceStarted':'Cannot call {0} once started.','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.','paramName':'Parameter name: {0}','nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.','cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.','cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.','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 \'{0}\' 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?'};
diff --git a/NzbDrone.Web/Scripts2/MicrosoftMvcAjax.debug.js b/NzbDrone.Web/Scripts2/MicrosoftMvcAjax.debug.js
deleted file mode 100644
index eb68ba7e7..000000000
--- a/NzbDrone.Web/Scripts2/MicrosoftMvcAjax.debug.js
+++ /dev/null
@@ -1,408 +0,0 @@
-//!----------------------------------------------------------
-//! Copyright (C) Microsoft Corporation. All rights reserved.
-//!----------------------------------------------------------
-//! MicrosoftMvcAjax.js
-
-Type.registerNamespace('Sys.Mvc');
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.AjaxOptions
-
-Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; }
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.InsertionMode
-
-Sys.Mvc.InsertionMode = function() {
- ///
- ///
- ///
- ///
- ///
- ///
-};
-Sys.Mvc.InsertionMode.prototype = {
- replace: 0,
- insertBefore: 1,
- insertAfter: 2
-}
-Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false);
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.AjaxContext
-
-Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- this._request = request;
- this._updateTarget = updateTarget;
- this._loadingElement = loadingElement;
- this._insertionMode = insertionMode;
-}
-Sys.Mvc.AjaxContext.prototype = {
- _insertionMode: 0,
- _loadingElement: null,
- _response: null,
- _request: null,
- _updateTarget: null,
-
- get_data: function Sys_Mvc_AjaxContext$get_data() {
- ///
- if (this._response) {
- return this._response.get_responseData();
- }
- else {
- return null;
- }
- },
-
- get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() {
- ///
- return this._insertionMode;
- },
-
- get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() {
- ///
- return this._loadingElement;
- },
-
- get_object: function Sys_Mvc_AjaxContext$get_object() {
- ///
- var executor = this.get_response();
- return (executor) ? executor.get_object() : null;
- },
-
- get_response: function Sys_Mvc_AjaxContext$get_response() {
- ///
- return this._response;
- },
- set_response: function Sys_Mvc_AjaxContext$set_response(value) {
- ///
- this._response = value;
- return value;
- },
-
- get_request: function Sys_Mvc_AjaxContext$get_request() {
- ///
- return this._request;
- },
-
- get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() {
- ///
- return this._updateTarget;
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.AsyncHyperlink
-
-Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() {
-}
-Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) {
- ///
- ///
- ///
- ///
- ///
- ///
- evt.preventDefault();
- Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions);
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.MvcHelpers
-
-Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() {
-}
-Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- if (element.disabled) {
- return null;
- }
- var name = element.name;
- if (name) {
- var tagName = element.tagName.toUpperCase();
- var encodedName = encodeURIComponent(name);
- var inputElement = element;
- if (tagName === 'INPUT') {
- var type = inputElement.type;
- if (type === 'submit') {
- return encodedName + '=' + encodeURIComponent(inputElement.value);
- }
- else if (type === 'image') {
- return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY;
- }
- }
- else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) {
- return encodedName + '=' + encodeURIComponent(inputElement.value);
- }
- }
- return null;
-}
-Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) {
- ///
- ///
- ///
- var formElements = form.elements;
- var formBody = new Sys.StringBuilder();
- var count = formElements.length;
- for (var i = 0; i < count; i++) {
- var element = formElements[i];
- var name = element.name;
- if (!name || !name.length) {
- continue;
- }
- var tagName = element.tagName.toUpperCase();
- if (tagName === 'INPUT') {
- var inputElement = element;
- var type = inputElement.type;
- if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) {
- formBody.append(encodeURIComponent(name));
- formBody.append('=');
- formBody.append(encodeURIComponent(inputElement.value));
- formBody.append('&');
- }
- }
- else if (tagName === 'SELECT') {
- var selectElement = element;
- var optionCount = selectElement.options.length;
- for (var j = 0; j < optionCount; j++) {
- var optionElement = selectElement.options[j];
- if (optionElement.selected) {
- formBody.append(encodeURIComponent(name));
- formBody.append('=');
- formBody.append(encodeURIComponent(optionElement.value));
- formBody.append('&');
- }
- }
- }
- else if (tagName === 'TEXTAREA') {
- formBody.append(encodeURIComponent(name));
- formBody.append('=');
- formBody.append(encodeURIComponent((element.value)));
- formBody.append('&');
- }
- }
- var additionalInput = form._additionalInput;
- if (additionalInput) {
- formBody.append(additionalInput);
- formBody.append('&');
- }
- return formBody.toString();
-}
-Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- if (ajaxOptions.confirm) {
- if (!confirm(ajaxOptions.confirm)) {
- return;
- }
- }
- if (ajaxOptions.url) {
- url = ajaxOptions.url;
- }
- if (ajaxOptions.httpMethod) {
- verb = ajaxOptions.httpMethod;
- }
- if (body.length > 0 && !body.endsWith('&')) {
- body += '&';
- }
- body += 'X-Requested-With=XMLHttpRequest';
- var upperCaseVerb = verb.toUpperCase();
- var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST');
- if (!isGetOrPost) {
- body += '&';
- body += 'X-HTTP-Method-Override=' + upperCaseVerb;
- }
- var requestBody = '';
- if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') {
- if (url.indexOf('?') > -1) {
- if (!url.endsWith('&')) {
- url += '&';
- }
- url += body;
- }
- else {
- url += '?';
- url += body;
- }
- }
- else {
- requestBody = body;
- }
- var request = new Sys.Net.WebRequest();
- request.set_url(url);
- if (isGetOrPost) {
- request.set_httpVerb(verb);
- }
- else {
- request.set_httpVerb('POST');
- request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb;
- }
- request.set_body(requestBody);
- if (verb.toUpperCase() === 'PUT') {
- request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;';
- }
- request.get_headers()['X-Requested-With'] = 'XMLHttpRequest';
- var updateElement = null;
- if (ajaxOptions.updateTargetId) {
- updateElement = $get(ajaxOptions.updateTargetId);
- }
- var loadingElement = null;
- if (ajaxOptions.loadingElementId) {
- loadingElement = $get(ajaxOptions.loadingElementId);
- }
- var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode);
- var continueRequest = true;
- if (ajaxOptions.onBegin) {
- continueRequest = ajaxOptions.onBegin(ajaxContext) !== false;
- }
- if (loadingElement) {
- Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true);
- }
- if (continueRequest) {
- request.add_completed(Function.createDelegate(null, function(executor) {
- Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext);
- }));
- request.invoke();
- }
-}
-Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) {
- ///
- ///
- ///
- ///
- ///
- ///
- ajaxContext.set_response(request.get_executor());
- if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) {
- return;
- }
- var statusCode = ajaxContext.get_response().get_statusCode();
- if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) {
- if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) {
- var contentType = ajaxContext.get_response().getResponseHeader('Content-Type');
- if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) {
- eval(ajaxContext.get_data());
- }
- else {
- Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data());
- }
- }
- if (ajaxOptions.onSuccess) {
- ajaxOptions.onSuccess(ajaxContext);
- }
- }
- else {
- if (ajaxOptions.onFailure) {
- ajaxOptions.onFailure(ajaxContext);
- }
- }
- if (ajaxContext.get_loadingElement()) {
- Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false);
- }
-}
-Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) {
- ///
- ///
- ///
- ///
- ///
- ///
- if (target) {
- switch (insertionMode) {
- case Sys.Mvc.InsertionMode.replace:
- target.innerHTML = content;
- break;
- case Sys.Mvc.InsertionMode.insertBefore:
- if (content && content.length > 0) {
- target.innerHTML = content + target.innerHTML.trimStart();
- }
- break;
- case Sys.Mvc.InsertionMode.insertAfter:
- if (content && content.length > 0) {
- target.innerHTML = target.innerHTML.trimEnd() + content;
- }
- break;
- }
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.AsyncForm
-
-Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() {
-}
-Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) {
- ///
- ///
- ///
- ///
- var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY);
- form._additionalInput = additionalInput;
-}
-Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) {
- ///
- ///
- ///
- ///
- ///
- ///
- evt.preventDefault();
- var validationCallbacks = form.validationCallbacks;
- if (validationCallbacks) {
- for (var i = 0; i < validationCallbacks.length; i++) {
- var callback = validationCallbacks[i];
- if (!callback()) {
- return;
- }
- }
- }
- var body = Sys.Mvc.MvcHelpers._serializeForm(form);
- Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions);
-}
-
-
-Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');
-Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');
-Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');
-Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
-
-// ---- Do not remove this footer ----
-// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
-// -----------------------------------
diff --git a/NzbDrone.Web/Scripts2/MicrosoftMvcAjax.js b/NzbDrone.Web/Scripts2/MicrosoftMvcAjax.js
deleted file mode 100644
index c5a6165e7..000000000
--- a/NzbDrone.Web/Scripts2/MicrosoftMvcAjax.js
+++ /dev/null
@@ -1,25 +0,0 @@
-//----------------------------------------------------------
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//----------------------------------------------------------
-// MicrosoftMvcAjax.js
-
-Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};}
-Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2}
-Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;}
-Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}}
-Sys.Mvc.AsyncHyperlink=function(){}
-Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);}
-Sys.Mvc.MvcHelpers=function(){}
-Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;}
-Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();}
-Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){
-Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}}
-Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}}
-Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}}
-Sys.Mvc.AsyncForm=function(){}
-Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;}
-Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);}
-Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm');
-// ---- Do not remove this footer ----
-// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
-// -----------------------------------
diff --git a/NzbDrone.Web/Scripts2/MicrosoftMvcValidation.debug.js b/NzbDrone.Web/Scripts2/MicrosoftMvcValidation.debug.js
deleted file mode 100644
index 346ba4818..000000000
--- a/NzbDrone.Web/Scripts2/MicrosoftMvcValidation.debug.js
+++ /dev/null
@@ -1,883 +0,0 @@
-//!----------------------------------------------------------
-//! Copyright (C) Microsoft Corporation. All rights reserved.
-//!----------------------------------------------------------
-//! MicrosoftMvcValidation.js
-
-
-Type.registerNamespace('Sys.Mvc');
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.Validation
-
-Sys.Mvc.$create_Validation = function Sys_Mvc_Validation() { return {}; }
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.JsonValidationField
-
-Sys.Mvc.$create_JsonValidationField = function Sys_Mvc_JsonValidationField() { return {}; }
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.JsonValidationOptions
-
-Sys.Mvc.$create_JsonValidationOptions = function Sys_Mvc_JsonValidationOptions() { return {}; }
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.JsonValidationRule
-
-Sys.Mvc.$create_JsonValidationRule = function Sys_Mvc_JsonValidationRule() { return {}; }
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.ValidationContext
-
-Sys.Mvc.$create_ValidationContext = function Sys_Mvc_ValidationContext() { return {}; }
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.NumberValidator
-
-Sys.Mvc.NumberValidator = function Sys_Mvc_NumberValidator() {
-}
-Sys.Mvc.NumberValidator.create = function Sys_Mvc_NumberValidator$create(rule) {
- ///
- ///
- ///
- return Function.createDelegate(new Sys.Mvc.NumberValidator(), new Sys.Mvc.NumberValidator().validate);
-}
-Sys.Mvc.NumberValidator.prototype = {
-
- validate: function Sys_Mvc_NumberValidator$validate(value, context) {
- ///
- ///
- ///
- ///
- ///
- if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
- return true;
- }
- var n = Number.parseLocale(value);
- return (!isNaN(n));
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.FormContext
-
-Sys.Mvc.FormContext = function Sys_Mvc_FormContext(formElement, validationSummaryElement) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- this._errors = [];
- this.fields = new Array(0);
- this._formElement = formElement;
- this._validationSummaryElement = validationSummaryElement;
- formElement[Sys.Mvc.FormContext._formValidationTag] = this;
- if (validationSummaryElement) {
- var ulElements = validationSummaryElement.getElementsByTagName('ul');
- if (ulElements.length > 0) {
- this._validationSummaryULElement = ulElements[0];
- }
- }
- this._onClickHandler = Function.createDelegate(this, this._form_OnClick);
- this._onSubmitHandler = Function.createDelegate(this, this._form_OnSubmit);
-}
-Sys.Mvc.FormContext._Application_Load = function Sys_Mvc_FormContext$_Application_Load() {
- var allFormOptions = window.mvcClientValidationMetadata;
- if (allFormOptions) {
- while (allFormOptions.length > 0) {
- var thisFormOptions = allFormOptions.pop();
- Sys.Mvc.FormContext._parseJsonOptions(thisFormOptions);
- }
- }
-}
-Sys.Mvc.FormContext._getFormElementsWithName = function Sys_Mvc_FormContext$_getFormElementsWithName(formElement, name) {
- ///
- ///
- ///
- ///
- ///
- var allElementsWithNameInForm = [];
- var allElementsWithName = document.getElementsByName(name);
- for (var i = 0; i < allElementsWithName.length; i++) {
- var thisElement = allElementsWithName[i];
- if (Sys.Mvc.FormContext._isElementInHierarchy(formElement, thisElement)) {
- Array.add(allElementsWithNameInForm, thisElement);
- }
- }
- return allElementsWithNameInForm;
-}
-Sys.Mvc.FormContext.getValidationForForm = function Sys_Mvc_FormContext$getValidationForForm(formElement) {
- ///
- ///
- ///
- return formElement[Sys.Mvc.FormContext._formValidationTag];
-}
-Sys.Mvc.FormContext._isElementInHierarchy = function Sys_Mvc_FormContext$_isElementInHierarchy(parent, child) {
- ///
- ///
- ///
- ///
- ///
- while (child) {
- if (parent === child) {
- return true;
- }
- child = child.parentNode;
- }
- return false;
-}
-Sys.Mvc.FormContext._parseJsonOptions = function Sys_Mvc_FormContext$_parseJsonOptions(options) {
- ///
- ///
- ///
- var formElement = $get(options.FormId);
- var validationSummaryElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(options.ValidationSummaryId)) ? $get(options.ValidationSummaryId) : null;
- var formContext = new Sys.Mvc.FormContext(formElement, validationSummaryElement);
- formContext.enableDynamicValidation();
- formContext.replaceValidationSummary = options.ReplaceValidationSummary;
- for (var i = 0; i < options.Fields.length; i++) {
- var field = options.Fields[i];
- var fieldElements = Sys.Mvc.FormContext._getFormElementsWithName(formElement, field.FieldName);
- var validationMessageElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(field.ValidationMessageId)) ? $get(field.ValidationMessageId) : null;
- var fieldContext = new Sys.Mvc.FieldContext(formContext);
- Array.addRange(fieldContext.elements, fieldElements);
- fieldContext.validationMessageElement = validationMessageElement;
- fieldContext.replaceValidationMessageContents = field.ReplaceValidationMessageContents;
- for (var j = 0; j < field.ValidationRules.length; j++) {
- var rule = field.ValidationRules[j];
- var validator = Sys.Mvc.ValidatorRegistry.getValidator(rule);
- if (validator) {
- var validation = Sys.Mvc.$create_Validation();
- validation.fieldErrorMessage = rule.ErrorMessage;
- validation.validator = validator;
- Array.add(fieldContext.validations, validation);
- }
- }
- fieldContext.enableDynamicValidation();
- Array.add(formContext.fields, fieldContext);
- }
- var registeredValidatorCallbacks = formElement.validationCallbacks;
- if (!registeredValidatorCallbacks) {
- registeredValidatorCallbacks = [];
- formElement.validationCallbacks = registeredValidatorCallbacks;
- }
- registeredValidatorCallbacks.push(Function.createDelegate(null, function() {
- return Sys.Mvc._validationUtil.arrayIsNullOrEmpty(formContext.validate('submit'));
- }));
- return formContext;
-}
-Sys.Mvc.FormContext.prototype = {
- _onClickHandler: null,
- _onSubmitHandler: null,
- _submitButtonClicked: null,
- _validationSummaryElement: null,
- _validationSummaryULElement: null,
- _formElement: null,
- replaceValidationSummary: false,
-
- addError: function Sys_Mvc_FormContext$addError(message) {
- ///
- ///
- this.addErrors([ message ]);
- },
-
- addErrors: function Sys_Mvc_FormContext$addErrors(messages) {
- ///
- ///
- if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) {
- Array.addRange(this._errors, messages);
- this._onErrorCountChanged();
- }
- },
-
- clearErrors: function Sys_Mvc_FormContext$clearErrors() {
- Array.clear(this._errors);
- this._onErrorCountChanged();
- },
-
- _displayError: function Sys_Mvc_FormContext$_displayError() {
- if (this._validationSummaryElement) {
- if (this._validationSummaryULElement) {
- Sys.Mvc._validationUtil.removeAllChildren(this._validationSummaryULElement);
- for (var i = 0; i < this._errors.length; i++) {
- var liElement = document.createElement('li');
- Sys.Mvc._validationUtil.setInnerText(liElement, this._errors[i]);
- this._validationSummaryULElement.appendChild(liElement);
- }
- }
- Sys.UI.DomElement.removeCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss);
- Sys.UI.DomElement.addCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss);
- }
- },
-
- _displaySuccess: function Sys_Mvc_FormContext$_displaySuccess() {
- var validationSummaryElement = this._validationSummaryElement;
- if (validationSummaryElement) {
- var validationSummaryULElement = this._validationSummaryULElement;
- if (validationSummaryULElement) {
- validationSummaryULElement.innerHTML = '';
- }
- Sys.UI.DomElement.removeCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss);
- Sys.UI.DomElement.addCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss);
- }
- },
-
- enableDynamicValidation: function Sys_Mvc_FormContext$enableDynamicValidation() {
- Sys.UI.DomEvent.addHandler(this._formElement, 'click', this._onClickHandler);
- Sys.UI.DomEvent.addHandler(this._formElement, 'submit', this._onSubmitHandler);
- },
-
- _findSubmitButton: function Sys_Mvc_FormContext$_findSubmitButton(element) {
- ///
- ///
- ///
- if (element.disabled) {
- return null;
- }
- var tagName = element.tagName.toUpperCase();
- var inputElement = element;
- if (tagName === 'INPUT') {
- var type = inputElement.type;
- if (type === 'submit' || type === 'image') {
- return inputElement;
- }
- }
- else if ((tagName === 'BUTTON') && (inputElement.type === 'submit')) {
- return inputElement;
- }
- return null;
- },
-
- _form_OnClick: function Sys_Mvc_FormContext$_form_OnClick(e) {
- ///
- ///
- this._submitButtonClicked = this._findSubmitButton(e.target);
- },
-
- _form_OnSubmit: function Sys_Mvc_FormContext$_form_OnSubmit(e) {
- ///
- ///
- var form = e.target;
- var submitButton = this._submitButtonClicked;
- if (submitButton && submitButton.disableValidation) {
- return;
- }
- var errorMessages = this.validate('submit');
- if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(errorMessages)) {
- e.preventDefault();
- }
- },
-
- _onErrorCountChanged: function Sys_Mvc_FormContext$_onErrorCountChanged() {
- if (!this._errors.length) {
- this._displaySuccess();
- }
- else {
- this._displayError();
- }
- },
-
- validate: function Sys_Mvc_FormContext$validate(eventName) {
- ///
- ///
- ///
- var fields = this.fields;
- var errors = [];
- for (var i = 0; i < fields.length; i++) {
- var field = fields[i];
- if (!field.elements[0].disabled) {
- var thisErrors = field.validate(eventName);
- if (thisErrors) {
- Array.addRange(errors, thisErrors);
- }
- }
- }
- if (this.replaceValidationSummary) {
- this.clearErrors();
- this.addErrors(errors);
- }
- return errors;
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.FieldContext
-
-Sys.Mvc.FieldContext = function Sys_Mvc_FieldContext(formContext) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- this._errors = [];
- this.elements = new Array(0);
- this.validations = new Array(0);
- this.formContext = formContext;
- this._onBlurHandler = Function.createDelegate(this, this._element_OnBlur);
- this._onChangeHandler = Function.createDelegate(this, this._element_OnChange);
- this._onInputHandler = Function.createDelegate(this, this._element_OnInput);
- this._onPropertyChangeHandler = Function.createDelegate(this, this._element_OnPropertyChange);
-}
-Sys.Mvc.FieldContext.prototype = {
- _onBlurHandler: null,
- _onChangeHandler: null,
- _onInputHandler: null,
- _onPropertyChangeHandler: null,
- defaultErrorMessage: null,
- formContext: null,
- replaceValidationMessageContents: false,
- validationMessageElement: null,
-
- addError: function Sys_Mvc_FieldContext$addError(message) {
- ///
- ///
- this.addErrors([ message ]);
- },
-
- addErrors: function Sys_Mvc_FieldContext$addErrors(messages) {
- ///
- ///
- if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) {
- Array.addRange(this._errors, messages);
- this._onErrorCountChanged();
- }
- },
-
- clearErrors: function Sys_Mvc_FieldContext$clearErrors() {
- Array.clear(this._errors);
- this._onErrorCountChanged();
- },
-
- _displayError: function Sys_Mvc_FieldContext$_displayError() {
- var validationMessageElement = this.validationMessageElement;
- if (validationMessageElement) {
- if (this.replaceValidationMessageContents) {
- Sys.Mvc._validationUtil.setInnerText(validationMessageElement, this._errors[0]);
- }
- Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss);
- Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss);
- }
- var elements = this.elements;
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss);
- Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss);
- }
- },
-
- _displaySuccess: function Sys_Mvc_FieldContext$_displaySuccess() {
- var validationMessageElement = this.validationMessageElement;
- if (validationMessageElement) {
- if (this.replaceValidationMessageContents) {
- Sys.Mvc._validationUtil.setInnerText(validationMessageElement, '');
- }
- Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss);
- Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss);
- }
- var elements = this.elements;
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss);
- Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss);
- }
- },
-
- _element_OnBlur: function Sys_Mvc_FieldContext$_element_OnBlur(e) {
- ///
- ///
- if (e.target[Sys.Mvc.FieldContext._hasTextChangedTag] || e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
- this.validate('blur');
- }
- },
-
- _element_OnChange: function Sys_Mvc_FieldContext$_element_OnChange(e) {
- ///
- ///
- e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
- },
-
- _element_OnInput: function Sys_Mvc_FieldContext$_element_OnInput(e) {
- ///
- ///
- e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
- if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
- this.validate('input');
- }
- },
-
- _element_OnPropertyChange: function Sys_Mvc_FieldContext$_element_OnPropertyChange(e) {
- ///
- ///
- if (e.rawEvent.propertyName === 'value') {
- e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true;
- if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) {
- this.validate('input');
- }
- }
- },
-
- enableDynamicValidation: function Sys_Mvc_FieldContext$enableDynamicValidation() {
- var elements = this.elements;
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- if (Sys.Mvc._validationUtil.elementSupportsEvent(element, 'onpropertychange')) {
- var compatMode = document.documentMode;
- if (compatMode && compatMode >= 8) {
- Sys.UI.DomEvent.addHandler(element, 'propertychange', this._onPropertyChangeHandler);
- }
- }
- else {
- Sys.UI.DomEvent.addHandler(element, 'input', this._onInputHandler);
- }
- Sys.UI.DomEvent.addHandler(element, 'change', this._onChangeHandler);
- Sys.UI.DomEvent.addHandler(element, 'blur', this._onBlurHandler);
- }
- },
-
- _getErrorString: function Sys_Mvc_FieldContext$_getErrorString(validatorReturnValue, fieldErrorMessage) {
- ///
- ///
- ///
- ///
- ///
- var fallbackErrorMessage = fieldErrorMessage || this.defaultErrorMessage;
- if (Boolean.isInstanceOfType(validatorReturnValue)) {
- return (validatorReturnValue) ? null : fallbackErrorMessage;
- }
- if (String.isInstanceOfType(validatorReturnValue)) {
- return ((validatorReturnValue).length) ? validatorReturnValue : fallbackErrorMessage;
- }
- return null;
- },
-
- _getStringValue: function Sys_Mvc_FieldContext$_getStringValue() {
- ///
- var elements = this.elements;
- return (elements.length > 0) ? elements[0].value : null;
- },
-
- _markValidationFired: function Sys_Mvc_FieldContext$_markValidationFired() {
- var elements = this.elements;
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- element[Sys.Mvc.FieldContext._hasValidationFiredTag] = true;
- }
- },
-
- _onErrorCountChanged: function Sys_Mvc_FieldContext$_onErrorCountChanged() {
- if (!this._errors.length) {
- this._displaySuccess();
- }
- else {
- this._displayError();
- }
- },
-
- validate: function Sys_Mvc_FieldContext$validate(eventName) {
- ///
- ///
- ///
- var validations = this.validations;
- var errors = [];
- var value = this._getStringValue();
- for (var i = 0; i < validations.length; i++) {
- var validation = validations[i];
- var context = Sys.Mvc.$create_ValidationContext();
- context.eventName = eventName;
- context.fieldContext = this;
- context.validation = validation;
- var retVal = validation.validator(value, context);
- var errorMessage = this._getErrorString(retVal, validation.fieldErrorMessage);
- if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(errorMessage)) {
- Array.add(errors, errorMessage);
- }
- }
- this._markValidationFired();
- this.clearErrors();
- this.addErrors(errors);
- return errors;
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.RangeValidator
-
-Sys.Mvc.RangeValidator = function Sys_Mvc_RangeValidator(minimum, maximum) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- this._minimum = minimum;
- this._maximum = maximum;
-}
-Sys.Mvc.RangeValidator.create = function Sys_Mvc_RangeValidator$create(rule) {
- ///
- ///
- ///
- var min = rule.ValidationParameters['min'];
- var max = rule.ValidationParameters['max'];
- return Function.createDelegate(new Sys.Mvc.RangeValidator(min, max), new Sys.Mvc.RangeValidator(min, max).validate);
-}
-Sys.Mvc.RangeValidator.prototype = {
- _minimum: null,
- _maximum: null,
-
- validate: function Sys_Mvc_RangeValidator$validate(value, context) {
- ///
- ///
- ///
- ///
- ///
- if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
- return true;
- }
- var n = Number.parseLocale(value);
- return (!isNaN(n) && this._minimum <= n && n <= this._maximum);
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.RegularExpressionValidator
-
-Sys.Mvc.RegularExpressionValidator = function Sys_Mvc_RegularExpressionValidator(pattern) {
- ///
- ///
- ///
- ///
- this._pattern = pattern;
-}
-Sys.Mvc.RegularExpressionValidator.create = function Sys_Mvc_RegularExpressionValidator$create(rule) {
- ///
- ///
- ///
- var pattern = rule.ValidationParameters['pattern'];
- return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator(pattern), new Sys.Mvc.RegularExpressionValidator(pattern).validate);
-}
-Sys.Mvc.RegularExpressionValidator.prototype = {
- _pattern: null,
-
- validate: function Sys_Mvc_RegularExpressionValidator$validate(value, context) {
- ///
- ///
- ///
- ///
- ///
- if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
- return true;
- }
- var regExp = new RegExp(this._pattern);
- var matches = regExp.exec(value);
- return (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(matches) && matches[0].length === value.length);
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.RequiredValidator
-
-Sys.Mvc.RequiredValidator = function Sys_Mvc_RequiredValidator() {
-}
-Sys.Mvc.RequiredValidator.create = function Sys_Mvc_RequiredValidator$create(rule) {
- ///
- ///
- ///
- return Function.createDelegate(new Sys.Mvc.RequiredValidator(), new Sys.Mvc.RequiredValidator().validate);
-}
-Sys.Mvc.RequiredValidator._isRadioInputElement = function Sys_Mvc_RequiredValidator$_isRadioInputElement(element) {
- ///
- ///
- ///
- if (element.tagName.toUpperCase() === 'INPUT') {
- var inputType = (element.type).toUpperCase();
- if (inputType === 'RADIO') {
- return true;
- }
- }
- return false;
-}
-Sys.Mvc.RequiredValidator._isSelectInputElement = function Sys_Mvc_RequiredValidator$_isSelectInputElement(element) {
- ///
- ///
- ///
- if (element.tagName.toUpperCase() === 'SELECT') {
- return true;
- }
- return false;
-}
-Sys.Mvc.RequiredValidator._isTextualInputElement = function Sys_Mvc_RequiredValidator$_isTextualInputElement(element) {
- ///
- ///
- ///
- if (element.tagName.toUpperCase() === 'INPUT') {
- var inputType = (element.type).toUpperCase();
- switch (inputType) {
- case 'TEXT':
- case 'PASSWORD':
- case 'FILE':
- return true;
- }
- }
- if (element.tagName.toUpperCase() === 'TEXTAREA') {
- return true;
- }
- return false;
-}
-Sys.Mvc.RequiredValidator._validateRadioInput = function Sys_Mvc_RequiredValidator$_validateRadioInput(elements) {
- ///
- ///
- ///
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- if (element.checked) {
- return true;
- }
- }
- return false;
-}
-Sys.Mvc.RequiredValidator._validateSelectInput = function Sys_Mvc_RequiredValidator$_validateSelectInput(optionElements) {
- ///
- ///
- ///
- for (var i = 0; i < optionElements.length; i++) {
- var element = optionElements[i];
- if (element.selected) {
- if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)) {
- return true;
- }
- }
- }
- return false;
-}
-Sys.Mvc.RequiredValidator._validateTextualInput = function Sys_Mvc_RequiredValidator$_validateTextualInput(element) {
- ///
- ///
- ///
- return (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value));
-}
-Sys.Mvc.RequiredValidator.prototype = {
-
- validate: function Sys_Mvc_RequiredValidator$validate(value, context) {
- ///
- ///
- ///
- ///
- ///
- var elements = context.fieldContext.elements;
- if (!elements.length) {
- return true;
- }
- var sampleElement = elements[0];
- if (Sys.Mvc.RequiredValidator._isTextualInputElement(sampleElement)) {
- return Sys.Mvc.RequiredValidator._validateTextualInput(sampleElement);
- }
- if (Sys.Mvc.RequiredValidator._isRadioInputElement(sampleElement)) {
- return Sys.Mvc.RequiredValidator._validateRadioInput(elements);
- }
- if (Sys.Mvc.RequiredValidator._isSelectInputElement(sampleElement)) {
- return Sys.Mvc.RequiredValidator._validateSelectInput((sampleElement).options);
- }
- return true;
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.StringLengthValidator
-
-Sys.Mvc.StringLengthValidator = function Sys_Mvc_StringLengthValidator(minLength, maxLength) {
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- this._minLength = minLength;
- this._maxLength = maxLength;
-}
-Sys.Mvc.StringLengthValidator.create = function Sys_Mvc_StringLengthValidator$create(rule) {
- ///
- ///
- ///
- var minLength = (rule.ValidationParameters['min'] || 0);
- var maxLength = (rule.ValidationParameters['max'] || Number.MAX_VALUE);
- return Function.createDelegate(new Sys.Mvc.StringLengthValidator(minLength, maxLength), new Sys.Mvc.StringLengthValidator(minLength, maxLength).validate);
-}
-Sys.Mvc.StringLengthValidator.prototype = {
- _maxLength: 0,
- _minLength: 0,
-
- validate: function Sys_Mvc_StringLengthValidator$validate(value, context) {
- ///
- ///
- ///
- ///
- ///
- if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) {
- return true;
- }
- return (this._minLength <= value.length && value.length <= this._maxLength);
- }
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc._validationUtil
-
-Sys.Mvc._validationUtil = function Sys_Mvc__validationUtil() {
-}
-Sys.Mvc._validationUtil.arrayIsNullOrEmpty = function Sys_Mvc__validationUtil$arrayIsNullOrEmpty(array) {
- ///
- ///
- ///
- return (!array || !array.length);
-}
-Sys.Mvc._validationUtil.stringIsNullOrEmpty = function Sys_Mvc__validationUtil$stringIsNullOrEmpty(value) {
- ///
- ///
- ///
- return (!value || !value.length);
-}
-Sys.Mvc._validationUtil.elementSupportsEvent = function Sys_Mvc__validationUtil$elementSupportsEvent(element, eventAttributeName) {
- ///
- ///
- ///
- ///
- ///
- return (eventAttributeName in element);
-}
-Sys.Mvc._validationUtil.removeAllChildren = function Sys_Mvc__validationUtil$removeAllChildren(element) {
- ///
- ///
- while (element.firstChild) {
- element.removeChild(element.firstChild);
- }
-}
-Sys.Mvc._validationUtil.setInnerText = function Sys_Mvc__validationUtil$setInnerText(element, innerText) {
- ///
- ///
- ///
- ///
- var textNode = document.createTextNode(innerText);
- Sys.Mvc._validationUtil.removeAllChildren(element);
- element.appendChild(textNode);
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// Sys.Mvc.ValidatorRegistry
-
-Sys.Mvc.ValidatorRegistry = function Sys_Mvc_ValidatorRegistry() {
- ///
- ///
-}
-Sys.Mvc.ValidatorRegistry.getValidator = function Sys_Mvc_ValidatorRegistry$getValidator(rule) {
- ///
- ///
- ///
- var creator = Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];
- return (creator) ? creator(rule) : null;
-}
-Sys.Mvc.ValidatorRegistry._getDefaultValidators = function Sys_Mvc_ValidatorRegistry$_getDefaultValidators() {
- ///
- return { required: Function.createDelegate(null, Sys.Mvc.RequiredValidator.create), length: Function.createDelegate(null, Sys.Mvc.StringLengthValidator.create), regex: Function.createDelegate(null, Sys.Mvc.RegularExpressionValidator.create), range: Function.createDelegate(null, Sys.Mvc.RangeValidator.create), number: Function.createDelegate(null, Sys.Mvc.NumberValidator.create) };
-}
-
-
-Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');
-Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');
-Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');
-Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');
-Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');
-Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');
-Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');
-Sys.Mvc._validationUtil.registerClass('Sys.Mvc._validationUtil');
-Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');
-Sys.Mvc.FormContext._validationSummaryErrorCss = 'validation-summary-errors';
-Sys.Mvc.FormContext._validationSummaryValidCss = 'validation-summary-valid';
-Sys.Mvc.FormContext._formValidationTag = '__MVC_FormValidation';
-Sys.Mvc.FieldContext._hasTextChangedTag = '__MVC_HasTextChanged';
-Sys.Mvc.FieldContext._hasValidationFiredTag = '__MVC_HasValidationFired';
-Sys.Mvc.FieldContext._inputElementErrorCss = 'input-validation-error';
-Sys.Mvc.FieldContext._inputElementValidCss = 'input-validation-valid';
-Sys.Mvc.FieldContext._validationMessageErrorCss = 'field-validation-error';
-Sys.Mvc.FieldContext._validationMessageValidCss = 'field-validation-valid';
-Sys.Mvc.ValidatorRegistry.validators = Sys.Mvc.ValidatorRegistry._getDefaultValidators();
-
-// ---- Do not remove this footer ----
-// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
-// -----------------------------------
-
-// register validation
-Sys.Application.add_load(function() {
- Sys.Application.remove_load(arguments.callee);
- Sys.Mvc.FormContext._Application_Load();
-});
diff --git a/NzbDrone.Web/Scripts2/MicrosoftMvcValidation.js b/NzbDrone.Web/Scripts2/MicrosoftMvcValidation.js
deleted file mode 100644
index 9483492f1..000000000
--- a/NzbDrone.Web/Scripts2/MicrosoftMvcValidation.js
+++ /dev/null
@@ -1,55 +0,0 @@
-//----------------------------------------------------------
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//----------------------------------------------------------
-// MicrosoftMvcValidation.js
-
-Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};}
-Sys.Mvc.$create_JsonValidationField=function(){return {};}
-Sys.Mvc.$create_JsonValidationOptions=function(){return {};}
-Sys.Mvc.$create_JsonValidationRule=function(){return {};}
-Sys.Mvc.$create_ValidationContext=function(){return {};}
-Sys.Mvc.NumberValidator=function(){}
-Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);}
-Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}}
-Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);}
-Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}}
-Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;}
-Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];}
-Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;}
-Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){
-return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;}
-Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}}
-Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;}
-Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['min'];var $1=rule.ValidationParameters['max'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);}
-Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}}
-Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;}
-Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);}
-Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}}
-Sys.Mvc.RequiredValidator=function(){}
-Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);}
-Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;}
-Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;}
-Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;}
-Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;}
-Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;}
-Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));}
-Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}}
-Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;}
-Sys.Mvc.StringLengthValidator.create=function(rule){var $0=(rule.ValidationParameters['min']||0);var $1=(rule.ValidationParameters['max']||Number.MAX_VALUE);return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);}
-Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}}
-Sys.Mvc._ValidationUtil=function(){}
-Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);}
-Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);}
-Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);}
-Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}}
-Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);}
-Sys.Mvc.ValidatorRegistry=function(){}
-Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;}
-Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),length:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regex:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};}
-Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0();
-// ---- Do not remove this footer ----
-// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net)
-// -----------------------------------
-Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();});
\ No newline at end of file
diff --git a/NzbDrone.Web/Scripts2/bootstrap-mvc.js b/NzbDrone.Web/Scripts2/bootstrap-mvc.js
deleted file mode 100644
index 154339b3a..000000000
--- a/NzbDrone.Web/Scripts2/bootstrap-mvc.js
+++ /dev/null
@@ -1,33 +0,0 @@
-
-jQuery(document).ready(function ($) {
-
- $('span.field-validation-valid, span.field-validation-error').each(function () {
- $(this).addClass('help-inline');
- });
-
- $("button, input[type='submit'],input[type='button']").each(function () {
- $(this).addClass('btn btn-madmin');
- });
-
- $(".btn").each(function () {
- $(this).addClass('btn-madmin');
- });
-
- $("input[type='submit']").each(function () {
- $(this).addClass('btn-primary btn-large');
- });
-
- $('.validation-summary-errors').livequery(function () {
- $(this).addClass('alert alert-error');
- });
-
- $('.field-validation-error').livequery(function () {
- $('.control-group').each(function () {
- if ($(this).find('span.field-validation-error').length == 0) {
- $(this).removeClass('error');
- } else {
- $(this).addClass('error');
- }
- });
- });
-});
\ No newline at end of file
diff --git a/NzbDrone.Web/Scripts2/jquery-1.8.2.intellisense.js b/NzbDrone.Web/Scripts2/jquery-1.8.2.intellisense.js
deleted file mode 100644
index 5514196d2..000000000
--- a/NzbDrone.Web/Scripts2/jquery-1.8.2.intellisense.js
+++ /dev/null
@@ -1,2494 +0,0 @@
-intellisense.annotate(jQuery, {
- 'ajax': function() {
- ///
- /// Perform an asynchronous HTTP (Ajax) request.
- /// A string containing the URL to which the request is sent.
- /// A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.
- ///
- ///
- ///
- /// Perform an asynchronous HTTP (Ajax) request.
- /// A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
- ///
- ///
- },
- 'ajaxPrefilter': function() {
- ///
- /// Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
- /// An optional string containing one or more space-separated dataTypes
- /// A handler to set default values for future Ajax requests.
- ///
- },
- 'ajaxSetup': function() {
- ///
- /// Set default values for future Ajax requests.
- /// A set of key/value pairs that configure the default Ajax request. All options are optional.
- ///
- },
- 'boxModel': function() {
- /// Deprecated in jQuery 1.3 (see jQuery.support). States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model.
- ///
- },
- 'browser': function() {
- /// Contains flags for the useragent, read from navigator.userAgent. We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.
- ///
- },
- 'browser.version': function() {
- /// The version number of the rendering engine for the user's browser.
- ///
- },
- 'Callbacks': function() {
- ///
- /// A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
- /// An optional list of space-separated flags that change how the callback list behaves.
- ///
- },
- 'contains': function() {
- ///
- /// Check to see if a DOM element is within another DOM element.
- /// The DOM element that may contain the other element.
- /// The DOM element that may be contained by the other element.
- ///
- ///
- },
- 'cssHooks': function() {
- /// Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
- ///
- },
- 'data': function() {
- ///
- /// Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
- /// The DOM element to query for the data.
- /// Name of the data stored.
- ///
- ///
- ///
- /// Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
- /// The DOM element to query for the data.
- ///
- ///
- },
- 'dequeue': function() {
- ///
- /// Execute the next function on the queue for the matched element.
- /// A DOM element from which to remove and execute a queued function.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- ///
- },
- 'each': function() {
- ///
- /// A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
- /// The object or array to iterate over.
- /// The function that will be executed on every object.
- ///
- ///
- },
- 'error': function() {
- ///
- /// Takes a string and throws an exception containing it.
- /// The message to send out.
- ///
- },
- 'extend': function() {
- ///
- /// Merge the contents of two or more objects together into the first object.
- /// An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.
- /// An object containing additional properties to merge in.
- /// Additional objects containing properties to merge in.
- ///
- ///
- ///
- /// Merge the contents of two or more objects together into the first object.
- /// If true, the merge becomes recursive (aka. deep copy).
- /// The object to extend. It will receive the new properties.
- /// An object containing additional properties to merge in.
- /// Additional objects containing properties to merge in.
- ///
- ///
- },
- 'get': function() {
- ///
- /// Load data from the server using a HTTP GET request.
- /// A string containing the URL to which the request is sent.
- /// A map or string that is sent to the server with the request.
- /// A callback function that is executed if the request succeeds.
- /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
- ///
- ///
- },
- 'getJSON': function() {
- ///
- /// Load JSON-encoded data from the server using a GET HTTP request.
- /// A string containing the URL to which the request is sent.
- /// A map or string that is sent to the server with the request.
- /// A callback function that is executed if the request succeeds.
- ///
- ///
- },
- 'getScript': function() {
- ///
- /// Load a JavaScript file from the server using a GET HTTP request, then execute it.
- /// A string containing the URL to which the request is sent.
- /// A callback function that is executed if the request succeeds.
- ///
- ///
- },
- 'globalEval': function() {
- ///
- /// Execute some JavaScript code globally.
- /// The JavaScript code to execute.
- ///
- },
- 'grep': function() {
- ///
- /// Finds the elements of an array which satisfy a filter function. The original array is not affected.
- /// The array to search through.
- /// The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
- /// If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
- ///
- ///
- },
- 'hasData': function() {
- ///
- /// Determine whether an element has any jQuery data associated with it.
- /// A DOM element to be checked for data.
- ///
- ///
- },
- 'holdReady': function() {
- ///
- /// Holds or releases the execution of jQuery's ready event.
- /// Indicates whether the ready hold is being requested or released
- ///
- },
- 'inArray': function() {
- ///
- /// Search for a specified value within an array and return its index (or -1 if not found).
- /// The value to search for.
- /// An array through which to search.
- /// The index of the array at which to begin the search. The default is 0, which will search the whole array.
- ///
- ///
- },
- 'isArray': function() {
- ///
- /// Determine whether the argument is an array.
- /// Object to test whether or not it is an array.
- ///
- ///
- },
- 'isEmptyObject': function() {
- ///
- /// Check to see if an object is empty (contains no properties).
- /// The object that will be checked to see if it's empty.
- ///
- ///
- },
- 'isFunction': function() {
- ///
- /// Determine if the argument passed is a Javascript function object.
- /// Object to test whether or not it is a function.
- ///
- ///
- },
- 'isNumeric': function() {
- ///
- /// Determines whether its argument is a number.
- /// The value to be tested.
- ///
- ///
- },
- 'isPlainObject': function() {
- ///
- /// Check to see if an object is a plain object (created using "{}" or "new Object").
- /// The object that will be checked to see if it's a plain object.
- ///
- ///
- },
- 'isWindow': function() {
- ///
- /// Determine whether the argument is a window.
- /// Object to test whether or not it is a window.
- ///
- ///
- },
- 'isXMLDoc': function() {
- ///
- /// Check to see if a DOM node is within an XML document (or is an XML document).
- /// The DOM node that will be checked to see if it's in an XML document.
- ///
- ///
- },
- 'makeArray': function() {
- ///
- /// Convert an array-like object into a true JavaScript array.
- /// Any object to turn into a native Array.
- ///
- ///
- },
- 'map': function() {
- ///
- /// Translate all items in an array or object to new array of items.
- /// The Array to translate.
- /// The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
- ///
- ///
- ///
- /// Translate all items in an array or object to new array of items.
- /// The Array or Object to translate.
- /// The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.
- ///
- ///
- },
- 'merge': function() {
- ///
- /// Merge the contents of two arrays together into the first array.
- /// The first array to merge, the elements of second added.
- /// The second array to merge into the first, unaltered.
- ///
- ///
- },
- 'noConflict': function() {
- ///
- /// Relinquish jQuery's control of the $ variable.
- /// A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
- ///
- ///
- },
- 'noop': function() {
- /// An empty function.
- ///
- },
- 'now': function() {
- /// Return a number representing the current time.
- ///
- },
- 'param': function() {
- ///
- /// Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
- /// An array or object to serialize.
- ///
- ///
- ///
- /// Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
- /// An array or object to serialize.
- /// A Boolean indicating whether to perform a traditional "shallow" serialization.
- ///
- ///
- },
- 'parseJSON': function() {
- ///
- /// Takes a well-formed JSON string and returns the resulting JavaScript object.
- /// The JSON string to parse.
- ///
- ///
- },
- 'parseXML': function() {
- ///
- /// Parses a string into an XML document.
- /// a well-formed XML string to be parsed
- ///
- ///
- },
- 'post': function() {
- ///
- /// Load data from the server using a HTTP POST request.
- /// A string containing the URL to which the request is sent.
- /// A map or string that is sent to the server with the request.
- /// A callback function that is executed if the request succeeds.
- /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
- ///
- ///
- },
- 'proxy': function() {
- ///
- /// Takes a function and returns a new one that will always have a particular context.
- /// The function whose context will be changed.
- /// The object to which the context (this) of the function should be set.
- ///
- ///
- ///
- /// Takes a function and returns a new one that will always have a particular context.
- /// The object to which the context of the function should be set.
- /// The name of the function whose context will be changed (should be a property of the context object).
- ///
- ///
- },
- 'queue': function() {
- ///
- /// Manipulate the queue of functions to be executed on the matched element.
- /// A DOM element where the array of queued functions is attached.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- /// An array of functions to replace the current queue contents.
- ///
- ///
- ///
- /// Manipulate the queue of functions to be executed on the matched element.
- /// A DOM element on which to add a queued function.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- /// The new function to add to the queue.
- ///
- ///
- },
- 'removeData': function() {
- ///
- /// Remove a previously-stored piece of data.
- /// A DOM element from which to remove data.
- /// A string naming the piece of data to remove.
- ///
- ///
- },
- 'sub': function() {
- /// Creates a new copy of jQuery whose properties and methods can be modified without affecting the original jQuery object.
- ///
- },
- 'support': function() {
- /// A collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance.
- ///
- },
- 'trim': function() {
- ///
- /// Remove the whitespace from the beginning and end of a string.
- /// The string to trim.
- ///
- ///
- },
- 'type': function() {
- ///
- /// Determine the internal JavaScript [[Class]] of an object.
- /// Object to get the internal JavaScript [[Class]] of.
- ///
- ///
- },
- 'unique': function() {
- ///
- /// Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
- /// The Array of DOM elements.
- ///
- ///
- },
- 'when': function() {
- ///
- /// Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
- /// One or more Deferred objects, or plain JavaScript objects.
- ///
- ///
- },
-});
-
-var _1228819969 = jQuery.Callbacks;
-jQuery.Callbacks = function(flags) {
-var _object = _1228819969(flags);
-intellisense.annotate(_object, {
- 'add': function() {
- ///
- /// Add a callback or a collection of callbacks to a callback list.
- /// A function, or array of functions, that are to be added to the callback list.
- ///
- },
- 'disable': function() {
- /// Disable a callback list from doing anything more.
- },
- 'empty': function() {
- /// Remove all of the callbacks from a list.
- },
- 'fire': function() {
- ///
- /// Call all of the callbacks with the given arguments
- /// The argument or list of arguments to pass back to the callback list.
- ///
- },
- 'fired': function() {
- /// Determine if the callbacks have already been called at least once.
- ///
- },
- 'fireWith': function() {
- ///
- /// Call all callbacks in a list with the given context and arguments.
- /// A reference to the context in which the callbacks in the list should be fired.
- /// An argument, or array of arguments, to pass to the callbacks in the list.
- ///
- },
- 'has': function() {
- ///
- /// Determine whether a supplied callback is in a list
- /// The callback to search for.
- ///
- ///
- },
- 'lock': function() {
- /// Lock a callback list in its current state.
- },
- 'locked': function() {
- /// Determine if the callbacks list has been locked.
- ///
- },
- 'remove': function() {
- ///
- /// Remove a callback or a collection of callbacks from a callback list.
- /// A function, or array of functions, that are to be removed from the callback list.
- ///
- },
-});
-
-return _object;
-};
-intellisense.redirectDefinition(jQuery.Callbacks, _1228819969);
-
-var _731531622 = jQuery.Deferred;
-jQuery.Deferred = function(func) {
-var _object = _731531622(func);
-intellisense.annotate(_object, {
- 'always': function() {
- ///
- /// Add handlers to be called when the Deferred object is either resolved or rejected.
- /// A function, or array of functions, that is called when the Deferred is resolved or rejected.
- /// Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
- ///
- ///
- },
- 'done': function() {
- ///
- /// Add handlers to be called when the Deferred object is resolved.
- /// A function, or array of functions, that are called when the Deferred is resolved.
- /// Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
- ///
- ///
- },
- 'fail': function() {
- ///
- /// Add handlers to be called when the Deferred object is rejected.
- /// A function, or array of functions, that are called when the Deferred is rejected.
- /// Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
- ///
- ///
- },
- 'isRejected': function() {
- /// Determine whether a Deferred object has been rejected.
- ///
- },
- 'isResolved': function() {
- /// Determine whether a Deferred object has been resolved.
- ///
- },
- 'notify': function() {
- ///
- /// Call the progressCallbacks on a Deferred object with the given args.
- /// Optional arguments that are passed to the progressCallbacks.
- ///
- ///
- },
- 'notifyWith': function() {
- ///
- /// Call the progressCallbacks on a Deferred object with the given context and args.
- /// Context passed to the progressCallbacks as the this object.
- /// Optional arguments that are passed to the progressCallbacks.
- ///
- ///
- },
- 'pipe': function() {
- ///
- /// Utility method to filter and/or chain Deferreds.
- /// An optional function that is called when the Deferred is resolved.
- /// An optional function that is called when the Deferred is rejected.
- ///
- ///
- ///
- /// Utility method to filter and/or chain Deferreds.
- /// An optional function that is called when the Deferred is resolved.
- /// An optional function that is called when the Deferred is rejected.
- /// An optional function that is called when progress notifications are sent to the Deferred.
- ///
- ///
- },
- 'progress': function() {
- ///
- /// Add handlers to be called when the Deferred object generates progress notifications.
- /// A function, or array of functions, that is called when the Deferred generates progress notifications.
- ///
- ///
- },
- 'promise': function() {
- ///
- /// Return a Deferred's Promise object.
- /// Object onto which the promise methods have to be attached
- ///
- ///
- },
- 'reject': function() {
- ///
- /// Reject a Deferred object and call any failCallbacks with the given args.
- /// Optional arguments that are passed to the failCallbacks.
- ///
- ///
- },
- 'rejectWith': function() {
- ///
- /// Reject a Deferred object and call any failCallbacks with the given context and args.
- /// Context passed to the failCallbacks as the this object.
- /// An optional array of arguments that are passed to the failCallbacks.
- ///
- ///
- },
- 'resolve': function() {
- ///
- /// Resolve a Deferred object and call any doneCallbacks with the given args.
- /// Optional arguments that are passed to the doneCallbacks.
- ///
- ///
- },
- 'resolveWith': function() {
- ///
- /// Resolve a Deferred object and call any doneCallbacks with the given context and args.
- /// Context passed to the doneCallbacks as the this object.
- /// An optional array of arguments that are passed to the doneCallbacks.
- ///
- ///
- },
- 'state': function() {
- /// Determine the current state of a Deferred object.
- ///
- },
- 'then': function() {
- ///
- /// Add handlers to be called when the Deferred object is resolved or rejected.
- /// A function, or array of functions, called when the Deferred is resolved.
- /// A function, or array of functions, called when the Deferred is rejected.
- ///
- ///
- ///
- /// Add handlers to be called when the Deferred object is resolved or rejected.
- /// A function, or array of functions, called when the Deferred is resolved.
- /// A function, or array of functions, called when the Deferred is rejected.
- /// A function, or array of functions, called when the Deferred notifies progress.
- ///
- ///
- },
-});
-
-return _object;
-};
-intellisense.redirectDefinition(jQuery.Callbacks, _731531622);
-
-intellisense.annotate(jQuery.Event.prototype, {
- 'currentTarget': function() {
- /// The current DOM element within the event bubbling phase.
- ///
- },
- 'data': function() {
- /// An optional data map passed to an event method when the current executing handler is bound.
- },
- 'delegateTarget': function() {
- /// The element where the currently-called jQuery event handler was attached.
- ///
- },
- 'isDefaultPrevented': function() {
- /// Returns whether event.preventDefault() was ever called on this event object.
- ///
- },
- 'isImmediatePropagationStopped': function() {
- /// Returns whether event.stopImmediatePropagation() was ever called on this event object.
- ///
- },
- 'isPropagationStopped': function() {
- /// Returns whether event.stopPropagation() was ever called on this event object.
- ///
- },
- 'namespace': function() {
- /// The namespace specified when the event was triggered.
- ///
- },
- 'pageX': function() {
- /// The mouse position relative to the left edge of the document.
- ///
- },
- 'pageY': function() {
- /// The mouse position relative to the top edge of the document.
- ///
- },
- 'preventDefault': function() {
- /// If this method is called, the default action of the event will not be triggered.
- },
- 'relatedTarget': function() {
- /// The other DOM element involved in the event, if any.
- ///
- },
- 'result': function() {
- /// The last value returned by an event handler that was triggered by this event, unless the value was undefined.
- ///
- },
- 'stopImmediatePropagation': function() {
- /// Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
- },
- 'stopPropagation': function() {
- /// Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
- },
- 'target': function() {
- /// The DOM element that initiated the event.
- ///
- },
- 'timeStamp': function() {
- /// The difference in milliseconds between the time the browser created the event and January 1, 1970.
- ///
- },
- 'type': function() {
- /// Describes the nature of the event.
- ///
- },
- 'which': function() {
- /// For key or mouse events, this property indicates the specific key or button that was pressed.
- ///
- },
-});
-
-intellisense.annotate(jQuery.fn, {
- 'add': function() {
- ///
- /// Add elements to the set of matched elements.
- /// A string representing a selector expression to find additional elements to add to the set of matched elements.
- ///
- ///
- ///
- /// Add elements to the set of matched elements.
- /// One or more elements to add to the set of matched elements.
- ///
- ///
- ///
- /// Add elements to the set of matched elements.
- /// An HTML fragment to add to the set of matched elements.
- ///
- ///
- ///
- /// Add elements to the set of matched elements.
- /// An existing jQuery object to add to the set of matched elements.
- ///
- ///
- ///
- /// Add elements to the set of matched elements.
- /// A string representing a selector expression to find additional elements to add to the set of matched elements.
- /// The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
- ///
- ///
- },
- 'addClass': function() {
- ///
- /// Adds the specified class(es) to each of the set of matched elements.
- /// One or more class names to be added to the class attribute of each matched element.
- ///
- ///
- ///
- /// Adds the specified class(es) to each of the set of matched elements.
- /// A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'after': function() {
- ///
- /// Insert content, specified by the parameter, after each element in the set of matched elements.
- /// HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements.
- /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
- ///
- ///
- ///
- /// Insert content, specified by the parameter, after each element in the set of matched elements.
- /// A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'ajaxComplete': function() {
- ///
- /// Register a handler to be called when Ajax requests complete. This is an Ajax Event.
- /// The function to be invoked.
- ///
- ///
- },
- 'ajaxError': function() {
- ///
- /// Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
- /// The function to be invoked.
- ///
- ///
- },
- 'ajaxSend': function() {
- ///
- /// Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
- /// The function to be invoked.
- ///
- ///
- },
- 'ajaxStart': function() {
- ///
- /// Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
- /// The function to be invoked.
- ///
- ///
- },
- 'ajaxStop': function() {
- ///
- /// Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
- /// The function to be invoked.
- ///
- ///
- },
- 'ajaxSuccess': function() {
- ///
- /// Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
- /// The function to be invoked.
- ///
- ///
- },
- 'all': function() {
- /// Selects all elements.
- },
- 'andSelf': function() {
- /// Add the previous set of elements on the stack to the current set.
- ///
- },
- 'animate': function() {
- ///
- /// Perform a custom animation of a set of CSS properties.
- /// A map of CSS properties that the animation will move toward.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Perform a custom animation of a set of CSS properties.
- /// A map of CSS properties that the animation will move toward.
- /// A map of additional options to pass to the method. Supported keys: duration: A string or number determining how long the animation will run.easing: A string indicating which easing function to use for the transition.complete: A function to call once the animation is complete.step: A function to be called after each step of the animation.queue: A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string.specialEasing: A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions (added 1.4).
- ///
- ///
- },
- 'animated': function() {
- /// Select all elements that are in the progress of an animation at the time the selector is run.
- },
- 'append': function() {
- ///
- /// Insert content, specified by the parameter, to the end of each element in the set of matched elements.
- /// DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
- /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
- ///
- ///
- ///
- /// Insert content, specified by the parameter, to the end of each element in the set of matched elements.
- /// A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'appendTo': function() {
- ///
- /// Insert every element in the set of matched elements to the end of the target.
- /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
- ///
- ///
- },
- 'attr': function() {
- ///
- /// Set one or more attributes for the set of matched elements.
- /// The name of the attribute to set.
- /// A value to set for the attribute.
- ///
- ///
- ///
- /// Set one or more attributes for the set of matched elements.
- /// A map of attribute-value pairs to set.
- ///
- ///
- ///
- /// Set one or more attributes for the set of matched elements.
- /// The name of the attribute to set.
- /// A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
- ///
- ///
- },
- 'attributeContains': function() {
- ///
- /// Selects elements that have the specified attribute with a value containing the a given substring.
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'attributeContainsPrefix': function() {
- ///
- /// Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'attributeContainsWord': function() {
- ///
- /// Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'attributeEndsWith': function() {
- ///
- /// Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'attributeEquals': function() {
- ///
- /// Selects elements that have the specified attribute with a value exactly equal to a certain value.
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'attributeHas': function() {
- ///
- /// Selects elements that have the specified attribute, with any value.
- /// An attribute name.
- ///
- },
- 'attributeMultiple': function() {
- ///
- /// Matches elements that match all of the specified attribute filters.
- /// An attribute filter.
- /// Another attribute filter, reducing the selection even more
- /// As many more attribute filters as necessary
- ///
- },
- 'attributeNotEqual': function() {
- ///
- /// Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value.
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'attributeStartsWith': function() {
- ///
- /// Selects elements that have the specified attribute with a value beginning exactly with a given string.
- /// An attribute name.
- /// An attribute value. Can be either an unquoted single word or a quoted string.
- ///
- },
- 'before': function() {
- ///
- /// Insert content, specified by the parameter, before each element in the set of matched elements.
- /// HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements.
- /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
- ///
- ///
- ///
- /// Insert content, specified by the parameter, before each element in the set of matched elements.
- /// A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'bind': function() {
- ///
- /// Attach a handler to an event for the elements.
- /// A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Attach a handler to an event for the elements.
- /// A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
- /// A map of data that will be passed to the event handler.
- /// Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
- ///
- ///
- ///
- /// Attach a handler to an event for the elements.
- /// A map of one or more DOM event types and functions to execute for them.
- ///
- ///
- },
- 'blur': function() {
- ///
- /// Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'button': function() {
- /// Selects all button elements and elements of type button.
- },
- 'change': function() {
- ///
- /// Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'checkbox': function() {
- /// Selects all elements of type checkbox.
- },
- 'checked': function() {
- /// Matches all elements that are checked.
- },
- 'child': function() {
- ///
- /// Selects all direct child elements specified by "child" of elements specified by "parent".
- /// Any valid selector.
- /// A selector to filter the child elements.
- ///
- },
- 'children': function() {
- ///
- /// Get the children of each element in the set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'class': function() {
- ///
- /// Selects all elements with the given class.
- /// A class to search for. An element can have multiple classes; only one of them must match.
- ///
- },
- 'clearQueue': function() {
- ///
- /// Remove from the queue all items that have not yet been run.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- ///
- ///
- },
- 'click': function() {
- ///
- /// Bind an event handler to the "click" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "click" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'clone': function() {
- ///
- /// Create a deep copy of the set of matched elements.
- /// A Boolean indicating whether event handlers should be copied along with the elements. As of jQuery 1.4, element data will be copied as well.
- ///
- ///
- ///
- /// Create a deep copy of the set of matched elements.
- /// A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back to false in 1.5.1 and up.
- /// A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
- ///
- ///
- },
- 'closest': function() {
- ///
- /// Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree.
- /// A string containing a selector expression to match elements against.
- /// A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
- ///
- ///
- ///
- /// Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree.
- /// A jQuery object to match elements against.
- ///
- ///
- ///
- /// Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree.
- /// An element to match elements against.
- ///
- ///
- },
- 'contains': function() {
- ///
- /// Select all elements that contain the specified text.
- /// A string of text to look for. It's case sensitive.
- ///
- },
- 'contents': function() {
- /// Get the children of each element in the set of matched elements, including text and comment nodes.
- ///
- },
- 'context': function() {
- /// The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document.
- ///
- },
- 'css': function() {
- ///
- /// Set one or more CSS properties for the set of matched elements.
- /// A CSS property name.
- /// A value to set for the property.
- ///
- ///
- ///
- /// Set one or more CSS properties for the set of matched elements.
- /// A CSS property name.
- /// A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
- ///
- ///
- ///
- /// Set one or more CSS properties for the set of matched elements.
- /// A map of property-value pairs to set.
- ///
- ///
- },
- 'data': function() {
- ///
- /// Store arbitrary data associated with the matched elements.
- /// A string naming the piece of data to set.
- /// The new data value; it can be any Javascript type including Array or Object.
- ///
- ///
- ///
- /// Store arbitrary data associated with the matched elements.
- /// An object of key-value pairs of data to update.
- ///
- ///
- },
- 'dblclick': function() {
- ///
- /// Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'delay': function() {
- ///
- /// Set a timer to delay execution of subsequent items in the queue.
- /// An integer indicating the number of milliseconds to delay execution of the next item in the queue.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- ///
- ///
- },
- 'delegate': function() {
- ///
- /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
- /// A selector to filter the elements that trigger the event.
- /// A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names.
- /// A function to execute at the time the event is triggered.
- ///
- ///
- ///
- /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
- /// A selector to filter the elements that trigger the event.
- /// A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names.
- /// A map of data that will be passed to the event handler.
- /// A function to execute at the time the event is triggered.
- ///
- ///
- ///
- /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
- /// A selector to filter the elements that trigger the event.
- /// A map of one or more event types and functions to execute for them.
- ///
- ///
- },
- 'dequeue': function() {
- ///
- /// Execute the next function on the queue for the matched elements.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- ///
- ///
- },
- 'descendant': function() {
- ///
- /// Selects all elements that are descendants of a given ancestor.
- /// Any valid selector.
- /// A selector to filter the descendant elements.
- ///
- },
- 'detach': function() {
- ///
- /// Remove the set of matched elements from the DOM.
- /// A selector expression that filters the set of matched elements to be removed.
- ///
- ///
- },
- 'die': function() {
- ///
- /// Remove an event handler previously attached using .live() from the elements.
- /// A string containing a JavaScript event type, such as click or keydown.
- /// The function that is no longer to be executed.
- ///
- ///
- ///
- /// Remove an event handler previously attached using .live() from the elements.
- /// A map of one or more event types, such as click or keydown and their corresponding functions that are no longer to be executed.
- ///
- ///
- },
- 'disabled': function() {
- /// Selects all elements that are disabled.
- },
- 'each': function() {
- ///
- /// Iterate over a jQuery object, executing a function for each matched element.
- /// A function to execute for each matched element.
- ///
- ///
- },
- 'element': function() {
- ///
- /// Selects all elements with the given tag name.
- /// An element to search for. Refers to the tagName of DOM nodes.
- ///
- },
- 'empty': function() {
- /// Select all elements that have no children (including text nodes).
- },
- 'enabled': function() {
- /// Selects all elements that are enabled.
- },
- 'end': function() {
- /// End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
- ///
- },
- 'eq': function() {
- ///
- /// Reduce the set of matched elements to the one at the specified index.
- /// An integer indicating the 0-based position of the element.
- ///
- ///
- ///
- /// Reduce the set of matched elements to the one at the specified index.
- /// An integer indicating the position of the element, counting backwards from the last element in the set.
- ///
- ///
- },
- 'error': function() {
- ///
- /// Bind an event handler to the "error" JavaScript event.
- /// A function to execute when the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "error" JavaScript event.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'even': function() {
- /// Selects even elements, zero-indexed. See also odd.
- },
- 'fadeIn': function() {
- ///
- /// Display the matched elements by fading them to opaque.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Display the matched elements by fading them to opaque.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'fadeOut': function() {
- ///
- /// Hide the matched elements by fading them to transparent.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Hide the matched elements by fading them to transparent.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'fadeTo': function() {
- ///
- /// Adjust the opacity of the matched elements.
- /// A string or number determining how long the animation will run.
- /// A number between 0 and 1 denoting the target opacity.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Adjust the opacity of the matched elements.
- /// A string or number determining how long the animation will run.
- /// A number between 0 and 1 denoting the target opacity.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'fadeToggle': function() {
- ///
- /// Display or hide the matched elements by animating their opacity.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'file': function() {
- /// Selects all elements of type file.
- },
- 'filter': function() {
- ///
- /// Reduce the set of matched elements to those that match the selector or pass the function's test.
- /// A string containing a selector expression to match the current set of elements against.
- ///
- ///
- ///
- /// Reduce the set of matched elements to those that match the selector or pass the function's test.
- /// A function used as a test for each element in the set. this is the current DOM element.
- ///
- ///
- ///
- /// Reduce the set of matched elements to those that match the selector or pass the function's test.
- /// An element to match the current set of elements against.
- ///
- ///
- ///
- /// Reduce the set of matched elements to those that match the selector or pass the function's test.
- /// An existing jQuery object to match the current set of elements against.
- ///
- ///
- },
- 'find': function() {
- ///
- /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
- /// A jQuery object to match elements against.
- ///
- ///
- ///
- /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
- /// An element to match elements against.
- ///
- ///
- },
- 'first': function() {
- /// Selects the first matched element.
- },
- 'first-child': function() {
- /// Selects all elements that are the first child of their parent.
- },
- 'focus': function() {
- ///
- /// Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'focusin': function() {
- ///
- /// Bind an event handler to the "focusin" event.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "focusin" event.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'focusout': function() {
- ///
- /// Bind an event handler to the "focusout" JavaScript event.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "focusout" JavaScript event.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'get': function() {
- ///
- /// Retrieve the DOM elements matched by the jQuery object.
- /// A zero-based integer indicating which element to retrieve.
- ///
- ///
- },
- 'gt': function() {
- ///
- /// Select all elements at an index greater than index within the matched set.
- /// Zero-based index.
- ///
- },
- 'has': function() {
- ///
- /// Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
- /// A DOM element to match elements against.
- ///
- ///
- },
- 'hasClass': function() {
- ///
- /// Determine whether any of the matched elements are assigned the given class.
- /// The class name to search for.
- ///
- ///
- },
- 'header': function() {
- /// Selects all elements that are headers, like h1, h2, h3 and so on.
- },
- 'height': function() {
- ///
- /// Set the CSS height of every matched element.
- /// An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
- ///
- ///
- ///
- /// Set the CSS height of every matched element.
- /// A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'hidden': function() {
- /// Selects all elements that are hidden.
- },
- 'hide': function() {
- ///
- /// Hide the matched elements.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Hide the matched elements.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'hover': function() {
- ///
- /// Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
- /// A function to execute when the mouse pointer enters the element.
- /// A function to execute when the mouse pointer leaves the element.
- ///
- ///
- },
- 'html': function() {
- ///
- /// Set the HTML contents of each element in the set of matched elements.
- /// A string of HTML to set as the content of each matched element.
- ///
- ///
- ///
- /// Set the HTML contents of each element in the set of matched elements.
- /// A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'id': function() {
- ///
- /// Selects a single element with the given id attribute.
- /// An ID to search for, specified via the id attribute of an element.
- ///
- },
- 'image': function() {
- /// Selects all elements of type image.
- },
- 'index': function() {
- ///
- /// Search for a given element from among the matched elements.
- /// A selector representing a jQuery collection in which to look for an element.
- ///
- ///
- ///
- /// Search for a given element from among the matched elements.
- /// The DOM element or first element within the jQuery object to look for.
- ///
- ///
- },
- 'init': function() {
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// A string containing a selector expression
- /// A DOM Element, Document, or jQuery to use as context
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// A DOM element to wrap in a jQuery object.
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// A plain object to wrap in a jQuery object.
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// An array containing a set of DOM elements to wrap in a jQuery object.
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// An existing jQuery object to clone.
- ///
- ///
- },
- 'innerHeight': function() {
- /// Get the current computed height for the first element in the set of matched elements, including padding but not border.
- ///
- },
- 'innerWidth': function() {
- /// Get the current computed width for the first element in the set of matched elements, including padding but not border.
- ///
- },
- 'input': function() {
- /// Selects all input, textarea, select and button elements.
- },
- 'insertAfter': function() {
- ///
- /// Insert every element in the set of matched elements after the target.
- /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
- ///
- ///
- },
- 'insertBefore': function() {
- ///
- /// Insert every element in the set of matched elements before the target.
- /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
- ///
- ///
- },
- 'is': function() {
- ///
- /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
- /// A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
- ///
- ///
- ///
- /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
- /// An existing jQuery object to match the current set of elements against.
- ///
- ///
- ///
- /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
- /// An element to match the current set of elements against.
- ///
- ///
- },
- 'jquery': function() {
- /// A string containing the jQuery version number.
- ///
- },
- 'keydown': function() {
- ///
- /// Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'keypress': function() {
- ///
- /// Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'keyup': function() {
- ///
- /// Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'last': function() {
- /// Selects the last matched element.
- },
- 'last-child': function() {
- /// Selects all elements that are the last child of their parent.
- },
- 'length': function() {
- /// The number of elements in the jQuery object.
- ///
- },
- 'live': function() {
- ///
- /// Attach an event handler for all elements which match the current selector, now and in the future.
- /// A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names.
- /// A function to execute at the time the event is triggered.
- ///
- ///
- ///
- /// Attach an event handler for all elements which match the current selector, now and in the future.
- /// A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names.
- /// A map of data that will be passed to the event handler.
- /// A function to execute at the time the event is triggered.
- ///
- ///
- ///
- /// Attach an event handler for all elements which match the current selector, now and in the future.
- /// A map of one or more JavaScript event types and functions to execute for them.
- ///
- ///
- },
- 'load': function() {
- ///
- /// Bind an event handler to the "load" JavaScript event.
- /// A function to execute when the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "load" JavaScript event.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'lt': function() {
- ///
- /// Select all elements at an index less than index within the matched set.
- /// Zero-based index.
- ///
- },
- 'map': function() {
- ///
- /// Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
- /// A function object that will be invoked for each element in the current set.
- ///
- ///
- },
- 'mousedown': function() {
- ///
- /// Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'mouseenter': function() {
- ///
- /// Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'mouseleave': function() {
- ///
- /// Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'mousemove': function() {
- ///
- /// Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'mouseout': function() {
- ///
- /// Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'mouseover': function() {
- ///
- /// Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'mouseup': function() {
- ///
- /// Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'multiple': function() {
- ///
- /// Selects the combined results of all the specified selectors.
- /// Any valid selector.
- /// Another valid selector.
- /// As many more valid selectors as you like.
- ///
- },
- 'next': function() {
- ///
- /// Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'next adjacent': function() {
- ///
- /// Selects all next elements matching "next" that are immediately preceded by a sibling "prev".
- /// Any valid selector.
- /// A selector to match the element that is next to the first selector.
- ///
- },
- 'next siblings': function() {
- ///
- /// Selects all sibling elements that follow after the "prev" element, have the same parent, and match the filtering "siblings" selector.
- /// Any valid selector.
- /// A selector to filter elements that are the following siblings of the first selector.
- ///
- },
- 'nextAll': function() {
- ///
- /// Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'nextUntil': function() {
- ///
- /// Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
- /// A string containing a selector expression to indicate where to stop matching following sibling elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
- /// A DOM node or jQuery object indicating where to stop matching following sibling elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'not': function() {
- ///
- /// Remove elements from the set of matched elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Remove elements from the set of matched elements.
- /// One or more DOM elements to remove from the matched set.
- ///
- ///
- ///
- /// Remove elements from the set of matched elements.
- /// A function used as a test for each element in the set. this is the current DOM element.
- ///
- ///
- ///
- /// Remove elements from the set of matched elements.
- /// An existing jQuery object to match the current set of elements against.
- ///
- ///
- },
- 'nth-child': function() {
- ///
- /// Selects all elements that are the nth-child of their parent.
- /// The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-child(even), :nth-child(4n) )
- ///
- },
- 'odd': function() {
- /// Selects odd elements, zero-indexed. See also even.
- },
- 'off': function() {
- ///
- /// Remove an event handler.
- /// One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
- /// A selector which should match the one originally passed to .on() when attaching event handlers.
- /// A handler function previously attached for the event(s), or the special value false.
- ///
- ///
- ///
- /// Remove an event handler.
- /// A map where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
- /// A selector which should match the one originally passed to .on() when attaching event handlers.
- ///
- ///
- },
- 'offset': function() {
- ///
- /// Set the current coordinates of every element in the set of matched elements, relative to the document.
- /// An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
- ///
- ///
- ///
- /// Set the current coordinates of every element in the set of matched elements, relative to the document.
- /// A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.
- ///
- ///
- },
- 'offsetParent': function() {
- /// Get the closest ancestor element that is positioned.
- ///
- },
- 'on': function() {
- ///
- /// Attach an event handler function for one or more events to the selected elements.
- /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
- /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
- /// Data to be passed to the handler in event.data when an event is triggered.
- /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
- ///
- ///
- ///
- /// Attach an event handler function for one or more events to the selected elements.
- /// A map in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
- /// A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
- /// Data to be passed to the handler in event.data when an event occurs.
- ///
- ///
- },
- 'one': function() {
- ///
- /// Attach a handler to an event for the elements. The handler is executed at most once per element.
- /// A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
- /// A map of data that will be passed to the event handler.
- /// A function to execute at the time the event is triggered.
- ///
- ///
- ///
- /// Attach a handler to an event for the elements. The handler is executed at most once per element.
- /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
- /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
- /// Data to be passed to the handler in event.data when an event is triggered.
- /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
- ///
- ///
- ///
- /// Attach a handler to an event for the elements. The handler is executed at most once per element.
- /// A map in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
- /// A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
- /// Data to be passed to the handler in event.data when an event occurs.
- ///
- ///
- },
- 'only-child': function() {
- /// Selects all elements that are the only child of their parent.
- },
- 'outerHeight': function() {
- ///
- /// Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
- /// A Boolean indicating whether to include the element's margin in the calculation.
- ///
- ///
- },
- 'outerWidth': function() {
- ///
- /// Get the current computed width for the first element in the set of matched elements, including padding and border.
- /// A Boolean indicating whether to include the element's margin in the calculation.
- ///
- ///
- },
- 'parent': function() {
- ///
- /// Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'parents': function() {
- ///
- /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'parentsUntil': function() {
- ///
- /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
- /// A string containing a selector expression to indicate where to stop matching ancestor elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
- /// A DOM node or jQuery object indicating where to stop matching ancestor elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'password': function() {
- /// Selects all elements of type password.
- },
- 'position': function() {
- /// Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
- ///
- },
- 'prepend': function() {
- ///
- /// Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
- /// DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
- /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
- ///
- ///
- ///
- /// Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
- /// A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'prependTo': function() {
- ///
- /// Insert every element in the set of matched elements to the beginning of the target.
- /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
- ///
- ///
- },
- 'prev': function() {
- ///
- /// Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'prevAll': function() {
- ///
- /// Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'prevUntil': function() {
- ///
- /// Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
- /// A string containing a selector expression to indicate where to stop matching preceding sibling elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- ///
- /// Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
- /// A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'promise': function() {
- ///
- /// Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
- /// The type of queue that needs to be observed.
- /// Object onto which the promise methods have to be attached
- ///
- ///
- },
- 'prop': function() {
- ///
- /// Set one or more properties for the set of matched elements.
- /// The name of the property to set.
- /// A value to set for the property.
- ///
- ///
- ///
- /// Set one or more properties for the set of matched elements.
- /// A map of property-value pairs to set.
- ///
- ///
- ///
- /// Set one or more properties for the set of matched elements.
- /// The name of the property to set.
- /// A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
- ///
- ///
- },
- 'pushStack': function() {
- ///
- /// Add a collection of DOM elements onto the jQuery stack.
- /// An array of elements to push onto the stack and make into a new jQuery object.
- ///
- ///
- ///
- /// Add a collection of DOM elements onto the jQuery stack.
- /// An array of elements to push onto the stack and make into a new jQuery object.
- /// The name of a jQuery method that generated the array of elements.
- /// The arguments that were passed in to the jQuery method (for serialization).
- ///
- ///
- },
- 'queue': function() {
- ///
- /// Manipulate the queue of functions to be executed on the matched elements.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- /// An array of functions to replace the current queue contents.
- ///
- ///
- ///
- /// Manipulate the queue of functions to be executed on the matched elements.
- /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
- /// The new function to add to the queue, with a function to call that will dequeue the next item.
- ///
- ///
- },
- 'radio': function() {
- /// Selects all elements of type radio.
- },
- 'ready': function() {
- ///
- /// Specify a function to execute when the DOM is fully loaded.
- /// A function to execute after the DOM is ready.
- ///
- ///
- },
- 'remove': function() {
- ///
- /// Remove the set of matched elements from the DOM.
- /// A selector expression that filters the set of matched elements to be removed.
- ///
- ///
- },
- 'removeAttr': function() {
- ///
- /// Remove an attribute from each element in the set of matched elements.
- /// An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
- ///
- ///
- },
- 'removeClass': function() {
- ///
- /// Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
- /// One or more space-separated classes to be removed from the class attribute of each matched element.
- ///
- ///
- ///
- /// Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
- /// A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.
- ///
- ///
- },
- 'removeData': function() {
- ///
- /// Remove a previously-stored piece of data.
- /// A string naming the piece of data to delete.
- ///
- ///
- ///
- /// Remove a previously-stored piece of data.
- /// An array or space-separated string naming the pieces of data to delete.
- ///
- ///
- },
- 'removeProp': function() {
- ///
- /// Remove a property for the set of matched elements.
- /// The name of the property to set.
- ///
- ///
- },
- 'replaceAll': function() {
- ///
- /// Replace each target element with the set of matched elements.
- /// A selector expression indicating which element(s) to replace.
- ///
- ///
- },
- 'replaceWith': function() {
- ///
- /// Replace each element in the set of matched elements with the provided new content.
- /// The content to insert. May be an HTML string, DOM element, or jQuery object.
- ///
- ///
- ///
- /// Replace each element in the set of matched elements with the provided new content.
- /// A function that returns content with which to replace the set of matched elements.
- ///
- ///
- },
- 'reset': function() {
- /// Selects all elements of type reset.
- },
- 'resize': function() {
- ///
- /// Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'scroll': function() {
- ///
- /// Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'scrollLeft': function() {
- ///
- /// Set the current horizontal position of the scroll bar for each of the set of matched elements.
- /// An integer indicating the new position to set the scroll bar to.
- ///
- ///
- },
- 'scrollTop': function() {
- ///
- /// Set the current vertical position of the scroll bar for each of the set of matched elements.
- /// An integer indicating the new position to set the scroll bar to.
- ///
- ///
- },
- 'select': function() {
- ///
- /// Bind an event handler to the "select" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "select" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'selected': function() {
- /// Selects all elements that are selected.
- },
- 'serialize': function() {
- /// Encode a set of form elements as a string for submission.
- ///
- },
- 'serializeArray': function() {
- /// Encode a set of form elements as an array of names and values.
- ///
- },
- 'show': function() {
- ///
- /// Display the matched elements.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Display the matched elements.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'siblings': function() {
- ///
- /// Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
- /// A string containing a selector expression to match elements against.
- ///
- ///
- },
- 'size': function() {
- /// Return the number of elements in the jQuery object.
- ///
- },
- 'slice': function() {
- ///
- /// Reduce the set of matched elements to a subset specified by a range of indices.
- /// An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
- /// An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
- ///
- ///
- },
- 'slideDown': function() {
- ///
- /// Display the matched elements with a sliding motion.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Display the matched elements with a sliding motion.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'slideToggle': function() {
- ///
- /// Display or hide the matched elements with a sliding motion.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Display or hide the matched elements with a sliding motion.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'slideUp': function() {
- ///
- /// Hide the matched elements with a sliding motion.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Hide the matched elements with a sliding motion.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- },
- 'stop': function() {
- ///
- /// Stop the currently-running animation on the matched elements.
- /// A Boolean indicating whether to remove queued animation as well. Defaults to false.
- /// A Boolean indicating whether to complete the current animation immediately. Defaults to false.
- ///
- ///
- ///
- /// Stop the currently-running animation on the matched elements.
- /// The name of the queue in which to stop animations.
- /// A Boolean indicating whether to remove queued animation as well. Defaults to false.
- /// A Boolean indicating whether to complete the current animation immediately. Defaults to false.
- ///
- ///
- },
- 'submit': function() {
- ///
- /// Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
- /// A function to execute each time the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'text': function() {
- ///
- /// Set the content of each element in the set of matched elements to the specified text.
- /// A string of text to set as the content of each matched element.
- ///
- ///
- ///
- /// Set the content of each element in the set of matched elements to the specified text.
- /// A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
- ///
- ///
- },
- 'toArray': function() {
- /// Retrieve all the DOM elements contained in the jQuery set, as an array.
- ///
- },
- 'toggle': function() {
- ///
- /// Display or hide the matched elements.
- /// A string or number determining how long the animation will run.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Display or hide the matched elements.
- /// A string or number determining how long the animation will run.
- /// A string indicating which easing function to use for the transition.
- /// A function to call once the animation is complete.
- ///
- ///
- ///
- /// Display or hide the matched elements.
- /// A Boolean indicating whether to show or hide the elements.
- ///
- ///
- },
- 'toggleClass': function() {
- ///
- /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
- /// One or more class names (separated by spaces) to be toggled for each element in the matched set.
- ///
- ///
- ///
- /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
- /// One or more class names (separated by spaces) to be toggled for each element in the matched set.
- /// A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
- ///
- ///
- ///
- /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
- /// A boolean value to determine whether the class should be added or removed.
- ///
- ///
- ///
- /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
- /// A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
- /// A boolean value to determine whether the class should be added or removed.
- ///
- ///
- },
- 'trigger': function() {
- ///
- /// Execute all handlers and behaviors attached to the matched elements for the given event type.
- /// A string containing a JavaScript event type, such as click or submit.
- /// Additional parameters to pass along to the event handler.
- ///
- ///
- ///
- /// Execute all handlers and behaviors attached to the matched elements for the given event type.
- /// A jQuery.Event object.
- ///
- ///
- },
- 'triggerHandler': function() {
- ///
- /// Execute all handlers attached to an element for an event.
- /// A string containing a JavaScript event type, such as click or submit.
- /// An array of additional parameters to pass along to the event handler.
- ///
- ///
- },
- 'unbind': function() {
- ///
- /// Remove a previously-attached event handler from the elements.
- /// A string containing a JavaScript event type, such as click or submit.
- /// The function that is to be no longer executed.
- ///
- ///
- ///
- /// Remove a previously-attached event handler from the elements.
- /// A string containing a JavaScript event type, such as click or submit.
- /// Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
- ///
- ///
- ///
- /// Remove a previously-attached event handler from the elements.
- /// A JavaScript event object as passed to an event handler.
- ///
- ///
- },
- 'undelegate': function() {
- ///
- /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
- /// A selector which will be used to filter the event results.
- /// A string containing a JavaScript event type, such as "click" or "keydown"
- ///
- ///
- ///
- /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
- /// A selector which will be used to filter the event results.
- /// A string containing a JavaScript event type, such as "click" or "keydown"
- /// A function to execute at the time the event is triggered.
- ///
- ///
- ///
- /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
- /// A selector which will be used to filter the event results.
- /// A map of one or more event types and previously bound functions to unbind from them.
- ///
- ///
- ///
- /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
- /// A string containing a namespace to unbind all events from.
- ///
- ///
- },
- 'unload': function() {
- ///
- /// Bind an event handler to the "unload" JavaScript event.
- /// A function to execute when the event is triggered.
- ///
- ///
- ///
- /// Bind an event handler to the "unload" JavaScript event.
- /// A map of data that will be passed to the event handler.
- /// A function to execute each time the event is triggered.
- ///
- ///
- },
- 'unwrap': function() {
- /// Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
- ///
- },
- 'val': function() {
- ///
- /// Set the value of each element in the set of matched elements.
- /// A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
- ///
- ///
- ///
- /// Set the value of each element in the set of matched elements.
- /// A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
- ///
- ///
- },
- 'visible': function() {
- /// Selects all elements that are visible.
- },
- 'width': function() {
- ///
- /// Set the CSS width of each element in the set of matched elements.
- /// An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
- ///
- ///
- ///
- /// Set the CSS width of each element in the set of matched elements.
- /// A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'wrap': function() {
- ///
- /// Wrap an HTML structure around each element in the set of matched elements.
- /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
- ///
- ///
- ///
- /// Wrap an HTML structure around each element in the set of matched elements.
- /// A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
- ///
- ///
- },
- 'wrapAll': function() {
- ///
- /// Wrap an HTML structure around all elements in the set of matched elements.
- /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
- ///
- ///
- },
- 'wrapInner': function() {
- ///
- /// Wrap an HTML structure around the content of each element in the set of matched elements.
- /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
- ///
- ///
- ///
- /// Wrap an HTML structure around the content of each element in the set of matched elements.
- /// A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
- ///
- ///
- },
-});
-
-intellisense.annotate(window, {
- '$': function() {
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// A string containing a selector expression
- /// A DOM Element, Document, or jQuery to use as context
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// A DOM element to wrap in a jQuery object.
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// A plain object to wrap in a jQuery object.
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// An array containing a set of DOM elements to wrap in a jQuery object.
- ///
- ///
- ///
- /// Accepts a string containing a CSS selector which is then used to match a set of elements.
- /// An existing jQuery object to clone.
- ///
- ///
- },
-});
-
diff --git a/NzbDrone.Web/Scripts2/jquery-1.8.2.js b/NzbDrone.Web/Scripts2/jquery-1.8.2.js
deleted file mode 100644
index 12c7797fd..000000000
--- a/NzbDrone.Web/Scripts2/jquery-1.8.2.js
+++ /dev/null
@@ -1,9440 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.8.2
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
- */
-(function( window, undefined ) {
-var
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // The deferred used on DOM ready
- readyList,
-
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
- location = window.location,
- navigator = window.navigator,
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // Save a reference to some core methods
- core_push = Array.prototype.push,
- core_slice = Array.prototype.slice,
- core_indexOf = Array.prototype.indexOf,
- core_toString = Object.prototype.toString,
- core_hasOwn = Object.prototype.hasOwnProperty,
- core_trim = String.prototype.trim,
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context, rootjQuery );
- },
-
- // Used for matching numbers
- core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
-
- // Used for detecting and trimming whitespace
- core_rnotwhite = /\S/,
- core_rspace = /\s+/,
-
- // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // A simple way to check for HTML strings
- // Prioritize #id over to avoid XSS via location.hash (#9521)
- rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
- // JSON RegExp
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
-
- // Matches dashed string for camelizing
- rmsPrefix = /^-ms-/,
- rdashAlpha = /-([\da-z])/gi,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return ( letter + "" ).toUpperCase();
- },
-
- // The ready event handler and self cleanup method
- DOMContentLoaded = function() {
- if ( document.addEventListener ) {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- } else if ( document.readyState === "complete" ) {
- // we're here because readyState === "complete" in oldIE
- // which is good enough for us to call the dom ready!
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- },
-
- // [[Class]] -> type pairs
- class2type = {};
-
-jQuery.fn = jQuery.prototype = {
- constructor: jQuery,
- init: function( selector, context, rootjQuery ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- context = context instanceof jQuery ? context[0] : context;
- doc = ( context && context.nodeType ? context.ownerDocument || context : document );
-
- // scripts is true for back-compat
- selector = jQuery.parseHTML( match[1], doc, true );
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
- this.attr.call( selector, context, true );
- }
-
- return jQuery.merge( this, selector );
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[2] );
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id !== match[2] ) {
- return rootjQuery.find( selector );
- }
-
- // Otherwise, we inject the element directly into the jQuery object
- this.length = 1;
- this[0] = elem;
- }
-
- this.context = document;
- this.selector = selector;
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.8.2",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return core_slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- return num == null ?
-
- // Return a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" ) {
- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Add the callback
- jQuery.ready.promise().done( fn );
-
- return this;
- },
-
- eq: function( i ) {
- i = +i;
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, i + 1 );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- slice: function() {
- return this.pushStack( core_slice.apply( this, arguments ),
- "slice", core_slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: core_push,
- sort: [].sort,
- splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( length === i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
-
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
-};
-
-jQuery.extend({
- noConflict: function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Hold (or release) the ready event
- holdReady: function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- },
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.trigger ) {
- jQuery( document ).trigger("ready").off("ready");
- }
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray || function( obj ) {
- return jQuery.type(obj) === "array";
- },
-
- isWindow: function( obj ) {
- return obj != null && obj == obj.window;
- },
-
- isNumeric: function( obj ) {
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
- },
-
- type: function( obj ) {
- return obj == null ?
- String( obj ) :
- class2type[ core_toString.call(obj) ] || "object";
- },
-
- isPlainObject: function( obj ) {
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- try {
- // Not own constructor property must be Object
- if ( obj.constructor &&
- !core_hasOwn.call(obj, "constructor") &&
- !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
- } catch ( e ) {
- // IE8,9 Will throw exceptions on certain host objects #9897
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || core_hasOwn.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- var name;
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- // data: string of html
- // context (optional): If specified, the fragment will be created in this context, defaults to document
- // scripts (optional): If true, will include scripts passed in the html string
- parseHTML: function( data, context, scripts ) {
- var parsed;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- if ( typeof context === "boolean" ) {
- scripts = context;
- context = 0;
- }
- context = context || document;
-
- // Single tag
- if ( (parsed = rsingleTag.exec( data )) ) {
- return [ context.createElement( parsed[1] ) ];
- }
-
- parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
- return jQuery.merge( [],
- (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
- },
-
- parseJSON: function( data ) {
- if ( !data || typeof data !== "string") {
- return null;
- }
-
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
- data = jQuery.trim( data );
-
- // Attempt to parse using the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- return window.JSON.parse( data );
- }
-
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
- .replace( rvalidtokens, "]" )
- .replace( rvalidbraces, "")) ) {
-
- return ( new Function( "return " + data ) )();
-
- }
- jQuery.error( "Invalid JSON: " + data );
- },
-
- // Cross-browser xml parsing
- parseXML: function( data ) {
- var xml, tmp;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- try {
- if ( window.DOMParser ) { // Standard
- tmp = new DOMParser();
- xml = tmp.parseFromString( data , "text/xml" );
- } else { // IE
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
- xml.async = "false";
- xml.loadXML( data );
- }
- } catch( e ) {
- xml = undefined;
- }
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- },
-
- noop: function() {},
-
- // Evaluates a script in a global context
- // Workarounds based on findings by Jim Driscoll
- // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
- globalEval: function( data ) {
- if ( data && core_rnotwhite.test( data ) ) {
- // We use execScript on Internet Explorer
- // We use an anonymous function so that context is window
- // rather than jQuery in Firefox
- ( window.execScript || function( data ) {
- window[ "eval" ].call( window, data );
- } )( data );
- }
- },
-
- // Convert dashed to camelCase; used by the css and data modules
- // Microsoft forgot to hump their vendor prefix (#9572)
- camelCase: function( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- },
-
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
- // args is for internal usage only
- each: function( obj, callback, args ) {
- var name,
- i = 0,
- length = obj.length,
- isObj = length === undefined || jQuery.isFunction( obj );
-
- if ( args ) {
- if ( isObj ) {
- for ( name in obj ) {
- if ( callback.apply( obj[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( obj[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in obj ) {
- if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
- break;
- }
- }
- }
- }
-
- return obj;
- },
-
- // Use native String.trim function wherever possible
- trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
- function( text ) {
- return text == null ?
- "" :
- core_trim.call( text );
- } :
-
- // Otherwise use our own trimming functionality
- function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var type,
- ret = results || [];
-
- if ( arr != null ) {
- // The window, strings (and functions) also have 'length'
- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
- type = jQuery.type( arr );
-
- if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
- core_push.call( ret, arr );
- } else {
- jQuery.merge( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- var len;
-
- if ( arr ) {
- if ( core_indexOf ) {
- return core_indexOf.call( arr, elem, i );
- }
-
- len = arr.length;
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
- for ( ; i < len; i++ ) {
- // Skip accessing in sparse arrays
- if ( i in arr && arr[ i ] === elem ) {
- return i;
- }
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var l = second.length,
- i = first.length,
- j = 0;
-
- if ( typeof l === "number" ) {
- for ( ; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var retVal,
- ret = [],
- i = 0,
- length = elems.length;
- inv = !!inv;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- retVal = !!callback( elems[ i ], i );
- if ( inv !== retVal ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value, key,
- ret = [],
- i = 0,
- length = elems.length,
- // jquery objects are treated as arrays
- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
- // Go through the array, translating each of the items to their
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( key in elems ) {
- value = callback( elems[ key ], key, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
- }
-
- // Flatten any nested arrays
- return ret.concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- proxy: function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !jQuery.isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = core_slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context, args.concat( core_slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- },
-
- // Multifunctional method to get and set values of a collection
- // The value/s can optionally be executed if it's a function
- access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
- var exec,
- bulk = key == null,
- i = 0,
- length = elems.length;
-
- // Sets many values
- if ( key && typeof key === "object" ) {
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
- }
- chainable = 1;
-
- // Sets one value
- } else if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = pass === undefined && jQuery.isFunction( value );
-
- if ( bulk ) {
- // Bulk operations only iterate when executing function values
- if ( exec ) {
- exec = fn;
- fn = function( elem, key, value ) {
- return exec.call( jQuery( elem ), value );
- };
-
- // Otherwise they run against the entire set
- } else {
- fn.call( elems, value );
- fn = null;
- }
- }
-
- if ( fn ) {
- for (; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
- }
-
- chainable = 1;
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
- },
-
- now: function() {
- return ( new Date() ).getTime();
- }
-});
-
-jQuery.ready.promise = function( obj ) {
- if ( !readyList ) {
-
- readyList = jQuery.Deferred();
-
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
- // we once tried to use readyState "interactive" here, but it caused issues like the one
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- setTimeout( jQuery.ready, 1 );
-
- // Standards-based browsers support DOMContentLoaded
- } else if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else {
- // Ensure firing before onload, maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var top = false;
-
- try {
- top = window.frameElement == null && document.documentElement;
- } catch(e) {}
-
- if ( top && top.doScroll ) {
- (function doScrollCheck() {
- if ( !jQuery.isReady ) {
-
- try {
- // Use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- top.doScroll("left");
- } catch(e) {
- return setTimeout( doScrollCheck, 50 );
- }
-
- // and execute any waiting functions
- jQuery.ready();
- }
- })();
- }
- }
- }
- return readyList.promise( obj );
-};
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
- var object = optionsCache[ options ] = {};
- jQuery.each( options.split( core_rspace ), function( _, flag ) {
- object[ flag ] = true;
- });
- return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- ( optionsCache[ options ] || createOptions( options ) ) :
- jQuery.extend( {}, options );
-
- var // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // Flag to know if list is currently firing
- firing,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = !options.once && [],
- // Fire callbacks
- fire = function( data ) {
- memory = options.memory && data;
- fired = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- firing = true;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
- memory = false; // To prevent further calls using add
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( stack ) {
- if ( stack.length ) {
- fire( stack.shift() );
- }
- } else if ( memory ) {
- list = [];
- } else {
- self.disable();
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- // First, we save the current length
- var start = list.length;
- (function add( args ) {
- jQuery.each( args, function( _, arg ) {
- var type = jQuery.type( arg );
- if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {
- list.push( arg );
- } else if ( arg && arg.length && type !== "string" ) {
- // Inspect recursively
- add( arg );
- }
- });
- })( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away
- } else if ( memory ) {
- firingStart = start;
- fire( memory );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
- // Handle firing indexes
- if ( firing ) {
- if ( index <= firingLength ) {
- firingLength--;
- }
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- });
- }
- return this;
- },
- // Control if a given callback is in the list
- has: function( fn ) {
- return jQuery.inArray( fn, list ) > -1;
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- if ( list && ( !fired || stack ) ) {
- if ( firing ) {
- stack.push( args );
- } else {
- fire( args );
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
-};
-jQuery.extend({
-
- Deferred: function( func ) {
- var tuples = [
- // action, add listener, listener list, final state
- [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
- [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
- [ "notify", "progress", jQuery.Callbacks("memory") ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- then: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
- return jQuery.Deferred(function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
- var action = tuple[ 0 ],
- fn = fns[ i ];
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
- function() {
- var returned = fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .done( newDefer.resolve )
- .fail( newDefer.reject )
- .progress( newDefer.notify );
- } else {
- newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
- }
- } :
- newDefer[ action ]
- );
- });
- fns = null;
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Keep pipe for back-compat
- promise.pipe = promise.then;
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 3 ];
-
- // promise[ done | fail | progress ] = list.add
- promise[ tuple[1] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(function() {
- // state = [ resolved | rejected ]
- state = stateString;
-
- // [ reject_list | resolve_list ].disable; progress_list.lock
- }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
- }
-
- // deferred[ resolve | reject | notify ] = list.fire
- deferred[ tuple[0] ] = list.fire;
- deferred[ tuple[0] + "With" ] = list.fireWith;
- });
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( subordinate /* , ..., subordinateN */ ) {
- var i = 0,
- resolveValues = core_slice.call( arguments ),
- length = resolveValues.length,
-
- // the count of uncompleted subordinates
- remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
- // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
- deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
- // Update function for both resolve and progress values
- updateFunc = function( i, contexts, values ) {
- return function( value ) {
- contexts[ i ] = this;
- values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
- if( values === progressValues ) {
- deferred.notifyWith( contexts, values );
- } else if ( !( --remaining ) ) {
- deferred.resolveWith( contexts, values );
- }
- };
- },
-
- progressValues, progressContexts, resolveContexts;
-
- // add listeners to Deferred subordinates; treat others as resolved
- if ( length > 1 ) {
- progressValues = new Array( length );
- progressContexts = new Array( length );
- resolveContexts = new Array( length );
- for ( ; i < length; i++ ) {
- if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
- resolveValues[ i ].promise()
- .done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject )
- .progress( updateFunc( i, progressContexts, progressValues ) );
- } else {
- --remaining;
- }
- }
- }
-
- // if we're not waiting on anything, resolve the master
- if ( !remaining ) {
- deferred.resolveWith( resolveContexts, resolveValues );
- }
-
- return deferred.promise();
- }
-});
-jQuery.support = (function() {
-
- var support,
- all,
- a,
- select,
- opt,
- input,
- fragment,
- eventName,
- i,
- isSupported,
- clickFn,
- div = document.createElement("div");
-
- // Preliminary tests
- div.setAttribute( "className", "t" );
- div.innerHTML = "
a";
-
- all = div.getElementsByTagName("*");
- a = div.getElementsByTagName("a")[ 0 ];
- a.style.cssText = "top:1px;float:left;opacity:.5";
-
- // Can't get basic test support
- if ( !all || !all.length ) {
- return {};
- }
-
- // First batch of supports tests
- select = document.createElement("select");
- opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName("input")[ 0 ];
-
- support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- style: /top/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.5/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: ( input.value === "on" ),
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: opt.selected,
-
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- getSetAttribute: div.className !== "t",
-
- // Tests for enctype support on a form(#6743)
- enctype: !!document.createElement("form").enctype,
-
- // Makes sure cloning an html5 element does not cause problems
- // Where outerHTML is undefined, this still works
- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>",
-
- // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
- boxModel: ( document.compatMode === "CSS1Compat" ),
-
- // Will be defined later
- submitBubbles: true,
- changeBubbles: true,
- focusinBubbles: false,
- deleteExpando: true,
- noCloneEvent: true,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableMarginRight: true,
- boxSizingReliable: true,
- pixelPosition: false
- };
-
- // Make sure checked status is properly cloned
- input.checked = true;
- support.noCloneChecked = input.cloneNode( true ).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
-
- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", clickFn = function() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- support.noCloneEvent = false;
- });
- div.cloneNode( true ).fireEvent("onclick");
- div.detachEvent( "onclick", clickFn );
- }
-
- // Check if a radio maintains its value
- // after being appended to the DOM
- input = document.createElement("input");
- input.value = "t";
- input.setAttribute( "type", "radio" );
- support.radioValue = input.value === "t";
-
- input.setAttribute( "checked", "checked" );
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
- fragment = document.createDocumentFragment();
- fragment.appendChild( div.lastChild );
-
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- support.appendChecked = input.checked;
-
- fragment.removeChild( input );
- fragment.appendChild( div );
-
- // Technique from Juriy Zaytsev
- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- // We only care about the case where non-standard event systems
- // are used, namely in IE. Short-circuiting here helps us to
- // avoid an eval call (in setAttribute) which can cause CSP
- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
- if ( div.attachEvent ) {
- for ( i in {
- submit: true,
- change: true,
- focusin: true
- }) {
- eventName = "on" + i;
- isSupported = ( eventName in div );
- if ( !isSupported ) {
- div.setAttribute( eventName, "return;" );
- isSupported = ( typeof div[ eventName ] === "function" );
- }
- support[ i + "Bubbles" ] = isSupported;
- }
- }
-
- // Run tests that need a body at doc ready
- jQuery(function() {
- var container, div, tds, marginDiv,
- divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
- body = document.getElementsByTagName("body")[0];
-
- if ( !body ) {
- // Return for frameset docs that don't have a body
- return;
- }
-
- container = document.createElement("div");
- container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
- body.insertBefore( container, body.firstChild );
-
- // Construct the test element
- div = document.createElement("div");
- container.appendChild( div );
-
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- // (only IE 8 fails this test)
- div.innerHTML = "
t
";
- tds = div.getElementsByTagName("td");
- tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
- tds[ 0 ].style.display = "";
- tds[ 1 ].style.display = "none";
-
- // Check if empty table cells still have offsetWidth/Height
- // (IE <= 8 fail this test)
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
- // Check box-sizing and margin behavior
- div.innerHTML = "";
- div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
- support.boxSizing = ( div.offsetWidth === 4 );
- support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
-
- // NOTE: To any future maintainer, we've window.getComputedStyle
- // because jsdom on node.js will break without it.
- if ( window.getComputedStyle ) {
- support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
- support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- marginDiv = document.createElement("div");
- marginDiv.style.cssText = div.style.cssText = divReset;
- marginDiv.style.marginRight = marginDiv.style.width = "0";
- div.style.width = "1px";
- div.appendChild( marginDiv );
- support.reliableMarginRight =
- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
- }
-
- if ( typeof div.style.zoom !== "undefined" ) {
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- // (IE < 8 does this)
- div.innerHTML = "";
- div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
- // Check if elements with layout shrink-wrap their children
- // (IE 6 does this)
- div.style.display = "block";
- div.style.overflow = "visible";
- div.innerHTML = "";
- div.firstChild.style.width = "5px";
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
- container.style.zoom = 1;
- }
-
- // Null elements to avoid leaks in IE
- body.removeChild( container );
- container = div = tds = marginDiv = null;
- });
-
- // Null elements to avoid leaks in IE
- fragment.removeChild( div );
- all = a = select = opt = input = fragment = div = null;
-
- return support;
-})();
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
- rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
- cache: {},
-
- deletedIds: [],
-
- // Remove at next major release (1.9/2.0)
- uuid: 0,
-
- // Unique for each copy of jQuery on the page
- // Non-digits removed to match rinlinejQuery
- expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
-
- hasData: function( elem ) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject( elem );
- },
-
- data: function( elem, name, data, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, ret,
- internalKey = jQuery.expando,
- getByName = typeof name === "string",
-
- // We have to handle DOM nodes and JS objects differently because IE6-7
- // can't GC object references properly across the DOM-JS boundary
- isNode = elem.nodeType,
-
- // Only DOM nodes need the global jQuery cache; JS object data is
- // attached directly to the object so GC can occur automatically
- cache = isNode ? jQuery.cache : elem,
-
- // Only defining an ID for JS objects if its cache already exists allows
- // the code to shortcut on the same path as a DOM node with no cache
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
-
- // Avoid doing any more work than we need to when trying to get data on an
- // object that has no data at all
- if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
- return;
- }
-
- if ( !id ) {
- // Only DOM nodes need a new unique ID for each element since their data
- // ends up in the global cache
- if ( isNode ) {
- elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
- } else {
- id = internalKey;
- }
- }
-
- if ( !cache[ id ] ) {
- cache[ id ] = {};
-
- // Avoids exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- if ( !isNode ) {
- cache[ id ].toJSON = jQuery.noop;
- }
- }
-
- // An object can be passed to jQuery.data instead of a key/value pair; this gets
- // shallow copied over onto the existing cache
- if ( typeof name === "object" || typeof name === "function" ) {
- if ( pvt ) {
- cache[ id ] = jQuery.extend( cache[ id ], name );
- } else {
- cache[ id ].data = jQuery.extend( cache[ id ].data, name );
- }
- }
-
- thisCache = cache[ id ];
-
- // jQuery data() is stored in a separate object inside the object's internal data
- // cache in order to avoid key collisions between internal data and user-defined
- // data.
- if ( !pvt ) {
- if ( !thisCache.data ) {
- thisCache.data = {};
- }
-
- thisCache = thisCache.data;
- }
-
- if ( data !== undefined ) {
- thisCache[ jQuery.camelCase( name ) ] = data;
- }
-
- // Check for both converted-to-camel and non-converted data property names
- // If a data property was specified
- if ( getByName ) {
-
- // First Try to find as-is property data
- ret = thisCache[ name ];
-
- // Test for null|undefined property data
- if ( ret == null ) {
-
- // Try to find the camelCased property
- ret = thisCache[ jQuery.camelCase( name ) ];
- }
- } else {
- ret = thisCache;
- }
-
- return ret;
- },
-
- removeData: function( elem, name, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, i, l,
-
- isNode = elem.nodeType,
-
- // See jQuery.data for more information
- cache = isNode ? jQuery.cache : elem,
- id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
- // If there is already no cache entry for this object, there is no
- // purpose in continuing
- if ( !cache[ id ] ) {
- return;
- }
-
- if ( name ) {
-
- thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
- if ( thisCache ) {
-
- // Support array or space separated string names for data keys
- if ( !jQuery.isArray( name ) ) {
-
- // try the string as a key before any manipulation
- if ( name in thisCache ) {
- name = [ name ];
- } else {
-
- // split the camel cased version by spaces unless a key with the spaces exists
- name = jQuery.camelCase( name );
- if ( name in thisCache ) {
- name = [ name ];
- } else {
- name = name.split(" ");
- }
- }
- }
-
- for ( i = 0, l = name.length; i < l; i++ ) {
- delete thisCache[ name[i] ];
- }
-
- // If there is no data left in the cache, we want to continue
- // and let the cache object itself get destroyed
- if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
- return;
- }
- }
- }
-
- // See jQuery.data for more information
- if ( !pvt ) {
- delete cache[ id ].data;
-
- // Don't destroy the parent cache unless the internal data object
- // had been the only thing left in it
- if ( !isEmptyDataObject( cache[ id ] ) ) {
- return;
- }
- }
-
- // Destroy the cache
- if ( isNode ) {
- jQuery.cleanData( [ elem ], true );
-
- // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
- } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
- delete cache[ id ];
-
- // When all else fails, null
- } else {
- cache[ id ] = null;
- }
- },
-
- // For internal use only.
- _data: function( elem, name, data ) {
- return jQuery.data( elem, name, data, true );
- },
-
- // A method for determining if a DOM node can handle the data expando
- acceptData: function( elem ) {
- var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- // nodes accept data unless otherwise specified; rejection can be conditional
- return !noData || noData !== true && elem.getAttribute("classid") === noData;
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- var parts, part, attr, name, l,
- elem = this[0],
- i = 0,
- data = null;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = jQuery.data( elem );
-
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
- attr = elem.attributes;
- for ( l = attr.length; i < l; i++ ) {
- name = attr[i].name;
-
- if ( !name.indexOf( "data-" ) ) {
- name = jQuery.camelCase( name.substring(5) );
-
- dataAttr( elem, name, data[ name ] );
- }
- }
- jQuery._data( elem, "parsedAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- parts = key.split( ".", 2 );
- parts[1] = parts[1] ? "." + parts[1] : "";
- part = parts[1] + "!";
-
- return jQuery.access( this, function( value ) {
-
- if ( value === undefined ) {
- data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
- // Try to fetch any internally stored data first
- if ( data === undefined && elem ) {
- data = jQuery.data( elem, key );
- data = dataAttr( elem, key, data );
- }
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- }
-
- parts[1] = value;
- this.each(function() {
- var self = jQuery( this );
-
- self.triggerHandler( "setData" + part, parts );
- jQuery.data( this, key, value );
- self.triggerHandler( "changeData" + part, parts );
- });
- }, null, value, arguments.length > 1, null, false );
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-
-function dataAttr( elem, key, data ) {
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
-
- var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- // Only convert to a number if it doesn't change the string
- +data + "" === data ? +data :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch( e ) {}
-
- // Make sure we set the data so it isn't changed later
- jQuery.data( elem, key, data );
-
- } else {
- data = undefined;
- }
- }
-
- return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
- var name;
- for ( name in obj ) {
-
- // if the public data object is empty, the private is still empty
- if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
- continue;
- }
- if ( name !== "toJSON" ) {
- return false;
- }
- }
-
- return true;
-}
-jQuery.extend({
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = jQuery._data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || jQuery.isArray(data) ) {
- queue = jQuery._data( elem, type, jQuery.makeArray(data) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // not intended for public consumption - generates a queueHooks object, or returns the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return jQuery._data( elem, key ) || jQuery._data( elem, key, {
- empty: jQuery.Callbacks("once memory").add(function() {
- jQuery.removeData( elem, type + "queue", true );
- jQuery.removeData( elem, key, true );
- })
- });
- }
-});
-
-jQuery.fn.extend({
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[0], type );
- }
-
- return data === undefined ?
- this :
- this.each(function() {
- var queue = jQuery.queue( this, type, data );
-
- // ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while( i-- ) {
- tmp = jQuery._data( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
-});
-var nodeHook, boolHook, fixSpecified,
- rclass = /[\t\r\n]/g,
- rreturn = /\r/g,
- rtype = /^(?:button|input)$/i,
- rfocusable = /^(?:button|input|object|select|textarea)$/i,
- rclickable = /^a(?:rea|)$/i,
- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- },
-
- prop: function( name, value ) {
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function() {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch( e ) {}
- });
- },
-
- addClass: function( value ) {
- var classNames, i, l, elem,
- setClass, c, cl;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call(this, j, this.className) );
- });
- }
-
- if ( value && typeof value === "string" ) {
- classNames = value.split( core_rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
-
- if ( elem.nodeType === 1 ) {
- if ( !elem.className && classNames.length === 1 ) {
- elem.className = value;
-
- } else {
- setClass = " " + elem.className + " ";
-
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
- setClass += classNames[ c ] + " ";
- }
- }
- elem.className = jQuery.trim( setClass );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var removes, className, elem, c, cl, i, l;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call(this, j, this.className) );
- });
- }
- if ( (value && typeof value === "string") || value === undefined ) {
- removes = ( value || "" ).split( core_rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
- if ( elem.nodeType === 1 && elem.className ) {
-
- className = (" " + elem.className + " ").replace( rclass, " " );
-
- // loop over each item in the removal list
- for ( c = 0, cl = removes.length; c < cl; c++ ) {
- // Remove until there is nothing to remove,
- while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
- className = className.replace( " " + removes[ c ] + " " , " " );
- }
- }
- elem.className = value ? jQuery.trim( className ) : "";
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- state = stateVal,
- classNames = value.split( core_rspace );
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space separated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- } else if ( type === "undefined" || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery._data( this, "__className__", this.className );
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var val,
- self = jQuery(this);
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, self.val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
- } else if ( typeof val === "number" ) {
- val += "";
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map(val, function ( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- // attributes.value is undefined in Blackberry 4.7 but
- // uses .value. See #6932
- var val = elem.attributes.value;
- return !val || val.specified ? elem.value : elem.text;
- }
- },
- select: {
- get: function( elem ) {
- var value, i, max, option,
- index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
-
- // Nothing was selected
- if ( index < 0 ) {
- return null;
- }
-
- // Loop through all the selected options
- i = one ? index : 0;
- max = one ? index + 1 : options.length;
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // Don't return options that are disabled or in a disabled optgroup
- if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
- (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
- if ( one && !values.length && options.length ) {
- return jQuery( options[ index ] ).val();
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var values = jQuery.makeArray( value );
-
- jQuery(elem).find("option").each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- },
-
- // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
- attrFn: {},
-
- attr: function( elem, name, value, pass ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
- return jQuery( elem )[ name ]( value );
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( notxml ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
-
- } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
-
- ret = elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret === null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var propName, attrNames, name, isBool,
- i = 0;
-
- if ( value && elem.nodeType === 1 ) {
-
- attrNames = value.split( core_rspace );
-
- for ( ; i < attrNames.length; i++ ) {
- name = attrNames[ i ];
-
- if ( name ) {
- propName = jQuery.propFix[ name ] || name;
- isBool = rboolean.test( name );
-
- // See #9699 for explanation of this approach (setting first, then removal)
- // Do not do this for boolean attributes (see #10870)
- if ( !isBool ) {
- jQuery.attr( elem, name, "" );
- }
- elem.removeAttribute( getSetAttribute ? name : propName );
-
- // Set corresponding property to false for boolean attributes
- if ( isBool && propName in elem ) {
- elem[ propName ] = false;
- }
- }
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
- jQuery.error( "type property can't be changed" );
- } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to it's default in case type is set after value
- // This is for element creation
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- },
- // Use the value property for back compat
- // Use the nodeHook for button elements in IE6/7 (#1954)
- value: {
- get: function( elem, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.get( elem, name );
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function( elem, value, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.set( elem, value, name );
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
- }
- },
-
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- return ( elem[ name ] = value );
- }
-
- } else {
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- return elem[ name ];
- }
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- var attributeNode = elem.getAttributeNode("tabindex");
-
- return attributeNode && attributeNode.specified ?
- parseInt( attributeNode.value, 10 ) :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
- }
- }
-});
-
-// Hook for boolean attributes
-boolHook = {
- get: function( elem, name ) {
- // Align boolean attributes with corresponding properties
- // Fall back to attribute presence where some booleans are not supported
- var attrNode,
- property = jQuery.prop( elem, name );
- return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
- name.toLowerCase() :
- undefined;
- },
- set: function( elem, value, name ) {
- var propName;
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- // value is true since we know at this point it's type boolean and not false
- // Set boolean attributes to the same name and set the DOM property
- propName = jQuery.propFix[ name ] || name;
- if ( propName in elem ) {
- // Only set the IDL specifically if it already exists on the element
- elem[ propName ] = true;
- }
-
- elem.setAttribute( name, name.toLowerCase() );
- }
- return name;
- }
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
- fixSpecified = {
- name: true,
- id: true,
- coords: true
- };
-
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = jQuery.valHooks.button = {
- get: function( elem, name ) {
- var ret;
- ret = elem.getAttributeNode( name );
- return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
- ret.value :
- undefined;
- },
- set: function( elem, value, name ) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode( name );
- if ( !ret ) {
- ret = document.createAttribute( name );
- elem.setAttributeNode( ret );
- }
- return ( ret.value = value + "" );
- }
- };
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each([ "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- set: function( elem, value ) {
- if ( value === "" ) {
- elem.setAttribute( name, "auto" );
- return value;
- }
- }
- });
- });
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- get: nodeHook.get,
- set: function( elem, value, name ) {
- if ( value === "" ) {
- value = "false";
- }
- nodeHook.set( elem, value, name );
- }
- };
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- get: function( elem ) {
- var ret = elem.getAttribute( name, 2 );
- return ret === null ? undefined : ret;
- }
- });
- });
-}
-
-if ( !jQuery.support.style ) {
- jQuery.attrHooks.style = {
- get: function( elem ) {
- // Return undefined in the case of empty string
- // Normalize to lowercase since IE uppercases css property names
- return elem.style.cssText.toLowerCase() || undefined;
- },
- set: function( elem, value ) {
- return ( elem.style.cssText = value + "" );
- }
- };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
- get: function( elem ) {
- var parent = elem.parentNode;
-
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- });
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
- jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
- jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- get: function( elem ) {
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
- };
- });
-}
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- });
-});
-var rformElems = /^(?:textarea|input|select)$/i,
- rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
- rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- hoverHack = function( events ) {
- return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
- };
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- add: function( elem, types, handler, data, selector ) {
-
- var elemData, eventHandle, events,
- t, tns, type, namespaces, handleObj,
- handleObjIn, handlers, special;
-
- // Don't attach events to noData or text/comment nodes (allow plain objects tho)
- if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- events = elemData.events;
- if ( !events ) {
- elemData.events = events = {};
- }
- eventHandle = elemData.handle;
- if ( !eventHandle ) {
- elemData.handle = eventHandle = function( e ) {
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
- jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
- undefined;
- };
- // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
- eventHandle.elem = elem;
- }
-
- // Handle multiple events separated by a space
- // jQuery(...).bind("mouseover mouseout", fn);
- types = jQuery.trim( hoverHack(types) ).split( " " );
- for ( t = 0; t < types.length; t++ ) {
-
- tns = rtypenamespace.exec( types[t] ) || [];
- type = tns[1];
- namespaces = ( tns[2] || "" ).split( "." ).sort();
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend({
- type: type,
- origType: tns[1],
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join(".")
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- handlers = events[ type ];
- if ( !handlers ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener/attachEvent if the special events handler returns false
- if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
- // Bind the global event handler to the element
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle, false );
-
- } else if ( elem.attachEvent ) {
- elem.attachEvent( "on" + type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- // Nullify elem to prevent memory leaks in IE
- elem = null;
- },
-
- global: {},
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var t, tns, type, origType, namespaces, origCount,
- j, events, special, eventType, handleObj,
- elemData = jQuery.hasData( elem ) && jQuery._data( elem );
-
- if ( !elemData || !(events = elemData.events) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
- for ( t = 0; t < types.length; t++ ) {
- tns = rtypenamespace.exec( types[t] ) || [];
- type = origType = tns[1];
- namespaces = tns[2];
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector? special.delegateType : special.bindType ) || type;
- eventType = events[ type ] || [];
- origCount = eventType.length;
- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
-
- // Remove matching events
- for ( j = 0; j < eventType.length; j++ ) {
- handleObj = eventType[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- eventType.splice( j--, 1 );
-
- if ( handleObj.selector ) {
- eventType.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( eventType.length === 0 && origCount !== eventType.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- delete elemData.handle;
-
- // removeData also checks for emptiness and clears the expando if empty
- // so use it instead of delete
- jQuery.removeData( elem, "events", true );
- }
- },
-
- // Events that are safe to short-circuit if no handlers are attached.
- // Native DOM events should not be added, they may have inline handlers.
- customEvent: {
- "getData": true,
- "setData": true,
- "changeData": true
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
- // Don't do events on text and comment nodes
- if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
- return;
- }
-
- // Event object or event type
- var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
- type = event.type || event,
- namespaces = [];
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf( "!" ) >= 0 ) {
- // Exclusive events trigger only for the exact event (no namespaces)
- type = type.slice(0, -1);
- exclusive = true;
- }
-
- if ( type.indexOf( "." ) >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
-
- if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
- // No jQuery handlers for this event type, and it can't have inline handlers
- return;
- }
-
- // Caller can pass in an Event, Object, or just an event type string
- event = typeof event === "object" ?
- // jQuery.Event object
- event[ jQuery.expando ] ? event :
- // Object literal
- new jQuery.Event( type, event ) :
- // Just the event type (string)
- new jQuery.Event( type );
-
- event.type = type;
- event.isTrigger = true;
- event.exclusive = exclusive;
- event.namespace = namespaces.join( "." );
- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
- ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
- // Handle a global trigger
- if ( !elem ) {
-
- // TODO: Stop taunting the data cache; remove global events and always attach to document
- cache = jQuery.cache;
- for ( i in cache ) {
- if ( cache[ i ].events && cache[ i ].events[ type ] ) {
- jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
- }
- }
- return;
- }
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data != null ? jQuery.makeArray( data ) : [];
- data.unshift( event );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- eventPath = [[ elem, special.bindType || type ]];
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
- for ( old = elem; cur; cur = cur.parentNode ) {
- eventPath.push([ cur, bubbleType ]);
- old = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( old === (elem.ownerDocument || document) ) {
- eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
- }
- }
-
- // Fire handlers on the event path
- for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
- cur = eventPath[i][0];
- event.type = eventPath[i][1];
-
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
- // Note that this is a bare JS function and not a jQuery handler
- handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
- event.preventDefault();
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name name as the event.
- // Can't use an .isFunction() check here because IE6/7 fails that test.
- // Don't do default actions on window, that's where global variables be (#6170)
- // IE<9 dies on focus/blur to hidden element (#1486)
- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- old = elem[ ontype ];
-
- if ( old ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if ( old ) {
- elem[ ontype ] = old;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event || window.event );
-
- var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
- handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
- delegateCount = handlers.delegateCount,
- args = core_slice.call( arguments ),
- run_all = !event.exclusive && !event.namespace,
- special = jQuery.event.special[ event.type ] || {},
- handlerQueue = [];
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[0] = event;
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers that should run if there are delegated events
- // Avoid non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && !(event.button && event.type === "click") ) {
-
- for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
- // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.disabled !== true || event.type !== "click" ) {
- selMatch = {};
- matches = [];
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
- sel = handleObj.selector;
-
- if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) >= 0 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( selMatch[ sel ] ) {
- matches.push( handleObj );
- }
- }
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, matches: matches });
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if ( handlers.length > delegateCount ) {
- handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
- }
-
- // Run delegates first; they may want to stop propagation beneath us
- for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
- matched = handlerQueue[ i ];
- event.currentTarget = matched.elem;
-
- for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
- handleObj = matched.matches[ j ];
-
- // Triggered event must either 1) be non-exclusive and have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
- event.data = handleObj.data;
- event.handleObj = handleObj;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- event.result = ret;
- if ( ret === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- // Includes some event props shared by KeyEvent and MouseEvent
- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
- fixHooks: {},
-
- keyHooks: {
- props: "char charCode key keyCode".split(" "),
- filter: function( event, original ) {
-
- // Add which for key events
- if ( event.which == null ) {
- event.which = original.charCode != null ? original.charCode : original.keyCode;
- }
-
- return event;
- }
- },
-
- mouseHooks: {
- props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- filter: function( event, original ) {
- var eventDoc, doc, body,
- button = original.button,
- fromElement = original.fromElement;
-
- // Calculate pageX/Y if missing and clientX/Y available
- if ( event.pageX == null && original.clientX != null ) {
- eventDoc = event.target.ownerDocument || document;
- doc = eventDoc.documentElement;
- body = eventDoc.body;
-
- event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
- event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
- }
-
- // Add relatedTarget, if necessary
- if ( !event.relatedTarget && fromElement ) {
- event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- // Note: button is not normalized, so don't use it
- if ( !event.which && button !== undefined ) {
- event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
- }
-
- return event;
- }
- },
-
- fix: function( event ) {
- if ( event[ jQuery.expando ] ) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop,
- originalEvent = event,
- fixHook = jQuery.event.fixHooks[ event.type ] || {},
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
- event = jQuery.Event( originalEvent );
-
- for ( i = copy.length; i; ) {
- prop = copy[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
- if ( !event.target ) {
- event.target = originalEvent.srcElement || document;
- }
-
- // Target should not be a text node (#504, Safari)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)
- event.metaKey = !!event.metaKey;
-
- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
- },
-
- special: {
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
-
- focus: {
- delegateType: "focusin"
- },
- blur: {
- delegateType: "focusout"
- },
-
- beforeunload: {
- setup: function( data, namespaces, eventHandle ) {
- // We only want to do this special case on windows
- if ( jQuery.isWindow( this ) ) {
- this.onbeforeunload = eventHandle;
- }
- },
-
- teardown: function( namespaces, eventHandle ) {
- if ( this.onbeforeunload === eventHandle ) {
- this.onbeforeunload = null;
- }
- }
- }
- },
-
- simulate: function( type, elem, event, bubble ) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- { type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if ( bubble ) {
- jQuery.event.trigger( e, null, elem );
- } else {
- jQuery.event.dispatch.call( elem, e );
- }
- if ( e.isDefaultPrevented() ) {
- event.preventDefault();
- }
- }
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
- function( elem, type, handle ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
- }
- } :
- function( elem, type, handle ) {
- var name = "on" + type;
-
- if ( elem.detachEvent ) {
-
- // #8545, #7054, preventing memory leaks for custom events in IE6-8 –
- // detachEvent needed property on element, by name of that event, to properly expose it to GC
- if ( typeof elem[ name ] === "undefined" ) {
- elem[ name ] = null;
- }
-
- elem.detachEvent( name, handle );
- }
- };
-
-jQuery.Event = function( src, props ) {
- // Allow instantiation without the 'new' keyword
- if ( !(this instanceof jQuery.Event) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
- src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || jQuery.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
-};
-
-function returnFalse() {
- return false;
-}
-function returnTrue() {
- return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
-
- // otherwise set the returnValue property of the original event to false (IE)
- } else {
- e.returnValue = false;
- }
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj,
- selector = handleObj.selector;
-
- // For mousenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
- jQuery.event.special.submit = {
- setup: function() {
- // Only need this for delegated form submit events
- if ( jQuery.nodeName( this, "form" ) ) {
- return false;
- }
-
- // Lazy-add a submit handler when a descendant form may potentially be submitted
- jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
- // Node name check avoids a VML-related crash in IE (#9807)
- var elem = e.target,
- form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
- if ( form && !jQuery._data( form, "_submit_attached" ) ) {
- jQuery.event.add( form, "submit._submit", function( event ) {
- event._submit_bubble = true;
- });
- jQuery._data( form, "_submit_attached", true );
- }
- });
- // return undefined since we don't need an event listener
- },
-
- postDispatch: function( event ) {
- // If form was submitted by the user, bubble the event up the tree
- if ( event._submit_bubble ) {
- delete event._submit_bubble;
- if ( this.parentNode && !event.isTrigger ) {
- jQuery.event.simulate( "submit", this.parentNode, event, true );
- }
- }
- },
-
- teardown: function() {
- // Only need this for delegated form submit events
- if ( jQuery.nodeName( this, "form" ) ) {
- return false;
- }
-
- // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
- jQuery.event.remove( this, "._submit" );
- }
- };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
-
- jQuery.event.special.change = {
-
- setup: function() {
-
- if ( rformElems.test( this.nodeName ) ) {
- // IE doesn't fire change on a check/radio until blur; trigger it on click
- // after a propertychange. Eat the blur-change in special.change.handle.
- // This still fires onchange a second time for check/radio after blur.
- if ( this.type === "checkbox" || this.type === "radio" ) {
- jQuery.event.add( this, "propertychange._change", function( event ) {
- if ( event.originalEvent.propertyName === "checked" ) {
- this._just_changed = true;
- }
- });
- jQuery.event.add( this, "click._change", function( event ) {
- if ( this._just_changed && !event.isTrigger ) {
- this._just_changed = false;
- }
- // Allow triggered, simulated change events (#11500)
- jQuery.event.simulate( "change", this, event, true );
- });
- }
- return false;
- }
- // Delegated event; lazy-add a change handler on descendant inputs
- jQuery.event.add( this, "beforeactivate._change", function( e ) {
- var elem = e.target;
-
- if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {
- jQuery.event.add( elem, "change._change", function( event ) {
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
- jQuery.event.simulate( "change", this.parentNode, event, true );
- }
- });
- jQuery._data( elem, "_change_attached", true );
- }
- });
- },
-
- handle: function( event ) {
- var elem = event.target;
-
- // Swallow native change events from checkbox/radio, we already triggered them above
- if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
- return event.handleObj.handler.apply( this, arguments );
- }
- },
-
- teardown: function() {
- jQuery.event.remove( this, "._change" );
-
- return !rformElems.test( this.nodeName );
- }
- };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler while someone wants focusin/focusout
- var attaches = 0,
- handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- if ( attaches++ === 0 ) {
- document.addEventListener( orig, handler, true );
- }
- },
- teardown: function() {
- if ( --attaches === 0 ) {
- document.removeEventListener( orig, handler, true );
- }
- }
- };
- });
-}
-
-jQuery.fn.extend({
-
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) { // && selector != null
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- this.on( type, selector, data, types[ type ], one );
- }
- return this;
- }
-
- if ( data == null && fn == null ) {
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return this;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return this.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- });
- },
- one: function( types, selector, data, fn ) {
- return this.on( types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- var handleObj, type;
- if ( types && types.preventDefault && types.handleObj ) {
- // ( event ) dispatched jQuery.Event
- handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
- // ( types-object [, selector] )
- for ( type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each(function() {
- jQuery.event.remove( this, types, fn, selector );
- });
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- live: function( types, data, fn ) {
- jQuery( this.context ).on( types, this.selector, data, fn );
- return this;
- },
- die: function( types, fn ) {
- jQuery( this.context ).off( types, this.selector || "**", fn );
- return this;
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
- },
-
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
- triggerHandler: function( type, data ) {
- if ( this[0] ) {
- return jQuery.event.trigger( type, data, this[0], true );
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments,
- guid = fn.guid || jQuery.guid++,
- i = 0,
- toggler = function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- };
-
- // link all the functions, so any of them can unbind this click handler
- toggler.guid = guid;
- while ( i < args.length ) {
- args[ i++ ].guid = guid;
- }
-
- return this.click( toggler );
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- if ( fn == null ) {
- fn = data;
- data = null;
- }
-
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-
- if ( rkeyEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
- }
-
- if ( rmouseEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
- }
-});
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
- */
-(function( window, undefined ) {
-
-var cachedruns,
- assertGetIdNotName,
- Expr,
- getText,
- isXML,
- contains,
- compile,
- sortOrder,
- hasDuplicate,
- outermostContext,
-
- baseHasDuplicate = true,
- strundefined = "undefined",
-
- expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
-
- Token = String,
- document = window.document,
- docElem = document.documentElement,
- dirruns = 0,
- done = 0,
- pop = [].pop,
- push = [].push,
- slice = [].slice,
- // Use a stripped-down indexOf if a native one is unavailable
- indexOf = [].indexOf || function( elem ) {
- var i = 0,
- len = this.length;
- for ( ; i < len; i++ ) {
- if ( this[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- // Augment a function for special use by Sizzle
- markFunction = function( fn, value ) {
- fn[ expando ] = value == null || value;
- return fn;
- },
-
- createCache = function() {
- var cache = {},
- keys = [];
-
- return markFunction(function( key, value ) {
- // Only keep the most recent entries
- if ( keys.push( key ) > Expr.cacheLength ) {
- delete cache[ keys.shift() ];
- }
-
- return (cache[ key ] = value);
- }, cache );
- },
-
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
-
- // Regex
-
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
- // http://www.w3.org/TR/css3-syntax/#characters
- characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
-
- // Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = characterEncoding.replace( "w", "w#" ),
-
- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
- operators = "([*^$|!~]?=)",
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
- "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
-
- // Prefer arguments not in parens/brackets,
- // then attribute selectors and non-pseudos (denoted by :),
- // then anything else
- // These preferences are here to reduce the number of selectors
- // needing tokenize in the PSEUDO preFilter
- pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
-
- // For matchExpr.POS and matchExpr.needsContext
- pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
- "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
- rpseudo = new RegExp( pseudos ),
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
-
- rnot = /^:not/,
- rsibling = /[\x20\t\r\n\f]*[+~]/,
- rendsWithNot = /:not\($/,
-
- rheader = /h\d/i,
- rinputs = /input|select|textarea|button/i,
-
- rbackslash = /\\(?!\\)/g,
-
- matchExpr = {
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
- "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "POS": new RegExp( pos, "i" ),
- "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- // For use in libraries implementing .is()
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
- },
-
- // Support
-
- // Used for testing something on an element
- assert = function( fn ) {
- var div = document.createElement("div");
-
- try {
- return fn( div );
- } catch (e) {
- return false;
- } finally {
- // release memory in IE
- div = null;
- }
- },
-
- // Check if getElementsByTagName("*") returns only elements
- assertTagNameNoComments = assert(function( div ) {
- div.appendChild( document.createComment("") );
- return !div.getElementsByTagName("*").length;
- }),
-
- // Check if getAttribute returns normalized href attributes
- assertHrefNotNormalized = assert(function( div ) {
- div.innerHTML = "";
- return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
- div.firstChild.getAttribute("href") === "#";
- }),
-
- // Check if attributes should be retrieved by attribute nodes
- assertAttributes = assert(function( div ) {
- div.innerHTML = "";
- var type = typeof div.lastChild.getAttribute("multiple");
- // IE8 returns a string for some attributes even when not present
- return type !== "boolean" && type !== "string";
- }),
-
- // Check if getElementsByClassName can be trusted
- assertUsableClassName = assert(function( div ) {
- // Opera can't find a second classname (in 9.6)
- div.innerHTML = "";
- if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
- return false;
- }
-
- // Safari 3.2 caches class attributes and doesn't catch changes
- div.lastChild.className = "e";
- return div.getElementsByClassName("e").length === 2;
- }),
-
- // Check if getElementById returns elements by name
- // Check if getElementsByName privileges form controls or returns elements by ID
- assertUsableName = assert(function( div ) {
- // Inject content
- div.id = expando + 0;
- div.innerHTML = "";
- docElem.insertBefore( div, docElem.firstChild );
-
- // Test
- var pass = document.getElementsByName &&
- // buggy browsers will return fewer than the correct 2
- document.getElementsByName( expando ).length === 2 +
- // buggy browsers will return more than the correct 0
- document.getElementsByName( expando + 0 ).length;
- assertGetIdNotName = !document.getElementById( expando );
-
- // Cleanup
- docElem.removeChild( div );
-
- return pass;
- });
-
-// If slice is not available, provide a backup
-try {
- slice.call( docElem.childNodes, 0 )[0].nodeType;
-} catch ( e ) {
- slice = function( i ) {
- var elem,
- results = [];
- for ( ; (elem = this[i]); i++ ) {
- results.push( elem );
- }
- return results;
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- results = results || [];
- context = context || document;
- var match, elem, xml, m,
- nodeType = context.nodeType;
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- if ( nodeType !== 1 && nodeType !== 9 ) {
- return [];
- }
-
- xml = isXML( context );
-
- if ( !xml && !seed ) {
- if ( (match = rquickExpr.exec( selector )) ) {
- // Speed-up: Sizzle("#ID")
- if ( (m = match[1]) ) {
- if ( nodeType === 9 ) {
- elem = context.getElementById( m );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE, Opera, and Webkit return items
- // by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
- } else {
- // Context is not a document
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
- contains( context, elem ) && elem.id === m ) {
- results.push( elem );
- return results;
- }
- }
-
- // Speed-up: Sizzle("TAG")
- } else if ( match[2] ) {
- push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
- return results;
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
- push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
- return results;
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
-}
-
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
- return Sizzle( expr, null, null, [ elem ] ).length > 0;
-};
-
-// Returns a function to use in pseudos for input types
-function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
-}
-
-// Returns a function to use in pseudos for buttons
-function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
-}
-
-// Returns a function to use in pseudos for positionals
-function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
-}
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( nodeType ) {
- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (see #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
- } else {
-
- // If no nodeType, this is expected to be an array
- for ( ; (node = elem[i]); i++ ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- }
- return ret;
-};
-
-isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-// Element contains another
-contains = Sizzle.contains = docElem.contains ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
- } :
- docElem.compareDocumentPosition ?
- function( a, b ) {
- return b && !!( a.compareDocumentPosition( b ) & 16 );
- } :
- function( a, b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- return false;
- };
-
-Sizzle.attr = function( elem, name ) {
- var val,
- xml = isXML( elem );
-
- if ( !xml ) {
- name = name.toLowerCase();
- }
- if ( (val = Expr.attrHandle[ name ]) ) {
- return val( elem );
- }
- if ( xml || assertAttributes ) {
- return elem.getAttribute( name );
- }
- val = elem.getAttributeNode( name );
- return val ?
- typeof elem[ name ] === "boolean" ?
- elem[ name ] ? name : null :
- val.specified ? val.value : null :
- null;
-};
-
-Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- // IE6/7 return a modified href
- attrHandle: assertHrefNotNormalized ?
- {} :
- {
- "href": function( elem ) {
- return elem.getAttribute( "href", 2 );
- },
- "type": function( elem ) {
- return elem.getAttribute("type");
- }
- },
-
- find: {
- "ID": assertGetIdNotName ?
- function( id, context, xml ) {
- if ( typeof context.getElementById !== strundefined && !xml ) {
- var m = context.getElementById( id );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- } :
- function( id, context, xml ) {
- if ( typeof context.getElementById !== strundefined && !xml ) {
- var m = context.getElementById( id );
-
- return m ?
- m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
- [m] :
- undefined :
- [];
- }
- },
-
- "TAG": assertTagNameNoComments ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== strundefined ) {
- return context.getElementsByTagName( tag );
- }
- } :
- function( tag, context ) {
- var results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- var elem,
- tmp = [],
- i = 0;
-
- for ( ; (elem = results[i]); i++ ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- },
-
- "NAME": assertUsableName && function( tag, context ) {
- if ( typeof context.getElementsByName !== strundefined ) {
- return context.getElementsByName( name );
- }
- },
-
- "CLASS": assertUsableClassName && function( className, context, xml ) {
- if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
- return context.getElementsByClassName( className );
- }
- }
- },
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( rbackslash, "" );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 3 xn-component of xn+y argument ([+-]?\d*n|)
- 4 sign of xn-component
- 5 x of xn-component
- 6 sign of y-component
- 7 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1] === "nth" ) {
- // nth-child requires argument
- if ( !match[2] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
- match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[2] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var unquoted, excess;
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- if ( match[3] ) {
- match[2] = match[3];
- } else if ( (unquoted = match[4]) ) {
- // Only check arguments that contain a pseudo
- if ( rpseudo.test(unquoted) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- unquoted = unquoted.slice( 0, excess );
- match[0] = match[0].slice( 0, excess );
- }
- match[2] = unquoted;
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
- "ID": assertGetIdNotName ?
- function( id ) {
- id = id.replace( rbackslash, "" );
- return function( elem ) {
- return elem.getAttribute("id") === id;
- };
- } :
- function( id ) {
- id = id.replace( rbackslash, "" );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
- return node && node.value === id;
- };
- },
-
- "TAG": function( nodeName ) {
- if ( nodeName === "*" ) {
- return function() { return true; };
- }
- nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
-
- return function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ expando ][ className ];
- if ( !pattern ) {
- pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
- }
- return function( elem ) {
- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
- };
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem, context ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.substr( result.length - check.length ) === check :
- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, argument, first, last ) {
-
- if ( type === "nth" ) {
- return function( elem ) {
- var node, diff,
- parent = elem.parentNode;
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- if ( parent ) {
- diff = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- diff++;
- if ( elem === node ) {
- break;
- }
- }
- }
- }
-
- // Incorporate the offset (or cast to NaN), then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- };
- }
-
- return function( elem ) {
- var node = elem;
-
- switch ( type ) {
- case "only":
- case "first":
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- if ( type === "first" ) {
- return true;
- }
-
- node = elem;
-
- /* falls through */
- case "last":
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- return true;
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf.call( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- "enabled": function( elem ) {
- return elem.disabled === false;
- },
-
- "disabled": function( elem ) {
- return elem.disabled === true;
- },
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
- // not comment, processing instructions, or others
- // Thanks to Diego Perini for the nodeName shortcut
- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
- var nodeType;
- elem = elem.firstChild;
- while ( elem ) {
- if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
- return false;
- }
- elem = elem.nextSibling;
- }
- return true;
- },
-
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "text": function( elem ) {
- var type, attr;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" &&
- (type = elem.type) === "text" &&
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
- },
-
- // Input types
- "radio": createInputPseudo("radio"),
- "checkbox": createInputPseudo("checkbox"),
- "file": createInputPseudo("file"),
- "password": createInputPseudo("password"),
- "image": createInputPseudo("image"),
-
- "submit": createButtonPseudo("submit"),
- "reset": createButtonPseudo("reset"),
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "focus": function( elem ) {
- var doc = elem.ownerDocument;
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
- },
-
- "active": function( elem ) {
- return elem === elem.ownerDocument.activeElement;
- },
-
- // Positional types
- "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = 0; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = 1; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
-};
-
-function siblingCheck( a, b, ret ) {
- if ( a === b ) {
- return ret;
- }
-
- var cur = a.nextSibling;
-
- while ( cur ) {
- if ( cur === b ) {
- return -1;
- }
-
- cur = cur.nextSibling;
- }
-
- return 1;
-}
-
-sortOrder = docElem.compareDocumentPosition ?
- function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
- a.compareDocumentPosition :
- a.compareDocumentPosition(b) & 4
- ) ? -1 : 1;
- } :
- function( a, b ) {
- // The nodes are identical, we can exit early
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
-
- // Fallback to using sourceIndex (in IE) if it's available on both nodes
- } else if ( a.sourceIndex && b.sourceIndex ) {
- return a.sourceIndex - b.sourceIndex;
- }
-
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
- // If the nodes are siblings (or identical) we can do a quick check
- if ( aup === bup ) {
- return siblingCheck( a, b );
-
- // If no parents were found then the nodes are disconnected
- } else if ( !aup ) {
- return -1;
-
- } else if ( !bup ) {
- return 1;
- }
-
- // Otherwise they're somewhere else in the tree so we need
- // to build up a full list of the parentNodes for comparison
- while ( cur ) {
- ap.unshift( cur );
- cur = cur.parentNode;
- }
-
- cur = bup;
-
- while ( cur ) {
- bp.unshift( cur );
- cur = cur.parentNode;
- }
-
- al = ap.length;
- bl = bp.length;
-
- // Start walking down the tree looking for a discrepancy
- for ( var i = 0; i < al && i < bl; i++ ) {
- if ( ap[i] !== bp[i] ) {
- return siblingCheck( ap[i], bp[i] );
- }
- }
-
- // We ended someplace up the tree so do a sibling check
- return i === al ?
- siblingCheck( a, bp[i], -1 ) :
- siblingCheck( ap[i], b, 1 );
- };
-
-// Always assume the presence of duplicates if sort doesn't
-// pass them to our comparison function (as in Google Chrome).
-[0, 0].sort( sortOrder );
-baseHasDuplicate = !hasDuplicate;
-
-// Document sorting and removing duplicates
-Sizzle.uniqueSort = function( results ) {
- var elem,
- i = 1;
-
- hasDuplicate = baseHasDuplicate;
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- for ( ; (elem = results[i]); i++ ) {
- if ( elem === results[ i - 1 ] ) {
- results.splice( i--, 1 );
- }
- }
- }
-
- return results;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-function tokenize( selector, parseOnly ) {
- var matched, match, tokens, type, soFar, groups, preFilters,
- cached = tokenCache[ expando ][ selector ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- soFar = soFar.slice( match[0].length );
- }
- groups.push( tokens = [] );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- tokens.push( matched = new Token( match.shift() ) );
- soFar = soFar.slice( matched.length );
-
- // Cast descendant combinators to space
- matched.type = match[0].replace( rtrim, " " );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- // The last two arguments here are (context, xml) for backCompat
- (match = preFilters[ type ]( match, document, true ))) ) {
-
- tokens.push( matched = new Token( match.shift() ) );
- soFar = soFar.slice( matched.length );
- matched.type = type;
- matched.matches = match;
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
-}
-
-function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- checkNonElements = base && combinator.dir === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- return matcher( elem, context, xml );
- }
- }
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
- if ( !xml ) {
- var cache,
- dirkey = dirruns + " " + doneName + " ",
- cachedkey = dirkey + cachedruns;
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- if ( (cache = elem[ expando ]) === cachedkey ) {
- return elem.sizset;
- } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
- if ( elem.sizset ) {
- return elem;
- }
- } else {
- elem[ expando ] = cachedkey;
- if ( matcher( elem, context, xml ) ) {
- elem.sizset = true;
- return elem;
- }
- elem.sizset = false;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- if ( matcher( elem, context, xml ) ) {
- return elem;
- }
- }
- }
- }
- };
-}
-
-function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
-}
-
-function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
- if ( seed && postFinder ) {
- return;
- }
-
- var i, elem, postFilterIn,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- postFilterIn = condense( matcherOut, postMap );
- postFilter( postFilterIn, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = postFilterIn.length;
- while ( i-- ) {
- if ( (elem = postFilterIn[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- // Keep seed and results synchronized
- if ( seed ) {
- // Ignore postFinder because it can't coexist with seed
- i = preFilter && matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
- }
- }
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
-}
-
-function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf.call( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
- } else {
- // The concatenated values are (context, xml) for backCompat
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && tokens.join("")
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, expandContext ) {
- var elem, j, matcher,
- setMatched = [],
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- outermost = expandContext != null,
- contextBackup = outermostContext,
- // We must always have either seed elements or context
- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
- // Nested matchers should use non-integer dirruns
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
-
- if ( outermost ) {
- outermostContext = context !== document && context;
- cachedruns = superMatcher.el;
- }
-
- // Add elements passing elementMatchers directly to results
- for ( ; (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
- if ( matcher( elem, context, xml ) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- cachedruns = ++superMatcher.el;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // Apply set filters to unmatched elements
- matchedCount += i;
- if ( bySet && i !== matchedCount ) {
- for ( j = 0; (matcher = setMatchers[j]); j++ ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- superMatcher.el = 0;
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ expando ][ selector ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !group ) {
- group = tokenize( selector );
- }
- i = group.length;
- while ( i-- ) {
- cached = matcherFromTokens( group[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
- }
- return cached;
-};
-
-function multipleContexts( selector, contexts, results, seed ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results, seed );
- }
- return results;
-}
-
-function select( selector, context, results, seed, xml ) {
- var i, tokens, token, type, find,
- match = tokenize( selector ),
- j = match.length;
-
- if ( !seed ) {
- // Try to minimize operations if there is only one group
- if ( match.length === 1 ) {
-
- // Take a shortcut and set the context if the root selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- context.nodeType === 9 && !xml &&
- Expr.relative[ tokens[1].type ] ) {
-
- context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
- if ( !context ) {
- return results;
- }
-
- selector = selector.slice( tokens.shift().length );
- }
-
- // Fetch a seed set for right-to-left matching
- for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( rbackslash, "" ),
- rsibling.test( tokens[0].type ) && context.parentNode || context,
- xml
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && tokens.join("");
- if ( !selector ) {
- push.apply( results, slice.call( seed, 0 ) );
- return results;
- }
-
- break;
- }
- }
- }
- }
- }
-
- // Compile and execute a filtering function
- // Provide `match` to avoid retokenization if we modified the selector above
- compile( selector, match )(
- seed,
- context,
- xml,
- results,
- rsibling.test( selector )
- );
- return results;
-}
-
-if ( document.querySelectorAll ) {
- (function() {
- var disconnectedMatch,
- oldSelect = select,
- rescape = /'|\\/g,
- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
-
- // qSa(:focus) reports false when true (Chrome 21),
- // A support test would require too much code (would include document ready)
- rbuggyQSA = [":focus"],
-
- // matchesSelector(:focus) reports false when true (Chrome 21),
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- // A support test would require too much code (would include document ready)
- // just skip matchesSelector for :active
- rbuggyMatches = [ ":active", ":focus" ],
- matches = docElem.matchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.webkitMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector;
-
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( div ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explictly
- // setting a boolean content attribute,
- // since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- div.innerHTML = "";
-
- // IE8 - Some boolean attributes are not treated correctly
- if ( !div.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here (do not put tests after this one)
- if ( !div.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
- });
-
- assert(function( div ) {
-
- // Opera 10-12/IE9 - ^= $= *= and empty values
- // Should not select anything
- div.innerHTML = "";
- if ( div.querySelectorAll("[test^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here (do not put tests after this one)
- div.innerHTML = "";
- if ( !div.querySelectorAll(":enabled").length ) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- });
-
- // rbuggyQSA always contains :focus, so no need for a length check
- rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
-
- select = function( selector, context, results, seed, xml ) {
- // Only use querySelectorAll when not filtering,
- // when this is not xml,
- // and when no QSA bugs apply
- if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- var groups, i,
- old = true,
- nid = expando,
- newContext = context,
- newSelector = context.nodeType === 9 && selector;
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- groups = tokenize( selector );
-
- if ( (old = context.getAttribute("id")) ) {
- nid = old.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", nid );
- }
- nid = "[id='" + nid + "'] ";
-
- i = groups.length;
- while ( i-- ) {
- groups[i] = nid + groups[i].join("");
- }
- newContext = rsibling.test( selector ) && context.parentNode || context;
- newSelector = groups.join(",");
- }
-
- if ( newSelector ) {
- try {
- push.apply( results, slice.call( newContext.querySelectorAll(
- newSelector
- ), 0 ) );
- return results;
- } catch(qsaError) {
- } finally {
- if ( !old ) {
- context.removeAttribute("id");
- }
- }
- }
- }
-
- return oldSelect( selector, context, results, seed, xml );
- };
-
- if ( matches ) {
- assert(function( div ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- disconnectedMatch = matches.call( div, "div" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- try {
- matches.call( div, "[test!='']:sizzle" );
- rbuggyMatches.push( "!=", pseudos );
- } catch ( e ) {}
- });
-
- // rbuggyMatches always contains :active and :focus, so no need for a length check
- rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
-
- Sizzle.matchesSelector = function( elem, expr ) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- // rbuggyMatches always contains :active, so no need for an existence check
- if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch(e) {}
- }
-
- return Sizzle( expr, null, null, [ elem ] ).length > 0;
- };
- }
- })();
-}
-
-// Deprecated
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Back-compat
-function setFilters() {}
-Expr.filters = setFilters.prototype = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})( window );
-var runtil = /Until$/,
- rparentsprev = /^(?:parents|prev(?:Until|All))/,
- isSimple = /^.[^:#\[\.,]*$/,
- rneedsContext = jQuery.expr.match.needsContext,
- // methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
-jQuery.fn.extend({
- find: function( selector ) {
- var i, l, length, n, r, ret,
- self = this;
-
- if ( typeof selector !== "string" ) {
- return jQuery( selector ).filter(function() {
- for ( i = 0, l = self.length; i < l; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- });
- }
-
- ret = this.pushStack( "", "find", selector );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- length = ret.length;
- jQuery.find( selector, this[i], ret );
-
- if ( i > 0 ) {
- // Make sure that the results are unique
- for ( n = length; n < ret.length; n++ ) {
- for ( r = 0; r < length; r++ ) {
- if ( ret[r] === ret[n] ) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
-
- has: function( target ) {
- var i,
- targets = jQuery( target, this ),
- len = targets.length;
-
- return this.filter(function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
- },
-
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
- },
-
- is: function( selector ) {
- return !!selector && (
- typeof selector === "string" ?
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- rneedsContext.test( selector ) ?
- jQuery( selector, this.context ).index( this[0] ) >= 0 :
- jQuery.filter( selector, this ).length > 0 :
- this.filter( selector ).length > 0 );
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- ret = [],
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( ; i < l; i++ ) {
- cur = this[i];
-
- while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
- if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
- ret.push( cur );
- break;
- }
- cur = cur.parentNode;
- }
- }
-
- ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
- return this.pushStack( ret, "closest", selectors );
- },
-
- // Determine the position of an element within
- // the matched set of elements
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
- }
-
- // index in selector
- if ( typeof elem === "string" ) {
- return jQuery.inArray( this[0], jQuery( elem ) );
- }
-
- // Locate the position of the desired element
- return jQuery.inArray(
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem, this );
- },
-
- add: function( selector, context ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context ) :
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
- all :
- jQuery.unique( all ) );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter(selector)
- );
- }
-});
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-function sibling( cur, dir ) {
- do {
- cur = cur[ dir ];
- } while ( cur && cur.nodeType !== 1 );
-
- return cur;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return jQuery.nodeName( elem, "iframe" ) ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.merge( [], elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var ret = jQuery.map( this, fn, until );
-
- if ( !runtil.test( name ) ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
- if ( this.length > 1 && rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
-
- return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
- };
-});
-
-jQuery.extend({
- filter: function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 ?
- jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
- jQuery.find.matches(expr, elems);
- },
-
- dir: function( elem, dir, until ) {
- var matched = [],
- cur = elem[ dir ];
-
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
- // Can't pass null or undefined to indexOf in Firefox 4
- // Set to 0 to skip string check
- qualifier = qualifier || 0;
-
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- var retVal = !!qualifier.call( elem, i, elem );
- return retVal === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return ( elem === qualifier ) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, filtered );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
- });
-}
-function createSafeFragment( document ) {
- var list = nodeNames.split( "|" ),
- safeFrag = document.createDocumentFragment();
-
- if ( safeFrag.createElement ) {
- while ( list.length ) {
- safeFrag.createElement(
- list.pop()
- );
- }
- }
- return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- rtagName = /<([\w:]+)/,
- rtbody = /]", "i"),
- rcheckableType = /^(?:checkbox|radio)$/,
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptType = /\/(java|ecma)script/i,
- rcleanScript = /^\s*\s*$/g,
- wrapMap = {
- option: [ 1, "" ],
- legend: [ 1, "" ],
- thead: [ 1, "
", "
" ],
- tr: [ 2, "
", "
" ],
- td: [ 3, "
", "
" ],
- col: [ 2, "
", "
" ],
- area: [ 1, "" ],
- _default: [ 0, "", "" ]
- },
- safeFragment = createSafeFragment( document ),
- fragmentDiv = safeFragment.appendChild( document.createElement("div") );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
-// unless wrapped in a div with non-breaking characters in front of it.
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "X
", "
" ];
-}
-
-jQuery.fn.extend({
- text: function( value ) {
- return jQuery.access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
- }, null, value, arguments.length );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each(function(i) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( !isDisconnected( this[0] ) ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- }
-
- if ( arguments.length ) {
- var set = jQuery.clean( arguments );
- return this.pushStack( jQuery.merge( set, this ), "before", this.selector );
- }
- },
-
- after: function() {
- if ( !isDisconnected( this[0] ) ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- }
-
- if ( arguments.length ) {
- var set = jQuery.clean( arguments );
- return this.pushStack( jQuery.merge( this, set ), "after", this.selector );
- }
- },
-
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- var elem,
- i = 0;
-
- for ( ; (elem = this[i]) != null; i++ ) {
- if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- jQuery.cleanData( [ elem ] );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- }
- }
-
- return this;
- },
-
- empty: function() {
- var elem,
- i = 0;
-
- for ( ; (elem = this[i]) != null; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( elem.firstChild ) {
- elem.removeChild( elem.firstChild );
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map( function () {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- });
- },
-
- html: function( value ) {
- return jQuery.access( this, function( value ) {
- var elem = this[0] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined ) {
- return elem.nodeType === 1 ?
- elem.innerHTML.replace( rinlinejQuery, "" ) :
- undefined;
- }
-
- // See if we can take a shortcut and just use innerHTML
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
- value = value.replace( rxhtmlTag, "<$1>$2>" );
-
- try {
- for (; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- elem = this[i] || {};
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName( "*" ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function( value ) {
- if ( !isDisconnected( this[0] ) ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this), old = self.html();
- self.replaceWith( value.call( this, i, old ) );
- });
- }
-
- if ( typeof value !== "string" ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling,
- parent = this.parentNode;
-
- jQuery( this ).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- }
-
- return this.length ?
- this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
- this;
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
-
- // Flatten any nested arrays
- args = [].concat.apply( [], args );
-
- var results, first, fragment, iNoClone,
- i = 0,
- value = args[0],
- scripts = [],
- l = this.length;
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {
- return this.each(function() {
- jQuery(this).domManip( args, table, callback );
- });
- }
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call( this, i, table ? self.html() : undefined );
- self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- results = jQuery.buildFragment( args, this, scripts );
- fragment = results.fragment;
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- // Use the original fragment for the last item instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- // Fragments from the fragment cache must always be cloned and never used in place.
- for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {
- callback.call(
- table && jQuery.nodeName( this[i], "table" ) ?
- findOrAppend( this[i], "tbody" ) :
- this[i],
- i === iNoClone ?
- fragment :
- jQuery.clone( fragment, true, true )
- );
- }
- }
-
- // Fix #11809: Avoid leaking memory
- fragment = first = null;
-
- if ( scripts.length ) {
- jQuery.each( scripts, function( i, elem ) {
- if ( elem.src ) {
- if ( jQuery.ajax ) {
- jQuery.ajax({
- url: elem.src,
- type: "GET",
- dataType: "script",
- async: false,
- global: false,
- "throws": true
- });
- } else {
- jQuery.error("no ajax");
- }
- } else {
- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- });
- }
- }
-
- return this;
- }
-});
-
-function findOrAppend( elem, tag ) {
- return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
-}
-
-function cloneCopyEvent( src, dest ) {
-
- if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
- return;
- }
-
- var type, i, l,
- oldData = jQuery._data( src ),
- curData = jQuery._data( dest, oldData ),
- events = oldData.events;
-
- if ( events ) {
- delete curData.handle;
- curData.events = {};
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
-
- // make the cloned public data object a copy from the original
- if ( curData.data ) {
- curData.data = jQuery.extend( {}, curData.data );
- }
-}
-
-function cloneFixAttributes( src, dest ) {
- var nodeName;
-
- // We do not need to do anything for non-Elements
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // clearAttributes removes the attributes, which we don't want,
- // but also removes the attachEvent events, which we *do* want
- if ( dest.clearAttributes ) {
- dest.clearAttributes();
- }
-
- // mergeAttributes, in contrast, only merges back on the
- // original attributes, not the events
- if ( dest.mergeAttributes ) {
- dest.mergeAttributes( src );
- }
-
- nodeName = dest.nodeName.toLowerCase();
-
- if ( nodeName === "object" ) {
- // IE6-10 improperly clones children of object elements using classid.
- // IE10 throws NoModificationAllowedError if parent is null, #12132.
- if ( dest.parentNode ) {
- dest.outerHTML = src.outerHTML;
- }
-
- // This path appears unavoidable for IE9. When cloning an object
- // element in IE9, the outerHTML strategy above is not sufficient.
- // If the src has innerHTML and the destination does not,
- // copy the src.innerHTML into the dest.innerHTML. #10324
- if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
- dest.innerHTML = src.innerHTML;
- }
-
- } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
- // IE6-8 fails to persist the checked state of a cloned checkbox
- // or radio button. Worse, IE6-7 fail to give the cloned element
- // a checked appearance if the defaultChecked value isn't also set
-
- dest.defaultChecked = dest.checked = src.checked;
-
- // IE6-7 get confused and end up setting the value of a cloned
- // checkbox/radio button to an empty string instead of "on"
- if ( dest.value !== src.value ) {
- dest.value = src.value;
- }
-
- // IE6-8 fails to return the selected option to the default selected
- // state when cloning options
- } else if ( nodeName === "option" ) {
- dest.selected = src.defaultSelected;
-
- // IE6-8 fails to set the defaultValue to the correct value when
- // cloning other types of input fields
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
-
- // IE blanks contents when cloning scripts
- } else if ( nodeName === "script" && dest.text !== src.text ) {
- dest.text = src.text;
- }
-
- // Event data gets referenced instead of copied if the expando
- // gets copied too
- dest.removeAttribute( jQuery.expando );
-}
-
-jQuery.buildFragment = function( args, context, scripts ) {
- var fragment, cacheable, cachehit,
- first = args[ 0 ];
-
- // Set context from what may come in as undefined or a jQuery collection or a node
- // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
- // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
- context = context || document;
- context = !context.nodeType && context[0] || context;
- context = context.ownerDocument || context;
-
- // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
- // Cloning options loses the selected state, so don't cache them
- // IE 6 doesn't like it when you put