// Namespaces
plupload = {}
plupload.runtimes = {}
// Classes
plupload.runtimes.BrowserPlus = function() {
/// Yahoo BrowserPlus implementation.
}
plupload.runtimes.BrowserPlus.init = function(uploader, callback) {
/// Initializes the browserplus runtime.
/// Uploader instance that needs to be initialized.
/// Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.runtimes.Flash = function() {
/// FlashRuntime implementation.
}
plupload.runtimes.Flash.init = function(uploader, callback) {
/// Initializes the upload runtime.
/// Uploader instance that needs to be initialized.
/// Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.runtimes.Gears = function() {
/// Gears implementation.
}
plupload.runtimes.Gears.init = function(uploader, callback) {
/// Initializes the upload runtime.
/// Uploader instance that needs to be initialized.
/// Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.runtimes.Html4 = function() {
/// HTML4 implementation.
}
plupload.runtimes.Html4.init = function(uploader, callback) {
/// Initializes the upload runtime.
/// Uploader instance that needs to be initialized.
/// Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.runtimes.Html5 = function() {
/// HMTL5 implementation.
}
plupload.runtimes.Html5.init = function(uploader, callback) {
/// Initializes the upload runtime.
/// Uploader instance that needs to be initialized.
/// Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.runtimes.Silverlight = function() {
/// Silverlight implementation.
}
plupload.runtimes.Silverlight.init = function(uploader, callback) {
/// Initializes the upload runtime.
/// Uploader instance that needs to be initialized.
/// Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.Uploader = function(settings) {
/// Uploader class, an instance of this class will be created for each upload field.
/// Initialization settings, to be used by the uploader instance and runtimes.
/// Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. These states are controlled by the stop/start methods. The default value is STOPPED.
/// Current runtime name.
/// Map of features that are available for the uploader runtime. Features will be filled before the init event is called, these features can then be used to alter the UI for the end user. Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize.
/// Current upload queue, an array of File instances.
/// Object with name/value settings.
/// Total progess information. How many files has been uploaded, total percent etc.
/// Unique id for the Uploader instance.
}
plupload.Uploader.prototype.init = function() {
/// Initializes the Uploader instance and adds internal event listeners.
}
plupload.Uploader.prototype.refresh = function() {
/// Refreshes the upload instance by dispatching out a refresh event to all runtimes.
}
plupload.Uploader.prototype.start = function() {
/// Starts uploading the queued files.
}
plupload.Uploader.prototype.stop = function() {
/// Stops the upload of the queued files.
}
plupload.Uploader.prototype.getFile = function(id) {
/// Returns the specified file object by id.
/// File id to look for.
/// File object or undefined if it wasn't found;
}
plupload.Uploader.prototype.removeFile = function(file) {
/// Removes a specific file.
/// File to remove from queue.
}
plupload.Uploader.prototype.splice = function(start, length) {
/// Removes part of the queue and returns the files removed.
/// (Optional) Start index to remove from.
/// (Optional) Lengh of items to remove.
/// Array of files that was removed.
}
plupload.Uploader.prototype.trigger = function(name, Multiple) {
/// Dispatches the specified event name and it's arguments to all listeners.
/// Event name to fire.
/// arguments to pass along to the listener functions.
}
plupload.Uploader.prototype.bind = function(name, func, scope) {
/// Adds an event listener by name.
/// Event name to listen for.
/// Function to call ones the event gets fired.
/// Optional scope to execute the specified function in.
}
plupload.Uploader.prototype.unbind = function(name, func) {
/// Removes the specified event listener.
/// Name of event to remove.
/// Function to remove from listener.
}
plupload.Uploader.prototype.unbindAll = function() {
/// Removes all event listeners.
}
plupload.Uploader.prototype.destroy = function() {
/// Destroys Plupload instance and cleans after itself.
}
plupload.File = function(id, name, size) {
/// File instance.
/// Unique file id.
/// File name.
/// File size in bytes.
/// File id this is a globally unique id for the specific file.
/// File name for example "myfile.gif".
/// File size in bytes.
/// Number of bytes uploaded of the files total size.
/// Number of percentage uploaded of the file.
/// Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.
}
plupload.Runtime = function() {
/// Runtime class gets implemented by each upload runtime.
}
plupload.Runtime.init = function(uploader, callback) {
/// Initializes the upload runtime.
/// Uploader instance that needs to be initialized.
/// Callback function to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.
}
plupload.QueueProgress = function() {
/// Runtime class gets implemented by each upload runtime.
/// Total queue file size.
/// Total bytes uploaded.
/// Number of files uploaded.
/// Number of files failed to upload.
/// Number of files yet to be uploaded.
/// Total percent of the uploaded bytes.
/// Bytes uploaded per second.
}
plupload.QueueProgress.prototype.reset = function() {
/// Resets the progress to it's initial values.
}
// Namespaces
plupload.STOPPED = new Object();
plupload.STARTED = new Object();
plupload.QUEUED = new Object();
plupload.UPLOADING = new Object();
plupload.FAILED = new Object();
plupload.DONE = new Object();
plupload.GENERIC_ERROR = new Object();
plupload.HTTP_ERROR = new Object();
plupload.IO_ERROR = new Object();
plupload.SECURITY_ERROR = new Object();
plupload.INIT_ERROR = new Object();
plupload.FILE_SIZE_ERROR = new Object();
plupload.FILE_EXTENSION_ERROR = new Object();
plupload.mimeTypes = new Object();
plupload.extend = function(target, obj) {
/// Extends the specified object with another object.
/// Object to extend.
/// Multiple objects to extend with.
/// Same as target, the extended object.
}
plupload.cleanName = function(s) {
/// Cleans the specified name from national characters (diacritics).
/// String to clean up.
/// Cleaned string.
}
plupload.addRuntime = function(name, obj) {
/// Adds a specific upload runtime like for example flash or gears.
/// Runtime name for example flash.
/// Object containing init/destroy method.
}
plupload.guid = function() {
/// Generates an unique ID.
/// Virtually unique id.
}
plupload.formatSize = function(size) {
/// Formats the specified number as a size string for example 1024 becomes 1 KB.
/// Size to format as string.
/// Formatted size string.
}
plupload.getPos = function(node, root) {
/// Returns the absolute x, y position of an Element.
/// HTML element or element id to get x, y position from.
/// Optional root element to stop calculations at.
/// Absolute position of the specified element object with x, y fields.
}
plupload.parseSize = function(size) {
/// Parses the specified size string into a byte value.
/// String to parse or number to just pass through.
/// Size in bytes.
}
plupload.xmlEncode = function(s) {
/// Encodes the specified string.
/// String to encode.
/// Encoded string.
}
plupload.toArray = function(obj) {
/// Forces anything into an array.
/// Object with length field.
/// Array object containing all items.
}