2011-04-11 06:43:27 +02:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
2011-08-05 08:40:12 +02:00
|
|
|
|
2011-04-11 06:43:27 +02:00
|
|
|
<title>Plupload - Queue widget example</title>
|
2011-08-05 08:40:12 +02:00
|
|
|
|
2011-04-11 06:43:27 +02:00
|
|
|
<style type="text/css">
|
2011-08-05 08:40:12 +02:00
|
|
|
body {
|
|
|
|
font-family:Verdana, Geneva, sans-serif;
|
|
|
|
font-size:13px;
|
|
|
|
color:#333;
|
|
|
|
background:url(bg.jpg);
|
|
|
|
}
|
2011-04-11 06:43:27 +02:00
|
|
|
</style>
|
2011-08-05 08:40:12 +02:00
|
|
|
|
2011-04-11 06:43:27 +02:00
|
|
|
<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
|
2011-08-05 08:40:12 +02:00
|
|
|
|
|
|
|
<script type="text/javascript" src="../js/plupload.js"></script>
|
|
|
|
<script type="text/javascript" src="../js/plupload.gears.js"></script>
|
|
|
|
<script type="text/javascript" src="../js/plupload.silverlight.js"></script>
|
|
|
|
<script type="text/javascript" src="../js/plupload.flash.js"></script>
|
|
|
|
<script type="text/javascript" src="../js/plupload.browserplus.js"></script>
|
|
|
|
<script type="text/javascript" src="../js/plupload.html4.js"></script>
|
|
|
|
<script type="text/javascript" src="../js/plupload.html5.js"></script>
|
|
|
|
|
2011-04-11 06:43:27 +02:00
|
|
|
<!-- <script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script> -->
|
2011-08-05 08:40:12 +02:00
|
|
|
|
2011-04-11 06:43:27 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2011-09-25 08:55:01 +02:00
|
|
|
<h1>Custom example</h1>
|
2011-04-11 06:43:27 +02:00
|
|
|
|
2011-09-25 08:55:01 +02:00
|
|
|
<p>Shows you how to use the core plupload API.</p>
|
|
|
|
|
|
|
|
<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>
|
2011-04-11 06:43:27 +02:00
|
|
|
|
|
|
|
|
2011-08-05 08:40:12 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
// Custom example logic
|
|
|
|
function $(id) {
|
|
|
|
return document.getElementById(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var uploader = new plupload.Uploader({
|
|
|
|
runtimes : 'gears,html5,flash,silverlight,browserplus',
|
|
|
|
browse_button : 'pickfiles',
|
2011-09-25 08:55:01 +02:00
|
|
|
container: 'container',
|
2011-08-05 08:40:12 +02:00
|
|
|
max_file_size : '10mb',
|
|
|
|
url : 'upload.php',
|
|
|
|
resize : {width : 320, height : 240, quality : 90},
|
|
|
|
flash_swf_url : '../js/plupload.flash.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.bind('FilesAdded', function(up, files) {
|
|
|
|
for (var i in files) {
|
|
|
|
$('filelist').innerHTML += '<div id="' + files[i].id + '">' + files[i].name + ' (' + plupload.formatSize(files[i].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;
|
|
|
|
};
|
|
|
|
|
|
|
|
uploader.init();
|
|
|
|
</script>
|
2011-04-11 06:43:27 +02:00
|
|
|
</body>
|
|
|
|
</html>
|