Last active
December 20, 2015 01:09
-
-
Save jayarjo/6047118 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="container"> | |
<div id="filelist">No runtime found.</div> | |
<br /> | |
<a id="pickfiles" href="javascript:;">[Select files]</a> | |
<a id="uploadfiles" href="javascript:;">[Upload files]</a> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
function $(id) { | |
return document.getElementById(id); | |
} | |
var uploader = new plupload.Uploader({ | |
runtimes : 'html5,flash,silverlight,browserplus', | |
browse_button : 'pickfiles', | |
container: 'container', | |
max_file_size : '10mb', | |
url : 'upload.php', | |
resize : {width : 320, height : 240, quality : 90}, | |
flash_swf_url : 'http://rawgithub.com/moxiecode/plupload/1.x/js/plupload.flash.cors.swf', | |
silverlight_xap_url : '../js/plupload.silverlight.xap', | |
filters : [ | |
{title : "Image files", extensions : "jpg,gif,png"}, | |
{title : "Zip files", extensions : "zip"} | |
] | |
}); | |
uploader.bind('Init', function(up, params) { | |
$('filelist').innerHTML = "<div>Current runtime: " + params.runtime + "</div>"; | |
}); | |
uploader.init(); | |
uploader.bind('FilesAdded', function(up, files) { | |
plupload.each(files, function(file) { | |
$('filelist').innerHTML += '<div id="' + file.id + '">' + file.name + ' (' + plupload.formatSize(file.size) + ') <b></b></div>'; | |
}); | |
}); | |
uploader.bind('UploadProgress', function(up, file) { | |
$(file.id).getElementsByTagName('b')[0].innerHTML = '<span>' + file.percent + "%</span>"; | |
}); | |
$('uploadfiles').onclick = function() { | |
uploader.start(); | |
return false; | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Plupload #842 | |
description: https://github.com/moxiecode/plupload/issues/842 | |
authors: | |
- Davit Barbakadze | |
resources: | |
- https://rawgithub.com/moxiecode/plupload/1.x/js/plupload.full.js | |
normalize_css: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{"jsonrpc" : "2.0", "result" : null, "id" : "id"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://jsfiddle.net/gh/gist/jquery/1.9.1/6047118/