Class SpazImageUploader
Defined in: spazimageuploader.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SpazImageUploader(opts)
An image uploader library for SpazCore. |
Field Attributes | Field Name and Description |
---|---|
a hash of service objects. |
Method Attributes | Method Name and Description |
---|---|
Retrieves the auth_header |
|
returns an array of labels for the services |
|
setOpts(opts)
this lets us set options after instantiation |
|
upload()
this actually does the upload. |
SpazImageUploader(opts)
An image uploader library for SpazCore. Probably this will supercede spazfileuploader.js
- Parameters:
- {object} opts Optional
- options hash
- {object} opts.auth_obj Optional
- A SpazAuth object that's filled with proper authentication info
- {string} opts.username Optional
- a username, in case we're doing that kind of thing
- {string} opts.password Optional
- a password, in case we're doing that kind of thing
- {string} opts.auth_method Optional
- the method of authentication: 'echo' or 'basic'. Default is 'echo'
- {object} opts.extra Optional
- Extra params to pass in the upload request
services
a hash of service objects. Each object has a URL endpoint, a parseResponse callback, and an optional "extra" set of params to pass on upload parseResponse should return one of these key/val pairs: - {'url':'http://foo.bar/XXXX'} - {'error':'Error message'}
setOpts(opts)
this lets us set options after instantiation
- Parameters:
- {object} opts
- options hash
- {object} opts.auth_obj Optional
- A SpazAuth object that's filled with proper authentication info
- {string} opts.username Optional
- a username, in case we're doing that kind of thing
- {string} opts.password Optional
- a password, in case we're doing that kind of thing
- {string} opts.auth_method Optional
- the method of authentication: 'echo' or 'basic'. Default is 'echo'
- {string} opts.statusnet_api_base Optional
- the api base URL for statusnet, if that service is used
- {object} opts.extra Optional
- Extra params to pass in the upload request