photomix/public/javascripts/plupload/examples/queue_widget_dev.html
2011-04-11 12:43:27 +08:00

194 lines
6.4 KiB
HTML

<!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"/>
<link rel="stylesheet" href="css/plupload.queue.css" type="text/css" media="screen" />
<title>Plupload - Queue widget example</title>
<style type="text/css">
body {background: #9A7C5F;}
</style>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1.3");
</script>
<script type="text/javascript" src="../src/javascript/gears_init.js"></script>
<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
<!-- Load source versions of the plupload script files -->
<script type="text/javascript" src="../src/javascript/plupload.js"></script>
<script type="text/javascript" src="../src/javascript/plupload.gears.js"></script>
<script type="text/javascript" src="../src/javascript/plupload.silverlight.js"></script>
<script type="text/javascript" src="../src/javascript/plupload.flash.js"></script>
<script type="text/javascript" src="../src/javascript/plupload.browserplus.js"></script>
<script type="text/javascript" src="../src/javascript/plupload.html4.js"></script>
<script type="text/javascript" src="../src/javascript/plupload.html5.js"></script>
<script type="text/javascript" src="../src/javascript/jquery.plupload.queue.js"></script>
<script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script>
<script>
$(function() {
// Setup flash version
$("#flash_uploader").pluploadQueue({
// General settings
runtimes : 'flash',
url : 'upload.php',
max_file_size : '10mb',
chunk_size : '1mb',
unique_names : true,
resize : {width : 320, height : 240, quality : 90},
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
],
// Flash settings
flash_swf_url : '../js/plupload.flash.swf'
});
// Setup gears version
$("#gears_uploader").pluploadQueue({
// General settings
runtimes : 'gears',
url : 'upload.php',
max_file_size : '10mb',
chunk_size : '1mb',
unique_names : true,
resize : {width : 320, height : 240, quality : 90},
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
});
// Setup silverlight version
$("#silverlight_uploader").pluploadQueue({
// General settings
runtimes : 'silverlight',
url : 'upload.php',
max_file_size : '10mb',
chunk_size : '1mb',
unique_names : true,
resize : {width : 320, height : 240, quality : 90},
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
],
// Silverlight settings
silverlight_xap_url : '../js/plupload.silverlight.xap'
});
// Setup html5 version
$("#html5_uploader").pluploadQueue({
// General settings
runtimes : 'html5',
url : 'upload.php',
max_file_size : '10mb',
chunk_size : '1mb',
unique_names : true,
resize : {width : 320, height : 240, quality : 90},
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
});
// Setup browserplus version
$("#browserplus_uploader").pluploadQueue({
// General settings
runtimes : 'browserplus',
url : 'upload.php',
max_file_size : '10mb',
chunk_size : '1mb',
unique_names : true,
resize : {width : 320, height : 240, quality : 90},
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
});
// Setup browserplus version
$("#html4_uploader").pluploadQueue({
// General settings
runtimes : 'html4',
url : 'upload.php',
max_file_size : '10mb',
chunk_size : '1mb',
unique_names : true,
resize : {width : 320, height : 240, quality : 90},
filters : [
{title : "Image files", extensions : "jpg,gif,png"},
{title : "Zip files", extensions : "zip"}
]
});
// Custom example
var uploader = new plupload.Uploader({
runtimes : 'gears,html5,flash,silverlight,browserplus',
browse_button : 'pickfiles',
url : 'upload.php'
});
uploader.bind('FilesAdded', function(up, files) {
$.each(files, function(i, file) {
$('#filelist').append("<div id=" + file.id + ">File: " + file.name + " (" + plupload.formatSize(file.size) + ") <span></span></div>");
});
});
uploader.bind('UploadProgress', function(up, file) {
$('#' + file.id + " span").html(file.percent + "%");
});
$('#uploadfiles').click(function() {
uploader.start();
});
uploader.init();
});
</script>
<!-- <script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script> -->
</head>
<body>
<form method="post" action="dump.php">
<h1>Queue widget example</h1>
<p>Shows the jQuery Plupload Queue widget and under different runtimes.</p>
<div style="float: left; margin-right: 20px">
<h3>Flash runtime</h3>
<div id="flash_uploader" style="width: 450px; height: 330px;">You browser doesn't have Flash installed.</div>
<h3>Gears runtime</h3>
<div id="gears_uploader" style="width: 450px; height: 330px;">You browser doesn't have Gears installed.</div>
</div>
<div style="float: left; margin-right: 20px">
<h3>Silverlight runtime</h3>
<div id="silverlight_uploader" style="width: 450px; height: 330px;">You browser doesn't have Silverlight installed.</div>
<h3>HTML 5 runtime</h3>
<div id="html5_uploader" style="width: 450px; height: 330px;">You browser doesn't support native upload. Try Firefox 3 or Safari 4.</div>
</div>
<div style="float: left; margin-right: 20px">
<h3>BrowserPlus runtime</h3>
<div id="browserplus_uploader" style="width: 450px; height: 330px;">You browser doesn't have BrowserPlus installed.</div>
<h3>HTML4 runtime</h3>
<div id="html4_uploader" style="width: 450px; height: 330px;">You browser doesn't have a HTML 4 browser.</div>
<div>
<h3>Custom example</h3>
<div id="filelist"></div>
<input id="pickfiles" type="button" value="Pick files" />
<input id="uploadfiles" type="button" value="Upload" />
</div>
</div>
<br style="clear: both" />
<input type="submit" value="Send" />
</form>
</body>
</html>