forked from ntulip/swfupload-jquery-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
76 lines (57 loc) · 2.3 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
SWFUpload jQuery Plugin v1.0.0
-------------------------------
Copyright (c) 2009 Adam Royle. Licensed under the MIT license.
Overview
--------
A jQuery plugin that makes working with SWFUpload even easier.
Features include:
- jQuery-style instantiation
- jQuery-style event handling
- Ability to separate SWFUpload object from UI code
Usage
-----
// create the swfupload instance (settings must be an object)
$('.swfupload-control').swfupload(settings);
// add some additional handlers (for any plugins if used)
$.swfupload.additionalHandlers('some_extra_handler', 'another_extra_handler');
// same as above but as an array
$.swfupload.additionalHandlers(['some_extra_handler', 'another_extra_handler']);
// or just return an array of the additional handler names
$.swfupload.additionalHandlers();
// or return an array of the default handler names
$.swfupload.defaultHandlers();
// bind the swfupload event handlers like an other jquery event
$('.swfupload-control')
.bind('swfuploadLoaded', function(event){
console.debug('swfuploadLoaded!!', event);
})
.bind('fileQueued', function(event, file){
$(this).swfupload('startUpload');
console.debug('fileQueued!!', event);
});
// call methods on the swfupload instances by passing a string as the first parameter
// this method is chainable and therefore does not return any values
$('.swfupload-control').swfupload('startUpload', fileID);
$('.swfupload-control').swfupload('cancelUpload', fileID, triggerErrorEvent);
// or if you prefer, you can just get the instance directly
// if you need any return values for methods
$.swfupload.getInstance('.swfupload-control');
Event Names (and, their, params)
--------------------------------
swfuploadPreload (event)
swfuploadLoadFailed (event)
swfuploadLoaded (event)
fileDialogStart (event)
fileQueued (event, file)
fileQueueError (event, file, errorCode, message)
fileDialogComplete (event, numFilesSelected, numFilesQueued)
// uploadResizeStart (event) // can't see where this is called from their code
uploadStart (event, file)
uploadProgress (event, file, bytesComplete, bytesTotal)
uploadError (event, file, errorCode, message)
uploadSuccess (event, file, serverData, responseReceived)
uploadComplete (event, file)
mouseClick (event)
mouseOut (event)
mouseOver (event)
queueComplete (event, uploadCount) // from queue plugin