#Marionette module for plupload
##Getting started
###Quick start
- Clone the repository:
https://github.com/denar90/backbone.marionette-plupload-module
##Usage
###Initialization
var MyView = Marionette.ItemView.extend({
template: '<div></div>',
onShow: function() {
new Marionette.PlUploader(this, {
pluploadType: 'queue',
settings: {
runtimes : 'html5,flash,silverlight,html4',
url : "/examples/upload",
chunk_size : '1mb',
rename : true,
dragdrop: true,
filters : {
max_file_size : '10mb',
mime_types: [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
},
resize: {
width : 200,
height : 200,
quality : 90,
crop: true
},
flash_swf_url : '/plupload/js/Moxie.swf',
silverlight_xap_url : '/plupload/js/Moxie.xap'
},
callbacks: {
Browse: function() {
console.log('upload Browse');
},
Error: function() {
console.log('upload error');
},
FilesAdded: function(up, files) {
var html = '';
plupload.each(files, function(file) {
html += '<li id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></li>';
});
document.getElementById('filelist').innerHTML += html;
up.start();
}
}
});
}
});
app.mainRegion.show(new MyView());
##Options
Options for plupload
pluploadType
- type: String
- default: 'core'
Type of plupload can have be: core
, ui
, queue
pluploadContainer
- type: String
- default: '#plupload-container'
template
Default template - <div id="plupload-container"></div>
settings
All available settings for plupload.
callbacks
All available events for plupload.