diff --git a/Inventarios/RepEntregaAlmacenRuta.aspx.cs b/Inventarios/RepEntregaAlmacenRuta.aspx.cs
index b459da736..3b24611ad 100644
--- a/Inventarios/RepEntregaAlmacenRuta.aspx.cs
+++ b/Inventarios/RepEntregaAlmacenRuta.aspx.cs
@@ -542,12 +542,17 @@ public partial class General_RepEntregaAlmacenRuta : ClsPaginas
{
if (ObjGenerales.CancelarTimbreTimbrado(CveTimbre, NowADS(), CvePACCancelacion, ObjCancelacion.CancelacionAcuse, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa))
- {
+ {
//regenero el timbre
- if (TimbreTipoDocto.Contiene("Ent","Tra"))
+ if (TimbreTipoDocto == "Tra")
{
- CveTimbre = ObjGenerales.AddGralTimbre(TimbreTipoDocto, CveSubProyecto, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
+ CveTimbre = ObjGenerales.AddGralTimbre("Tra", CveSubProyecto, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
}
+ ////regenero el timbre
+ //if (TimbreTipoDocto == "Ent")
+ //{
+ // CveTimbre = ObjGenerales.AddGralTimbre("Ent", CveSubProyecto, NowADS(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveEntregaAlmacen: CveEntregaAlmacen, AplicaCP: true);
+ //}
ProcesoOK = true;
}
}
diff --git a/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js b/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js
index 525e27f2c..374a56b0d 100644
--- a/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/Accordion.debug.js
@@ -208,25 +208,29 @@ Sys.Extended.UI.AccordionBehavior = function(element) {
// has content at div 2i+1).
Sys.Extended.UI.AccordionBehavior.initializeBase(this, [element]);
- // The _selectedIndex variable is used to track the currently visible content
- // pane. It is persisted via ClientState so that it can be restored on PostBack.
- // If 0 <= _selectedIndex < _panes.Length is not true, then no pane is selected
- // (and they all appear collapsed). While any index outside the bounds of the
- // _panes array indicates that no pane is selected, we don't automatically set
- // the value to a sentinel like -1 (especially on the server) because it's
- // possible for additional panes to be added at any time. We abstract this
- // problem using the getPane() function which returns the selected pane when
- // it's called with no arguments (and returns null when the current selected
- // index is invalid).
-
///
- /// The index of a pane selected to display its content.
+ /// The _selectedIndex variable is used to track the currently visible content
+ /// pane. It is persisted via ClientState so that it can be restored on PostBack.
+ /// If 0 <= _selectedIndex < _panes.Length is not true, then no pane is selected
+ /// (and they all appear collapsed). While any index outside the bounds of the
+ /// _panes array indicates that no pane is selected, we don't automatically set
+ /// the value to a sentinel like -1 (especially on the server) because it's
+ /// possible for additional panes to be added at any time. We abstract this
+ /// problem using the getPane() function which returns the selected pane when
+ /// it's called with no arguments (and returns null when the current selected
+ /// index is invalid).
///
///get_selectedIndex
///set_selectedIndex
- ///
+ ///
this._selectedIndex = 0;
+ ///
+ /// Panes count.
+ ///
+ ///getCount
+ ///
+
// The _panes array represents the collection of Accordion panes. Each element of
// the array is an object of the form {header, content, animation} corresponding
// to that pane's header section, content section, and the animation used to open
@@ -247,58 +251,58 @@ Sys.Extended.UI.AccordionBehavior = function(element) {
this._panes = [];
///
- /// True - to use the fading transition effect for Accordion panes, false - for standard transitions.
+ /// Whether or not to fade the accordion panes when transitioning
///
///get_fadeTransitions
///set_fadeTransitions
- ///
+ ///
this._fadeTransitions = false;
///
- /// The number of milliseconds a transition effect takes to complete.
- /// The default value is 250ms.
+ /// Length of time to transition between Accordion sections in
+ /// milleseconds. The default value is 250ms.
///
///get_transitionDuration
///set_transitionDuration
- ///
+ ///
this._duration = 0.25;
///
- /// The number of steps per second in transition animations.
+ /// A number of steps per second in transition animations.
/// The default value is 30 frames per second.
///
///get_framesPerSecond
///set_framesPerSecond
- ///
+ ///
this._framesPerSecond = 30;
///
- /// Controls how the Accordion changes its size to occupy space on a web page.
+ /// Determines how to control resizing of the Accordion.
+ /// If it is set to None, then the Accordion can grow as large or as small as necessary.
+ /// If it is set to Limit, then the Accordion will always be less than or equal to its available space.
+ /// If it is set to Fill, then it will always be equal to its available space.
///
- ///
- /// If set to None, the Accordion grows/shrinks vertically without restriction when its pane is expanded/collapsed; this can cause other elements on a web page to move up and down with it.
- /// If set to Limit, the Accordion never grows larger than the value specified by its Height property; this will cause the Accordion content to scroll if it is too large to be displayed.
- /// If set to Fill, the Accordion always keeps the same size as its Height property. This will cause the content to be expanded or shrunk if it isn't of the right size.
- ///
///get_autoSize
- ///
+ ///
this._autoSize = Sys.Extended.UI.AutoSize.None;
///
- /// True - to force the Accordion to always have one pane expanded, false - to enable end-users to close all panes.
+ /// Whether or not clicking the header will close the currently opened pane (which
+ /// leaves all the Accordion's panes closed).
///
///get_requireOpenedPane
///set_requireOpenedPane
- ///
+ ///
this._requireOpenedPane = true;
///
- /// A Boolean value specifying whether the Accordion control will not be interrupted by the default click event of the anchor tag specified in the header element's template.
- /// If set to true, this property prevents any client event handler that may interrupt the activity of the Accordion control.
+ /// Whether or not we suppress the client-side click handlers of any elements
+ /// (including server controls like Button or HTML elements like anchor) in the header
+ /// sections of the Accordion.
///
///get_suppressHeaderPostbacks
///set_suppressHeaderPostbacks
- ///
+ ///
this._suppressHeaderPostbacks = false;
// Size of all the headers
@@ -309,19 +313,19 @@ Sys.Extended.UI.AccordionBehavior = function(element) {
this._headerClickHandler = null;
///
- /// The name of the CSS class applied to headers.
+ /// The _headerSelectedCssClass is the css class applied to the selected header.
///
///get_headerCssClass
///set_headerCssClass
- ///
+ ///
this._headerCssClass = '';
///
- /// The name of the CSS class applied to the selected header.
+ /// The _headerSelectedCssClass is the css class applied to the selected header.
///
///get_headerSelectedCssClass
///get_headerSelectedCssClass
- ///
+ ///
this._headerSelectedCssClass = '';
// The _resizeHandler is a reference to the global event handler used to patch
@@ -330,8 +334,6 @@ Sys.Extended.UI.AccordionBehavior = function(element) {
// Check the browser version and document mode to see if IE8 in standards-compliant mode is used
this._isIE8InStandardMode = (Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version > 7 && Sys.Browser.documentMode != 0);
-
- this._paneHeaderClassNames = [];
}
Sys.Extended.UI.AccordionBehavior.prototype = {
// The initialize function is responsible for getting the selected index from
@@ -413,12 +415,13 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
},
///
- /// Creates a new Accordion pane and adds it to the Panes collection.
- /// The method provides references to the created pane's header and content DIVs.
+ /// Create a new Accordion pane given references to its header and content divs
+ /// and add it to the _panes collection. We also wrap the content div in a new
+ /// container div, add a click handler to the header div, etc.
///
/// header element of the new Accordion pane
/// content element of the new Accordion pane
- ///
+ ///
addPane: function(header, content) {
// New pane object added to the end of the Accordion's pane collection. The pane
// is an object of the form {header, content, animation} corresponding to that
@@ -464,8 +467,6 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
// Add the new pane at the bottom of the accordion
Array.add(this._panes, pane);
- this._paneHeaderClassNames.push(pane.header.className);
-
// Setup the layout attributes for the pane so that it will be in a proper opened or
// closed state (we don't bother setting the opacity of the wrapper with
// $common.setElementOpacity(wrapper, selected ? 1 : 0); because it will
@@ -636,9 +637,7 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
}
}
- pane.header.className = this._selectedIndex === index
- ? (this._headerSelectedCssClass || this._headerCssClass)
- : (this._paneHeaderClassNames[index] || this._headerCssClass);
+ pane.header.className = this._selectedIndex === index ? (this._headerSelectedCssClass || this._headerCssClass) : this._headerCssClass;
},
_addResizeHandler: function() {
@@ -814,7 +813,7 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
//This sets the header CSS class to the non-selected case.
if(lastPane) {
- lastPane.header.className = this._paneHeaderClassNames[lastIndex] || this._headerCssClass;
+ lastPane.header.className = this._headerCssClass;
}
//This sets the selected header CSS class if available.
@@ -1100,9 +1099,9 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
},
///
- /// Fires after a pane header is clicked but before the Accordion changes the selected pane.
+ /// Fires when an Accordion pane is clicked, but before Accordion changes the pane.
///
- ///
+ ///
///
add_selectedIndexChanging: function(handler) {
this.get_events().addHandler('selectedIndexChanging', handler);
@@ -1122,9 +1121,9 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
},
///
- /// Fires after a pane header is clicked and the Accordion changes the selected pane.
+ /// Fires when an Accordion pane is clicked, but after Accordion changes the pane.
///
- ///
+ ///
///
add_selectedIndexChanged: function(handler) {
this.get_events().addHandler('selectedIndexChanged', handler);
@@ -1144,12 +1143,12 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
},
///
- /// Returns an Accordion pane specified by its index. If no index is provided, the currently selected pane is returned.
+ /// Get a specific Accordion pane given its index. If no index is provided, get the currently selected pane.
///
/// index of the desired Accordion pane. If the index is not provided, we use
/// the currently selected index. In the event the provided index (or the currently
/// selected index) is outside the bounds of the panes collection, we return null.
- ///
+ ///
getPane: function(index) {
if(index === undefined || index === null) {
index = this._selectedIndex;
@@ -1162,9 +1161,9 @@ Sys.Extended.UI.AccordionBehavior.prototype = {
},
///
- /// Returns the total number of panes.
+ /// Panes count.
///
- ///
+ ///
getCount: function() {
return this._panes ? this._panes.length : 0;
},
diff --git a/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js b/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js
index f59e51cfe..4e06d9cb7 100644
--- a/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/AjaxFileUpload.debug.js
@@ -2,11 +2,6 @@
// Utils
Sys.Extended.UI.AjaxFileUpload.Utils = function() {
-
- function getExtension(filename) {
- var extensionStartIndex = filename.lastIndexOf('.') + 1;
- return extensionStartIndex ? filename.substring(extensionStartIndex) : "";
- }
this.generateGuid = function() {
var result, i, j;
@@ -46,7 +41,7 @@ Sys.Extended.UI.AjaxFileUpload.Utils = function() {
}
}
- return result;
+ return encodeURIComponent(result);
};
this.getFileType = function(file) {
@@ -54,7 +49,7 @@ Sys.Extended.UI.AjaxFileUpload.Utils = function() {
throw 'file must defined or not null';
if(!file.value && file.name)
- return getExtension(file.name);
+ return file.name.substring(file.name.lastIndexOf('.') + 1);
if(file.value)
file = file.value;
@@ -62,7 +57,7 @@ Sys.Extended.UI.AjaxFileUpload.Utils = function() {
if(typeof (file) !== "string")
throw "can't resolve file type.";
- return getExtension(file);
+ return file.substring(file.lastIndexOf('.') + 1);
};
this.sizeToString = function(bytes) {
@@ -160,19 +155,18 @@ Sys.Extended.UI.AjaxFileUpload.Item.prototype = {
});
this._fileName = utils.getFileName(file);
-
- var htmlEncode = Sys.Extended.UI.htmlEncode;
+ var fileNameToDisplay = decodeURIComponent(this._fileName);
if(isHtml5Support) {
this._fileSize = file.size;
- var fType = file.type ? '(' + htmlEncode(file.type) + ')' : '';
- fileInfoText.innerHTML = '' + htmlEncode(this._fileName) + ' '
+ var fType = file.type ? '(' + file.type + ')' : '';
+ fileInfoText.innerHTML = '' + fileNameToDisplay + ' '
+ fType
+ ' - ' + utils.sizeToString(file.size) + ' ';
this._fileType = file.type;
} else {
- fileInfoText.innerHTML = '' + htmlEncode(this._fileName) + '';
+ fileInfoText.innerHTML = '' + fileNameToDisplay + '';
this._fileType = utils.getFileType(file);
}
@@ -308,19 +302,13 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
};
- if(!control.fileTypeIsValid(fileItem.type)) {
+ if(control.fileTypeIsValid(fileItem.type)) {
+ control.addFileToQueue(fileItem);
+ this.createInputFileElement();
+ } else {
control.confirmFileIsInvalid(fileItem);
- return;
}
- if(control.fileSizeExceeded(fileItem.value.size)) {
- control.confirmFileIsTooLarge(fileItem);
- return;
- }
-
- control.addFileToQueue(fileItem);
- this.createInputFileElement();
-
};
this.createInputFileElement = function() {
@@ -343,8 +331,7 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
zIndex: 0,
cursor: 'pointer',
position: 'absolute'
- },
- multiple: true
+ }
}
}, currentInputFile.parentNode);
@@ -387,12 +374,7 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
// only add 1 file input element to be uploaded
form.appendChild(inputElement);
- form.setAttribute("action", control.get_uploadHandlerPath()
- + '?contextKey=' + control.get_contextKey()
- + '&controlID=' + control.get_id()
- + '&fileId=' + control._currentFileId
- + '&fileName=' + encodeURIComponent(fileItem._fileName)
- + '&usePoll=' + (control.get_serverPollingSupport() ? "true" : "false"));
+ form.setAttribute("action", control._uploadUrl + '?contextKey=' + control.get_id() + '&fileId=' + control._currentFileId + '&fileName=' + fileItem._fileName + '&usePoll=' + (control.get_serverPollingSupport() ? "true" : "false"));
// upload it now
form.submit();
@@ -407,12 +389,7 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
if(xhrPoll)
xhrPoll.abort();
- xhr.open("POST",
- '?contextKey=' + control.get_contextKey()
- + '&controlID=' + control.get_id()
- + '&cancel=1&guid=' + control._currentFileId
- + self.getQueryString(), true);
-
+ xhr.open("POST", '?contextKey=' + control.get_id() + "&cancel=1&guid=" + control._currentFileId, true);
xhr.onreadystatechange = function() {
self.setThrobber(false);
if(xhr.readyState == 4) {
@@ -428,10 +405,6 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
xhr.send(null);
},
- this.getQueryString = function() {
- return "&" + window.location.search.replace("?", "");
- },
-
this.createIFrame = function() {
var name = this._iframeName,
@@ -513,10 +486,7 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
if(!value || !control._currentFileId)
return;
- xhrPoll.open("GET",
- '?contextKey=' + control.get_contextKey()
- + '&controlID=' + control.get_id()
- + '&poll=1&guid=' + control._currentFileId, true);
+ xhrPoll.open("GET", '?contextKey=' + control.get_id() + "&poll=1&guid=" + control._currentFileId, true);
xhrPoll.send(null);
};
@@ -546,16 +516,13 @@ Sys.Extended.UI.AjaxFileUpload.Processor = function(control, elements) {
this.raiseUploadError = function(xhr) {
control.raise_uploadError(xhr);
+ control.setFileStatus(control._currentFileId, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error);
if(xhrPoll)
xhrPoll.abort();
control._currentFileId = null;
};
- this.resetUI = function() {
- control.setFileStatus(control._currentFileId, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error);
- };
-
};
// ProcessorHtml5
@@ -590,16 +557,7 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
this.onFileDroppedHandler = function(e) {
e.stopPropagation();
e.preventDefault();
-
- if(!control.get_enabled())
- return;
-
this.addFilesToQueue(e.dataTransfer.files);
-
- if (control.get_autoStartUpload()) {
- control.startUpload();
- }
-
};
this.onFileDragOverHandler = function(e) {
@@ -610,15 +568,11 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
this.onFileSelectedHandler = function(e) {
this.addFilesToQueue(e.target.files);
this.createInputFileElement();
-
- if (control.get_autoStartUpload()) {
- control.startUpload();
- }
};
this.createInputFileElement = function() {
var currentInputFile = elements.inputFile;
-
+
delete currentInputFile;
// create new input file element in same location
@@ -633,8 +587,7 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
zIndex: 0,
cursor: 'pointer',
position: 'absolute'
- },
- multiple: true
+ }
}
}, currentInputFile.parentNode);
@@ -654,10 +607,10 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
// #endregion
- this.addFilesToQueue = function (files) {
-
+ this.addFilesToQueue = function(files) {
// Validate and generate file item from HTML5 files.
- for (var i = 0; i < files.length; i++) {
+
+ for(var i = 0; i < files.length; i++) {
var blob = files[i],
slices = 0;
@@ -677,19 +630,12 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
};
// validate it, add it if it's OK
- if(!control.fileTypeIsValid(fileItem.type)) {
+ if(control.fileTypeIsValid(fileItem.type)) {
+ if(!control.addFileToQueue(fileItem))
+ break;
+ } else {
control.confirmFileIsInvalid(fileItem);
- continue;
}
-
- if(control.fileSizeExceeded(fileItem.value.size))
- {
- control.confirmFileIsTooLarge(fileItem);
- continue;
- }
-
- if(!control.addFileToQueue(fileItem))
- break;
}
// reset input file value so 'change' event can be fired again with same file name.
@@ -722,15 +668,6 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
}
};
- this.resetUI = function() {
- $common.setVisible(elements.progressBarContainer, false);
- $common.setVisible(control._elements.uploadOrCancelButton, false);
-
- var fileItem = control.getNextFile();
- fileItem._isUploaded = true;
- fileItem._isUploading = false;
- },
-
this.upload = function(fileItem) {
if(!control._isUploading)
return;
@@ -743,6 +680,7 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
// preparing upload data
var blob = fileItem.get_inputElementValue(),
+ fileName = fileItem._fileName,
chunked = fileItem._slices && (fileItem._slices > 0),
firstChunk = fileItem._sliceIndex == 0;
@@ -763,15 +701,7 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
xhrReq.addEventListener("load", xhrDelegate(this.onUploadCompleteHandler), false);
xhrReq.addEventListener("error", xhrDelegate(this.onUploadFailedHandler), false);
xhrReq.addEventListener("abort", xhrDelegate(this.onUploadCanceledHandler), false);
- xhrReq.open("POST",
- control.get_uploadHandlerPath()
- + '?contextKey=' + control.get_contextKey()
- + '&controlID=' + control.get_id()
- + '&fileId=' + id
- + '&fileName=' + encodeURIComponent(fileItem._fileName)
- + '&chunked=' + (chunked ? "true" : "false")
- + '&firstChunk=' + firstChunk, true);
-
+ xhrReq.open("POST", control._uploadUrl + '?contextKey=' + control.get_id() + '&fileId=' + id + '&fileName=' + fileName + '&chunked=' + (chunked ? "true" : "false") + '&firstChunk=' + firstChunk, true);
form.append("act-file-data", blob);
xhrReq.send(form);
};
@@ -831,7 +761,7 @@ Sys.Extended.UI.AjaxFileUpload.ProcessorHtml5 = function(control, elements) {
// set statuses as uploaded
fileItem.setStatus('uploaded', Sys.Extended.UI.Resources.AjaxFileUpload_Uploaded);
control.setStatusMessage(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_UploadingHtml5File,
- Sys.Extended.UI.htmlEncode(file.name), utils.sizeToString(file.size)));
+ file.name, utils.sizeToString(file.size)));
// finalizing and upload next file
control.doneAndUploadNextFile(fileItem);
@@ -966,24 +896,13 @@ Sys.Extended.UI.AjaxFileUpload.Control = function(element) {
this._postBackUrl = null;
///
- /// Specifies how AjaxFileUpload uploads files.
- /// If set to Auto or Client and the client browser supports HTML 5, AjaxFileUpload uploads files using AJAX requests.
- /// If set to Server or the browser does not support HTML 5, AjaxFileUpload uploads files by posting the HTML form.
- /// The default is Auto.
+ /// How AjaxFileUpload displays a progress bar.
///
/// get_mode
/// set_mode
///
this._mode = 0;
- ///
- /// Whether or not automatically start upload files after drag/drop or select in file dialog. The default is false
- ///
- /// get_autoStartUpload
- /// set_autoStartUpload
- ///
- this._autoStartUpload = false;
-
///
/// Whether or not AjaxFileUpload supports server polling.
///
@@ -1028,37 +947,8 @@ Sys.Extended.UI.AjaxFileUpload.Control = function(element) {
this._clearFileListAfterUpload = false;
- ///
- /// Whether or not to use absolute path for AjaxFileUploadHandler
- ///
- /// get_useAbsoluteHandlerPath
- /// set_useAbsoluteHandlerPath
- ///
- this._useAbsoluteHandlerPath = true;
-
- ///
- /// The maximum size of a file to be uploaded in Kbytes.
- /// A non-positive value means the size is unlimited.
- ///
- /// get_maxFileSize
- /// set_maxFileSize
- ///
- this._maxFileSize = 0;
-
- ///
- /// The path to the upload handler.
- ///
- /// get_uploadHandlerPath
- /// set_uploadHandlerPath
- ///
- this._uploadHandlerPath = '';
- ///
- /// Whether the control is enabled.
- ///
- /// get_enabled
- /// set_enabled
- ///
- this._enabled = true;
+ // fields
+ this._uploadUrl = 'AjaxFileUploadHandler.axd';
this._useHtml5Support = false;
this._elements = null;
this._processor = null;
@@ -1165,10 +1055,6 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
},
_onUploadOrCancelButtonClickedHandler: function(e) {
var files = this._filesInQueue;
-
- if(!this.validateFiles(files))
- return;
-
if(!files.length) {
alert(Sys.Extended.UI.Resources.AjaxFileUpload_SelectFileToUpload);
return;
@@ -1197,11 +1083,8 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
var xhr = new XMLHttpRequest(),
self = this;
- xhr.open("POST",
- '?contextKey=' + this.get_contextKey()
- + '&controlID=' + this.get_id()
- + '&start=1&queue=' + this._filesInQueue.length
- + this.getQueryString());
+ xhr.open("POST", '?contextKey=' + this.get_id()
+ + "&start=1&queue=" + this._filesInQueue.length);
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
if(xhr.status == 200) {
@@ -1209,7 +1092,6 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
self.raise_uploadStart(Sys.Serialization.JavaScriptSerializer.deserialize(xhr.responseText));
} else {
self.raise_uploadError(xhr);
- self.setFileStatus(fileItem, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error);
throw "Failed to starting upload.";
}
}
@@ -1229,30 +1111,6 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
}
},
- ///
- /// Validates files in queue before uploading.
- /// Returns true if validation is passed, otherwise false
- ///
- ///
- /// An array of files in the upload queue
- validateFiles: function(files)
- {
- return true;
- },
-
- ///
- /// Manually starts upload process
- ///
- ///
- startUpload: function () {
- if (this._isUploading || !this._filesInQueue.length) {
- return;
- }
-
- this._onUploadOrCancelButtonClickedHandler();
- },
-
-
///
/// If set to true, it will set the control state to enabled (ready to upload),
/// otherwise the control will be disabled and the button state turns to the Cancel button.
@@ -1289,13 +1147,10 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
self = this,
currentFile = this._filesInQueue[this._currentQueueIndex - 1];
- xhr.open("POST",
- '?contextKey=' + this.get_contextKey()
- + '&controlID=' + this.get_id()
- + '&complete=1&queue=' + this._filesInQueue.length
- + '&uploaded=' + (this._currentQueueIndex - (currentFile._isUploaded ? 0 : 1))
- + '&reason=' + (this._canceled ? "cancel" : "done")
- + this.getQueryString());
+ xhr.open("POST", '?contextKey=' + this.get_id()
+ + "&complete=1&queue=" + this._filesInQueue.length
+ + "&uploaded=" + (this._currentQueueIndex - (currentFile._isUploaded ? 0 : 1))
+ + "&reason=" + (this._canceled ? "cancel" : "done"));
xhr.onreadystatechange = function() {
if(xhr.readyState == 4) {
@@ -1303,13 +1158,12 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
self.raise_uploadCompleteAll(Sys.Serialization.JavaScriptSerializer.deserialize(xhr.responseText));
} else {
self.raise_uploadError(xhr);
- self.setFileStatus(fileItem, 'error', Sys.Extended.UI.Resources.AjaxFileUpload_error);
throw "Failed to completing upload.";
}
}
};
xhr.send(null);
-
+
if(this.get_clearFileListAfterUpload()) {
for(var i = 0; i < this._filesInQueue.length; i += 1) {
var item = this._filesInQueue[i];
@@ -1418,43 +1272,16 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
return false;
},
- ///
- /// Checks if the file size is larger than the upload size limit.
- ///
- ///
- /// File size in bytes
- fileSizeExceeded: function(fileSize) {
- if(this.get_maxFileSize() <= 0)
- return false;
-
- return fileSize > this.getMaxFileSizeInBytes();
- },
-
///
/// Sends alert to a user that the file type is not acceptable. The processor uses this method after validation.
///
///
- /// A file attempting to be added to the upload queue.
+ /// File trying to be added to queue
confirmFileIsInvalid: function(fileItem) {
var utils = new Sys.Extended.UI.AjaxFileUpload.Utils();
alert(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_WrongFileType, utils.getFileName(fileItem.value), fileItem.type));
},
- ///
- /// Sends alert to a user that the file size is too large. The processor uses this method after validation.
- ///
- ///
- /// A file attempting to be added to the upload queue.
- confirmFileIsTooLarge: function(fileItem) {
- var utils = new Sys.Extended.UI.AjaxFileUpload.Utils();
- alert(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_TooLargeFile, utils.getFileName(fileItem.value), this.get_maxFileSize()));
- },
-
- getMaxFileSizeInBytes: function()
- {
- return this.get_maxFileSize() * 1024;
- },
-
///
/// Marks fileItem as uploaded, and uploads the next file in a queue.
///
@@ -1465,15 +1292,10 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
var xhr = new XMLHttpRequest(),
self = this;
- xhr.open("POST",
- '?contextKey=' + this.get_contextKey()
- + '&controlID=' + this.get_id()
- + '&done=1&guid=' + fileItem._id
- + this.getQueryString(), true);
-
+ xhr.open("POST", "?contextKey=" + this.get_id() + "&done=1&guid=" + fileItem._id, true);
xhr.onreadystatechange = function(e) {
if(xhr.readyState == 4) {
- if(xhr.status == 200 && xhr.responseText != "") {
+ if(xhr.status == 200) {
// Mark as done and invoke event handler
self.raise_uploadComplete(Sys.Serialization.JavaScriptSerializer.deserialize(xhr.responseText));
@@ -1489,11 +1311,7 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
}
}
};
- xhr.send();
- },
-
- getQueryString: function() {
- return "&" + window.location.search.replace("?", "");
+ xhr.send(null);
},
///
@@ -1531,7 +1349,7 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
this._currentQueueIndex = Array.indexOf(this._filesInQueue, fileItem) + 1;
this.setFileStatus(fileItem, 'uploading', Sys.Extended.UI.Resources.AjaxFileUpload_Uploading);
- this.setStatusMessage(String.format(Sys.Extended.UI.Resources.AjaxFileUpload_UploadingFileInQueue, this._currentQueueIndex, this._filesInQueue.length));
+ this.setStatusMessage('Uploading ' + this._currentQueueIndex + ' of ' + this._filesInQueue.length + ' file(s)');
},
///
@@ -1601,13 +1419,6 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
this._mode = value;
},
- get_autoStartUpload: function () {
- return this._autoStartUpload;
- },
- set_autoStartUpload: function (value) {
- this._autoStartUpload = value;
- },
-
get_serverPollingSupport: function() {
return this._serverPollingSupport;
},
@@ -1638,7 +1449,7 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
///
/// Whether or not to hide the file upload list container after uploading finished
- ///
+ /// get_clearQueueContainerAfterUpload
/// set_clearQueueContainerAfterUpload
///
@@ -1649,33 +1460,6 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
this._clearFileListAfterUpload = value;
},
- get_useAbsoluteHandlerPath: function() {
- return this._useAbsoluteHandlerPath;
- },
- set_useAbsoluteHandlerPath: function(value) {
- this._useAbsoluteHandlerPath = value;
- },
-
- get_maxFileSize: function() {
- return this._maxFileSize;
- },
- set_maxFileSize: function(value) {
- this._maxFileSize = value;
- },
-
- get_uploadHandlerPath: function () {
- return this._uploadHandlerPath;
- },
- set_uploadHandlerPath: function (value) {
- this._uploadHandlerPath = value;
- },
- get_enabled: function () {
- return this.enabled;
- },
- set_enabled: function (value) {
- this.enabled = value;
- },
-
///
/// Occurs when the file upload starts
///
@@ -1786,11 +1570,8 @@ Sys.Extended.UI.AjaxFileUpload.Control.prototype = {
eh(this, e);
}
- this._processor.resetUI();
-
this._canceled = false;
this._isUploading = false;
- this._isUploaded = true;
this.enableControls(true);
},
diff --git a/Scripts/AjaxControlToolkit/Debug/Animation.debug.js b/Scripts/AjaxControlToolkit/Debug/Animation.debug.js
index a67a3ae34..60ad603d9 100644
--- a/Scripts/AjaxControlToolkit/Debug/Animation.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/Animation.debug.js
@@ -212,8 +212,8 @@ Sys.Extended.UI.Animation.AnimationBehavior.prototype = {
///
/// Generic OnMouseOver Animation's behavior
///
- /// get_onMouseOverBehavior
- ///
+ /// get_onLoadBehavior
+ ///
get_onMouseOverBehavior: function() {
return this._onMouseOver;
},
@@ -379,8 +379,8 @@ Sys.Extended.UI.Animation.AnimationBehavior.prototype = {
///
/// Generic OnHoverOut Animation's behavior
///
- /// get_onHoverOutBehavior
- ///
+ /// get_onHoverOverBehavior
+ ///
get_onHoverOutBehavior: function() {
return this._onHoverOut;
},
diff --git a/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js b/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js
index 7e583d873..de48097d4 100644
--- a/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/AnimationScripts.debug.js
@@ -233,22 +233,17 @@ $AA.createAnimation = function(obj, defaultTarget) {
// In the Xml comments for each of the animations below, there is a special tag
// that describes how the animation is referenced from a generic XML animation description
-///
-/// Animation is an abstract base class used as a starting point for all the other animations.
-/// It provides the basic mechanics for the animation (playing, pausing, stopping, timing, etc.)
-/// and leaves the actual animation to be done in the abstract methods getAnimatedValue
-/// and setValue.
-///
-///
-
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
$AA.Animation = function(target, duration, fps) {
+ // Animation is an abstract base class used as a starting point for all the other animations.
+ // It provides the basic mechanics for the animation (playing, pausing, stopping, timing, etc.)
+ // and leaves the actual animation to be done in the abstract methods getAnimatedValue
+ // and setValue.
// Animations need to be as fast as possible - even in debug mode. Don't add validation code to
- // methods involved in every step of the animation.
+ // methods involved in every step of the animation.
+ //
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
//
// The DynamicProperties collection is used to associate JavaScript expressions with
// properties. The expressions are evaluated just before the animation is played
@@ -265,40 +260,16 @@ $AA.Animation = function(target, duration, fps) {
// raised when setting dynamic properties (including both JavaScript evaluation errors
// and other exceptions raised by property setters) will only be propogated when
// debugging.
-
+
$AA.Animation.initializeBase(this);
- ///
- /// Length of the animation in seconds. The default is 1.
- ///
- ///get_duration
- ///set_duration
- ///
+ // Length of the animation in seconds
this._duration = 1;
- ///
- /// Number of steps per second. The default is 25.
- ///
- ///get_fps
- ///set_fps
- ///
+ // Number of steps per second
this._fps = 25;
- ///
- /// Target Sys.UI.DomElement of the animation. If the target of this animation is null and
- /// the animation has a parent, then it will recursively use the target of
- /// the parent animation instead.
- ///
- ///
- /// Do not set this property in a generic Xml animation description. It should be set
- /// using either the extender's TargetControlID or the AnimationTarget property (the latter
- /// maps to Sys.Extended.UI.Animation.set_animationTarget). The only valid way to
- /// set this property in the generic Xml animation description is to use the dynamic
- /// property TargetScript="$get('myElement')".
- ///
- ///get_target
- ///set_target
- ///
+ // Target Sys.UI.DomElement of the animation
this._target = null;
// Tick event handler
@@ -307,12 +278,7 @@ $AA.Animation = function(target, duration, fps) {
// Animation timer
this._timer = null;
- ///
- /// Percentage of the animation already played.
- ///
- ///get_percentComplete
- ///set_percentComplete
- ///
+ // Percentage of the animation already played
this._percentComplete = 0;
// Percentage of the animation to play on each step
@@ -360,14 +326,10 @@ $AA.Animation.prototype = {
$AA.Animation.callBaseMethod(this, 'dispose');
},
- ///
- /// Play the animation from the beginning or where it was left off when paused.
- ///
- ///
- /// If this animation is the child of another, you must call play on its parent instead.
- ///
- ///
play: function() {
+ // Play the animation from the beginning or where it was left off when paused.
+ // If this animation is the child of another, you must call play on its parent instead.
+
// If ownership of this animation has been claimed, then we'll require the parent to
// handle playing the animation (this is very important because then the entire animation
// tree runs on the same timer and updates consistently)
@@ -399,15 +361,11 @@ $AA.Animation.prototype = {
}
},
- ///
- /// Pause the animation if it is playing. Calling play will resume where
- /// the animation left off.
- ///
- ///
- /// If this animation is the child of another, you must call pause on its parent instead.
- ///
- ///
pause: function() {
+ // Pause the animation if it is playing. Calling play will resume where
+ // the animation left off.
+ // If this animation is the child of another, you must call pause on its parent instead.
+
if(!this._owner) {
if(this._timer) {
this._timer.set_enabled(false);
@@ -417,18 +375,15 @@ $AA.Animation.prototype = {
}
},
- ///
- /// Stop playing the animation.
- ///
- ///
- /// If this animation is the child of another, you must call stop on
- /// its parent instead.
- ///
- ///
- /// Whether or not stopping the animation should leave the target element in a state
- /// consistent with the animation playing completely by performing the last step.
- /// The default value is true.
stop: function(finish) {
+ // Stop playing the animation.
+ // If this animation is the child of another, you must call stop on
+ // its parent instead.
+ //
+ // "finish" - Whether or not stopping the animation should leave the target element in a state
+ // consistent with the animation playing completely by performing the last step.
+ // The default value is true.
+
if(!this._owner) {
var t = this._timer;
this._timer = null;
@@ -450,12 +405,9 @@ $AA.Animation.prototype = {
}
},
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
- this.raise_started();
+ // The onStart method is called just before the animation is played each time.
+ this.raiseStarted();
// Initialize any dynamic properties
for(var property in this.DynamicProperties) {
@@ -471,59 +423,46 @@ $AA.Animation.prototype = {
}
},
- ///
- /// The onStep method is called repeatedly to progress the animation through each frame.
- ///
- ///
- /// Percentage of the animation already complete.
onStep: function(percentage) {
+ // The onStep method is called repeatedly to progress the animation through each frame
+ //
+ // "percentage" - percentage of the animation already complete
this.setValue(this.getAnimatedValue(percentage));
- this.raise_step();
+ this.raiseStep();
},
- ///
- /// The onEnd method is called just after the animation is played each time.
- ///
- ///
onEnd: function() {
- this.raise_ended();
+ this.raiseEnded();
},
- ///
- /// Determine the state of the animation after the given percentage of its duration has elapsed.
- ///
- ///
- /// Percentage of the animation already complete.
getAnimatedValue: function(percentage) {
+ // Determine the state of the animation after the given percentage of its duration has elapsed
// Returns state of the animation after the given percentage of its duration has elapsed that will
// be passed to setValue
+ //
+ // "percentage" - percentage of the animation already complete
+
throw Error.notImplemented();
},
- ///
- /// Set the current state of the animation.
- ///
- ///
- /// Animation state.
setValue: function(value) {
+ // Set the current state of the animation
// Returns current state of the animation (as retreived from getAnimatedValue)
throw Error.notImplemented();
},
- ///
- /// The interpolate function is used to find the appropriate value between starting and
- /// ending values given the current percentage.
- ///
- ///
- /// Start of the range to interpolate.
- /// End of the range to interpolate.
- /// Percentage completed in the range to interpolate.
interpolate: function(start, end, percentage) {
+ // The interpolate function is used to find the appropriate value between starting and
+ // ending values given the current percentage.
// In the future, we hope to make several implementations of this available so we can dynamically
// change the apparent speed of the animations, although it may make more sense to modify the
// _updatePercentComplete function instead.
- // Returns the desired percentage between the start and end values
-
+ // Returns the desired percentage between the start and end values
+ //
+ // "start"- start of the range to interpolate
+ // "end" - end of the range to interpolate
+ // "percentage" - percentage completed in the range to interpolate
+
return start + (end - start) * (percentage / 100);
},
@@ -555,79 +494,67 @@ $AA.Animation.prototype = {
}
},
- ///
- /// Makes this animation the child of another animation.
- ///
- ///
- /// Parent animation.
setOwner: function(owner) {
+ // Make this animation the child of another animation
+ //
+ // "owner" - parent animation
this._owner = owner;
},
- ///
- /// Occurs each time before animation starts playing.
- ///
- ///
- ///
+ raiseStarted: function() {
+ var handlers = this.get_events().getHandler('started');
+ if(handlers) {
+ handlers(this, Sys.EventArgs.Empty);
+ }
+ },
+
add_started: function(handler) {
this.get_events().addHandler("started", handler);
},
+
remove_started: function(handler) {
this.get_events().removeHandler("started", handler);
},
- raise_started: function() {
- var handlers = this.get_events().getHandler('started');
- if(handlers)
+
+ raiseEnded: function() {
+ var handlers = this.get_events().getHandler('ended');
+ if(handlers) {
handlers(this, Sys.EventArgs.Empty);
- },
- raiseStarted: function() {
- Sys.Extended.Deprecated("raiseStarted()", "raise_started()");
- this.raise_started();
+ }
},
- ///
- /// Occurs each time after animation stops playing.
- ///
- ///
- ///
add_ended: function(handler) {
this.get_events().addHandler("ended", handler);
},
+
remove_ended: function(handler) {
this.get_events().removeHandler("ended", handler);
},
- raise_ended: function() {
- var handlers = this.get_events().getHandler('ended');
- if(handlers)
+
+ raiseStep: function() {
+ var handlers = this.get_events().getHandler('step');
+ if(handlers) {
handlers(this, Sys.EventArgs.Empty);
- },
- raiseEnded: function() {
- Sys.Extended.Deprecated("raiseEnded()", "raise_ended()");
- this.raise_ended();
+ }
},
- ///
- /// Occurs on animation's each frame.
- ///
- ///
- ///
add_step: function(handler) {
this.get_events().addHandler("step", handler);
},
+
remove_step: function(handler) {
this.get_events().removeHandler("step", handler);
},
- raise_step: function() {
- var handlers = this.get_events().getHandler('step');
- if(handlers)
- handlers(this, Sys.EventArgs.Empty);
- },
- raiseStep: function() {
- Sys.Extended.Deprecated("raiseStep()", "raise_step()");
- this.raise_ended();
- },
get_target: function() {
+ // Target of the animation. If the target of this animation is null and
+ // the animation has a parent, then it will recursively use the target of
+ // the parent animation instead.
+ // Do not set this property in a generic Xml animation description. It should be set
+ // using either the extender's TargetControlID or the AnimationTarget property (the latter
+ // maps to Sys.Extended.UI.Animation.set_animationTarget). The only valid way to
+ // set this property in the generic Xml animation description is to use the dynamic
+ // property TargetScript="$get('myElement')".
if(!this._target && this._parentAnimation) {
return this._parentAnimation.get_target();
}
@@ -640,14 +567,11 @@ $AA.Animation.prototype = {
}
},
- ///
- /// Set the animation target by its identifier.
- ///
- ///
- /// ID of a Sys.UI.DomElement or Sys.UI.Control to use as the target of the animation
- /// If no Sys.UI.DomElement or Sys.UI.Control can be found for the given ID, an
- /// argument exception will be thrown.
- setAnimationTarget: function(id) {
+ set_animationTarget: function(id) {
+ // ID of a Sys.UI.DomElement or Sys.UI.Control to use as the target of the animation
+ // If no Sys.UI.DomElement or Sys.UI.Control can be found for the given ID, an
+ // argument exception will be thrown.
+
// Try to find a Sys.UI.DomElement
var target = null;
var element = $get(id);
@@ -671,12 +595,9 @@ $AA.Animation.prototype = {
throw Error.argument('id', String.format(Sys.Extended.UI.Resources.Animation_TargetNotFound, id));
}
},
- set_animationTarget: function(id) {
- Sys.Extended.Deprecated("setAnimationTarget(id)", "set_animationTarget(id)");
- this.setAnimationTarget(id);
- },
get_duration: function() {
+ // Length of the animation in seconds. The default is 1.
return this._duration;
},
set_duration: function(value) {
@@ -688,6 +609,7 @@ $AA.Animation.prototype = {
},
get_fps: function() {
+ // Number of steps per second. The default is 25.
return this._fps;
},
set_fps: function(value) {
@@ -698,20 +620,10 @@ $AA.Animation.prototype = {
}
},
- ///
- /// A boolean value that determines whether or not animation is active.
- ///
- ///get_isActive
- ///
get_isActive: function() {
return (this._timer !== null);
},
- ///
- /// A boolean value that determines whether or not animation is currently playing.
- ///
- ///get_isPlaying
- ///
get_isPlaying: function() {
return (this._timer !== null) && this._timer.get_enabled();
},
@@ -747,7 +659,7 @@ $AA.Animation.prototype = {
//
// "value" - value to convert if it's a string
// "type" - type of the enum to convert to
-
+
if(String.isInstanceOfType(value) && type && type.parse) {
return type.parse(value);
}
@@ -757,25 +669,24 @@ $AA.Animation.prototype = {
$AA.Animation.registerClass('Sys.Extended.UI.Animation.Animation', Sys.Component);
$AA.registerAnimation('animation', $AA.Animation);
-///
-/// The ParentAnimation serves as a base class for all animations that contain children (such as
-/// Sys.Extended.UI.Animation.ParallelAnimation, Sys.Extended.UI.SequenceAnimation,
-/// etc.). It does not actually play the animations, so any classes that inherit from it must do so. Any animation
-/// that requires nested child animations must inherit from this class, although it will likely want to inherit off of
-/// Sys.Extended.UI.Animation.ParallelAnimation or Sys.Extended.UI.SequenceAnimation
-/// which will actually play their child animations.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Array of child animations to be played.
$AA.ParentAnimation = function(target, duration, fps, animations) {
+ // The ParentAnimation serves as a base class for all animations that contain children (such as
+ // Sys.Extended.UI.Animation.ParallelAnimation, Sys.Extended.UI.SequenceAnimation,
+ // etc.). It does not actually play the animations, so any classes that inherit from it must do so. Any animation
+ // that requires nested child animations must inherit from this class, although it will likely want to inherit off of
+ // Sys.Extended.UI.Animation.ParallelAnimation or Sys.Extended.UI.SequenceAnimation
+ // which will actually play their child animations.
+ //
+ // "target"- target of the animation
+ // "duration"- length of the animation in seconds. he default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "animations" - array of child animations to be played
$AA.ParentAnimation.initializeBase(this, [target, duration, fps]);
+ // Array of child animations (there are no assumptions placed on order because
+ // it will matter for some derived animations like SequenceAnimation, but not
+ // for others like ParallelAnimation) that is demand created in add
this._animations = [];
// Add any child animations passed into the constructor
@@ -807,24 +718,18 @@ $AA.ParentAnimation.prototype = {
$AA.ParentAnimation.callBaseMethod(this, 'dispose');
},
- ///
- /// Array of child animations to be played (there are no assumptions placed on order because it will matter for some
- /// derived animations like Sys.Extended.UI.Animation.SequenceAnimation, but not for
- /// others like Sys.Extended.UI.Animation.ParallelAnimation). To manipulate the child
- /// animations, use the functions add, clear, remove, and removeAt.
- ///
- ///get_target
- ///
get_animations: function() {
+ // Array of child animations to be played (there are no assumptions placed on order because it will matter for some
+ // derived animations like Sys.Extended.UI.Animation.SequenceAnimation, but not for
+ // others like Sys.Extended.UI.Animation.ParallelAnimation). To manipulate the child
+ // animations, use the functions add, clear, remove, and removeAt.
return this._animations;
},
- ///
- /// Add an animation as a child of this animation.
- ///
- ///
- /// Child animation to add.
add: function(animation) {
+ // Add an animation as a child of this animation.
+ //
+ // "animation" - child animation to add
if(this._animations) {
if(animation) {
animation._parentAnimation = this;
@@ -834,13 +739,12 @@ $AA.ParentAnimation.prototype = {
}
},
- ///
- /// Remove the animation from the array of child animations.
- /// This will dispose the removed animation.
- ///
- ///
- /// Child animation to remove.
remove: function(animation) {
+ // Remove the animation from the array of child animations.
+ // This will dispose the removed animation.
+ //
+ // "animation" - child animation to remove
+
if(this._animations) {
if(animation) {
animation.dispose();
@@ -850,12 +754,10 @@ $AA.ParentAnimation.prototype = {
}
},
- ///
- /// Remove the animation at a given index from the array of child animations.
- ///
- ///
- /// Index of the child animation to remove.
removeAt: function(index) {
+ // Remove the animation at a given index from the array of child animations.
+ //
+ // "index" - Index of the child animation to remove
if(this._animations) {
var animation = this._animations[index];
if(animation) {
@@ -866,12 +768,9 @@ $AA.ParentAnimation.prototype = {
}
},
- ///
- /// Clear the array of child animations.
- /// This will dispose the cleared child animations.
- ///
- ///
clear: function() {
+ // Clear the array of child animations.
+ // This will dispose the cleared child animations.
if(this._animations) {
for(var i = this._animations.length - 1; i >= 0; i--) {
this._animations[i].dispose();
@@ -886,41 +785,33 @@ $AA.ParentAnimation.prototype = {
$AA.ParentAnimation.registerClass('Sys.Extended.UI.Animation.ParentAnimation', $AA.Animation);
$AA.registerAnimation('parent', $AA.ParentAnimation);
-///
-/// The ParallelAnimation plays several animations simultaneously. It inherits from
-/// Sys.Extended.UI.Animation.ParentAnimation, but makes itself the owner of all
-/// its child animations to allow the use a single timer and syncrhonization mechanisms shared with
-/// all the children (in other words, the duration properties of any child animations
-/// are ignored in favor of the parent's duration). It is very useful in creating
-/// sophisticated effects through combination of simpler animations.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Array of child animations.
$AA.ParallelAnimation = function(target, duration, fps, animations) {
+ // The ParallelAnimation plays several animations simultaneously. It inherits from
+ // Sys.Extended.UI.Animation.ParentAnimation, but makes itself the owner of all
+ // its child animations to allow the use a single timer and syncrhonization mechanisms shared with
+ // all the children (in other words, the duration properties of any child animations
+ // are ignored in favor of the parent's duration). It is very useful in creating
+ // sophisticated effects through combination of simpler animations.
+ //
+ // "target"- target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "animations" - array of child animations
$AA.ParallelAnimation.initializeBase(this, [target, duration, fps, animations]);
}
$AA.ParallelAnimation.prototype = {
- ///
- /// Add an animation as a child of this animation and make ourselves its owner.
- ///
- ///
- /// Child animation to add.
add: function(animation) {
+ // Add an animation as a child of this animation and make ourselves its owner.
+ //
+ // "animation" - child animation to add
+
$AA.ParallelAnimation.callBaseMethod(this, 'add', [animation]);
animation.setOwner(this);
},
- ///
- /// Get the child animations ready to play.
- ///
- ///
onStart: function() {
+ // Get the child animations ready to play
$AA.ParallelAnimation.callBaseMethod(this, 'onStart');
var animations = this.get_animations();
for(var i = 0; i < animations.length; i++) {
@@ -928,23 +819,18 @@ $AA.ParallelAnimation.prototype = {
}
},
- ///
- /// Progress the child animations through each frame.
- ///
- ///
- /// Percentage of the animation already complete.
onStep: function(percentage) {
+ // Progress the child animations through each frame
+ //
+ // "percentage" - percentage of the animation already complete
var animations = this.get_animations();
for(var i = 0; i < animations.length; i++) {
animations[i].onStep(percentage);
}
},
- ///
- /// Finish playing all of the child animations.
- ///
- ///
onEnd: function() {
+ // Finish playing all of the child animations
var animations = this.get_animations();
for(var i = 0; i < animations.length; i++) {
animations[i].onEnd();
@@ -955,27 +841,23 @@ $AA.ParallelAnimation.prototype = {
$AA.ParallelAnimation.registerClass('Sys.Extended.UI.Animation.ParallelAnimation', $AA.ParentAnimation);
$AA.registerAnimation('parallel', $AA.ParallelAnimation);
-///
-/// The SequenceAnimation runs several animations one after the other. It can also
-/// repeat the sequence of animations for a specified number of iterations (which defaults to a
-/// single iteration, but will repeat forever if you specify zero or less iterations). Also, the
-/// SequenceAnimation cannot be a child of a Sys.Extended.UI.Animation.ParallelAnimation
-/// (or any animation inheriting from it).
-///
-///
-///
-/// The SequenceAnimation ignores the duration and fps
-/// properties, and will let each of its child animations use any settings they please.
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Array of child animations.
-/// Number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence
-/// will repeat forever. The default value is 1 iteration.
$AA.SequenceAnimation = function(target, duration, fps, animations, iterations) {
+ // The SequenceAnimation runs several animations one after the other. It can also
+ // repeat the sequence of animations for a specified number of iterations (which defaults to a
+ // single iteration, but will repeat forever if you specify zero or less iterations). Also, the
+ // SequenceAnimation cannot be a child of a Sys.Extended.UI.Animation.ParallelAnimation
+ // (or any animation inheriting from it).
+ // The SequenceAnimation ignores the duration and fps
+ // properties, and will let each of its child animations use any settings they please.
+ //
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps"- number of steps per second. The default is 25.
+ // "animations" - array of child animations
+ // "iterations" - number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence
+ // will repeat forever. The default value is 1 iteration.
+
$AA.SequenceAnimation.initializeBase(this, [target, duration, fps, animations]);
// Handler used to determine when an animation has finished
@@ -991,13 +873,7 @@ $AA.SequenceAnimation = function(target, duration, fps, animations, iterations)
// Counter used when playing the animation to determine the remaining number of times to play the entire sequence
this._remainingIterations = 0;
- ///
- /// Number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence
- /// will repeat forever. The default value is 1 iteration.
- ///
- ///get_iterations
- ///set_iterations
- ///
+ // Number of iterations
this._iterations = (iterations !== undefined) ? iterations : 1;
}
$AA.SequenceAnimation.prototype = {
@@ -1006,16 +882,12 @@ $AA.SequenceAnimation.prototype = {
$AA.SequenceAnimation.callBaseMethod(this, 'dispose');
},
- ///
- /// Stop playing the entire sequence of animations.
- ///
- ///
- /// Stopping this animation will perform the last step of each child animation, thereby leaving their
- /// target elements in a state consistent with the animation playing completely. If this animation is
- /// the child of another, you must call stop on its parent instead.
- ///
- ///
stop: function() {
+ // Stop playing the entire sequence of animations
+ // Stopping this animation will perform the last step of each child animation, thereby leaving their
+ // target elements in a state consistent with the animation playing completely. If this animation is
+ // the child of another, you must call stop on its parent instead.
+
if(this._playing) {
var animations = this.get_animations();
if(this._index < animations.length) {
@@ -1034,15 +906,10 @@ $AA.SequenceAnimation.prototype = {
}
},
- ///
- /// Pause the animation if it is playing. Calling play will resume where
- /// the animation left off.
- ///
- ///
- /// If this animation is the child of another, you must call pause on its parent instead.
- ///
- ///
pause: function() {
+ // Pause the animation if it is playing. Calling play will resume where
+ // the animation left off.
+ // If this animation is the child of another, you must call pause on its parent instead.
if(this.get_isPlaying()) {
var current = this.get_animations()[this._index];
if(current != null) {
@@ -1053,14 +920,10 @@ $AA.SequenceAnimation.prototype = {
}
},
- ///
- /// Play the sequence of animations from the beginning or where it was left off when paused.
- ///
- ///
- /// If this animation is the child of another, you must call play on its parent instead.
- ///
- ///
play: function() {
+ // Play the sequence of animations from the beginning or where it was left off when paused
+ // If this animation is the child of another, you must call play on its parent instead
+
var animations = this.get_animations();
if(!this._playing) {
this._playing = true;
@@ -1087,11 +950,8 @@ $AA.SequenceAnimation.prototype = {
}
},
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
+ // The onStart method is called just before the animation is played each time
$AA.SequenceAnimation.callBaseMethod(this, 'onStart');
this._remainingIterations = this._iterations - 1;
@@ -1128,21 +988,15 @@ $AA.SequenceAnimation.prototype = {
}
},
- ///
- /// Raises an invalid operation exception because this will only be called if a SequenceAnimation
- /// has been nested inside an Sys.Extended.UI.Animation.ParallelAnimation (or a derived type).
- ///
- ///
- /// Percentage of the animation already complete.
onStep: function(percentage) {
+ // Raises an invalid operation exception because this will only be called if a SequenceAnimation
+ // has been nested inside an (or a derived type).
+ // "percentage" - percentage of the animation already complete
throw Error.invalidOperation(Sys.Extended.UI.Resources.Animation_CannotNestSequence);
},
- ///
- /// The onEnd method is called just after the animation is played each time.
- ///
- ///
onEnd: function() {
+ // The onEnd method is called just after the animation is played each time.
this._remainingIterations = 0;
$AA.SequenceAnimation.callBaseMethod(this, 'onEnd');
},
@@ -1156,6 +1010,8 @@ $AA.SequenceAnimation.prototype = {
},
get_iterations: function() {
+ // Number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence
+ // will repeat forever. The default value is 1 iteration.
return this._iterations;
},
set_iterations: function(value) {
@@ -1166,11 +1022,6 @@ $AA.SequenceAnimation.prototype = {
}
},
- ///
- /// A boolean value that determines whether or not animation runs in an infinite loop until it is explicitly stopped.
- ///
- ///get_isInfinite
- ///
get_isInfinite: function() {
return this._iterations <= 0;
}
@@ -1178,21 +1029,16 @@ $AA.SequenceAnimation.prototype = {
$AA.SequenceAnimation.registerClass('Sys.Extended.UI.Animation.SequenceAnimation', $AA.ParentAnimation);
$AA.registerAnimation('sequence', $AA.SequenceAnimation);
-///
-/// The SelectionAnimation will run a single animation chosen from of its child animations. It is
-/// important to note that the SelectionAnimation ignores the duration and fps
-/// properties, and will let each of its child animations use any settings they please. This is a base class with no
-/// functional implementation, so consider using ConditionAnimation or CaseAnimation instead.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Array of child animations to be played.
$AA.SelectionAnimation = function(target, duration, fps, animations) {
+ // The SelectionAnimation will run a single animation chosen from of its child animations. It is
+ // important to note that the SelectionAnimation ignores the duration and fps
+ // properties, and will let each of its child animations use any settings they please. This is a base class with no
+ // functional implementation, so consider using ConditionAnimation or CaseAnimation instead.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "animations" - array of child animations
$AA.SelectionAnimation.initializeBase(this, [target, duration, fps, animations]);
// Index of the animation selected to play
@@ -1202,20 +1048,15 @@ $AA.SelectionAnimation = function(target, duration, fps, animations) {
this._selected = null;
}
$AA.SelectionAnimation.prototype = {
- ///
- /// Get the index of the animation that is selected to be played. If this returns an index outside the bounds of
- /// the child animations array, then nothing is played.
- ///
- ///
getSelectedIndex: function() {
+ // Get the index of the animation that is selected to be played. If this returns an index outside the bounds of
+ // the child animations array, then nothing is played.
+ // returns index of the selected child animation to play
throw Error.notImplemented();
},
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
+ // The onStart method is called just before the animation is played each time.
$AA.SelectionAnimation.callBaseMethod(this, 'onStart');
var animations = this.get_animations();
@@ -1229,22 +1070,16 @@ $AA.SelectionAnimation.prototype = {
}
},
- ///
- /// The onStep method is called repeatedly to progress the animation through each frame.
- ///
- ///
- /// Percentage of the animation already complete.
onStep: function(percentage) {
+ // The onStep method is called repeatedly to progress the animation through each frame
+ // "percentage" - percentage of the animation already complete
if(this._selected) {
this._selected.onStep(percentage);
}
},
- ///
- /// The onEnd method is called just after the animation is played each time.
- ///
- ///
onEnd: function() {
+ // The onEnd method is called just after the animation is played each time.
if(this._selected) {
this._selected.onEnd();
this._selected.setOwner(null);
@@ -1257,35 +1092,28 @@ $AA.SelectionAnimation.prototype = {
$AA.SelectionAnimation.registerClass('Sys.Extended.UI.Animation.SelectionAnimation', $AA.ParentAnimation);
$AA.registerAnimation('selection', $AA.SelectionAnimation);
-///
-/// The ConditionAnimation is used as a control structure to play a specific child animation
-/// depending on the result of executing the conditionScript. If the conditionScript
-/// evaluates to true, the first child animation is played. If it evaluates to false,
-/// the second child animation is played (although nothing is played if a second animation is not present).
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Array of child animations to be played.
-/// JavaScript that should evaluate to true or false to determine which child
-/// animation to play.
$AA.ConditionAnimation = function(target, duration, fps, animations, conditionScript) {
+ // The ConditionAnimation is used as a control structure to play a specific child animation
+ // depending on the result of executing the conditionScript. If the conditionScript
+ // evaluates to true, the first child animation is played. If it evaluates to false,
+ // the second child animation is played (although nothing is played if a second animation is not present).
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "animations" - array of child animations
+ // "conditionScript" - javaScript that should evaluate to true or false to determine which child
+ // animation to play.
$AA.ConditionAnimation.initializeBase(this, [target, duration, fps, animations]);
// Condition to determine which index we will play
this._conditionScript = conditionScript;
}
$AA.ConditionAnimation.prototype = {
- ///
- /// Get the index of the animation that is selected to be played. If this returns an index outside the bounds of
- /// the child animations array, then nothing is played.
- ///
- ///
getSelectedIndex: function() {
+ // Get the index of the animation that is selected to be played. If this returns an index outside the bounds of
+ // the child animations array, then nothing is played.
+ // returns index of the selected child animation to play
var selected = -1;
if(this._conditionScript && this._conditionScript.length > 0) {
try {
@@ -1296,14 +1124,9 @@ $AA.ConditionAnimation.prototype = {
return selected;
},
- ///
- /// JavaScript that should evaluate to true or false to determine which
- /// child animation to play.
- ///
- /// get_conditionScript
- /// set_conditionScript
- ///
get_conditionScript: function() {
+ // JavaScript that should evaluate to true or false to determine which
+ // child animation to play.
return this._conditionScript;
},
set_conditionScript: function(value) {
@@ -1316,35 +1139,28 @@ $AA.ConditionAnimation.prototype = {
$AA.ConditionAnimation.registerClass('Sys.Extended.UI.Animation.ConditionAnimation', $AA.SelectionAnimation);
$AA.registerAnimation('condition', $AA.ConditionAnimation);
-///
-/// The CaseAnimation is used as a control structure to play a specific child animation depending on
-/// the result of executing the selectScript, which should return the index of the child animation to
-/// play (this is similar to the case or select statements in C#/VB, etc.). If the provided
-/// index is outside the bounds of the child animations array (or if nothing was returned) then we will not play anything.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Array of child animations to be played.
-/// JavaScript that should evaluate to the index of the appropriate child animation to play.
-/// If this returns an index outside the bounds of the child animations array, then nothing is played.
$AA.CaseAnimation = function(target, duration, fps, animations, selectScript) {
+ // The CaseAnimation is used as a control structure to play a specific child animation depending on
+ // the result of executing the selectScript, which should return the index of the child animation to
+ // play (this is similar to the case or select statements in C#/VB, etc.). If the provided
+ // index is outside the bounds of the child animations array (or if nothing was returned) then we will not play anything.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "animations" - array of child animations
+ // "selectScript" - JavaScript that should evaluate to the index of the appropriate child animation to play.
+ // If this returns an index outside the bounds of the child animations array, then nothing is played.
$AA.CaseAnimation.initializeBase(this, [target, duration, fps, animations]);
// Condition to determine which index we will play
this._selectScript = selectScript;
}
$AA.CaseAnimation.prototype = {
- ///
- /// Get the index of the animation that is selected to be played. If this returns an index outside the bounds of
- /// the child animations array, then nothing is played.
- ///
- ///
getSelectedIndex: function() {
+ // Get the index of the animation that is selected to be played. If this returns an index outside the bounds of
+ // the child animations array, then nothing is played.
+ // returns index of the selected child animation to play
var selected = -1;
if(this._selectScript && this._selectScript.length > 0) {
try {
@@ -1357,14 +1173,9 @@ $AA.CaseAnimation.prototype = {
return selected;
},
- ///
- /// JavaScript that should evaluate to the index of the appropriate child animation to play.
- /// If this returns an index outside the bounds of the child animations array, then nothing is played.
- ///
- /// get_selectScript
- /// set_selectScript
- ///
get_selectScript: function() {
+ // JavaScript that should evaluate to the index of the appropriate child animation to play.
+ // If this returns an index outside the bounds of the child animations array, then nothing is played.
return this._selectScript;
},
set_selectScript: function(value) {
@@ -1388,28 +1199,23 @@ $AA.FadeEffect.prototype = {
}
$AA.FadeEffect.registerEnum("Sys.Extended.UI.Animation.FadeEffect", false);
-///
-/// The FadeAnimation is used to fade an element in or out of view, depending on the
-/// provided Sys.Extended.UI.Animation.FadeEffect, by settings its opacity.
-/// The minimum and maximum opacity values can be specified to precisely control the fade.
-/// You may also consider using FadeInAnimation or FadeOutAnimation if you know the only direction you
-/// are fading.
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// determine whether to fade the element in or fade the element out. The possible values are FadeIn
-/// and FadeOut. The default value is FadeOut.
-/// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
-/// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
-/// whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
-/// background color (the latter is required in case the user has ClearType enabled). The default value is true.
-/// This is obviously ignored when working in other browsers.
$AA.FadeAnimation = function(target, duration, fps, effect, minimumOpacity, maximumOpacity, forceLayoutInIE) {
+ // The FadeAnimation is used to fade an element in or out of view, depending on the
+ // provided , by settings its opacity.
+ // The minimum and maximum opacity values can be specified to precisely control the fade.
+ // You may also consider using FadeInAnimation or FadeOutAnimation if you know the only direction you
+ // are fading.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "effect" - determine whether to fade the element in or fade the element out. The possible values are FadeIn
+ // and FadeOut. The default value is FadeOut.
+ // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
+ // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
+ // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
+ // background color (the latter is required in case the user has ClearType enabled). The default value is true.
+ // This is obviously ignored when working in other browsers.
$AA.FadeAnimation.initializeBase(this, [target, duration, fps]);
// The effect determines whether or not we fade in or out
@@ -1482,11 +1288,8 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
+ // The onStart method is called just before the animation is played each time.
$AA.FadeAnimation.callBaseMethod(this, 'onStart');
this._currentTarget = this.get_target();
@@ -1498,21 +1301,16 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// Determine the current opacity after the given percentage of its duration has elapsed.
- ///
- ///
- /// Percentage of the animation already complete.
getAnimatedValue: function(percentage) {
+ // Determine the current opacity after the given percentage of its duration has elapsed
+ // "percentage" - percentage of the animation already complete
+ // returns - current opacity after the given percentage of its duration has elapsed that will be passed to setValue
return this.interpolate(this._start, this._end, percentage);
},
- ///
- /// Set the current opacity of the element.
- ///
- ///
- /// Current opacity (as retreived from getAnimatedValue).
setValue: function(value) {
+ // Set the current opacity of the element.
+ // "value" - current opacity (as retreived from getAnimatedValue)
// This method will be replaced by a dynamically generated function that requires no logic
// to determine whether it should use filters or the style's opacity.
if(this._currentTarget) {
@@ -1520,14 +1318,9 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// Determine whether to fade the element in or fade the element out. The possible values are
- /// FadeIn and FadeOut. The default value is FadeOut.
- ///
- ///get_effect
- ///set_effect
- ///
get_effect: function() {
+ // Determine whether to fade the element in or fade the element out. The possible values are
+ // FadeIn and FadeOut. The default value is FadeOut.
return this._effect;
},
set_effect: function(value) {
@@ -1539,14 +1332,9 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1.
- /// The default value is 0.
- ///
- ///get_minimumOpacity
- ///set_minimumOpacity
- ///
get_minimumOpacity: function() {
+ // Minimum opacity to use when fading in or out. Its value can range from between 0 to 1.
+ // The default value is 0.
return this._min;
},
set_minimumOpacity: function(value) {
@@ -1558,14 +1346,9 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1.
- /// The default value is 1.
- ///
- ///get_maximumOpacity
- ///set_maximumOpacity
- ///
get_maximumOpacity: function() {
+ // Maximum opacity to use when fading in or out. Its value can range from between 0 to 1.
+ // The default value is 1.
return this._max;
},
set_maximumOpacity: function(value) {
@@ -1577,15 +1360,10 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
- /// background color (the latter is required in case the user has ClearType enabled). The default value is true.
- /// This is obviously ignored when working in other browsers.
- ///
- ///get_forceLayoutInIE
- ///set_forceLayoutInIE
- ///
get_forceLayoutInIE: function() {
+ // Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
+ // background color (the latter is required in case the user has ClearType enabled). The default value is true.
+ // This is obviously ignored when working in other browsers.
return this._forceLayoutInIE;
},
set_forceLayoutInIE: function(value) {
@@ -1596,48 +1374,32 @@ $AA.FadeAnimation.prototype = {
}
},
- ///
- /// Set the start value (so that child animations can set the current opacity as the start value when fading in or out).
- ///
- ///
- /// Opacity to start fade animation with.
- setStartValue: function(value) {
+ set_startValue: function(value) {
+ // Set the start value (so that child animations can set the current opacity as the start value when fading in or out)
value = this._getFloat(value);
this._start = value;
- },
- set_startValue: function(value) {
- Sys.Extended.Deprecated("setStartValue(value)", "set_startValue(value)");
- this.setStartValue(value);
}
}
$AA.FadeAnimation.registerClass('Sys.Extended.UI.Animation.FadeAnimation', $AA.Animation);
$AA.registerAnimation('fade', $AA.FadeAnimation);
-///
-/// The FadeInAnimation will fade the target in by moving from hidden to visible.
-/// It starts the animation the target's current opacity.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
-/// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
-/// whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
-/// background color (the latter is required in case the user has ClearType enabled). The default value is true.
-/// This is obviously ignored when working in other browsers.
$AA.FadeInAnimation = function(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) {
+ // The FadeInAnimation will fade the target in by moving from hidden to visible.
+ // It starts the animation the target's current opacity.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
+ // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
+ // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
+ // background color (the latter is required in case the user has ClearType enabled). The default value is true.
+ // This is obviously ignored when working in other browsers.
$AA.FadeInAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeIn, minimumOpacity, maximumOpacity, forceLayoutInIE]);
}
$AA.FadeInAnimation.prototype = {
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
+ // The onStart method is called just before the animation is played each time.
$AA.FadeInAnimation.callBaseMethod(this, 'onStart');
if(this._currentTarget) {
@@ -1649,31 +1411,22 @@ $AA.FadeInAnimation.registerClass('Sys.Extended.UI.Animation.FadeInAnimation', $
$AA.registerAnimation('fadeIn', $AA.FadeInAnimation);
-///
-/// The FadeOutAnimation will fade the element out by moving from visible to hidden. It starts the animation
-/// at the element's current opacity.
-///
-///
-
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
-/// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
-/// whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
-/// background color (the latter is required in case the user has ClearType enabled). The default value is true.
-/// This is obviously ignored when working in other browsers.
$AA.FadeOutAnimation = function(target, duration, fps, minimumOpacity, maximumOpacity, forceLayoutInIE) {
+ // The FadeInAnimation will fade the element out by moving from visible to hidden. It starts the animation
+ // at the element's current opacity.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
+ // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
+ // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
+ // background color (the latter is required in case the user has ClearType enabled). The default value is true.
+ // This is obviously ignored when working in other browsers.
$AA.FadeOutAnimation.initializeBase(this, [target, duration, fps, $AA.FadeEffect.FadeOut, minimumOpacity, maximumOpacity, forceLayoutInIE]);
}
$AA.FadeOutAnimation.prototype = {
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
+ // The onStart method is called just before the animation is played each time.
$AA.FadeOutAnimation.callBaseMethod(this, 'onStart');
if(this._currentTarget) {
@@ -1684,28 +1437,23 @@ $AA.FadeOutAnimation.prototype = {
$AA.FadeOutAnimation.registerClass('Sys.Extended.UI.Animation.FadeOutAnimation', $AA.FadeAnimation);
$AA.registerAnimation('fadeOut', $AA.FadeOutAnimation);
-///
-/// The PulseAnimation fades an element in and our repeatedly to create a pulsating
-/// effect. The iterations determines how many pulses there will be (which defaults
-/// to three, but it will repeat infinitely if given zero or less). The duration
-/// property defines the duration of each fade in or fade out, not the duration of
-/// the animation as a whole.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence
-/// will repeat forever. The default value is 1 iteration.
-/// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
-/// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
-/// whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
-/// background color (the latter is required in case the user has ClearType enabled). The default value is true.
-/// This is obviously ignored when working in other browsers.
$AA.PulseAnimation = function(target, duration, fps, iterations, minimumOpacity, maximumOpacity, forceLayoutInIE) {
+ // The PulseAnimation fades an element in and our repeatedly to create a pulsating
+ // effect. The iterations determines how many pulses there will be (which defaults
+ // to three, but it will repeat infinitely if given zero or less). The duration
+ // property defines the duration of each fade in or fade out, not the duration of
+ // the animation as a whole.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "iterations" - number of times to repeatedly play the sequence. If zero or less iterations are specified, the sequence
+ // will repeat forever. The default value is 1 iteration.
+ // "minimumOpacity" - minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
+ // "maximumOpacity" - maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
+ // "forceLayoutInIE" - whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
+ // background color (the latter is required in case the user has ClearType enabled). The default value is true.
+ // This is obviously ignored when working in other browsers.
$AA.PulseAnimation.initializeBase(this, [target, duration, fps, null, ((iterations !== undefined) ? iterations : 3)]);
// Create the FadeOutAnimation
@@ -1717,13 +1465,9 @@ $AA.PulseAnimation = function(target, duration, fps, iterations, minimumOpacity,
this.add(this._in);
}
$AA.PulseAnimation.prototype = {
- ///
- /// Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
- ///
- ///get_minimumOpacity
- ///set_minimumOpacity
- ///
+
get_minimumOpacity: function() {
+ // Minimum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 0.
return this._out.get_minimumOpacity();
},
set_minimumOpacity: function(value) {
@@ -1733,13 +1477,8 @@ $AA.PulseAnimation.prototype = {
this.raisePropertyChanged('minimumOpacity');
},
- ///
- /// Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
- ///
- ///get_maximumOpacity
- ///set_maximumOpacity
- ///
get_maximumOpacity: function() {
+ // Maximum opacity to use when fading in or out. Its value can range from between 0 to 1. The default value is 1.
return this._out.get_maximumOpacity();
},
set_maximumOpacity: function(value) {
@@ -1749,15 +1488,10 @@ $AA.PulseAnimation.prototype = {
this.raisePropertyChanged('maximumOpacity');
},
- ///
- /// Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
- /// background color (the latter is required in case the user has ClearType enabled). The default value is true.
- /// This is obviously ignored when working in other browsers.
- ///
- ///get_forceLayoutInIE
- ///set_forceLayoutInIE
- ///
get_forceLayoutInIE: function() {
+ // Whether or not we should force a layout to be created for Internet Explorer by giving it a width and setting its
+ // background color (the latter is required in case the user has ClearType enabled). The default value is true.
+ // This is obviously ignored when working in other browsers.
return this._out.get_forceLayoutInIE();
},
set_forceLayoutInIE: function(value) {
@@ -1767,60 +1501,39 @@ $AA.PulseAnimation.prototype = {
this.raisePropertyChanged('forceLayoutInIE');
},
- ///
- /// Override the duration property.
- ///
- ///
- /// Length of the animation in seconds.
- setDuration: function(value) {
+ set_duration: function(value) {
+ // Override the duration property
value = this._getFloat(value);
$AA.PulseAnimation.callBaseMethod(this, 'set_duration', [value]);
this._in.set_duration(value);
this._out.set_duration(value);
},
- set_duration: function(value) {
- Sys.Extended.Deprecated("setDuration(value)", "set_duration(value)");
- this.setDuration(value);
- },
- ///
- /// Override the fps property.
- ///
- ///
- /// Number of steps per second..
- setFps: function(value) {
+ set_fps: function(value) {
+ // Override the fps property
value = this._getInteger(value);
$AA.PulseAnimation.callBaseMethod(this, 'set_fps', [value]);
this._in.set_fps(value);
this._out.set_fps(value);
- },
- set_fps: function(value) {
- Sys.Extended.Deprecated("setFps(value)", "set_fps(value)");
- this.setFps(value);
}
}
$AA.PulseAnimation.registerClass('Sys.Extended.UI.Animation.PulseAnimation', $AA.SequenceAnimation);
$AA.registerAnimation('pulse', $AA.PulseAnimation);
-///
-/// The PropertyAnimation is a useful base animation that will assign the value from
-/// getAnimatedValue to a specified property. You can provide the name of
-/// a property alongside an optional propertyKey (which indicates the value
-/// property[propertyKey], like style['backgroundColor']).
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Property of the target element to set when animating.
-/// optional key of the property to be set (which indicates the value property[propertyKey],
-/// like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
-/// format (i.e. backgroundColor instead of background-color).
$AA.PropertyAnimation = function(target, duration, fps, property, propertyKey) {
+ // The PropertyAnimation is a useful base animation that will assign the value from
+ // getAnimatedValue to a specified property. You can provide the name of
+ // a property alongside an optional propertyKey (which indicates the value
+ // property[propertyKey], like style['backgroundColor']).
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "property" - property of the target element to set when animating
+ // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey],
+ // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
+ // format (i.e. backgroundColor instead of background-color).
$AA.PropertyAnimation.initializeBase(this, [target, duration, fps]);
// Name of the property to set
@@ -1836,21 +1549,13 @@ $AA.PropertyAnimation = function(target, duration, fps, property, propertyKey) {
this._currentTarget = null;
}
$AA.PropertyAnimation.prototype = {
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
+ // The onStart method is called just before the animation is played each time.
$AA.PropertyAnimation.callBaseMethod(this, 'onStart');
this._currentTarget = this.get_target();
},
- ///
- /// Set the property's value.
- ///
- ///
- /// Value to set.
setValue: function(value) {
var element = this._currentTarget;
if(element && this._property && this._property.length > 0) {
@@ -1862,10 +1567,6 @@ $AA.PropertyAnimation.prototype = {
}
},
- ///
- /// Get the property's current value.
- ///
- ///
getValue: function() {
var element = this.get_target();
if(element && this._property && this._property.length > 0) {
@@ -1880,12 +1581,6 @@ $AA.PropertyAnimation.prototype = {
return null;
},
- ///
- /// A string value specifying the name of the target element's property to be set when animation plays.
- ///
- /// get_property
- /// set_property
- ///
get_property: function() {
return this._property;
},
@@ -1896,14 +1591,9 @@ $AA.PropertyAnimation.prototype = {
}
},
- ///
- /// Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']).
- /// Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
- ///
- /// get_propertyKey
- /// set_propertyKey
- ///
get_propertyKey: function() {
+ // Optional key of the property to be set (which indicates the value property[propertyKey], like style['backgroundColor']).
+ // Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
return this._propertyKey;
},
set_propertyKey: function(value) {
@@ -1916,46 +1606,35 @@ $AA.PropertyAnimation.prototype = {
$AA.PropertyAnimation.registerClass('Sys.Extended.UI.Animation.PropertyAnimation', $AA.Animation);
$AA.registerAnimation('property', $AA.PropertyAnimation);
-///
-/// The DiscreteAnimation inherits from Sys.Extended.UI.Animation.PropertyAnimation
-/// and sets the value of the property to the elements in a provided array of values.
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Property of the target element to set when animating.
-/// optional key of the property to be set (which indicates the value property[propertyKey],
-/// like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
-/// format (i.e. backgroundColor instead of background-color).
-/// Array of possible values of the property that will be iterated over as the animation is played.
$AA.DiscreteAnimation = function(target, duration, fps, property, propertyKey, values) {
+ // The DiscreteAnimation inherits from
+ // and sets the value of the property to the elements in a provided array of values.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "property" - property of the target element to set when animating
+ // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey],
+ // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
+ // format (i.e. backgroundColor instead of background-color).
+ // "values" - array of possible values of the property that will be iterated over as the animation is played
$AA.DiscreteAnimation.initializeBase(this, [target, duration, fps, property, propertyKey]);
// Values to assign to the property
this._values = (values && values.length) ? values : [];
}
$AA.DiscreteAnimation.prototype = {
- ///
- /// Assign the value whose index corresponds to the current percentage.
- ///
- ///
- /// Percentage of the animation already complete.
getAnimatedValue: function(percentage) {
+ // Assign the value whose index corresponds to the current percentage
+ // "percentage" - percentage of the animation already complete
+ // returns - state of the animation after the given percentage of its duration has elapsed that will
+ // be passed to setValue
var index = Math.floor(this.interpolate(0, this._values.length - 1, percentage));
return this._values[index];
},
- ///
- /// Array of possible values of the property that will be iterated over as the animation is played
- ///
- /// get_values
- /// set_values
- ///
get_values: function() {
+ // Array of possible values of the property that will be iterated over as the animation is played
return this._values;
},
set_values: function(value) {
@@ -1968,24 +1647,19 @@ $AA.DiscreteAnimation.prototype = {
$AA.DiscreteAnimation.registerClass('Sys.Extended.UI.Animation.DiscreteAnimation', $AA.PropertyAnimation);
$AA.registerAnimation('discrete', $AA.DiscreteAnimation);
-///
-/// The InterpolatedAnimation assigns a range of values between startValue
-/// and endValue to the designated property.
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Property of the target element to set when animating.
-/// optional key of the property to be set (which indicates the value property[propertyKey],
-/// like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
-/// format (i.e. backgroundColor instead of background-color).
-/// Start of the range of values.
-/// End of the range of values.
$AA.InterpolatedAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue) {
+ // The InterpolatedAnimation assigns a range of values between startValue
+ // and endValue to the designated property.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "property" - property of the target element to set when animating. The default value is 'style'.
+ // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey],
+ // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
+ // format (i.e. backgroundColor instead of background-color).
+ // "startValue" - start of the range of values
+ // "endValue" - end of the range of values
$AA.InterpolatedAnimation.initializeBase(this, [target, duration, fps, ((property !== undefined) ? property : 'style'), propertyKey]);
// Start and end values
@@ -1993,12 +1667,6 @@ $AA.InterpolatedAnimation = function(target, duration, fps, property, propertyKe
this._endValue = endValue;
}
$AA.InterpolatedAnimation.prototype = {
- ///
- /// Specifies the start value of the value range.
- ///
- /// get_startValue
- /// set_startValue
- ///
get_startValue: function() {
return this._startValue;
},
@@ -2010,12 +1678,6 @@ $AA.InterpolatedAnimation.prototype = {
}
},
- ///
- /// Specifies the end value of the value range.
- ///
- /// get_endValue
- /// set_endValue
- ///
get_endValue: function() {
return this._endValue;
},
@@ -2030,25 +1692,19 @@ $AA.InterpolatedAnimation.prototype = {
$AA.InterpolatedAnimation.registerClass('Sys.Extended.UI.Animation.InterpolatedAnimation', $AA.PropertyAnimation);
$AA.registerAnimation('interpolated', $AA.InterpolatedAnimation);
-///
-/// The ColorAnimation transitions the value of the property between
-/// two colors (although it does ignore the alpha channel). The colors must be 7-character hex strings
-/// (like #246ACF).
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Property of the target element to set when animating.
-/// optional key of the property to be set (which indicates the value property[propertyKey],
-/// like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
-/// format (i.e. backgroundColor instead of background-color).
-/// Start of the range of values.
-/// End of the range of values.
$AA.ColorAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue) {
+ // The ColorAnimation transitions the value of the property between
+ // two colors (although it does ignore the alpha channel). The colors must be 7-character hex strings
+ // (like #246ACF).
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "property" - property of the target element to set when animating. The default value is 'style'.
+ // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey],
+ // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly format (i.e. backgroundColor instead of background-color).
+ // "startValue" - start of the range of colors
+ // "endValue" - end of the range of colors
$AA.ColorAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]);
// Cached start/end RBG triplets
@@ -2061,11 +1717,8 @@ $AA.ColorAnimation = function(target, duration, fps, property, propertyKey, star
this._interpolateBlue = false;
}
$AA.ColorAnimation.prototype = {
- ///
- /// Determine which dimensions of color will be animated.
- ///
- ///
onStart: function() {
+ // Determine which dimensions of color will be animated
$AA.ColorAnimation.callBaseMethod(this, 'onStart');
this._start = $AA.ColorAnimation.getRGB(this.get_startValue());
@@ -2076,12 +1729,10 @@ $AA.ColorAnimation.prototype = {
this._interpolateBlue = (this._start.Blue != this._end.Blue);
},
- ///
- /// Get the interpolated color values.
- ///
- ///
- /// Percentage of the animation already complete.
getAnimatedValue: function(percentage) {
+ // Get the interpolated color values
+ // "percentage" - percentage of the animation already complete
+ // returns current color formatted as a 7-character hex string (like #246ACF).
var r = this._start.Red;
var g = this._start.Green;
var b = this._start.Blue;
@@ -2098,37 +1749,26 @@ $AA.ColorAnimation.prototype = {
return $AA.ColorAnimation.toColor(r, g, b);
},
- ///
- /// Starting color of the transition formatted as a 7-character hex string (like #246ACF).
- ///
- /// set_startValue
- ///
set_startValue: function(value) {
+ // Starting color of the transition formatted as a 7-character hex string (like #246ACF).
if(this._startValue != value) {
this._startValue = value;
this.raisePropertyChanged('startValue');
}
},
- ///
- /// Ending color of the transition formatted as a 7-character hex string (like #246ACF).
- ///
- /// set_startValue
- ///
set_endValue: function(value) {
+ // Ending color of the transition formatted as a 7-character hex string (like #246ACF).
if(this._endValue != value) {
this._endValue = value;
this.raisePropertyChanged('endValue');
}
}
}
-
-///
-/// Convert the color to an RGB triplet.
-///
-///
-/// Color formatted as a 7-character hex string (like #246ACF).
$AA.ColorAnimation.getRGB = function(color) {
+ // Convert the color to an RGB triplet
+ // "color" - color formatted as a 7-character hex string (like #246ACF)
+ // returns object representing the color with Red, Green, and Blue properties.
if(!color || color.length != 7) {
throw String.format(Sys.Extended.UI.Resources.Animation_InvalidColor, color);
}
@@ -2138,15 +1778,12 @@ $AA.ColorAnimation.getRGB = function(color) {
'Blue': parseInt(color.substr(5, 2), 16)
};
}
-
-///
-/// Convert an RBG triplet into a 7-character hex string (like #246ACF).
-///
-///
-/// Value of the color's red dimension.
-/// Value of the color's green dimension.
-/// Value of the color's blue dimension.
$AA.ColorAnimation.toColor = function(red, green, blue) {
+ // Convert an RBG triplet into a 7-character hex string (like #246ACF)
+ // "red" - value of the color's red dimension
+ // "green" - value of the color's green dimension
+ // "blue" - value of the color's blue dimension
+ // returns color as a 7-character hex string (like #246ACF)
var r = red.toString(16);
var g = green.toString(16);
var b = blue.toString(16);
@@ -2158,48 +1795,37 @@ $AA.ColorAnimation.toColor = function(red, green, blue) {
$AA.ColorAnimation.registerClass('Sys.Extended.UI.Animation.ColorAnimation', $AA.InterpolatedAnimation);
$AA.registerAnimation('color', $AA.ColorAnimation);
-///
-/// The LengthAnimation is identical to Sys.Extended.UI.Animation.InterpolatedAnimation
-/// except it adds a unit to the value before assigning it to the property.
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Property of the target element to set when animating.
-/// optional key of the property to be set (which indicates the value property[propertyKey],
-/// like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
-/// format (i.e. backgroundColor instead of background-color).
-/// Start of the range of values.
-/// End of the range of values.
-/// Unit of the interpolated values. The default value is 'px'.
$AA.LengthAnimation = function(target, duration, fps, property, propertyKey, startValue, endValue, unit) {
+ // The LengthAnimation is identical to
+ // except it adds a unit to the value before assigning it to the property.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "property" - property of the target element to set when animating. The default value is 'style'.
+ // "propertyKey" - optional key of the property to be set (which indicates the value property[propertyKey],
+ // like style['backgroundColor']). Note that for the style property, the key must be in a JavaScript friendly
+ // format (i.e. backgroundColor instead of background-color).
+ // "startValue" - start of the range of values
+ // "endValue" - end of the range of values
+ // "unit" - unit of the interpolated values. The default value is 'px'.
$AA.LengthAnimation.initializeBase(this, [target, duration, fps, property, propertyKey, startValue, endValue]);
// Unit of length (which defaults to px)
this._unit = (unit != null) ? unit : 'px';
}
$AA.LengthAnimation.prototype = {
- ///
- /// Get the interpolated length value.
- ///
- ///
- /// Percentage of the animation already complete.
+
getAnimatedValue: function(percentage) {
+ // Get the interpolated length value
+ // "percentage" - percentage of the animation already complete
+ // returns interpolated length
var value = this.interpolate(this.get_startValue(), this.get_endValue(), percentage);
return Math.round(value) + this._unit;
},
- ///
- /// Unit of the interpolated values. The default value is 'px'.
- ///
- /// get_unit
- /// set_unit
- ///
get_unit: function() {
+ // Unit of the interpolated values. The default value is 'px'.
return this._unit;
},
set_unit: function(value) {
@@ -2212,29 +1838,24 @@ $AA.LengthAnimation.prototype = {
$AA.LengthAnimation.registerClass('Sys.Extended.UI.Animation.LengthAnimation', $AA.InterpolatedAnimation);
$AA.registerAnimation('length', $AA.LengthAnimation);
-///
-/// The MoveAnimation is used to move the target element. If the
-/// relative flag is set to true, then it treats the horizontal
-/// and vertical properties as offsets to move the element. If the relative
-/// flag is false, then it will treat the horizontal and vertical
-/// properties as coordinates on the page where the target element should be moved. It is
-/// important to note that the target must be positioned (i.e. absolutely) so
-/// that settings its top/left style attributes will change its location.
-///
-///
-///
-///
-/// Length of the animation in seconds. The default is 1.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// If relative is true, this is the offset to move horizontally. Otherwise this is the x
-/// coordinate on the page where the target should be moved.
-/// if relative is true, this is the offset to move vertically. Otherwise this is the y
-/// coordinate on the page where the target should be moved.
-/// true if we are moving relative to the current position, false if we are moving absolutely.
-/// Unit of the interpolated values. The default value is 'px'.
$AA.MoveAnimation = function(target, duration, fps, horizontal, vertical, relative, unit) {
+ // The MoveAnimation is used to move the target element. If the
+ // relative flag is set to true, then it treats the horizontal
+ // and vertical properties as offsets to move the element. If the relative
+ // flag is false, then it will treat the horizontal and vertical
+ // properties as coordinates on the page where the target element should be moved. It is
+ // important to note that the target must be positioned (i.e. absolutely) so
+ // that settings its top/left style attributes will change its location.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "horizontal" - if relative is true, this is the offset to move horizontally. Otherwise this is the x
+ // coordinate on the page where the target should be moved.
+ // "vertical" - if relative is true, this is the offset to move vertically. Otherwise this is the y
+ // coordinate on the page where the target should be moved.
+ // "relative" - true if we are moving relative to the current position, false if we are moving absolutely
+ // "unit" - length unit for the size of the target. The default value is 'px'.
$AA.MoveAnimation.initializeBase(this, [target, duration, fps, null]);
// Distance to move horizontally and vertically
@@ -2249,10 +1870,7 @@ $AA.MoveAnimation = function(target, duration, fps, horizontal, vertical, relati
this.add(this._horizontalAnimation);
}
$AA.MoveAnimation.prototype = {
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
+
onStart: function() {
// Use the target's current position as the starting point for the animation
$AA.MoveAnimation.callBaseMethod(this, 'onStart');
@@ -2320,21 +1938,16 @@ $AA.MoveAnimation.prototype = {
$AA.MoveAnimation.registerClass('Sys.Extended.UI.Animation.MoveAnimation', $AA.ParallelAnimation);
$AA.registerAnimation('move', $AA.MoveAnimation);
-///
-/// The ResizeAnimation changes the size of the target from its
-/// current value to the specified width and height.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// New width of the target.
-/// New height of the target.
-/// Length unit for the size of the target. The default value is 'px'.
$AA.ResizeAnimation = function(target, duration, fps, width, height, unit) {
+ // The ResizeAnimation changes the size of the target from its
+ // current value to the specified width and height.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "width" - new width of the target
+ // "height" - new height of the target
+ // "unit" - length unit for the size of the target. The default value is 'px'.
$AA.ResizeAnimation.initializeBase(this, [target, duration, fps, null]);
// New size of the element
@@ -2348,10 +1961,7 @@ $AA.ResizeAnimation = function(target, duration, fps, width, height, unit) {
this.add(this._verticalAnimation);
}
$AA.ResizeAnimation.prototype = {
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
+
onStart: function() {
// Use the target's current size as the starting point for the animation
$AA.ResizeAnimation.callBaseMethod(this, 'onStart');
@@ -2367,12 +1977,6 @@ $AA.ResizeAnimation.prototype = {
this._height : element.offsetHeight);
},
- ///
- /// New width of the element.
- ///
- ///get_width
- ///set_width
- ///
get_width: function() {
return this._width;
},
@@ -2384,12 +1988,6 @@ $AA.ResizeAnimation.prototype = {
}
},
- ///
- /// New height of the element.
- ///
- ///get_height
- ///set_height
- ///
get_height: function() {
return this._height;
},
@@ -2401,13 +1999,8 @@ $AA.ResizeAnimation.prototype = {
}
},
- ///
- /// Length unit for the size of the target. The default value is 'px'.
- ///
- ///get_unit
- ///set_unit
- ///
get_unit: function() {
+ // Length unit for the size of the target. The default value is 'px'.
this._horizontalAnimation.get_unit();
},
set_unit: function(value) {
@@ -2422,30 +2015,24 @@ $AA.ResizeAnimation.prototype = {
$AA.ResizeAnimation.registerClass('Sys.Extended.UI.Animation.ResizeAnimation', $AA.ParallelAnimation);
$AA.registerAnimation('resize', $AA.ResizeAnimation);
-///
-/// The ScaleAnimation scales the size of the target element by the given scaleFactor
-/// (i.e. a scaleFactor of .5 will shrink it in half and a scaleFactor of 2.0
-/// will double it). If scaleFont is true, the size of the font will also scale with the element. If
-/// center is true, then the element's center will not move as it is scaled. It is important to note that
-/// the target must be positioned (i.e. absolutely) so that setting its top/left properties will change
-/// its location in order for center to have an effect.
-///
-///
-
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// The amount to scale the target (a scaleFactor of .5 will
-/// shrink it in half and a scaleFactor of 2.0 will double it). The default value is
-/// 1, which does no scaling.
-/// Length unit for the size of the target. The default value is 'px'.
-/// Whether the target should stay centered while scaling.
-/// Whether the font should be scaled along with the size.
-/// Unit of the font, which is only used if scaleFont is true.
-/// The default value is 'pt'.
$AA.ScaleAnimation = function(target, duration, fps, scaleFactor, unit, center, scaleFont, fontUnit) {
+ // The ScaleAnimation scales the size of the target element by the given scaleFactor
+ // (i.e. a scaleFactor of .5 will shrink it in half and a scaleFactor of 2.0
+ // will double it). If scaleFont is true, the size of the font will also scale with the element. If
+ // center is true, then the element's center will not move as it is scaled. It is important to note that
+ // the target must be positioned (i.e. absolutely) so that setting its top/left properties will change
+ // its location in order for center to have an effect.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 1.
+ // "fps" - number of steps per second. The default is 25.
+ // "scaleFactor" - the amount to scale the target (a scaleFactor of .5 will
+ // shrink it in half and a scaleFactor of 2.0 will double it). The default value is
+ // 1, which does no scaling.
+ // "unit" - length unit for the size of the target. The default value is 'px'.
+ // "center" - whether the target should stay centered while scaling
+ // "scaleFont" - whether the font should be scaled along with the size
+ // "fontUnit" - unit of the font, which is only used if scaleFont is true.
+ // The default value is 'pt'.
$AA.ScaleAnimation.initializeBase(this, [target, duration, fps]);
// Percentage to scale
@@ -2468,19 +2055,13 @@ $AA.ScaleAnimation = function(target, duration, fps, scaleFactor, unit, center,
this._initialFontSize = null;
}
$AA.ScaleAnimation.prototype = {
- ///
- /// Get the amount to scale the target.
- ///
- ///
- /// Percentage of the animation already complete.
getAnimatedValue: function(percentage) {
+ // Get the amount to scale the target
+ // "percentage" - percentage of the animation already complete
+ // returns percentage to scale the target
return this.interpolate(1.0, this._scaleFactor, percentage);
},
- ///
- /// The onStart method is called just before the animation is played each time.
- ///
- ///
onStart: function() {
// Cache the initial size because it will be used to determine how much to scale the element at each step of the animation
$AA.ScaleAnimation.callBaseMethod(this, 'onStart');
@@ -2501,12 +2082,9 @@ $AA.ScaleAnimation.prototype = {
}
},
- ///
- /// Scale the target by the given percentage.
- ///
- ///
- /// Percentage to scale the target.
setValue: function(scale) {
+ // Scale the target by the given percentage
+ // "scale" - percentage to scale the target
if(this._element) {
var width = Math.round(this._initialWidth * scale);
var height = Math.round(this._initialHeight * scale);
@@ -2530,10 +2108,6 @@ $AA.ScaleAnimation.prototype = {
}
},
- ///
- /// The onEnd method is called just after the animation is played each time.
- ///
- ///
onEnd: function() {
// Wipe the cached values after the animation completes
this._element = null;
@@ -2545,15 +2119,10 @@ $AA.ScaleAnimation.prototype = {
$AA.ScaleAnimation.callBaseMethod(this, 'onEnd');
},
- ///
- /// The amount to scale the target (a scaleFactor of .5 will
- /// shrink it in half and a scaleFactor of 2.0 will double it). The default value is
- /// 1, which does no scaling.
- ///
- ///get_scaleFactore
- ///set_scaleFactore
- ///
get_scaleFactor: function() {
+ // The amount to scale the target (a scaleFactor of .5 will
+ // shrink it in half and a scaleFactor of 2.0 will double it). The default value is
+ // 1, which does no scaling.
return this._scaleFactor;
},
set_scaleFactor: function(value) {
@@ -2564,13 +2133,8 @@ $AA.ScaleAnimation.prototype = {
}
},
- ///
- /// Length unit for the size of the target. The default value is 'px'.
- ///
- ///get_unit
- ///set_unit
- ///
get_unit: function() {
+ // Length unit for the size of the target. The default value is 'px'.
return this._unit;
},
set_unit: function(value) {
@@ -2580,13 +2144,8 @@ $AA.ScaleAnimation.prototype = {
}
},
- ///
- /// Whether the target should stay centered while scaling.
- ///
- ///get_center
- ///set_center
- ///
get_center: function() {
+ // Whether the target should stay centered while scaling
return this._center;
},
set_center: function(value) {
@@ -2597,13 +2156,8 @@ $AA.ScaleAnimation.prototype = {
}
},
- ///
- /// Whether the font should be scaled along with the size.
- ///
- ///get_scaleFont
- ///set_scaleFont
- ///
get_scaleFont: function() {
+ // Whether the font should be scaled along with the size
return this._scaleFont;
},
set_scaleFont: function(value) {
@@ -2614,14 +2168,9 @@ $AA.ScaleAnimation.prototype = {
}
},
- ///
- /// Unit of the font, which is only used if scaleFont is true.
- /// The default value is 'pt'.
- ///
- ///get_fontUnit
- ///set_fontUnit
- ///
get_fontUnit: function() {
+ // Unit of the font, which is only used if scaleFont is true.
+ // The default value is 'pt'.
return this._fontUnit;
},
set_fontUnit: function(value) {
@@ -2634,21 +2183,16 @@ $AA.ScaleAnimation.prototype = {
$AA.ScaleAnimation.registerClass('Sys.Extended.UI.Animation.ScaleAnimation', $AA.Animation);
$AA.registerAnimation('scale', $AA.ScaleAnimation);
-///
-/// Action is a base class for all "non-animating" animations that provides empty implementations
-/// for abstract methods and adds a doAction method that will be called to perform the action's
-/// operation. While regular animations perform an operation in a sequence of small steps spread over an interval,
-/// the actions perform a single operation instantaneously. By default, all actions have a duration
-/// of zero. The actions are very useful for defining complex animations.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
$AA.Action = function(target, duration, fps) {
+ // Action is a base class for all "non-animating" animations that provides empty implementations
+ // for abstract methods and adds a doAction method that will be called to perform the action's
+ // operation. While regular animations perform an operation in a sequence of small steps spread over an interval,
+ // the actions perform a single operation instantaneously. By default, all actions have a duration
+ // of zero. The actions are very useful for defining complex animations.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 0.
+ // "fps" - number of steps per second. The default is 25.
$AA.Action.initializeBase(this, [target, duration, fps]);
// Set the duration to 0 if it wasn't specified
@@ -2657,76 +2201,51 @@ $AA.Action = function(target, duration, fps) {
}
}
$AA.Action.prototype = {
- ///
- /// Calls the doAction method when the animation completes.
- ///
- ///
+
onEnd: function() {
+ // Call the doAction method when the animation completes
this.doAction();
$AA.Action.callBaseMethod(this, 'onEnd');
},
- ///
- /// The doAction method must be implemented by all actions.
- ///
- ///
doAction: function() {
+ // The doAction method must be implemented by all actions
throw Error.notImplemented();
},
- ///
- /// Empty implementation of required abstract method.
- ///
- ///
getAnimatedValue: function() {
+ // Empty implementation of required abstract method
},
-
- ///
- /// Empty implementation of required abstract method.
- ///
- ///
setValue: function() {
+ // Empty implementation of required abstract method
}
}
$AA.Action.registerClass('Sys.Extended.UI.Animation.Action', $AA.Animation);
$AA.registerAnimation('action', $AA.Action);
-///
-/// The EnableAction changes whether or not the target is disabled.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Whether or not the target is disabled. The default value is true.
$AA.EnableAction = function(target, duration, fps, enabled) {
+ // The EnableAction changes whether or not the target is disabled.
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 0.
+ // "fps" - number of steps per second. The default is 25.
+ // "enabled" - whether or not the target is disabled. The default value is true.
$AA.EnableAction.initializeBase(this, [target, duration, fps]);
// Whether to enable or disable
this._enabled = (enabled !== undefined) ? enabled : true;
}
$AA.EnableAction.prototype = {
- ///
- /// Sets the enabled property of the target.
- ///
- ///
doAction: function() {
+ // Set the enabled property of the target
var element = this.get_target();
if(element) {
element.disabled = !this._enabled;
}
},
- ///
- /// Whether or not the target is disabled. The default value is true.
- ///
- ///get_enabled
- ///set_enabled
- ///
get_enabled: function() {
+ // Whether or not the target is disabled. The default value is true.
return this._enabled;
},
set_enabled: function(value) {
@@ -2740,42 +2259,29 @@ $AA.EnableAction.prototype = {
$AA.EnableAction.registerClass('Sys.Extended.UI.Animation.EnableAction', $AA.Action);
$AA.registerAnimation('enableAction', $AA.EnableAction);
-///
-/// The HideAction simply hides the target from view
-/// (by setting its style's display attribute to 'none')
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// true to show the target, false to hide it. The default value is false.
$AA.HideAction = function(target, duration, fps, visible) {
+ // The HideAction simply hides the target from view
+ // (by setting its style's display attribute to 'none')
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 0.
+ // "fps" - number of steps per second. The default is 25.
+ // "visible" - true to show the target, false to hide it. The default value is false.
$AA.HideAction.initializeBase(this, [target, duration, fps]);
this._visible = visible;
}
$AA.HideAction.prototype = {
- ///
- /// Hides the target element.
- ///
- ///
doAction: function() {
+ // Hide the target
var element = this.get_target();
if(element) {
$common.setVisible(element, this._visible);
}
},
- ///
- /// True to show the target, false to hide it. The default value is false.
- ///
- ///get_visible
- ///set_visible
- ///
get_visible: function() {
+ // True to show the target, false to hide it. The default value is false.
return this._visible;
},
set_visible: function(value) {
@@ -2788,20 +2294,15 @@ $AA.HideAction.prototype = {
$AA.HideAction.registerClass('Sys.Extended.UI.Animation.HideAction', $AA.Action);
$AA.registerAnimation('hideAction', $AA.HideAction);
-///
-/// The StyleAction is used to set a particular attribute of the target's style.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Style attribute to set (this must be in a JavaScript friendly format, i.e. backgroundColor
-/// instead of background-color).
-/// Value to set the attribute.
$AA.StyleAction = function(target, duration, fps, attribute, value) {
+ // The StyleAction is used to set a particular attribute of the target's style
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 0.
+ // "fps" - number of steps per second. The default is 25.
+ // "attribute" - style attribute to set (this must be in a JavaScript friendly format, i.e. backgroundColor
+ // instead of background-color)
+ // "value" - value to set the attribute
$AA.StyleAction.initializeBase(this, [target, duration, fps]);
// Style attribute (like "backgroundColor" or "borderWidth"
@@ -2812,25 +2313,17 @@ $AA.StyleAction = function(target, duration, fps, attribute, value) {
}
$AA.StyleAction.prototype = {
- ///
- /// Assigns the value to the style's attribute.
- ///
- ///
doAction: function() {
+ // Assign the value to the style's attribute
var element = this.get_target();
if(element) {
element.style[this._attribute] = this._value;
}
},
- ///
- /// Style attribute to set (this must be in a JavaScript friendly format, i.e. backgroundColor
- /// instead of background-color).
- ///
- ///get_attribute
- ///set_attribute
- ///
get_attribute: function() {
+ // Style attribute to set (this must be in a JavaScript friendly format, i.e. backgroundColor
+ // instead of background-color)
return this._attribute;
},
set_attribute: function(value) {
@@ -2840,12 +2333,6 @@ $AA.StyleAction.prototype = {
}
},
- ///
- /// The attribute's value.
- ///
- ///get_value
- ///set_value
- ///
get_value: function() {
return this._value;
},
@@ -2859,41 +2346,27 @@ $AA.StyleAction.prototype = {
$AA.StyleAction.registerClass('Sys.Extended.UI.Animation.StyleAction', $AA.Action);
$AA.registerAnimation('styleAction', $AA.StyleAction);
-///
-/// OpacityAction allows you to set the opacity of the target.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// Opacity to set the target.
$AA.OpacityAction = function(target, duration, fps, opacity) {
+ // OpacityAction allows you to set the opacity of the target
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 0.
+ // "fps" - number of steps per second. The default is 25.
+ // "opacity" - opacity to set the target
$AA.OpacityAction.initializeBase(this, [target, duration, fps]);
// Opacity
this._opacity = opacity;
}
$AA.OpacityAction.prototype = {
- ///
- /// Sets the target element's opacity.
- ///
- ///
doAction: function() {
+ // Set the opacity
var element = this.get_target();
if(element) {
$common.setElementOpacity(element, this._opacity);
}
},
- ///
- /// The opacity value to set to the target element.
- ///
- ///get_opacity
- ///set_opacity
- ///
get_opacity: function() {
return this._opacity;
},
@@ -2908,28 +2381,19 @@ $AA.OpacityAction.prototype = {
$AA.OpacityAction.registerClass('Sys.Extended.UI.Animation.OpacityAction', $AA.Action);
$AA.registerAnimation('opacityAction', $AA.OpacityAction);
-///
-/// The ScriptAction is used to execute arbitrary JavaScript.
-///
-///
-///
-///
-/// Target of the animation.
-/// Length of the animation in seconds. The default is 1.
-/// Number of steps per second. The default is 25.
-/// JavaScript to execute.
$AA.ScriptAction = function(target, duration, fps, script) {
+ // The ScriptAction is used to execute arbitrary JavaScript
+ // "target" - target of the animation
+ // "duration" - length of the animation in seconds. The default is 0.
+ // "fps" - number of steps per second. The default is 25.
+ // "script" - javaScript to execute
$AA.ScriptAction.initializeBase(this, [target, duration, fps]);
// Script to execute
this._script = script;
}
$AA.ScriptAction.prototype = {
- ///
- /// Executes the script.
- ///
- ///
doAction: function() {
try {
eval(this._script);
@@ -2937,12 +2401,6 @@ $AA.ScriptAction.prototype = {
}
},
- ///
- /// JavaScript code to execute.
- ///
- ///get_script
- ///set_script
- ///
get_script: function() {
return this._script;
},
diff --git a/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js b/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js
index ab869326d..375e77736 100644
--- a/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/AsyncFileUpload.debug.js
@@ -38,9 +38,9 @@ Sys.Extended.UI.AsyncFileUpload = function(element) {
///
/// A name of the form.
///
- /// get_formName
- /// set_formName
- ///
+ /// get_postBackUrl
+ /// set_postBackUrl
+ ///
this._formName = "";
this._iframe = null;
this._waitTimer = null;
@@ -139,7 +139,13 @@ Sys.Extended.UI.AsyncFileUpload.prototype = {
set_postBackUrl: function(value) {
this._postBackUrl = value;
},
-
+
+ ///
+ /// Name of the form
+ ///
+ /// get_formName
+ /// set_formName
+ ///
get_formName: function() {
return this._formName;
},
@@ -373,7 +379,7 @@ Sys.Extended.UI.AsyncFileUpload.prototype = {
var mainForm = document.getElementById(this._formName);
this._removeTimer();
this.setThrobber(false);
- this._restoreFormTarget(mainForm);
+ mainForm.target = "_top";
mainForm.action = this._postBackUrl;
var length;
var contentType = "";
@@ -422,7 +428,7 @@ Sys.Extended.UI.AsyncFileUpload.prototype = {
var url = this._postBackUrl;
url += url.indexOf("?") === -1 ? "?" : "&";
mainForm.action = url + 'AsyncFileUploadID=' + this.get_element().id + '&rnd=' + Math.random().toString().replace(/\./g, "");
- this._changeFormTarget(mainForm);
+ mainForm.target = this._iframeName;
cleanup = false;
this.setThrobber(true);
setTimeout(function() {
@@ -485,7 +491,7 @@ Sys.Extended.UI.AsyncFileUpload.prototype = {
}
this._removeTimer();
- this._restoreFormTarget(mainForm);
+ mainForm.target = "_top";
mainForm.action = this._postBackUrl;
if(this.get_completeBackColor() != "") {
if(this._innerTB != null) {
@@ -500,7 +506,7 @@ Sys.Extended.UI.AsyncFileUpload.prototype = {
}
catch(ex) {
this._removeTimer();
- this._restoreFormTarget(mainForm);
+ mainForm.target = "_top";
mainForm.action = this._postBackUrl;
this._onError(ex.message);
}
@@ -526,16 +532,6 @@ Sys.Extended.UI.AsyncFileUpload.prototype = {
setTimeout(function() { uploader._onError(Sys.Extended.UI.Resources.AsyncFileUpload_UploadingProblem); }, 0);
this._waitTimer = null;
}
- },
-
- _changeFormTarget: function(form) {
- this._mainFormOldTarget = form.target;
- form.target = this._iframeName;
- },
-
- _restoreFormTarget: function(form) {
- form.target = this._mainFormOldTarget;
- this._mainFormOldTarget = undefined;
}
}
diff --git a/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js b/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js
index c60fd7621..3900ad450 100644
--- a/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/AutoComplete.debug.js
@@ -99,7 +99,6 @@ Sys.Extended.UI.AutoCompleteBehavior = function(element) {
this._focusHandler = null;
this._blurHandler = null;
this._bodyClickHandler = null;
- this._clickHandler = null;
this._completionListBlurHandler = null;
this._keyDownHandler = null;
this._mouseDownHandler = null;
@@ -189,7 +188,6 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
this._mouseOverHandler = Function.createDelegate(this, this._onListMouseOver);
this._completionListBlurHandler = Function.createDelegate(this, this._onCompletionListBlur);
this._bodyClickHandler = Function.createDelegate(this, this._onCompletionListBlur);
- this._clickHandler = Function.createDelegate(this, this._onInputClick);
this._timer = new Sys.Timer();
@@ -246,7 +244,6 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
$removeHandler(element, "focus", this._focusHandler);
$removeHandler(element, "blur", this._blurHandler);
$removeHandler(element, "keydown", this._keyDownHandler);
- $removeHandler(element, "click", this._clickHandler);
$removeHandler(this._completionListElement, 'blur', this._completionListBlurHandler);
$removeHandler(this._completionListElement, 'mousedown', this._mouseDownHandler);
$removeHandler(this._completionListElement, 'mouseup', this._mouseUpHandler);
@@ -261,7 +258,6 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
this._tickHandler = null;
this._focusHandler = null;
this._blurHandler = null;
- this._clickHandler = null;
this._keyDownHandler = null;
this._completionListBlurHandler = null;
this._mouseDownHandler = null;
@@ -281,7 +277,6 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
$addHandler(element, "focus", this._focusHandler);
$addHandler(element, "blur", this._blurHandler);
$addHandler(element, "keydown", this._keyDownHandler);
- $addHandler(element, "click", this._clickHandler);
},
initializeCompletionList: function(element) {
@@ -312,16 +307,6 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
$addHandler(document.body, 'click', this._bodyClickHandler);
},
- _onInputClick: function(e) {
- if(!e)
- e = window.event;
-
- if(e.stopPropagation)
- e.stopPropagation();
- else
- e.cancelBubble = true;
- },
-
_currentCompletionWord: function() {
var element = this.get_element();
var elementValue = element.value;
@@ -723,10 +708,7 @@ Sys.Extended.UI.AutoCompleteBehavior.prototype = {
} else {
element.value = newText;
}
-
- // In Chrome and Firefox, this event is triggered automatically
- if ($common.isMsBrowser() || $common.isAppleBrowser())
- $common.tryFireEvent(element, "change");
+ $common.tryFireEvent(element, "change");
this.raise_itemSelected(new Sys.Extended.UI.AutoCompleteItemEventArgs(item, text, item ? item._value : null));
@@ -1299,4 +1281,4 @@ Sys.Extended.UI.AutoCompleteItemEventArgs.prototype = {
this._value = value;
}
}
-Sys.Extended.UI.AutoCompleteItemEventArgs.registerClass('Sys.Extended.UI.AutoCompleteItemEventArgs', Sys.EventArgs);
+Sys.Extended.UI.AutoCompleteItemEventArgs.registerClass('Sys.Extended.UI.AutoCompleteItemEventArgs', Sys.EventArgs);
\ No newline at end of file
diff --git a/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js b/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js
index e88a24867..e157ebc43 100644
--- a/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/BalloonPopup.debug.js
@@ -534,8 +534,7 @@ Sys.Extended.UI.BalloonPopupControlBehavior.prototype = {
do {
_elementLeftPosition += e.offsetLeft;
_elementTopPosition += e.offsetTop;
- e = e.offsetParent;
- } while(e);
+ } while(e = e.offsetParent);
}
var _pageTopPosition = this.posTop();
diff --git a/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js b/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js
index b161bb255..8bd19de5c 100644
--- a/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/BarChart.debug.js
@@ -2,6 +2,9 @@
Sys.Extended.UI.BarChart = function(element) {
Sys.Extended.UI.BarChart.initializeBase(this, [element]);
+ var id = this.get_id();
+ id = id.replace("_ctl00", "");
+ this._parentDiv = document.getElementById(id + "__ParentDiv");
this._chartWidth = '300';
this._chartHeight = '200';
@@ -15,7 +18,6 @@ Sys.Extended.UI.BarChart = function(element) {
this._valueAxisLineColor = '';
this._categoryAxisLineColor = '';
this._baseLineColor = '';
- this._container = null;
// variables
this.yMax = 0;
@@ -49,8 +51,6 @@ Sys.Extended.UI.BarChart.prototype = {
if(this._valueAxisLines == 0) {
this._valueAxisLines = 9;
}
-
- this._parentDiv = this.get_container();
if(this._chartType == Sys.Extended.UI.BarChartType.Column || this._chartType == Sys.Extended.UI.BarChartType.StackedColumn)
this.generateColumnChart();
@@ -349,7 +349,9 @@ Sys.Extended.UI.BarChart.prototype = {
svgContents = svgContents + '';
svgContents = svgContents + '';
- svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight);
+ svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10);
+ svgContents = svgContents + String.format('', this._chartWidth, this._chartHeight);
+ svgContents = svgContents + String.format('', parseInt(this._chartHeight) * 1 / 10 + 5, parseInt(this._chartWidth) - 5, parseInt(this._chartHeight) - parseInt(this._chartHeight) * 1 / 10);
return svgContents;
},
@@ -838,14 +840,7 @@ Sys.Extended.UI.BarChart.prototype = {
},
set_baseLineColor: function(value) {
this._baseLineColor = value;
- },
-
- get_container: function () {
- return this._container;
- },
- set_container: function (value) {
- this._container = value;
- },
+ }
};
Sys.Extended.UI.BarChart.registerClass("Sys.Extended.UI.BarChart", Sys.Extended.UI.ControlBase);
diff --git a/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js b/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js
index abb5cd852..1f6ca2ba1 100644
--- a/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/BaseScripts.debug.js
@@ -306,24 +306,15 @@ Sys.Extended.UI.ControlBase = function(element) {
this._onerror$delegate = Function.createDelegate(this, this._onerror);
}
-Sys.Extended.UI.ControlBase._execOnSubmitCollection = function() {
+Sys.Extended.UI.ControlBase.__doPostBack = function(eventTarget, eventArgument) {
if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
for (var i = 0; i < Sys.Extended.UI.ControlBase.onsubmitCollection.length; i++) {
Sys.Extended.UI.ControlBase.onsubmitCollection[i]();
}
}
-}
-
-Sys.Extended.UI.ControlBase.__doPostBack = function(eventTarget, eventArgument) {
- Sys.Extended.UI.ControlBase._execOnSubmitCollection();
Function.createDelegate(window, Sys.Extended.UI.ControlBase.__doPostBackSaved)(eventTarget, eventArgument);
}
-Sys.Extended.UI.ControlBase.__doPostBackWithOptions = function(options) {
- Sys.Extended.UI.ControlBase._execOnSubmitCollection();
- Sys.Extended.UI.ControlBase.__doPostBackWithOptionsSaved(options);
-}
-
Sys.Extended.UI.ControlBase.prototype = {
initialize: function() {
Sys.Extended.UI.ControlBase.callBaseMethod(this, "initialize");
@@ -337,10 +328,6 @@ Sys.Extended.UI.ControlBase.prototype = {
window.__doPostBack = Sys.Extended.UI.ControlBase.__doPostBack;
Sys.Extended.UI.ControlBase.onsubmitCollection = new Array();
}
- if (!Sys.Extended.UI.ControlBase.__doPostBackWithOptionsSaved) {
- Sys.Extended.UI.ControlBase.__doPostBackWithOptionsSaved = window.WebForm_DoPostBackWithOptions;
- window.WebForm_DoPostBackWithOptions = Sys.Extended.UI.ControlBase.__doPostBackWithOptions;
- }
Array.add(Sys.Extended.UI.ControlBase.onsubmitCollection, this._onsubmit$delegate);
} else {
$addHandler(document.forms[0], "submit", this._onsubmit$delegate);
@@ -413,14 +400,4 @@ Sys.Extended.UI.ControlBase.prototype = {
}
}
-Sys.Extended.UI.ControlBase.registerClass("Sys.Extended.UI.ControlBase", Sys.UI.Control);
-
-var isUnminified = /param/.test(function(param) { });
-
-Sys.Extended.Deprecated = function(oldMethodName, properMethodName) {
- if(isUnminified && window.console && console.warn)
- if(arguments.length == 1)
- console.warn(oldMethodName + " is deprecated.");
- else
- console.warn(oldMethodName + " is deprecated. Use " + properMethodName + " instead.");
-}
\ No newline at end of file
+Sys.Extended.UI.ControlBase.registerClass("Sys.Extended.UI.ControlBase", Sys.UI.Control);
\ No newline at end of file
diff --git a/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js b/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js
index 458e3727c..16fbe4515 100644
--- a/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/Calendar.debug.js
@@ -264,7 +264,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
set_startDate: function(value) {
// The property of the start date for range
if(this._startDate != value) {
- this._startDate = this._parseDateSortableFormat(value);
+ this._startDate = new Date(value);
this.raisePropertyChanged('startDate');
}
},
@@ -274,7 +274,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
},
set_endDate: function(value) {
if(this._endDate != value) {
- this._endDate = this._parseDateSortableFormat(value);
+ this._endDate = new Date(value);
this.raisePropertyChanged('endDate');
}
},
@@ -324,7 +324,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
},
set_selectedDate: function(value) {
if(value && (String.isInstanceOfType(value)) && (value.length != 0)) {
- value = this._parseDateSortableFormat(value);
+ value = Date.fromISO(value);
}
if(this._selectedDate != value) {
@@ -332,7 +332,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
this._selectedDateChanging = true;
var text = "";
if(value) {
- text = value.localeFormat(this._format);
+ text = this._convertToLocal(value).localeFormat(this._format);
// If we don't clear the time then we transfer the time from the
// textbox to the selected value
@@ -344,12 +344,12 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
if(tbvalue) {
if(value != tbvalue.getDateOnly()) {
// Transfer time from textbox to selected value
- value.setHours(tbvalue.getHours());
- value.setMinutes(tbvalue.getMinutes());
- value.setSeconds(tbvalue.getSeconds());
- value.setMilliseconds(tbvalue.getMilliseconds());
+ value.setUTCHours(tbvalue.getUTCHours());
+ value.setUTCMinutes(tbvalue.getUTCMinutes());
+ value.setUTCSeconds(tbvalue.getUTCSeconds());
+ value.setUTCMilliseconds(tbvalue.getUTCMilliseconds());
- text = value.localeFormat(this._format);
+ text = this._convertToLocal(value).localeFormat(this._format);
}
}
}
@@ -385,7 +385,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
if(this._visibleDate != value) {
- this._switchView(value, Sys.Extended.UI.CalendarSwitchViewMode.RangeZoom, !this._isOpen);
+ this._switchMonth(value, !this._isOpen);
this.raisePropertyChanged("visibleDate");
}
},
@@ -683,7 +683,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
this._popupBehavior.show();
if(this._firstPopUp) {
- this._switchView(null, Sys.Extended.UI.CalendarSwitchViewMode.RangeZoom, true);
+ this._switchMonth(null, true);
switch(this._defaultView) {
case Sys.Extended.UI.CalendarDefaultView.Months:
this._switchMode("months", true);
@@ -995,7 +995,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
},
- _isInDateRange: function(date, part, switchMode) {
+ _isInDateRange: function(date, part) {
switch(part) {
case "d":
if((this._startDate) && (this._getDateOnly(date) < this._getDateOnly(this._startDate))) { return false; }
@@ -1006,73 +1006,111 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
if((this._endDate) && (this._getMonthOnly(date) > this._getMonthOnly(this._endDate))) { return false; }
break;
case "y":
- if((this._startDate) && (date.getFullYear() < this._startDate.getFullYear())) { return false; }
- if((this._endDate) && (date.getFullYear() > this._endDate.getFullYear())) { return false; }
+ if((this._startDate) && (date.getUTCFullYear() < this._startDate.getUTCFullYear())) { return false; }
+ if((this._endDate) && (date.getUTCFullYear() > this._endDate.getUTCFullYear())) { return false; }
break;
case "yy":
- if(this._startDate && this._endDate) {
- return this._isInYearsDateRange(date, switchMode);
- } else {
- if(!this._startDate && !this._endDate)
- return true;
+ var startYear = date.getUTCFullYear();
+ var endYear = date.getUTCFullYear() + 9;
- var startYear = this._getRangeStartYear(date);
- if(this._endDate && startYear < this._endDate.getFullYear())
- return true;
-
- var endYear = this._getRangeEndYear(date);
- if (this._startDate && endYear > this._startDate.getFullYear())
+ if (this._startDate && this._endDate) {
+ if (startYear < this._startDate.getUTCFullYear()
+ &&
+ endYear > this._endDate.getUTCFullYear())
return true;
return false;
}
+ else {
+ if(!this._startDate && !this._endDate)
+ return true;
+
+ if (this._startDate && endYear > this._startDate.getUTCFullYear())
+ return true;
+
+ if (this._endDate && startYear < this._endDate.getUTCFullYear())
+ return true;
+
+ return false;
+ }
+
+ break;
+ }
+ return true;
+ },
+ _isInNextDateRange: function (date, part) {
+ switch (part) {
+ case "d":
+ if ((this._startDate) && (this._getDateOnly(date) > this._getDateOnly(this._startDate))) { return false; }
+ break;
+ case "M":
+ if ((this._startDate) && (this._getMonthOnly(date) > this._getMonthOnly(this._startDate))) { return false; }
+ break;
+ case "y":
+ if ((this._startDate) && (date.getUTCFullYear() > this._startDate.getUTCFullYear())) { return false; }
+ break;
+ case "yy":
+ var startYear = date.getUTCFullYear();
+ var endYear = date.getUTCFullYear();
+ if ((this._startDate) && (date.getUTCFullYear() > this._startDate.getUTCFullYear())) { return false; }
+ break;
+ }
+ return true;
+ },
+ _isInPrevDateRange: function (date, part) {
+ switch (part) {
+ case "d":
+ if ((this._endDate) && (this._getDateOnly(date) < this._getDateOnly(this._endDate))) { return false; }
+ break;
+ case "M":
+ if ((this._endDate) && (this._getMonthOnly(date) < this._getMonthOnly(this._endDate))) { return false; }
+ break;
+ case "y":
+ if ((this._endDate) && (date.getUTCFullYear() < this._endDate.getUTCFullYear())) { return false; }
+ break;
+ case "yy":
+ var startYear = date.getUTCFullYear();
+ var endYear = date.getUTCFullYear() + 9;
+
+ if (this._startDate || this._endDate)
+ {
+ if (startYear < this._startDate.getUTCFullYear()
+ &&
+ endYear > this._endDate.getUTCFullYear())
+ return true;
+ }
+
+ break;
}
return true;
},
- _isInYearsDateRange: function(date, switchMode) {
- var startYear = this._getRangeStartYear(date);
- var endYear = this._getRangeEndYear(date);
-
- switch(switchMode) {
- case Sys.Extended.UI.CalendarSwitchViewMode.PreviousRange:
- if(endYear > this._startDate.getFullYear())
- return true;
-
- return false;
-
- case Sys.Extended.UI.CalendarSwitchViewMode.NextRange:
- if(startYear < this._endDate.getFullYear())
- return true;
-
- return false;
-
- case Sys.Extended.UI.CalendarSwitchViewMode.RangeZoom:
- if(startYear > this._startDate.getFullYear()
- &&
- endYear < this._endDate.getFullYear())
- return true;
-
- return false;
- default:
- throw Error.invalidOperation();
- }
- },
-
- _getRangeStartYear: function(date) {
- return date.getFullYear();
- },
-
- _getRangeEndYear: function(date) {
- return date.getFullYear() + 9;
- },
-
_getDateOnly: function(date) {
- return new Date(date.getFullYear(), date.getMonth(), date.getDate());
+ return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));
},
_getMonthOnly: function(date) {
- return new Date(date.getFullYear(), date.getMonth(), 1);
+ return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));
+ },
+
+ _convertToUTC: function(value) {
+ // Converts a local date such as 1/1/2007 into 1/1/2007 GMT without adjusting for time zone
+ if(value) {
+ value = new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
+ }
+ return value;
+ },
+
+ _convertToLocal: function(value) {
+ // Converts a UTC date such as 1/1/2007 GMT into 1/1/2007 without adjusting for time zone
+
+ var result = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours(), value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
+
+ // Handle daylight savings time offset (The first hour of September 25 becomes the last hour of September 24 when DST starts)
+ if(result.getDate() != value.getUTCDate()) {
+ result = new Date(value.getUTCFullYear(), value.getUTCMonth(), value.getUTCDate(), value.getUTCHours() + 1, value.getUTCMinutes(), value.getUTCSeconds(), value.getUTCMilliseconds());
+ }
+ return result;
},
_performLayout: function() {
@@ -1091,12 +1129,12 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
case "days":
var firstDayOfWeek = this._getFirstDayOfWeek();
- var daysToBacktrack = visibleDate.getDay() - firstDayOfWeek;
+ var daysToBacktrack = visibleDate.getUTCDay() - firstDayOfWeek;
if(daysToBacktrack <= 0)
daysToBacktrack += 7;
var startDate = new Date(visibleDate);
- startDate.setDate(startDate.getDate() - daysToBacktrack);
+ startDate.setUTCDate(startDate.getUTCDate() - daysToBacktrack);
var currentDate = new Date(startDate);
for(var i = 0; i < 7; i++) {
@@ -1113,8 +1151,8 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
if(dayCell.firstChild) {
dayCell.removeChild(dayCell.firstChild);
}
- dayCell.appendChild(document.createTextNode(currentDate.getDate()));
- dayCell.title = currentDate.localeFormat("D");
+ dayCell.appendChild(document.createTextNode(currentDate.getUTCDate()));
+ dayCell.title = this._convertToLocal(currentDate).localeFormat("D");
dayCell.date = currentDate;
$common.removeCssClasses(dayCell.parentNode, ["ajax__calendar_other", "ajax__calendar_active", "ajax__calendar_today"]);
@@ -1127,17 +1165,17 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
currentDate = new Date(currentDate);
- currentDate.setDate(currentDate.getDate() + 1);
+ currentDate.setUTCDate(currentDate.getUTCDate() + 1);
}
}
- this._prevArrow.date = new Date(visibleDate.getFullYear(), visibleDate.getMonth() - 1, 1);
- this._nextArrow.date = new Date(visibleDate.getFullYear(), visibleDate.getMonth() + 1, 1);
+ this._prevArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear(), visibleDate.getUTCMonth() - 1, 1));
+ this._nextArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear(), visibleDate.getUTCMonth() + 1, 1));
if(this._title.firstChild) {
this._title.removeChild(this._title.firstChild);
}
- this._title.appendChild(document.createTextNode(visibleDate.localeFormat(this.get_daysModeTitleFormat())));
+ this._title.appendChild(document.createTextNode(this._convertToLocal(visibleDate).localeFormat(this.get_daysModeTitleFormat())));
this._title.date = visibleDate;
break;
@@ -1146,8 +1184,8 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
var row = this._monthsBody.rows[i];
for(var j = 0; j < row.cells.length; j++) {
var cell = row.cells[j].firstChild;
- cell.date = new Date(visibleDate.getFullYear(), cell.month, 1);
- cell.title = cell.date.localeFormat("Y");
+ cell.date = new Date(Date.UTC(visibleDate.getUTCFullYear(), cell.month, 1));
+ cell.title = this._convertToLocal(cell.date).localeFormat("Y");
if(!this._isInDateRange(cell.date, "M")) {
$common.removeCssClasses(cell.parentNode, ["ajax__calendar_other", "ajax__calendar_active"]);
@@ -1165,20 +1203,20 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
this._title.removeChild(this._title.firstChild);
}
- this._title.appendChild(document.createTextNode(visibleDate.localeFormat("yyyy")));
+ this._title.appendChild(document.createTextNode(this._convertToLocal(visibleDate).localeFormat("yyyy")));
this._title.date = visibleDate;
- this._prevArrow.date = new Date(visibleDate.getFullYear() - 1, 0, 1);
- this._nextArrow.date = new Date(visibleDate.getFullYear() + 1, 0, 1);
+ this._prevArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear() - 1, 0, 1));
+ this._nextArrow.date = new Date(Date.UTC(visibleDate.getUTCFullYear() + 1, 0, 1));
break;
case "years":
- var minYear = (Math.floor(visibleDate.getFullYear() / 10) * 10);
+ var minYear = (Math.floor(visibleDate.getUTCFullYear() / 10) * 10);
for(var i = 0; i < this._yearsBody.rows.length; i++) {
var row = this._yearsBody.rows[i];
for(var j = 0; j < row.cells.length; j++) {
var cell = row.cells[j].firstChild;
- cell.date = new Date(minYear + cell.year, 0, 1);
+ cell.date = new Date(Date.UTC(minYear + cell.year, 0, 1));
if(cell.firstChild) {
cell.removeChild(cell.lastChild);
} else {
@@ -1203,8 +1241,8 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
this._title.appendChild(document.createTextNode(minYear.toString() + "-" + (minYear + 9).toString()));
this._title.date = visibleDate;
- this._prevArrow.date = new Date(minYear - 10, 0, 1);
- this._nextArrow.date = new Date(minYear + 10, 0, 1);
+ this._prevArrow.date = new Date(Date.UTC(minYear - 10, 0, 1));
+ this._nextArrow.date = new Date(Date.UTC(minYear + 10, 0, 1));
break;
}
@@ -1218,7 +1256,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
Sys.UI.DomElement.addCssClass(this._today.parentNode, "ajax__calendar_invalid");
}
- this._today.date = todaysDate;
+ this._today.date = this._convertToUTC(todaysDate);
},
_ensureCalendar: function() {
@@ -1261,7 +1299,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
elt.dispatchEvent(e);
}
},
- _switchView: function(date, switchMode, dontAnimate) {
+ _switchMonth: function(date, dontAnimate) {
// Switches the visible month in the days view
// param name "date" of type "Date" is the visible date to switch to
// param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated
@@ -1272,7 +1310,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
// Check if can switch month depending on the startDate and endDAte
- if(date && !this._canSwitchMonth(date, switchMode)) {
+ if(date && !this._canSwitchMonth(date)) {
return;
}
@@ -1282,96 +1320,219 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
if(this._animated && !dontAnimate) {
- this._animateViewSwitch(date, visibleDate);
+ this._isAnimating = true;
+
+ var newElement = this._modes[this._mode];
+ var oldElement = newElement.cloneNode(true);
+ this._body.appendChild(oldElement);
+ if(visibleDate > date) {
+
+ // animating down
+ // the newIndex element is the top
+ // the oldIndex element is the bottom (visible)
+
+ // move in, fade in
+ $common.setLocation(newElement, { x: -162, y: 0 });
+ $common.setVisible(newElement, true);
+ this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
+ this._modeChangeMoveTopOrLeftAnimation.set_target(newElement);
+ this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width);
+ this._modeChangeMoveTopOrLeftAnimation.set_endValue(0);
+
+ // move out, fade out
+ $common.setLocation(oldElement, { x: 0, y: 0 });
+ $common.setVisible(oldElement, true);
+ this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
+ this._modeChangeMoveBottomOrRightAnimation.set_target(oldElement);
+ this._modeChangeMoveBottomOrRightAnimation.set_startValue(0);
+ this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width);
+
+ } else {
+ // animating up
+ // the oldIndex element is the top (visible)
+ // the newIndex element is the bottom
+
+ // move out, fade out
+ $common.setLocation(oldElement, { x: 0, y: 0 });
+ $common.setVisible(oldElement, true);
+ this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
+ this._modeChangeMoveTopOrLeftAnimation.set_target(oldElement);
+ this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width);
+ this._modeChangeMoveTopOrLeftAnimation.set_startValue(0);
+
+ // move in, fade in
+ $common.setLocation(newElement, { x: 162, y: 0 });
+ $common.setVisible(newElement, true);
+ this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
+ this._modeChangeMoveBottomOrRightAnimation.set_target(newElement);
+ this._modeChangeMoveBottomOrRightAnimation.set_endValue(0);
+ this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width);
+ }
+ this._visibleDate = date;
+ this.invalidate();
+
+ var endHandler = Function.createDelegate(this, function() {
+ this._body.removeChild(oldElement);
+ oldElement = null;
+ this._isAnimating = false;
+ this._modeChangeAnimation.remove_ended(endHandler);
+ });
+ this._modeChangeAnimation.add_ended(endHandler);
+ this._modeChangeAnimation.play();
} else {
this._visibleDate = date;
this.invalidate();
}
},
+ _switchNextRange: function(date, dontAnimate) {
+ // Switches the visible month in the days view
+ // param name "date" of type "Date" is the visible date to switch to
+ // param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated
- _animateViewSwitch: function(date, visibleDate) {
- this._isAnimating = true;
-
- var newElement = this._modes[this._mode];
- var oldElement = newElement.cloneNode(true);
- this._body.appendChild(oldElement);
- if(visibleDate > date) {
-
- // animating down
- // the newIndex element is the top
- // the oldIndex element is the bottom (visible)
-
- // move in, fade in
- $common.setLocation(newElement, { x: -162, y: 0 });
- $common.setVisible(newElement, true);
- this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
- this._modeChangeMoveTopOrLeftAnimation.set_target(newElement);
- this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width);
- this._modeChangeMoveTopOrLeftAnimation.set_endValue(0);
-
- // move out, fade out
- $common.setLocation(oldElement, { x: 0, y: 0 });
- $common.setVisible(oldElement, true);
- this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
- this._modeChangeMoveBottomOrRightAnimation.set_target(oldElement);
- this._modeChangeMoveBottomOrRightAnimation.set_startValue(0);
- this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width);
-
- } else {
- // animating up
- // the oldIndex element is the top (visible)
- // the newIndex element is the bottom
-
- // move out, fade out
- $common.setLocation(oldElement, { x: 0, y: 0 });
- $common.setVisible(oldElement, true);
- this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
- this._modeChangeMoveTopOrLeftAnimation.set_target(oldElement);
- this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width);
- this._modeChangeMoveTopOrLeftAnimation.set_startValue(0);
-
- // move in, fade in
- $common.setLocation(newElement, { x: 162, y: 0 });
- $common.setVisible(newElement, true);
- this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
- this._modeChangeMoveBottomOrRightAnimation.set_target(newElement);
- this._modeChangeMoveBottomOrRightAnimation.set_endValue(0);
- this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width);
+ // Check _isAnimating to make sure we don't animate horizontally and vertically at the same time
+ if(this._isAnimating) {
+ return;
}
- this._visibleDate = date;
- this.invalidate();
- var endHandler = Function.createDelegate(this, function() {
- this._body.removeChild(oldElement);
- oldElement = null;
- this._isAnimating = false;
- this._modeChangeAnimation.remove_ended(endHandler);
- });
- this._modeChangeAnimation.add_ended(endHandler);
- this._modeChangeAnimation.play();
+ // Check if can switch month depending on the startDate and endDAte
+ if(date && !this._canSwitchNextRange(date)) {
+ return;
+ }
+
+ this._switchRange(date, dontAnimate);
},
+ _switchPrevRange: function (date, dontAnimate) {
+ // Switches the visible month in the days view
+ // param name "date" of type "Date" is the visible date to switch to
+ // param name "dontAnimate" of type "Boolean" prevents animation from occuring if the control is animated
- _canSwitchMonth: function(date, switchMode) {
+ // Check _isAnimating to make sure we don't animate horizontally and vertically at the same time
+ if (this._isAnimating) {
+ return;
+ }
+
+ // Check if can switch month depending on the startDate and endDAte
+ if (date && !this._canSwitchPrevRange(date)) {
+ return;
+ }
+
+ this._switchRange(date, dontAnimate);
+ },
+ _switchRange: function (date, dontAnimate)
+ {
+ var visibleDate = this._getEffectiveVisibleDate();
+ if((date && date.getFullYear() == visibleDate.getFullYear() && date.getMonth() == visibleDate.getMonth())) {
+ dontAnimate = true;
+ }
+
+ if(this._animated && !dontAnimate) {
+ this._isAnimating = true;
+
+ var newElement = this._modes[this._mode];
+ var oldElement = newElement.cloneNode(true);
+ this._body.appendChild(oldElement);
+ if(visibleDate > date) {
+
+ // animating down
+ // the newIndex element is the top
+ // the oldIndex element is the bottom (visible)
+
+ // move in, fade in
+ $common.setLocation(newElement, { x: -162, y: 0 });
+ $common.setVisible(newElement, true);
+ this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
+ this._modeChangeMoveTopOrLeftAnimation.set_target(newElement);
+ this._modeChangeMoveTopOrLeftAnimation.set_startValue(-this._width);
+ this._modeChangeMoveTopOrLeftAnimation.set_endValue(0);
+
+ // move out, fade out
+ $common.setLocation(oldElement, { x: 0, y: 0 });
+ $common.setVisible(oldElement, true);
+ this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
+ this._modeChangeMoveBottomOrRightAnimation.set_target(oldElement);
+ this._modeChangeMoveBottomOrRightAnimation.set_startValue(0);
+ this._modeChangeMoveBottomOrRightAnimation.set_endValue(this._width);
+
+ } else {
+ // animating up
+ // the oldIndex element is the top (visible)
+ // the newIndex element is the bottom
+
+ // move out, fade out
+ $common.setLocation(oldElement, { x: 0, y: 0 });
+ $common.setVisible(oldElement, true);
+ this._modeChangeMoveTopOrLeftAnimation.set_propertyKey("left");
+ this._modeChangeMoveTopOrLeftAnimation.set_target(oldElement);
+ this._modeChangeMoveTopOrLeftAnimation.set_endValue(-this._width);
+ this._modeChangeMoveTopOrLeftAnimation.set_startValue(0);
+
+ // move in, fade in
+ $common.setLocation(newElement, { x: 162, y: 0 });
+ $common.setVisible(newElement, true);
+ this._modeChangeMoveBottomOrRightAnimation.set_propertyKey("left");
+ this._modeChangeMoveBottomOrRightAnimation.set_target(newElement);
+ this._modeChangeMoveBottomOrRightAnimation.set_endValue(0);
+ this._modeChangeMoveBottomOrRightAnimation.set_startValue(this._width);
+ }
+ this._visibleDate = date;
+ this.invalidate();
+
+ var endHandler = Function.createDelegate(this, function() {
+ this._body.removeChild(oldElement);
+ oldElement = null;
+ this._isAnimating = false;
+ this._modeChangeAnimation.remove_ended(endHandler);
+ });
+ this._modeChangeAnimation.add_ended(endHandler);
+ this._modeChangeAnimation.play();
+ } else {
+ this._visibleDate = date;
+ this.invalidate();
+ }
+ },
+
+
+ _canSwitchMonth: function(date) {
switch(this._mode) {
case "days":
- if(!this._isInDateRange(date, "M", switchMode)) {
+ if(!this._isInDateRange(date, "M")) {
return false;
}
break;
case "months":
- if(!this._isInDateRange(date, "y", switchMode)) {
+ if(!this._isInDateRange(date, "y")) {
return false;
}
break;
case "years":
- if(!this._isInDateRange(date, "yy", switchMode)) {
+ if(!this._isInDateRange(date, "yy")) {
return false;
}
break;
}
return true;
- },
-
+ },
+ _canSwitchNextRange: function (date) {
+ switch (this._mode) {
+ case "days":
+ return this._isInNextDateRange(date, "M");
+ case "months":
+ return this._isInNextDateRange(date, "y");
+ case "years":
+ return this._isInNextDateRange(date, "yy");
+ }
+ },
+ _canSwitchPrevRange: function (date) {
+ switch (this._mode) {
+ case "days":
+ return this._isInPrevDateRange(date, "M");
+ case "months":
+ return this._isInPrevDateRange(date, "y");
+ case "years":
+ return this._isInPrevDateRange(date, "yy");
+ }
+ },
+
_switchMode: function(mode, dontAnimate) {
// Switches the visible view from "days" to "months" to "years"
// param name "mode" of type "String" is the view mode to switch to
@@ -1458,13 +1619,13 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
if(!value) return false;
switch(part) {
case 'd':
- if(date.getDate() != value.getDate()) return false;
+ if(date.getUTCDate() != value.getUTCDate()) return false;
// goto case 'M';
case 'M':
- if(date.getMonth() != value.getMonth()) return false;
+ if(date.getUTCMonth() != value.getUTCMonth()) return false;
// goto case 'y';
case 'y':
- if(date.getFullYear() != value.getFullYear()) return false;
+ if(date.getUTCFullYear() != value.getUTCFullYear()) return false;
break;
}
return true;
@@ -1478,18 +1639,18 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
var value = this._getEffectiveVisibleDate();
switch(part) {
case 'd':
- return (date.getFullYear() != value.getFullYear() || date.getMonth() != value.getMonth());
+ return (date.getUTCFullYear() != value.getUTCFullYear() || date.getUTCMonth() != value.getUTCMonth());
case 'M':
return false;
case 'y':
- var minYear = (Math.floor(value.getFullYear() / 10) * 10);
- return date.getFullYear() < minYear || (minYear + 10) <= date.getFullYear();
+ var minYear = (Math.floor(value.getUTCFullYear() / 10) * 10);
+ return date.getUTCFullYear() < minYear || (minYear + 10) <= date.getUTCFullYear();
}
return false;
},
_isTodaysDate: function(date) {
- return this._getDateOnly(this.get_todaysDate()).valueOf() === this._getDateOnly(date).valueOf();
+ return this._getDateOnly(this._convertToUTC(this.get_todaysDate())).valueOf() === this._getDateOnly(date).valueOf();
},
_getCssClass: function(date, part) {
@@ -1515,23 +1676,12 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
if(value == null)
value = this.get_todaysDate();
- if (this._endDate && value > this._endDate)
- value = this._endDate;
- else if (this._startDate && value < this._startDate)
- value = this._startDate;
-
value = new Date(value);
- value.setDate(1);
+ value.setUTCDate(1);
return this._getDateOnly(value);
},
- getMonthStartDate: function(date)
- {
- var value = new Date(date);
- value.setDate(1);
- return this._getDateOnly(value);
- },
_getFirstDayOfWeek: function() {
// Gets the first day of the week
@@ -1546,9 +1696,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
var value = null;
if(text) {
- value = Date.parseLocale(text, this.get_format());
- if(value && value.getFullYear() < 100)
- value.setYear(value.getFullYear());
+ value = this._convertToUTC(Date.parseLocale(text, this.get_format()));
}
if(isNaN(value)) {
value = null;
@@ -1578,7 +1726,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
var value = this._parseTextValue(this._textbox.get_Value());
this._selectedDate = value;
if(this._isOpen) {
- this._switchView(this._selectedDate, Sys.Extended.UI.CalendarSwitchViewMode.RangeZoom, this._selectedDate == null);
+ this._switchMonth(this._selectedDate, this._selectedDate == null);
}
}
},
@@ -1669,10 +1817,10 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
Sys.UI.DomElement.removeCssClass(target.parentNode, "ajax__calendar_hover");
switch(target.mode) {
case "prev":
- this._switchView(target.date, Sys.Extended.UI.CalendarSwitchViewMode.PreviousRange);
+ this._switchMonth(target.date);
break;
case "next":
- this._switchView(target.date, Sys.Extended.UI.CalendarSwitchViewMode.NextRange);
+ this._switchMonth(target.date);
break;
case "title":
switch(this._mode) {
@@ -1681,7 +1829,7 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
break;
case "month":
- if(target.month == visibleDate.getMonth()) {
+ if(target.month == visibleDate.getUTCMonth()) {
this._switchMode("days");
} else {
this._visibleDate = target.date;
@@ -1698,13 +1846,13 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
break;
case "day":
this.set_selectedDate(target.date);
- this._switchView(target.date, Sys.Extended.UI.CalendarSwitchViewMode.RangeZoom);
+ this._switchMonth(target.date);
this._blur.post(true);
this.raise_dateSelectionChanged();
break;
case "today":
this.set_selectedDate(target.date);
- this._switchView(target.date, Sys.Extended.UI.CalendarSwitchViewMode.RangeZoom);
+ this._switchMonth(target.date);
this._blur.post(true);
this.raise_dateSelectionChanged();
break;
@@ -1753,38 +1901,31 @@ Sys.Extended.UI.CalendarBehavior.prototype = {
}
// make sure we clean up the flag due to issues with alert/alt-tab/etc
this._popupMouseDown = false;
- },
- _parseDateSortableFormat: function (dateString) {
- var dateParts = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.?(\d{0,7})?/.exec(dateString);
-
- return new Date(
- dateParts[1],
- dateParts[2] - 1,
- dateParts[3],
- dateParts[4],
- dateParts[5],
- dateParts[6]);
}
}
Sys.Extended.UI.CalendarBehavior.registerClass("Sys.Extended.UI.CalendarBehavior", Sys.Extended.UI.BehaviorBase);
-Sys.Extended.UI.CalendarPosition = {
+Sys.Extended.UI.CalendarPosition = function() {
+ // Position of the popup relative to the target control
+ throw Error.invalidOperation();
+}
+Sys.Extended.UI.CalendarPosition.prototype = {
BottomLeft: 0,
BottomRight: 1,
TopLeft: 2,
TopRight: 3,
Right: 4,
Left: 5
-};
+}
+Sys.Extended.UI.CalendarPosition.registerEnum('Sys.Extended.UI.CalendarPosition');
-Sys.Extended.UI.CalendarDefaultView = {
+Sys.Extended.UI.CalendarDefaultView = function() {
+ // Choices for default view of the calendar when it first pops up.
+ throw Error.invalidOperation();
+}
+Sys.Extended.UI.CalendarDefaultView.prototype = {
Days: 0,
Months: 1,
Years: 2
-};
-
-Sys.Extended.UI.CalendarSwitchViewMode = {
- PreviousRange: 0,
- NextRange: 1,
- RangeZoom: 2
-};
\ No newline at end of file
+}
+Sys.Extended.UI.CalendarDefaultView.registerEnum('Sys.Extended.UI.CalendarDefaultView');
\ No newline at end of file
diff --git a/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js b/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js
index 6f7c53f9f..535794e94 100644
--- a/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/CascadingDropDown.debug.js
@@ -129,14 +129,6 @@ Sys.Extended.UI.CascadingDropDownBehavior = function(e) {
///
this._enableAtLoading = false;
- ///
- /// Always clear selected item when parent value changes.
- ///
- /// get_clearSelectedItemOnParentChange
- /// set_clearSelectedItemOnParentChange
- ///
- this._clearSelectedItemOnParentChange = false;
-
// Variables
this._parentElement = null;
this._changeHandler = null;
@@ -337,7 +329,7 @@ Sys.Extended.UI.CascadingDropDownBehavior.prototype = {
}
}
else {
- if(list && (Sys.Browser.agent !== Sys.Browser.Firefox) && (Sys.Browser.agent !== Sys.Browser.Safari) && (Sys.Browser.agent !== Sys.Browser.Opera)) {
+ if(list && (Sys.Browser.agent !== Sys.Browser.Safari) && (Sys.Browser.agent !== Sys.Browser.Opera)) {
// Fire the onchange event for the control to notify any listeners of the change
if(document.createEvent) {
var onchangeEvent = document.createEvent('HTMLEvents');
@@ -380,9 +372,6 @@ Sys.Extended.UI.CascadingDropDownBehavior.prototype = {
// "evt" - set by the browser when called as an event handler (unused here)
// "inInit" - whether this is being called from the initialize method
- if(this.get_clearSelectedItemOnParentChange())
- this.set_selectedValue('', '');
-
var e = this.get_element();
// Create the known category/value pairs string for sending to the helper web service
@@ -726,16 +715,6 @@ Sys.Extended.UI.CascadingDropDownBehavior.prototype = {
}
},
- get_clearSelectedItemOnParentChange: function() {
- return this._clearSelectedItemOnParentChange;
- },
- set_clearSelectedItemOnParentChange: function(value) {
- if(this._clearSelectedItemOnParentChange != value) {
- this._clearSelectedItemOnParentChange = value;
- this.raisePropertyChanged('clearSelectedItemOnParentChange');
- }
- },
-
///
/// Fires when selection is changed.
///
diff --git a/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js b/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js
index 64d6a400e..dc31f1871 100644
--- a/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/CollapsiblePanel.debug.js
@@ -171,7 +171,7 @@ Sys.Extended.UI.CollapsiblePanelBehavior.prototype = {
},
///
- /// Event handler to expand or collapse the panel (based on its current state)
+ /// Event handler to epxand or collapse the panel (based on its current state)
/// This is the public function that should be called instead of _toggle if
/// you wish to programmatically open and close the collapsible panel
///
diff --git a/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js b/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js
index 537f02105..988191261 100644
--- a/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/ColorPicker.debug.js
@@ -9,7 +9,6 @@ Sys.Extended.UI.ColorPickerBehavior = function(element) {
this._sample = null;
this._cssClass = "ajax__colorPicker";
this._popupPosition = Sys.Extended.UI.PositioningMode.BottomLeft;
- this._paletteStyle = Sys.Extended.UI.ColorPickerPaletteStyle.Default;
this._selectedColor = null;
this._enabled = true;
@@ -224,23 +223,6 @@ Sys.Extended.UI.ColorPickerBehavior.prototype = {
}
},
- ///
- /// The Sys.Extended.UI.PaletteStyle object that represents which color palette is used.
- /// The default is Default.
- ///
- /// get_paletteStyle
- /// set_paletteStyle
- ///
- get_paletteStyle: function () {
- return this._paletteStyle;
- },
- set_paletteStyle: function (value) {
- if (this._paletteStyle !== value) {
- this._paletteStyle = value;
- this.raisePropertyChanged('paletteStyle');
- }
- },
-
///
/// Fires when color selection is changed.
///
@@ -361,14 +343,14 @@ Sys.Extended.UI.ColorPickerBehavior.prototype = {
if (!this._isOpen) {
var eventArgs = new Sys.CancelEventArgs();
- this.raise_showing(eventArgs);
+ this.raiseShowing(eventArgs);
if (eventArgs.get_cancel()) {
return;
}
this._isOpen = true;
this._popupBehavior.show();
- this.raise_shown();
+ this.raiseShown();
}
},
@@ -379,7 +361,7 @@ Sys.Extended.UI.ColorPickerBehavior.prototype = {
hide: function() {
if (this._isOpen) {
var eventArgs = new Sys.CancelEventArgs();
- this.raise_hiding(eventArgs);
+ this.raiseHiding(eventArgs);
if (eventArgs.get_cancel()) {
return;
}
@@ -388,7 +370,7 @@ Sys.Extended.UI.ColorPickerBehavior.prototype = {
this._popupBehavior.hide();
}
this._isOpen = false;
- this.raise_hidden();
+ this.raiseHidden();
// make sure we clean up the flag due to issues with alert/alt-tab/etc
this._popupMouseDown = false;
@@ -452,76 +434,34 @@ Sys.Extended.UI.ColorPickerBehavior.prototype = {
properties: { id: id + "_colorsBody" }
}, this._colorsTable);
- switch (this._paletteStyle) {
- case Sys.Extended.UI.ColorPickerPaletteStyle.Default:
- var rgb = ['00', '99', '33', '66', 'FF', 'CC'], color, cssColor;
- var l = rgb.length;
+ var rgb = ['00', '99', '33', '66', 'FF', 'CC'], color, cssColor;
+ var l = rgb.length;
- for (var r = 0; r < l; r++) {
- var colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody);
- for (var g = 0; g < l; g++) {
- if (g === 3) {
- colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody);
- }
- for (var b = 0; b < l; b++) {
- color = rgb[r] + rgb[g] + rgb[b];
- this._createColorCell(color, colorsRow);
- }
- }
+ for (var r = 0; r < l; r++) {
+ var colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody);
+ for (var g = 0; g < l; g++) {
+ if (g === 3) {
+ colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody);
}
- break;
- case Sys.Extended.UI.ColorPickerPaletteStyle.Continuous:
- var step = 100 / 12;
- for(var l = 0; l <= 100; l = l + step) {
- var colorsRow = $common.createElementFromTemplate({ nodeName: "tr" }, this._colorsBody);
- for (var h = 0; h < 360; h = h + 20) {
- rgb = this._hslToRgb(h / 360, 1, l / 100);
- color = this._rgbToHex(rgb[0], rgb[1], rgb[2]);
- this._createColorCell(color, colorsRow);
- }
- }
- break;
+ for (var b = 0; b < l; b++) {
+ color = rgb[r] + rgb[g] + rgb[b];
+ cssColor = '#' + color;
+ var colorCell = $common.createElementFromTemplate({ nodeName: "td" }, colorsRow);
+ var colorDiv = $common.createElementFromTemplate({
+ nodeName: "div",
+ properties: {
+ id: id + "_color_" + color,
+ color: color,
+ title: cssColor,
+ style: { backgroundColor: cssColor },
+ innerHTML: " "
+ },
+ events: this._cell$delegates
+ }, colorCell);
+ }
+ }
}
},
- _rgbToHex: function(r, g, b){
- function padHex(n){
- var nHex = n.toString(16);
- return (n < 16) ? ("0" + nHex) : nHex;
- }
-
- return padHex(r) + padHex(g) + padHex(b);
- },
- _hslToRgb: function(h, s, l){
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
- var p = 2 * l - q;
- var r = this._hue2rgb(p, q, h + 1 / 3);
- var g = this._hue2rgb(p, q, h);
- var b = this._hue2rgb(p, q, h - 1 / 3);
-
- return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
- },
- _hue2rgb: function(p, q, t){
- if (t < 0) t += 1;
- if (t > 1) t -= 1;
- if (t < 1 / 6) return p + (q - p) * 6 * t;
- if (t < 1 / 2) return q;
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
- return p;
- },
- _createColorCell: function (color, colorsRow) {
- var cssColor = '#' + color;
- var colorCell = $common.createElementFromTemplate({ nodeName: "td" }, colorsRow);
- $common.createElementFromTemplate({
- nodeName: "div",
- properties: {
- color: color,
- title: cssColor,
- style: { backgroundColor: cssColor },
- innerHTML: " "
- },
- events: this._cell$delegates
- }, colorCell);
- },
_ensureColorPicker: function() {
if (!this._container) {
@@ -674,9 +614,4 @@ Sys.Extended.UI.ColorPickerBehavior.prototype = {
this._popupMouseDown = false;
}
}
-Sys.Extended.UI.ColorPickerBehavior.registerClass('Sys.Extended.UI.ColorPickerBehavior', Sys.Extended.UI.BehaviorBase);
-
-Sys.Extended.UI.ColorPickerPaletteStyle = {
- Default: 0,
- Continuous: 1
-}
\ No newline at end of file
+Sys.Extended.UI.ColorPickerBehavior.registerClass('Sys.Extended.UI.ColorPickerBehavior', Sys.Extended.UI.BehaviorBase);
\ No newline at end of file
diff --git a/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js b/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js
index ccadc4c4c..244f42e1d 100644
--- a/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/ComboBox.debug.js
@@ -184,10 +184,14 @@ Sys.Extended.UI.ComboBox.prototype = {
"click": this._textBoxClickHandler,
"focus": this._textBoxFocusHandler,
"blur": this._textBoxBlurHandler,
- "keypress": this._textBoxKeyPressHandler,
- "keydown": this._textBoxKeyDownHandler
+ "keypress": this._textBoxKeyPressHandler
}, this);
-
+
+ if (Sys.Browser.agent == Sys.Browser.InternetExplorer || Sys.Browser.agent === Sys.Browser.Safari
+ || Sys.Browser.agent === Sys.Browser.WebKit) {
+ $addHandler(this.get_textBoxControl(), "keydown", this._textBoxKeyDownHandler);
+ }
+
$addHandlers(this.get_buttonControl(),
{
'click': this._buttonClickHandler,
@@ -239,6 +243,10 @@ Sys.Extended.UI.ComboBox.prototype = {
// zero margins & padding (helps particularly in firefox)
if (style.padding == '')
style.padding = '0px';
+
+ // button is originally hidden to reduce screen flicker
+ this._buttonControl.style.visibility = 'visible';
+
},
initializeOptionList: function () {
@@ -251,7 +259,7 @@ Sys.Extended.UI.ComboBox.prototype = {
var optionListControl = this.get_optionListControl();
// force inline display on Safari by moving the list to the bottom of the form.
- if (Sys.Browser.agent === Sys.Browser.Safari) {
+ if (Sys.Browser.agent === Sys.Browser.Safari || Sys.Browser.agent === Sys.Browser.WebKit) {
//this.get_element().removeChild(optionListControl);
var parentOfOptionList = optionListControl.parentNode;
if (parentOfOptionList != null)
@@ -491,8 +499,7 @@ Sys.Extended.UI.ComboBox.prototype = {
x = textBoxBounds.x - (listBounds.width - textBoxBounds.width);
}
- if($common.getCurrentStyle(this.get_textBoxControl(), "position", "") == "absolute")
- Sys.UI.DomElement.setLocation(optionListControl, x, y);
+ Sys.UI.DomElement.setLocation(optionListControl, x, y);
// enforce default scroll
this._ensureHighlightedIndex();
@@ -953,8 +960,9 @@ Sys.Extended.UI.ComboBox.prototype = {
liElement.style.backgroundColor = 'Highlight';
liElement.style.color = 'HighlightText';
}
- else
- liElement.className = this.get_listItemHoverCssClass();
+ else {
+ liElement.className = this.get_listItemHoverCssClass;
+ }
}
// unselect previously highlighted item
@@ -1082,8 +1090,7 @@ Sys.Extended.UI.ComboBox.prototype = {
if (this._highlightedIndex >= 0) {
this.get_textBoxControl().value = this._optionListItems[this._highlightedIndex].text;
this.set_selectedIndex(this._highlightedIndex);
- if(this.get_autoPostBack())
- __doPostBack(this.get_element().id, '');
+ __doPostBack(this.get_element().id, '');
}
this._popupBehavior.hide();
e.preventDefault();
@@ -1233,6 +1240,33 @@ Sys.Extended.UI.ComboBox.prototype = {
return true;
}
}
+ else if (Sys.Browser.agent == Sys.Browser.WebKit) {
+
+ // allow special funky apple webkit keypresses
+ if (code == 8 // BACKSPACE in Safari 3
+ || code == 9 // TAB in Safari 3
+ || code == 19 // PAUSE BREAK Safari 3
+ || code == 33 // PAGEUP in Safari 3
+ || code == 34 // PAGEDOWN in Safari 3
+ || code == 35 // END in Safari 3
+ || code == 36 // HOME in Safari 3
+ || code == 37 // ARROWLEFT in Safari 3
+ || code == 39 // ARROWRIGHT in Safari 3
+ || code == 45 // INSERT in Safari 3
+ || code == 46 // DELETE in Safari 3
+ || code == 91 // WINDOWS LEFT Safari 3
+ || code == 92 // WINDOWS RIGHT Safari 3
+ || code == 93 // MENU Safari 3
+ || code == 113 // F2 Safari 3
+ || code == 115 // F4 Safari 3
+ || code == 118 // F7 Safari 3
+ || code == 119 // F8 Safari 3
+ || code == 120 // F9 Safari 3
+ || code == 122 // F11 Safari 3
+ || code == 145 // SCROLL LOCK Safari 3
+ )
+ return true;
+ }
else if (Sys.Browser.agent != Sys.Browser.InternetExplorer) {
// allow kepress events triggered by FF & Opera
@@ -1438,7 +1472,7 @@ Sys.Extended.UI.ComboBox.prototype = {
}
// typedCharacter, textBoxValue, selectionPrefix, selectionSuffix, selectionTextFirst
- info.typedCharacter = String.fromCharCode(e.rawEvent.charCode || e.rawEvent.keyCode);
+ info.typedCharacter = String.fromCharCode(e.charCode);
info.textBoxValue = textBox.value;
info.selectionPrefix = (info.textBoxValue.length >= info.selectionStart)
? info.textBoxValue.substring(0, info.selectionStart)
@@ -1710,17 +1744,10 @@ Sys.Extended.UI.ComboBox.prototype = {
return parseInt(selectedIndex);
},
set_selectedIndex: function (value) {
- if(this.get_hiddenFieldControl().value !== value.toString()) {
- var oldIndex = +this.get_hiddenFieldControl().value;
-
+ if (this.get_hiddenFieldControl().value !== value.toString()) {
this.get_hiddenFieldControl().value = value.toString();
this._ensureSelectedIndex();
this.raisePropertyChanged('selectedIndex');
-
- this.raise_selectedIndexChanged({
- oldIndex: oldIndex,
- newIndex: value
- });
}
},
@@ -1815,24 +1842,6 @@ Sys.Extended.UI.ComboBox.prototype = {
this.raisePropertyChanged('listItemHoverCssClass');
}
},
-
- ///
- /// An event handler rised when selected index changed
- ///
- ///
- ///
- add_selectedIndexChanged: function(handler) {
- this.get_events().addHandler("selectedIndexChanged", handler);
- },
- remove_selectedIndexChanged: function(handler) {
- this.get_events().removeHandler("selectedIndexChanged", handler);
- },
- raise_selectedIndexChanged: function(eventArgs) {
- var handler = this.get_events().getHandler('selectedIndexChanged');
- if(handler) {
- handler(this, eventArgs);
- }
- }
};
Sys.Extended.UI.ComboBox.registerClass('Sys.Extended.UI.ComboBox', Sys.UI.Control);
diff --git a/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js b/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js
index a394b9a95..37e9f2250 100644
--- a/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/Common.DateTime.debug.js
@@ -299,4 +299,37 @@ Sys.Extended.UI.FirstDayOfWeek.prototype = {
Saturday : 6,
Default : 7
}
-Sys.Extended.UI.FirstDayOfWeek.registerEnum("Sys.Extended.UI.FirstDayOfWeek");
\ No newline at end of file
+Sys.Extended.UI.FirstDayOfWeek.registerEnum("Sys.Extended.UI.FirstDayOfWeek");
+
+(function(){
+ var D= new Date('2011-06-02T09:34:29+02:00');
+ if(!D || +D!== 1307000069000){
+ Date.fromISO= function(s){
+ var day, tz,
+ rx=/^(\d{4}\-\d\d\-\d\d([tT ][\d:\.]*)?)([zZ]|([+\-])(\d\d):(\d\d))?$/,
+ p= rx.exec(s) || [];
+ if(p[1]){
+ day= p[1].split(/\D/);
+ for(var i= 0, L= day.length; i/g, '>');
-};
+Sys.Extended.UI.zIndex.SliderDragHandle = 999;
\ No newline at end of file
diff --git a/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js b/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js
index 83b73f3b4..0542e2e59 100644
--- a/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/ConfirmButton.debug.js
@@ -119,8 +119,8 @@ Sys.Extended.UI.ConfirmButtonBehavior.prototype = {
throw Error.argument('displayModalPopupID', String.format(Sys.Extended.UI.Resources.CollapsiblePanel_NoControlID, this._displayModalPopupID));
// Hook into ModalPopupBehavior for the confirm result
- mpe.set_onOkScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(true);");
- mpe.set_onCancelScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(false);");
+ mpe.set_OnOkScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(true);");
+ mpe.set_OnCancelScript("$find('" + this.get_id() + "')._handleConfirmDialogCompletion(false);");
// Show the ModalPopupBehavior
mpe.show();
diff --git a/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js b/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js
index 615dc3e30..69d3255c0 100644
--- a/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/DropWatcher.debug.js
@@ -34,7 +34,6 @@ Sys.Extended.UI.DragDropList = function(associatedElement) {
this._originalParent = null;
this._originalNextSibling = null;
this._originalZIndex = null;
- this._originalOpacity = null;
this._currentContext = null;
this._data = null;
@@ -94,7 +93,6 @@ Sys.Extended.UI.DragDropList.prototype = {
this._dragVisual.style.width = dragObject.offsetWidth + "px";
this._dragVisual.style.height = dragObject.offsetHeight + "px";
- this._originalOpacity = this._dragVisual.style.opacity;
this._dragVisual.style.opacity = "0.4";
this._dragVisual.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(opacity=0.4);";
this._originalZIndex = this._dragVisual.style.zIndex;
@@ -114,6 +112,14 @@ Sys.Extended.UI.DragDropList.prototype = {
dragVisualContainer.appendChild(this._dragVisual);
+ var newOffset = Sys.Extended.UI.DragDropManager._getInstance().getScrollOffset(dragObject, true);
+ if(oldOffset.x !== newOffset.x || oldOffset.y !== newOffset.y) {
+ var diff = Sys.Extended.UI.DragDropManager._getInstance().subtractPoints(oldOffset, newOffset);
+ var location = Sys.Extended.UI.DragDropManager._getInstance().subtractPoints(currentLocation, diff);
+
+ $common.setLocation(dragVisualContainer, location);
+ }
+
return dragVisualContainer;
},
@@ -163,19 +169,13 @@ Sys.Extended.UI.DragDropList.prototype = {
if(this._dragMode === Sys.Extended.UI.DragMode.Copy) {
this._floatContainerInstance.removeChild(this._dragVisual);
} else {
+ // NOTE: There seems to be a cursor issue in Mozilla when setting the opacity to 1. We
+ // can work around this by setting the opacity to anything lower than 1 instead.
+ this._dragVisual.style.opacity = "0.999";
+ //_dragVisual.style.opacity = "1";
this._dragVisual.style.filter = "";
- if(this._originalOpacity === "") {
- this._dragVisual.style.removeProperty("opacity");
- } else {
- this._dragVisual.style.opacity = this._originalOpacity;
- }
-
- if(this._originalZIndex === "") {
- this._dragVisual.style.removeProperty("z-index");
- } else {
- this._dragVisual.style.zIndex = this._originalZIndex;
- }
+ this._dragVisual.style.zIndex = this._originalZIndex ? this._originalZIndex : 0;
// restore the height/width of the drag visual.
//
diff --git a/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js b/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js
index 75fafa530..bcd0529cf 100644
--- a/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/FilteredTextBox.debug.js
@@ -118,12 +118,15 @@ Sys.Extended.UI.FilteredTextBoxBehavior.prototype = {
(evt.ctrlKey /* Control keys */))
return;
- if("keyIdentifier" in evt.rawEvent) {
+ if(evt.rawEvent.keyIdentifier) {
// Safari
// Note (Garbin): used the underlying rawEvent insted of the DomEvent instance.
if(evt.rawEvent.ctrlKey || evt.rawEvent.altKey || evt.rawEvent.metaKey)
return;
+ if(evt.rawEvent.keyIdentifier.substring(0, 2) != "U+")
+ return;
+
scanCode = evt.rawEvent.charCode;
if(scanCode == 63272 /* Delete */)
return;
@@ -176,7 +179,7 @@ Sys.Extended.UI.FilteredTextBoxBehavior.prototype = {
// Else if it was decided that it shouldn't be allowed,
// raise the Filtered event and return false to filter the key
- this.raise_filtered(new Sys.Extended.UI.FilteredTextBoxEventArgs(key));
+ this.raiseFiltered(new Sys.Extended.UI.FilteredTextBoxEventArgs(key));
return false;
},
diff --git a/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js b/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js
index 7e2bf590f..b038c4811 100644
--- a/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanel.debug.js
@@ -1772,9 +1772,7 @@ Sys.Extended.UI.HtmlEditor.DesignPanel.prototype = {
var node = range.startContainer,
pos = range.startOffset;
- if(node.ownerDocument.id != "EditorDocument"
- &&
- node.ownerDocument.uniqueID.substring(0, 6) != "ms__id")
+ if(node.ownerDocument.id != "EditorDocument")
return false;
if((range.startContainer.nodeType == 1 && range.startContainer.tagName.toUpperCase() == "TR") ||
diff --git a/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js b/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js
index 11c72e88b..b727bfe68 100644
--- a/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/HtmlEditor.DesignPanelEventHandler.debug.js
@@ -339,6 +339,7 @@ Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler = function(ev) {
Sys.Extended.UI.HtmlEditor._stopEvent(ev);
return false;
+ break;
case "x":
if(this.isShadowed()) {
Sys.Extended.UI.HtmlEditor._stopEvent(ev);
@@ -440,12 +441,14 @@ Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler = function(ev) {
Sys.Extended.UI.HtmlEditor._stopEvent(ev);
return false;
+ break;
case "0": // test KEY
var str1 = "Your browser:\n\n" + navigator.userAgent;
alert(str1);
Sys.Extended.UI.HtmlEditor._stopEvent(ev);
return false;
+ break;
case "9":
if(!Sys.Extended.UI.HtmlEditor.isIE) {
var sel = editor._getSelection(),
@@ -488,6 +491,7 @@ Sys.Extended.UI.HtmlEditor.DesignPanelEventHandler = function(ev) {
Sys.Extended.UI.HtmlEditor._stopEvent(ev);
return false;
+ break;
}
}
if(cmd) {
diff --git a/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js b/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js
index 725f6b993..abf9147d8 100644
--- a/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/HtmlEditor.HtmlEditor.debug.js
@@ -9,7 +9,7 @@ Sys.Extended.UI.HtmlEditor.TrimAll = function(value) {
};
Sys.Extended.UI.HtmlEditor.isIE = (Sys.Browser.agent == Sys.Browser.InternetExplorer);
-Sys.Extended.UI.HtmlEditor.isSafari = (Sys.Browser.agent == Sys.Browser.Safari || (Sys.Browser.agent == null && Sys.Browser.version == 5 && Sys.Browser.name == "Netscape"));
+Sys.Extended.UI.HtmlEditor.isSafari = (Sys.Browser.agent == Sys.Browser.Safari);
Sys.Extended.UI.HtmlEditor.isOpera = (Sys.Browser.agent == Sys.Browser.Opera);
Sys.Extended.UI.HtmlEditor.tryReplaceRgb = function(value) {
diff --git a/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js b/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js
index 861fb7fb7..517aeb71b 100644
--- a/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js
+++ b/Scripts/AjaxControlToolkit/Debug/HtmlEditorExtender.debug.js
@@ -20,7 +20,7 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) {
/// get_isDirty
///
this._isDirty = false;
- this._lastMode = Sys.Extended.UI.HtmlEditorExtenderMode.Content;
+ this._viewMode = 'content';
///
/// Determines whether or not to display a source view tab/button to see the source view of HtmlEditorExtender
@@ -30,14 +30,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) {
///
this._displaySourceTab = false;
- ///
- /// Determines whether or not to display a preview tab/button providing access to HtmlEditorExtender’s preview
- ///
- /// get_displayPreviewTab
- /// set_displayPreviewTab
- ///
- this._displayPreviewTab = false;
-
///
/// Button width in pixels
///
@@ -127,18 +119,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) {
cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_source']
};
- this._buttonPreviewTemplate = {
- nodeName: 'input',
- properties: {
- type: 'button',
- style: {
- width: this._ButtonWidth + 'px',
- height: this._ButtonHeight + 'px'
- }
- },
- cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_preview']
- };
-
this._textboxTemplate = {
nodeName: 'input',
properties: {
@@ -165,15 +145,15 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) {
cssClasses: ['ajax__html_editor_extender_buttoncontainer']
};
- this._bottomButtonsContainerTemplate = {
+ this._topButtonContainerTemplate2 = {
nodeName: 'div',
properties: {
- id: id + '_ExtenderModeButtonContainer',
+ id: id + '_ExtenderButtonContainer2',
style: {
clear: 'both'
}
},
- cssClasses: ['ajax__html_editor_extender_modebuttonscontainer']
+ cssClasses: ['ajax__html_editor_extender_buttoncontainer2']
};
// variables
@@ -188,16 +168,14 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) {
this._toolbarButtons = null;
this._editableDiv = null;
this._sourceViewDiv = null;
- this._previewDiv = null;
this._topButtonContainer = null;
- this._bottomButtonsContainer = null;
+ this._topButtonContainer2 = null;
this._buttons = [];
this._requested_buttons = new Array();
this._colorPicker = null;
this._txtBoxForColor = null;
this._contentViewButton = null;
this._sourceViewButton = null;
- this._previewButton = null;
this._popupDiv = null;
this._btnDone = null;
this._btnCancel = null;
@@ -209,7 +187,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior = function(element) {
this._contentViewClickDelegate = null;
this._sourceViewClickDelegate = null;
this._sourceViewDivOnBlurDelegate = null;
- this._previewClickDelegate = null;
this._imageCancelClickDelegate = null;
// Hook into the ASP.NET WebForm_OnSubmit function to encode html tags prior to submission
@@ -226,20 +203,15 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
HtmlEditorExtender_editableDivs[HtmlEditorExtender_editableDivs.length] = this;
this._button_list = new Array();
- var focused = this._element === document.activeElement;
this._createContainer();
this._createTopButtonContainer();
this._createButton();
this._createEditableDiv();
- if(this.get_displaySourceTab())
+ if(this.get_displaySourceTab()) {
this._createSourceViewDiv();
-
- if(this.get_displayPreviewTab())
- this._createPreviewDiv();
-
- if(this._hasMultipleTabs())
- this._createBottomButtonsContainer();
+ this._createTopButtonContainer2();
+ }
// get form that contains textbox
var formElement = this._textbox._element.parentNode;
@@ -275,14 +247,9 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
this._editableDivOnFocusDelegate = Function.createDelegate(this, this._editableDiv_onfocus);
this._btnClickDelegate = Function.createDelegate(this, this._executeCommand);
- if(this.get_displaySourceTab())
- this._sourceViewClickDelegate = Function.createDelegate(this, this._sourceView_click);
-
- if(this.get_displayPreviewTab())
- this._previewClickDelegate = Function.createDelegate(this, this._preview_click);
-
- if(this._hasMultipleTabs()) {
+ if(this.get_displaySourceTab()) {
this._contentViewClickDelegate = Function.createDelegate(this, this._contentView_click);
+ this._sourceViewClickDelegate = Function.createDelegate(this, this._sourceView_click);
this._sourceViewDivOnBlurDelegate = Function.createDelegate(this, this._sourceViewDiv_onblur);
}
@@ -292,19 +259,11 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
$addHandler(this._editableDiv, 'focus', this._editableDivOnFocusDelegate, true);
$addHandler(this._topButtonContainer, 'click', this._btnClickDelegate, true);
- if(this.get_displaySourceTab())
- $addHandler(this._sourceViewButton, 'click', this._sourceViewClickDelegate, true);
-
- if(this.get_displayPreviewTab())
- $addHandler(this._previewButton, 'click', this._previewClickDelegate, true);
-
- if(this._hasMultipleTabs()) {
+ if(this.get_displaySourceTab()) {
$addHandler(this._contentViewButton, 'click', this._contentViewClickDelegate, true);
+ $addHandler(this._sourceViewButton, 'click', this._sourceViewClickDelegate, true);
$addHandler(this._sourceViewDiv, 'blur', this._sourceViewDivOnBlurDelegate, true);
}
-
- if(focused)
- this._editableDiv.focus();
},
_dispose: function() {
@@ -313,14 +272,9 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
$removeHandler(this._editableDiv, 'focus', this._editableDivOnFocusDelegate);
$removeHandler(this._topButtonContainer, 'click', this._btnClickDelegate);
- if(this.get_displaySourceTab())
- $removeHandler(this._sourceViewButton, 'click', this._sourceViewClickDelegate);
-
- if(this.get_displayPreviewTab())
- $removeHandler(this.previewButton, 'click', this._previewClickDelegate);
-
- if(this._hasMultipleTabs()) {
+ if(this.get_displaySourceTab()) {
$removeHandler(this._contentViewButton, 'click', this._contentViewClickDelegate);
+ $removeHandler(this._sourceViewButton, 'click', this._sourceViewClickDelegate);
$removeHandler(this._sourceViewDiv, 'blur', this._sourceViewDivOnBlurDelegate);
}
@@ -330,10 +284,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
Sys.Extended.UI.HtmlEditorExtenderBehavior.callBaseMethod(this, 'dispose');
},
- _hasMultipleTabs: function(){
- return this.get_displaySourceTab() || this.get_displayPreviewTab();
- },
-
_createContainer: function() {
var e = this.get_element();
this._container = $common.createElementFromTemplate(this._containerTemplate, e.parentNode);
@@ -356,8 +306,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
},
_createButton: function() {
- var self = this;
-
var isIE = Sys.Browser.agent == Sys.Browser.InternetExplorer;
for(i = 0; i < this._toolbarButtons.length; i++) {
var _btn;
@@ -405,7 +353,7 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
change: function(e) {
var value = this.options[this.selectedIndex].value;
setTimeout(function() {
- self.setFontFamily(value);
+ document.execCommand("fontname", false, value);
}, 200);
}
}
@@ -477,7 +425,7 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
change: function(e) {
var value = this.options[this.selectedIndex].value;
setTimeout(function() {
- self.setFontSize(value);
+ document.execCommand("fontsize", false, value);
}, 200);
}
}
@@ -579,45 +527,36 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
this._backColor.setAttribute('unselectable', 'on');
} else {
- _btn = $common.createElementFromTemplate({
- nodeName: 'input',
- properties: {
- type: 'button',
- id: this._id + this._toolbarButtons[i].CommandName,
- name: this._toolbarButtons[i].CommandName,
- title: this._toolbarButtons[i].Tooltip,
- style: {
- width: '23px',
- height: '21px'
- }
- },
- cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_' + this._toolbarButtons[i].CommandName]
- }, this._topButtonContainer);
- _btn.setAttribute('unselectable', 'on');
+ var map = {
+ Copy: 1,
+ Cut: 1,
+ Paste: 1
+ };
+ if(Sys.Browser.agent != Sys.Browser.InternetExplorer && map[this._toolbarButtons[i].CommandName]) {
+ // don't render button
+ } else {
+ _btn = $common.createElementFromTemplate({
+ nodeName: 'input',
+ properties: {
+ type: 'button',
+ id: this._id + this._toolbarButtons[i].CommandName,
+ name: this._toolbarButtons[i].CommandName,
+ title: this._toolbarButtons[i].Tooltip,
+ style: {
+ width: '23px',
+ height: '21px'
+ }
+ },
+ cssClasses: ['ajax__html_editor_extender_button ajax__html_editor_extender_' + this._toolbarButtons[i].CommandName]
+ }, this._topButtonContainer);
+ _btn.setAttribute('unselectable', 'on');
+ }
Array.add(this._buttons, _btn);
}
}
},
- setFontFamily: function(fontFamilyName) {
- this._executeStyleWithCssCommand();
- document.execCommand("fontname", false, fontFamilyName);
- },
-
- setFontSize: function(fontSize) {
- this._executeStyleWithCssCommand();
- document.execCommand("fontsize", false, fontSize);
- },
-
- _executeStyleWithCssCommand: function(){
- var styleWithCssCmdName = 'styleWithCSS';
- var isStyleWithCssCommandAvailable = document.queryCommandSupported(styleWithCssCmdName);
-
- if(isStyleWithCssCommandAvailable)
- document.execCommand(styleWithCssCmdName, false, true);
- },
-
_createEditableDiv: function() {
var id = this.get_id(),
height;
@@ -646,22 +585,17 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
cssClasses: ['ajax__html_editor_extender_texteditor']
}, this._container);
- this._textbox._element.value = this._textbox._element.value.replace(/&/g, '&');
+ this._textbox._element.value = this._textbox._element.value.replace('&', '&');
this._editableDiv.innerHTML = this._textbox._element.value;
this._oldContents = this._editableDiv.innerHTML;
$common.setVisible(this._textbox._element, false);
},
- _createBottomButtonsContainer: function() {
- this._bottomButtonsContainer = $common.createElementFromTemplate(this._bottomButtonsContainerTemplate, this._container);
- this._contentViewButton = $common.createElementFromTemplate(this._buttonContentTemplate, this._bottomButtonsContainer);
-
- if(this.get_displaySourceTab())
- this._sourceViewButton = $common.createElementFromTemplate(this._buttonSourceTemplate, this._bottomButtonsContainer);
-
- if(this.get_displayPreviewTab())
- this._previewButton = $common.createElementFromTemplate(this._buttonPreviewTemplate, this._bottomButtonsContainer);
+ _createTopButtonContainer2: function() {
+ this._topButtonContainer2 = $common.createElementFromTemplate(this._topButtonContainerTemplate2, this._container);
+ this._contentViewButton = $common.createElementFromTemplate(this._buttonContentTemplate, this._topButtonContainer2);
+ this._sourceViewButton = $common.createElementFromTemplate(this._buttonSourceTemplate, this._topButtonContainer2);
},
_createSourceViewDiv: function() {
@@ -685,26 +619,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
$common.setVisible(this._sourceViewDiv, false);
},
- _createPreviewDiv: function () {
- var id = this.get_id(),
- height = this._container.clientHeight - 25;
-
- this._previewDiv = $common.createElementFromTemplate({
- nodeName: 'div',
- properties: {
- id: id + '_ExtenderPreview',
- style: {
- height: height + 'px',
- overflow: 'auto',
- clear: 'both'
- }
- },
- cssClasses: ['ajax__html_editor_extender_texteditor']
- }, this._container);
-
- $common.setVisible(this._previewDiv, false);
- },
-
_editableDiv_onblur: function() {
this._textbox._element.value = this._encodeHtml();
this._isFocusInEditableDiv = false;
@@ -738,89 +652,54 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
this._editableDiv.innerHTML = this._textbox._element.value;
},
- _contentView_click: function () {
- if(this._lastMode === Sys.Extended.UI.HtmlEditorExtenderMode.Content)
- return;
+ _contentView_click: function() {
+ if(this._viewMode != 'content') {
+ $common.setVisible(this._topButtonContainer, true);
+ $common.setVisible(this._editableDiv, true);
- $common.setVisible(this._topButtonContainer, true);
- $common.setVisible(this._editableDiv, true);
-
- if(this._sourceViewDiv.textContent != undefined)
- this._editableDiv.innerHTML = this._sourceViewDiv.textContent;
- else
- this._editableDiv.innerHTML = this._sourceViewDiv.innerText;
-
- this._oldContents = this._editableDiv.innerHTML;
- $common.setVisible(this._sourceViewDiv, false);
- $common.setVisible(this._previewDiv, false);
- this._lastMode = Sys.Extended.UI.HtmlEditorExtenderMode.Content;
- },
-
- _sourceView_click: function () {
- if(this._lastMode === Sys.Extended.UI.HtmlEditorExtenderMode.Source)
- return;
-
- $common.setVisible(this._sourceViewDiv, true);
-
- this._copyContentToSource();
-
- this._oldContents = this._editableDiv.innerHTML;
- $common.setVisible(this._editableDiv, false);
- $common.setVisible(this._topButtonContainer, false);
- $common.setVisible(this._previewDiv, false);
- this._lastMode = Sys.Extended.UI.HtmlEditorExtenderMode.Source;
- },
-
- _preview_click: function () {
- if(this._lastMode === Sys.Extended.UI.HtmlEditorExtenderMode.Preview)
- return;
-
- $common.setVisible(this._previewDiv, true);
-
- if(this._lastMode === Sys.Extended.UI.HtmlEditorExtenderMode.Content)
- this._copyContentToSource();
-
- if(this._lastMode === Sys.Extended.UI.HtmlEditorExtenderMode.Source) {
if(this._sourceViewDiv.textContent != undefined)
- this._previewDiv.innerHTML = this._sourceViewDiv.textContent;
+ this._editableDiv.innerHTML = this._sourceViewDiv.textContent;
else
- this._previewDiv.innerHTML = this._sourceViewDiv.innerText;
+ this._editableDiv.innerHTML = this._sourceViewDiv.innerText;
+
+ this._oldContents = this._editableDiv.innerHTML;
+ $common.setVisible(this._sourceViewDiv, false);
+ this._viewMode = 'content';
}
-
- if(this._lastMode === Sys.Extended.UI.HtmlEditorExtenderMode.Content)
- this._previewDiv.innerHTML = this._editableDiv.innerHTML;
-
- $common.setVisible(this._editableDiv, false);
- $common.setVisible(this._sourceViewDiv, false);
- $common.setVisible(this._topButtonContainer, false);
- this._lastMode = Sys.Extended.UI.HtmlEditorExtenderMode.Preview;
},
- _copyContentToSource: function() {
- var html = this._editableDiv.innerHTML;
+ _sourceView_click: function() {
+ if(this._viewMode != 'source') {
+ $common.setVisible(this._sourceViewDiv, true);
- if(/^\s*$/.test(this._editableDiv.innerText)
- && this._editableDiv.innerHTML === " ")
- html = "";
+ if(this._sourceViewDiv.textContent != undefined)
+ this._sourceViewDiv.textContent = this._editableDiv.innerHTML;
+ else
+ this._sourceViewDiv.innerText = this._editableDiv.innerHTML;
- if(this._sourceViewDiv.textContent != undefined)
- this._sourceViewDiv.textContent = this.cleanHtml(html);
- else
- this._sourceViewDiv.innerText = this.cleanHtml(html);
- },
-
- cleanHtml: function(html) {
- return html.replace(/ /g, " ");
+ this._oldContents = this._editableDiv.innerHTML;
+ $common.setVisible(this._editableDiv, false);
+ $common.setVisible(this._topButtonContainer, false);
+ this._viewMode = 'source';
+ }
},
_btnCancel_click: function() {
this._popupBehavior.hide();
},
+ _attributes: {
+ style: 'st_yle_',
+ size: 'si_ze_',
+ color: 'co_lor_',
+ face: 'fa_ce_',
+ align: 'al_ign_'
+ },
+
_rgbToHex: function(s) {
var a = /rgb\s?\(\s?(\d+)\s?,\s?(\d+)\s?,\s?(\d+)\s?\)/.exec(s);
- return '#' + ("000000" + (parseInt(a[3], 10) | (parseInt(a[2], 10) << 8) | (parseInt(a[1], 10) << 16)).toString(16)).substr(-6);
+ return '#' + (parseInt(a[3], 10) | (parseInt(a[2], 10) << 8) | (parseInt(a[1], 10) << 16)).toString(16);
},
_encodeHtml: function() {
@@ -829,6 +708,22 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
elements = this._editableDiv.getElementsByTagName('*'),
element;
+ for(var i = 0; element = elements[i]; i++) {
+ try {
+ element.className = '';
+ element.removeAttribute('class');
+ } catch(ex) { }
+
+ try {
+ element.id = '';
+ element.removeAttribute('id');
+ } catch(ex) { }
+
+ try {
+ element.removeAttribute('width');
+ } catch(ex) { }
+ }
+
var html = this._editableDiv.innerHTML;
if(isIE) {
//force attributes to be double quoted
@@ -875,18 +770,40 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
},
_editableDiv_submit: function() {
+ var char = 0,
+ selection = null;
+
+ setTimeout(function() {
+ if(this._editableDiv != null)
+ this._editableDiv.focus();
+ }, 0);
+
+ if(Sys.Browser.agent != Sys.Browser.Firefox) {
+ if(document.selection) {
+ selection = document.selection.createRange();
+ selection.moveStart('character', char);
+ selection.select();
+ } else {
+ selection = window.getSelection();
+
+ if(this._editableDiv.firstChild !== null)
+ selection.collapse(this._editableDiv.firstChild, char);
+ }
+ }
+
this._textbox._element.value = this._encodeHtml();
},
- _isHtmlElement: function(obj) {
+ _isHtmlElement: function (obj) {
if(obj instanceof HTMLElement)
return true;
return false;
},
- isValidTarget: function(target) {
- if(target.name == undefined
+ isValidTarget: function(target)
+ {
+ if (target.name == undefined
||
target.name == ""
||
@@ -896,40 +813,22 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
return true;
},
- isSimpleTextDecoration: function(commandName) {
- if(commandName)
- return commandName.toLowerCase() == "bold"
- || commandName.toLowerCase() == "italic"
- || commandName.toLowerCase() == "underline";
-
- return false;
- },
-
_executeCommand: function(command) {
if(!this.isValidTarget(command.target))
return;
- var selection = this._getSelection();
- if(selection != null) {
- var isEditDivChild = this._isDescendantOrSelf(this._editableDiv, selection.commonAncestorContainer);
-
- if(!isEditDivChild)
- return;
- }
-
var isFireFox = Sys.Browser.agent == Sys.Browser.Firefox,
- isWebKit = Sys.Browser.agent == Sys.Browser.Safari,
- isIE = (Sys.Browser.agent == Sys.Browser.InternetExplorer || Sys.Browser.agent == null),
delcolorPicker_onchange = Function.createDelegate(this, this._colorPicker_onchange);
- if(!this.isSimpleTextDecoration(command.target.name))
- this._executeStyleWithCssCommand();
+ if(isFireFox)
+ document.execCommand('styleWithCSS', false, false);
var map = {
JustifyRight: 1,
JustifyLeft: 1,
JustifyCenter: 1,
JustifyFull: 1,
+ Indent: 1,
Outdent: 1
};
@@ -1005,7 +904,7 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
document.execCommand(command.target.name, false, null);
}
} else if(command.target.name == 'InsertImage') {
- // if focus in not at editable div then dom error occurs
+ // if focus in not at editable div then dom error occurs
if(!this._isFocusInEditableDiv)
this._editableDiv.focus();
@@ -1030,21 +929,6 @@ Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype = {
left: '',
opacity: '1'
});
- } else if(command.target.name == 'CleanWord') {
- this._editableDiv.innerHTML = this.cleanWordHtml(this._editableDiv.innerHTML);
- } else if(command.target.name == 'Indent') {
- if(isIE)
- document.execCommand(command.target.name, false, null);
- else {
- var selectionHtml = this._getSelectionHtml();
- var indentedHtml = "