Important! This page is auto-generated from the comments in the source files. All changes will be overwritten! If you are looking to contribute, modify the comment in the corresponding source file instead.
Table of Contents
- Constructor
- Properties
- VERSION
static
- STOPPED
static
- STARTED
static
- QUEUED
static
- UPLOADING
static
- FAILED
static
- DONE
static
- GENERIC_ERROR
static
- HTTP_ERROR
static
- IO_ERROR
static
- SECURITY_ERROR
static
- INIT_ERROR
static
- FILE_SIZE_ERROR
static
- FILE_EXTENSION_ERROR
static
- FILE_DUPLICATE_ERROR
static
- IMAGE_FORMAT_ERROR
static
- MEMORY_ERROR
static
- IMAGE_DIMENSIONS_ERROR
static
- mimeTypes
- VERSION
- Methods
- typeOf(o)
static
- extend(target, obj)
static
- guid()
static
- get(id)
- get(id)
- each(obj, callback)
static
- getPos(node, root)
static
- getSize(node)
static
- xmlEncode(s)
static
- toArray(obj)
static
- inArray(needle, array)
static
- inSeries(queue, cb)
static
- addI18n(pack)
static
- translate(str)
static
- isEmptyObj(obj)
static
- hasClass(obj, name)
static
- addClass(obj, name)
static
- removeClass(obj, name)
static
- getStyle(obj, name)
static
- addEvent(obj, name, callback, (optional))
static
- removeEvent(obj, name, (optional))
static
- removeAllEvents(obj, (optional))
static
- cleanName(s)
static
- buildUrl(url, items)
static
- formatSize(size)
static
- parseSize(size)
static
- predictRuntime(config, [runtimes])
static
- addFileFilter(name, cb)
static
- typeOf(o)
Properties
VERSION static
Plupload version will be replaced on build.
STOPPED static
The state of the queue before it has started and after it has finished
STARTED static
Upload process is running
QUEUED static
File is queued for upload
UPLOADING static
File is being uploaded
FAILED static
File has failed to be uploaded
DONE static
File has been uploaded successfully
GENERIC_ERROR static
Generic error for example if an exception is thrown inside Silverlight.
HTTP_ERROR static
HTTP transport error. For example if the server produces a HTTP status other than 200.
IO_ERROR static
Generic I/O error. For example if it wasn't possible to open the file stream on local machine.
SECURITY_ERROR static
INIT_ERROR static
Initialization error. Will be triggered if no runtime was initialized.
FILE_SIZE_ERROR static
File size error. If the user selects a file that is too large it will be blocked and an error of this type will be triggered.
FILE_EXTENSION_ERROR static
File extension error. If the user selects a file that isn't valid according to the filters setting.
FILE_DUPLICATE_ERROR static
Duplicate file error. If prevent_duplicates is set to true and user selects the same file again.
IMAGE_FORMAT_ERROR static
Runtime will try to detect if image is proper one. Otherwise will throw this error.
MEMORY_ERROR static
While working on files runtime may run out of memory and will throw this error.
IMAGE_DIMENSIONS_ERROR static
Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error.
mimeTypes
Mime type lookup table.
Methods
typeOf(o) static
Gets the true type of the built-in object (better version of typeof).
_Arguments_
- o
Object
Object to check.
extend(target, obj) static
Extends the specified object with another object.
_Arguments_
- target
Object
Object to extend. - obj
Object..
Multiple objects to extend with.
guid() static
Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property to an user unique key.
get(id)
Get array of DOM Elements by their ids.
_Arguments_
- id
String
Identifier of the DOM Element
get(id)
Get DOM element by id
_Arguments_
- id
String
Identifier of the DOM Element
each(obj, callback) static
Executes the callback function for each item in array/object. If you return false in the callback it will break the loop.
_Arguments_
- obj
Object
Object to iterate. - callback
Function
Callback function to execute for each item.
getPos(node, root) static
Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields.
_Arguments_
- node
Element
HTML element or element id to get x, y position from. - root
Element
Optional root element to stop calculations at.
getSize(node) static
Returns the size of the specified node in pixels.
_Arguments_
- node
Node
Node to get the size of.
xmlEncode(s) static
Encodes the specified string.
_Arguments_
- s
String
String to encode.
toArray(obj) static
Forces anything into an array.
_Arguments_
- obj
Object
Object with length field.
inArray(needle, array) static
Find an element in array and return its index if present, otherwise return -1.
_Arguments_
- needle
Mixed
Element to find - array
Array
inSeries(queue, cb) static
Recieve an array of functions (usually async) to call in sequence, each function receives a callback as first argument that it should call, when it completes. Finally, after everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the sequence and invoke main callback immediately.
_Arguments_
- queue
Array
Array of functions to call in sequence - cb
Function
Main callback that is called in the end, or in case of error
addI18n(pack) static
Extends the language pack object with new items.
_Arguments_
- pack
Object
Language pack items to add.
translate(str) static
Translates the specified string by checking for the english string in the language pack lookup.
_Arguments_
- str
String
String to look for.
isEmptyObj(obj) static
Checks if object is empty.
_Arguments_
- obj
Object
Object to check.
hasClass(obj, name) static
Checks if specified DOM element has specified class.
_Arguments_
- obj
Object
DOM element like object to add handler to. - name
String
Class name
addClass(obj, name) static
Adds specified className to specified DOM element.
_Arguments_
- obj
Object
DOM element like object to add handler to. - name
String
Class name
removeClass(obj, name) static
Removes specified className from specified DOM element.
_Arguments_
- obj
Object
DOM element like object to add handler to. - name
String
Class name
getStyle(obj, name) static
Returns a given computed style of a DOM element.
_Arguments_
- obj
Object
DOM element like object. - name
String
Style you want to get from the DOM element
addEvent(obj, name, callback, (optional)) static
Adds an event handler to the specified object and store reference to the handler in objects internal Plupload registry (@see removeEvent).
_Arguments_
- obj
Object
DOM element like object to add handler to. - name
String
Name to add event listener to. - callback
Function
Function to call when event occurs. - (optional)
String
key that might be used to add specifity to the event record.
removeEvent(obj, name, (optional)) static
Remove event handler from the specified object. If third argument (callback) is not specified remove all events with the specified name.
_Arguments_
- obj
Object
DOM element to remove event listener(s) from. - name
String
Name of event listener to remove. - (optional)
Function|String
might be a callback or unique key to match.
removeAllEvents(obj, (optional)) static
Remove all kind of events from the specified object
_Arguments_
- obj
Object
DOM element to remove event listeners from. - (optional)
String
unique key to match, when removing events.
cleanName(s) static
Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and *.
_Arguments_
- s
String
String to clean up.
buildUrl(url, items) static
Builds a full url out of a base URL and an object with items to append as query string items.
_Arguments_
- url
String
Base URL to append query string items to. - items
Object
Name/value object to serialize as a querystring.
formatSize(size) static
Formats the specified number as a size string for example 1024 becomes 1 KB.
_Arguments_
- size
Number
Size to format as string.
parseSize(size) static
Parses the specified size string into a byte value. For example 10kb becomes 10240.
_Arguments_
- size
String|Number
String to parse or number to just pass through.
predictRuntime(config, [runtimes]) static
A way to predict what runtime will be choosen in the current environment with the specified settings.
_Arguments_
- config
Object|String
Plupload settings to check - [runtimes]
String
Comma-separated list of runtimes to check against
addFileFilter(name, cb) static
Registers a filter that will be executed for each file added to the queue. If callback returns false, file will not be added.
Callback receives two arguments: a value for the filter as it was specified in settings.filters and a file to be filtered. Callback is executed in the context of uploader instance.
_Arguments_
- name
String
Name of the filter by which it can be referenced in settings.filters - cb
String
Callback - the actual routine that every added file must pass