-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Plupload
- 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
-
IMAGE_MEMORY_ERROR
static
-
IMAGE_DIMENSIONS_ERROR
static
- mimeTypes
-
VERSION
-
Methods
-
typeOf(o)
static
-
extend(target, obj)
static
-
guid()
static
-
each(obj, callback)
static
-
getPos(node, root)
static
-
getSize(node)
static
-
xmlEncode(s)
static
-
toArray(obj)
static
-
inArray(needle, array)
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)
Plupload version will be replaced on build.
### [STOPPED](/moxiecode/plupload/blob/master/src/plupload.js#L88 "Defined at: src/plupload.js:88") `static`Inital state of the queue and also the state ones it's finished all it's uploads.
### [STARTED](/moxiecode/plupload/blob/master/src/plupload.js#L97 "Defined at: src/plupload.js:97") `static`Upload process is running
### [QUEUED](/moxiecode/plupload/blob/master/src/plupload.js#L106 "Defined at: src/plupload.js:106") `static`File is queued for upload
### [UPLOADING](/moxiecode/plupload/blob/master/src/plupload.js#L115 "Defined at: src/plupload.js:115") `static`File is being uploaded
### [FAILED](/moxiecode/plupload/blob/master/src/plupload.js#L124 "Defined at: src/plupload.js:124") `static`File has failed to be uploaded
### [DONE](/moxiecode/plupload/blob/master/src/plupload.js#L133 "Defined at: src/plupload.js:133") `static`File has been uploaded successfully
### [GENERIC_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L144 "Defined at: src/plupload.js:144") `static`Generic error for example if an exception is thrown inside Silverlight.
### [HTTP_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L153 "Defined at: src/plupload.js:153") `static`HTTP transport error. For example if the server produces a HTTP status other than 200.
### [IO_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L162 "Defined at: src/plupload.js:162") `static`Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.
### [SECURITY_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L171 "Defined at: src/plupload.js:171") `static`Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.
### [INIT_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L180 "Defined at: src/plupload.js:180") `static`Initialization error. Will be triggered if no runtime was initialized.
### [FILE_SIZE_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L189 "Defined at: src/plupload.js:189") `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](/moxiecode/plupload/blob/master/src/plupload.js#L198 "Defined at: src/plupload.js:198") `static`File extension error. If the user selects a file that isn't valid according to the filters setting.
### [FILE_DUPLICATE_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L207 "Defined at: src/plupload.js:207") `static`Duplicate file error. If prevent_duplicates is set to true and user selects the same file again.
### [IMAGE_FORMAT_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L216 "Defined at: src/plupload.js:216") `static`Runtime will try to detect if image is proper one. Otherwise will throw this error.
### [IMAGE_MEMORY_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L225 "Defined at: src/plupload.js:225") `static`While working on the image runtime will try to detect if the operation may potentially run out of memeory and will throw this error.
### [IMAGE_DIMENSIONS_ERROR](/moxiecode/plupload/blob/master/src/plupload.js#L234 "Defined at: src/plupload.js:234") `static`Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error.
### [mimeTypes](/moxiecode/plupload/blob/master/src/plupload.js#L243 "Defined at: src/plupload.js:243")Mime type lookup table.
## Methods ### [typeOf(o)](/moxiecode/plupload/blob/master/src/plupload.js#L257 "Defined at: src/plupload.js:257") `static`Gets the true type of the built-in object (better version of typeof).
Arguments
-
o
Object
Object to check.
Extends the specified object with another object.
Arguments
-
target
Object
Object to extend. -
obj
Object..
Multiple objects to extend with.
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 milisecond 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 ansteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property to an user unique key.
### [each(obj, callback)](/moxiecode/plupload/blob/master/src/plupload.js#L292 "Defined at: src/plupload.js:292") `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.
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.
Returns the size of the specified node in pixels.
Arguments
-
node
Node
Node to get the size of.
Encodes the specified string.
Arguments
-
s
String
String to encode.
Forces anything into an array.
Arguments
-
obj
Object
Object with length field.
Find an element in array and return it's index if present, otherwise return -1.
Arguments
-
needle
Mixed
Element to find -
array
Array
Extends the language pack object with new items.
Arguments
-
pack
Object
Language pack items to add.
Translates the specified string by checking for the english string in the language pack lookup.
Arguments
-
str
String
String to look for.
Checks if object is empty.
Arguments
-
obj
Object
Object to check.
Checks if specified DOM element has specified class.
Arguments
-
obj
Object
DOM element like object to add handler to. -
name
String
Class name
Adds specified className to specified DOM element.
Arguments
-
obj
Object
DOM element like object to add handler to. -
name
String
Class name
Removes specified className from specified DOM element.
Arguments
-
obj
Object
DOM element like object to add handler to. -
name
String
Class name
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
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.
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.
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.
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.
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.
Formats the specified number as a size string for example 1024 becomes 1 KB.
Arguments
-
size
Number
Size to format as string.
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.
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
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