From 9b16c56e61566b7c51f7346b78157309db5a581c Mon Sep 17 00:00:00 2001
From: Wong Hoi Sing Edison <hswong3i@gmail.com>
Date: Mon, 13 Jan 2014 09:39:00 +0800
Subject: [PATCH] Issue #1903850: [meta] Patch for remove plupload library
 examples folder for Drupal distribution.

---
 examples/bg.jpg                       |  Bin 5753 -> 0 bytes
 examples/custom.html                  |   88 ---------------
 examples/dump.php                     |   35 ------
 examples/jquery/events.html           |  196 ---------------------------------
 examples/jquery/jquery_ui_widget.html |  101 -----------------
 examples/jquery/queue_widget.html     |  173 -----------------------------
 examples/jquery/s3.php                |  158 --------------------------
 examples/upload.php                   |  129 ----------------------
 8 files changed, 880 deletions(-)
 delete mode 100644 examples/bg.jpg
 delete mode 100644 examples/custom.html
 delete mode 100644 examples/dump.php
 delete mode 100644 examples/jquery/events.html
 delete mode 100644 examples/jquery/jquery_ui_widget.html
 delete mode 100644 examples/jquery/queue_widget.html
 delete mode 100644 examples/jquery/s3.php
 delete mode 100644 examples/upload.php

diff --git a/examples/bg.jpg b/examples/bg.jpg
deleted file mode 100644
index 9b27383bc5e8ef5cbfe8184cb382f57bd6257d3b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 5753
zcmaJ@dpy+H`~Q4Cb1??vt_TgeYsR=UQZtR*?}SAyximvF#*E9jY<)zesBsA)xf3Oo
zq_Q;?64g#Z<<=0jvSQU%wl=@1@9uuT-`DHAzvqw7InO!I^M0Ol&ij1Mv-Wgt8d$%B
z$A|_17Z)P{1N>XoegWhi5+h<$01!ZmhrIz{Z5m-rPe@>sO-xu^Vt8cSo+x5O9Mgms
z&NeY6l1zXt+j#8oh}ftE{GO=243@q2()F9#ct)hXcA%vP$%9RcqBERRIZ=M8p8gT3
zu@SbB+S|6`xA4e3CYu?R5RT_D_p!KSp1t-raI(1nb=X83|IH*J)?S<XH7Y*H!y8YF
z<3!;ti6lY<$%=%xG9{XtTUc9LZ^oOEOi3mrGZRxYf~hsx+>A^j;r|qEa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xDXo$?u
z6mN;pvKWI#hnEaJr8@c2nqEFe*p}5SG_#gpLs|^=rVtGR>RU%@VB}caQ0C-J3rM);
za12-Z9zJfhYG8E8Zw01}pXpcU*@j`>yR6UO%2%8T)VugQ<@<ccO$ALF)kap0S~k{N
z=ck}9*?srdfc!GQ4v=nnjpgd9%>?^jhaP%$#mfRpOt>o5u0Z_&Pw%2i^*jWafY;T<
z5ZC@Mr`^$|_B|M)pZ9~VKtLmSn%g~iY+21>0(Yf%R=?>7X%PJzF5s$ngy%sBv5Dwg
Ms_thXyY}q=0Jy;wm;e9(

diff --git a/examples/custom.html b/examples/custom.html
deleted file mode 100644
index 0672ced..0000000
--- a/examples/custom.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!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"/>
-
-<title>Plupload - Custom example</title>
-
-<style type="text/css">
-	body {
-		font-family:Verdana, Geneva, sans-serif;
-		font-size:13px;
-		color:#333;
-		background:url(bg.jpg);
-	}
-</style>
-
-<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
-
-<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>
-
-</head>
-<body>
-
-<h1>Custom example</h1>
-
-<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>
-
-
-<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',
-	container: 'container',
-	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.init();
-
-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;
-};
-
-
-</script>
-</body>
-</html>
\ No newline at end of file
diff --git a/examples/dump.php b/examples/dump.php
deleted file mode 100644
index 2aacd20..0000000
--- a/examples/dump.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<!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"/>
-<title>Plupload - Form dump</title>
-<style type="text/css">
-	body {
-		font-family:Verdana, Geneva, sans-serif;
-		font-size:13px;
-		color:#333;
-		background:url(bg.jpg);
-	}
-</style>
-</head>
-<body>
-
-<h1>Post dump</h1>
-
-<p>Shows the form items posted.</p>
-
-<table>
-	<tr>
-		<th>Name</th>
-		<th>Value</th>
-	</tr>
-	<?php $count = 0; foreach ($_POST as $name => $value) { ?>
-	<tr class="<?php echo $count % 2 == 0 ? 'alt' : ''; ?>">
-		<td><?php echo htmlentities(stripslashes($name)) ?></td>
-		<td><?php echo nl2br(htmlentities(stripslashes($value))) ?></td>
-	</tr>
-	<?php } ?>
-</table>
-
-</body>
-</html>
diff --git a/examples/jquery/events.html b/examples/jquery/events.html
deleted file mode 100644
index 388cd86..0000000
--- a/examples/jquery/events.html
+++ /dev/null
@@ -1,196 +0,0 @@
-<!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="../../js/jquery.plupload.queue/css/jquery.plupload.queue.css" type="text/css" media="screen" />
-<title>Plupload - Events example</title>
-<style type="text/css">
-	body {
-		font-family:Verdana, Geneva, sans-serif;
-		font-size:13px;
-		color:#333;
-		background:url(../bg.jpg);
-	}
-</style>
-
-<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
-<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
-
-<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="../../js/jquery.plupload.queue/jquery.plupload.queue.js"></script>
-
-</head>
-<body>
-
-<form method="post" action="dump.php">
-	<h1>Events example</h1>
-
-	<p>Shows how to bind and use all available events.</p>
-
-	<h3>Log messages</h3>
-	<textarea id="log" style="width: 100%; height: 150px; font-size: 11px" spellcheck="false" wrap="off"></textarea>
-
-	<h3>Queue widget</h3>
-	<div id="uploader" style="width: 450px; height: 330px;">Your browser doesn't support upload.</div>
-	<a id="clear" href="#">Clear queue</a>
-</form>
-<script type="text/javascript">
-$(function() {
-	function log() {
-		var str = "";
-
-		plupload.each(arguments, function(arg) {
-			var row = "";
-
-			if (typeof(arg) != "string") {
-				plupload.each(arg, function(value, key) {
-					// Convert items in File objects to human readable form
-					if (arg instanceof plupload.File) {
-						// Convert status to human readable
-						switch (value) {
-							case plupload.QUEUED:
-								value = 'QUEUED';
-								break;
-
-							case plupload.UPLOADING:
-								value = 'UPLOADING';
-								break;
-
-							case plupload.FAILED:
-								value = 'FAILED';
-								break;
-
-							case plupload.DONE:
-								value = 'DONE';
-								break;
-						}
-					}
-
-					if (typeof(value) != "function") {
-						row += (row ? ', ': '') + key + '=' + value;
-					}
-				});
-
-				str += row + " ";
-			} else { 
-				str += arg + " ";
-			}
-		});
-
-		$('#log').val($('#log').val() + str + "\r\n");
-	}
-
-	$("#uploader").pluploadQueue({
-		// General settings
-		runtimes: 'html5,gears,browserplus,silverlight,flash,html4',
-		url: '../upload.php',
-		max_file_size: '10mb',
-		chunk_size: '1mb',
-		unique_names: true,
-
-		// Resize images on clientside if we can
-		resize: {width: 320, height: 240, quality: 90},
-
-		// Specify what files to browse for
-		filters: [
-			{title: "Image files", extensions: "jpg,gif,png"},
-			{title: "Zip files", extensions: "zip"}
-		],
-
-		// Flash/Silverlight paths
-		flash_swf_url: '../../js/plupload.flash.swf',
-		silverlight_xap_url: '../../js/plupload.silverlight.xap',
-
-		// PreInit events, bound before any internal events
-		preinit: {
-			Init: function(up, info) {
-				log('[Init]', 'Info:', info, 'Features:', up.features);
-			},
-
-			UploadFile: function(up, file) {
-				log('[UploadFile]', file);
-
-				// You can override settings before the file is uploaded
-				// up.settings.url = 'upload.php?id=' + file.id;
-				// up.settings.multipart_params = {param1: 'value1', param2: 'value2'};
-			}
-		},
-
-		// Post init events, bound after the internal events
-		init: {
-			Refresh: function(up) {
-				// Called when upload shim is moved
-				log('[Refresh]');
-			},
-
-			StateChanged: function(up) {
-				// Called when the state of the queue is changed
-				log('[StateChanged]', up.state == plupload.STARTED ? "STARTED": "STOPPED");
-			},
-
-			QueueChanged: function(up) {
-				// Called when the files in queue are changed by adding/removing files
-				log('[QueueChanged]');
-			},
-
-			UploadProgress: function(up, file) {
-				// Called while a file is being uploaded
-				log('[UploadProgress]', 'File:', file, "Total:", up.total);
-			},
-
-			FilesAdded: function(up, files) {
-				// Callced when files are added to queue
-				log('[FilesAdded]');
-
-				plupload.each(files, function(file) {
-					log('  File:', file);
-				});
-			},
-
-			FilesRemoved: function(up, files) {
-				// Called when files where removed from queue
-				log('[FilesRemoved]');
-
-				plupload.each(files, function(file) {
-					log('  File:', file);
-				});
-			},
-
-			FileUploaded: function(up, file, info) {
-				// Called when a file has finished uploading
-				log('[FileUploaded] File:', file, "Info:", info);
-			},
-
-			ChunkUploaded: function(up, file, info) {
-				// Called when a file chunk has finished uploading
-				log('[ChunkUploaded] File:', file, "Info:", info);
-			},
-
-			Error: function(up, args) {
-				// Called when a error has occured
-
-				// Handle file specific error and general error
-				if (args.file) {
-					log('[error]', args, "File:", args.file);
-				} else {
-					log('[error]', args);
-				}
-			}
-		}
-	});
-
-	$('#log').val('');
-	$('#clear').click(function(e) {
-		e.preventDefault();
-		$("#uploader").pluploadQueue().splice();
-	});
-});
-</script>
-</body>
-</html>
\ No newline at end of file
diff --git a/examples/jquery/jquery_ui_widget.html b/examples/jquery/jquery_ui_widget.html
deleted file mode 100644
index 26255c0..0000000
--- a/examples/jquery/jquery_ui_widget.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!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"/>
-<title>Plupload - jQuery UI Widget</title>
-<style type="text/css">
-	body {
-		font-family:Verdana, Geneva, sans-serif;
-		font-size:13px;
-		color:#333;
-		background:url(../bg.jpg);
-	}
-</style>
-<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" type="text/css" />
-<link rel="stylesheet" href="../../src/javascript/jquery.ui.plupload/css/jquery.ui.plupload.css" type="text/css" />
-
-<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
-<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
-<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
-
-<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.ui.plupload/jquery.ui.plupload.js"></script>
-
-</head>
-<body>
-
-<h1>jQuery UI Widget</h1>
-
-<p>You can see this example with different themes on the <a href="http://plupload.com/example_jquery_ui.php">www.plupload.com</a> website.</p>
-
-<form  method="post" action="../dump.php">
-	<div id="uploader">
-		<p>Your browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
-	</div>
-</form>
-<script type="text/javascript">
-// Convert divs to queue widgets when the DOM is ready
-$(function() {
-	$("#uploader").plupload({
-		// General settings
-		runtimes : 'flash,html5,browserplus,silverlight,gears,html4',
-		url : '../upload.php',
-		max_file_size : '1000mb',
-		max_file_count: 20, // user can add no more then 20 files at a time
-		chunk_size : '1mb',
-		rename: true,
-		multiple_queues : true,
-
-		// Resize images on clientside if we can
-		resize : {width : 320, height : 240, quality : 90},
-		
-		// Rename files by clicking on their titles
-		rename: true,
-		
-		// Sort files
-		sortable: true,
-
-		// Specify what files to browse for
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip,avi"}
-		],
-
-		// Flash settings
-		flash_swf_url : '../../js/plupload.flash.swf',
-
-		// Silverlight settings
-		silverlight_xap_url : '../../js/plupload.silverlight.xap'
-	});
-
-	// Client side form validation
-	$('form').submit(function(e) {
-        var uploader = $('#uploader').plupload('getUploader');
-
-        // Files in queue upload them first
-        if (uploader.files.length > 0) {
-            // When all files are uploaded submit form
-            uploader.bind('StateChanged', function() {
-                if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
-                    $('form')[0].submit();
-                }
-            });
-                
-            uploader.start();
-        } else
-            alert('You must at least upload one file.');
-
-        return false;
-    });
-	 
-
-});
-</script>
-</body>
-</html>
\ No newline at end of file
diff --git a/examples/jquery/queue_widget.html b/examples/jquery/queue_widget.html
deleted file mode 100644
index 5884857..0000000
--- a/examples/jquery/queue_widget.html
+++ /dev/null
@@ -1,173 +0,0 @@
-<!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"/>
-<title>Plupload - Queue widget example</title>
-<style type="text/css">
-	body {
-		font-family:Verdana, Geneva, sans-serif;
-		font-size:13px;
-		color:#333;
-		background:url(../bg.jpg);
-	}
-</style>
-<link rel="stylesheet" href="../../js/jquery.plupload.queue/css/jquery.plupload.queue.css" type="text/css" media="screen" />
-
-<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
-<script type="text/javascript" src="http://bp.yahooapis.com/2.4.21/browserplus-min.js"></script>
-
-<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/jquery.plupload.queue.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;">Your browser doesn't have Flash installed.</div>
-
-		<h3>Gears runtime</h3>
-		<div id="gears_uploader" style="width: 450px; height: 330px;">Your 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;">Your browser doesn't have Silverlight installed.</div>
-
-		<h3>HTML 5 runtime</h3>
-		<div id="html5_uploader" style="width: 450px; height: 330px;">Your 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;">Your browser doesn't have BrowserPlus installed.</div>
-
-		<h3>HTML 4 runtime</h3>
-		<div id="html4_uploader" style="width: 450px; height: 330px;">Your browser doesn't have HTML 4 support.</div>
-	</div>
-
-	<br style="clear: both" />
-
-	<input type="submit" value="Send" />
-</form>
-
-<script type="text/javascript">
-$(function() {
-	// Setup flash version
-	$("#flash_uploader").pluploadQueue({
-		// General settings
-		runtimes : 'flash',
-		url : '../upload.php',
-		max_file_size : '10mb',
-		chunk_size : '1mb',
-		rename : true,
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip"}
-		],
-
-		// Resize images on clientside if we can
-		resize : {width : 320, height : 240, quality : 90},
-
-		// 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,
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip"}
-		],
-
-		// Resize images on clientside if we can
-		resize : {width : 320, height : 240, quality : 90}
-	});
-
-	// Setup silverlight version
-	$("#silverlight_uploader").pluploadQueue({
-		// General settings
-		runtimes : 'silverlight',
-		url : '../upload.php',
-		max_file_size : '10mb',
-		chunk_size : '1mb',
-		unique_names : true,
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip"}
-		],
-
-		// Resize images on clientside if we can
-		resize : {width : 320, height : 240, quality : 90},
-
-		// 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,
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip"}
-		],
-
-		// Resize images on clientside if we can
-		resize : {width : 320, height : 240, quality : 90}
-	});
-
-	// Setup browserplus version
-	$("#browserplus_uploader").pluploadQueue({
-		// General settings
-		runtimes : 'browserplus',
-		url : '../upload.php',
-		max_file_size : '10mb',
-		chunk_size : '1mb',
-		unique_names : true,
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip"}
-		],
-
-		// Resize images on clientside if we can
-		resize : {width : 320, height : 240, quality : 90}
-	});
-
-	// Setup html4 version
-	$("#html4_uploader").pluploadQueue({
-		// General settings
-		runtimes : 'html4',
-		url : '../upload.php',
-		unique_names : true,
-		filters : [
-			{title : "Image files", extensions : "jpg,gif,png"},
-			{title : "Zip files", extensions : "zip"}
-		]
-	});
-});
-</script>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/examples/jquery/s3.php b/examples/jquery/s3.php
deleted file mode 100644
index e960afc..0000000
--- a/examples/jquery/s3.php
+++ /dev/null
@@ -1,158 +0,0 @@
-<?php 
-/* 
-In order to upload files to S3 using Flash runtime, one should start by placing crossdomain.xml into the bucket.
-crossdomain.xml can be as simple as this:
-
-<?xml version="1.0"?>
-<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
-<cross-domain-policy>
-<allow-access-from domain="*" secure="false" />
-</cross-domain-policy>
-
-In our tests SilverLight didn't require anything special and worked with this configuration just fine. It may fail back
-to the same crossdomain.xml as last resort.
-
-!!!Important!!! Plupload UI Widget here, is used only for demo purposes and is not required for uploading to S3.
-*/
-
-// important variables that will be used throughout this example
-$bucket = 'BUCKET';
-
-// these can be found on your Account page, under Security Credentials > Access Keys
-$accessKeyId = 'ACCESS_KEY_ID';
-$secret = 'SECRET_ACCESS_KEY';
-
-
-// hash_hmac — Generate a keyed hash value using the HMAC method 
-// (PHP 5 >= 5.1.2, PECL hash >= 1.1)
-if (!function_exists('hash_hmac')) :
-// based on: http://www.php.net/manual/en/function.sha1.php#39492
-function hash_hmac($algo, $data, $key, $raw_output = false)
-{
-	$blocksize = 64;
-    if (strlen($key) > $blocksize)
-        $key = pack('H*', $algo($key));
-    
-	$key = str_pad($key, $blocksize, chr(0x00));
-    $ipad = str_repeat(chr(0x36), $blocksize);
-    $opad = str_repeat(chr(0x5c), $blocksize);
-    $hmac = pack('H*', $algo(($key^$opad) . pack('H*', $algo(($key^$ipad) . $data))));
-	
-	return $raw_output ? $hmac : bin2hex($hmac);
-}
-endif;
-
-// prepare policy
-$policy = base64_encode(json_encode(array(
-	// ISO 8601 - date('c'); generates uncompatible date, so better do it manually
-	'expiration' => date('Y-m-d\TH:i:s.000\Z', strtotime('+1 day')),  
-	'conditions' => array(
-		array('bucket' => $bucket),
-		array('acl' => 'public-read'),
-		array('starts-with', '$key', ''),
-		// for demo purposes we are accepting only images
-		array('starts-with', '$Content-Type', 'image/'),
-		// "Some versions of the Adobe Flash Player do not properly handle HTTP responses that have an empty body. 
-		// To configure POST to return a response that does not have an empty body, set success_action_status to 201.
-		// When set, Amazon S3 returns an XML document with a 201 status code." 
-		// http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTFlash.html
-		array('success_action_status' => '201'),
-		// Plupload internally adds name field, so we need to mention it here
-		array('starts-with', '$name', ''), 	
-		// One more field to take into account: Filename - gets silently sent by FileReference.upload() in Flash
-		// http://docs.amazonwebservices.com/AmazonS3/latest/dev/HTTPPOSTFlash.html
-		array('starts-with', '$Filename', ''), 
-	)
-)));
-
-// sign policy
-$signature = base64_encode(hash_hmac('sha1', $policy, $secret, true));
-
-?>
-<!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"/>
-<title>Plupload to Amazon S3 Example</title>
-
-<style type="text/css">
-	body {
-		font-family:Verdana, Geneva, sans-serif;
-		font-size:13px;
-		color:#333;
-		background:url(../bg.jpg);
-	}
-</style>
-
-<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" type="text/css" />
-<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
-<script src=" https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script>
-
-<!-- Load plupload and all it's runtimes and finally the UI widget -->
-<link rel="stylesheet" href="../../js/jquery.ui.plupload/css/jquery.ui.plupload.css" type="text/css" />
-
-<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="../../js/jquery.ui.plupload/jquery.ui.plupload.js"></script>
-<!--<script type="text/javascript" src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script>-->
-
-</head>
-<body>
-
-<h1>Plupload to Amazon S3 Example</h1>
-
-<div id="uploader">
-    <p>Your browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p>
-</div>
-
-<script type="text/javascript">
-// Convert divs to queue widgets when the DOM is ready
-$(function() {
-	$("#uploader").plupload({
-		runtimes : 'flash,silverlight',
-		url : 'http://<?php echo $bucket; ?>.s3.amazonaws.com/',
-		max_file_size : '10mb',
-		
-		multipart: true,
-		multipart_params: {
-			'key': '${filename}', // use filename as a key
-			'Filename': '${filename}', // adding this to keep consistency across the runtimes
-			'acl': 'public-read',
-			'Content-Type': 'image/jpeg',
-			'success_action_status': '201',
-			'AWSAccessKeyId' : '<?php echo $accessKeyId; ?>',		
-			'policy': '<?php echo $policy; ?>',
-			'signature': '<?php echo $signature; ?>'
-		},
-		
-		// !!!Important!!! 
-		// this is not recommended with S3, since it will force Flash runtime into the mode, with no progress indication
-		//resize : {width : 800, height : 600, quality : 60},  // Resize images on clientside, if possible 
-		
-		// optional, but better be specified directly
-		file_data_name: 'file',
-		
-		// re-use widget (not related to S3, but to Plupload UI Widget)
-		multiple_queues: true,
-
-		// Specify what files to browse for
-		filters : [
-			{title : "JPEG files", extensions : "jpg"}
-		],
-
-		// Flash settings
-		flash_swf_url : '../../js/plupload.flash.swf',
-
-		// Silverlight settings
-		silverlight_xap_url : '../../js/plupload.silverlight.xap'
-	});
-});
-</script>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/examples/upload.php b/examples/upload.php
deleted file mode 100644
index 70f16d9..0000000
--- a/examples/upload.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-/**
- * upload.php
- *
- * Copyright 2009, Moxiecode Systems AB
- * Released under GPL License.
- *
- * License: http://www.plupload.com/license
- * Contributing: http://www.plupload.com/contributing
- */
-
-// HTTP headers for no cache etc
-header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
-header("Cache-Control: no-store, no-cache, must-revalidate");
-header("Cache-Control: post-check=0, pre-check=0", false);
-header("Pragma: no-cache");
-
-// Settings
-$targetDir = ini_get("upload_tmp_dir") . DIRECTORY_SEPARATOR . "plupload";
-//$targetDir = 'uploads';
-
-$cleanupTargetDir = true; // Remove old files
-$maxFileAge = 5 * 3600; // Temp file age in seconds
-
-// 5 minutes execution time
-@set_time_limit(5 * 60);
-
-// Uncomment this one to fake upload time
-// usleep(5000);
-
-// Get parameters
-$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0;
-$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
-$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';
-
-// Clean the fileName for security reasons
-$fileName = preg_replace('/[^\w\._]+/', '_', $fileName);
-
-// Make sure the fileName is unique but only if chunking is disabled
-if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {
-	$ext = strrpos($fileName, '.');
-	$fileName_a = substr($fileName, 0, $ext);
-	$fileName_b = substr($fileName, $ext);
-
-	$count = 1;
-	while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . '_' . $count . $fileName_b))
-		$count++;
-
-	$fileName = $fileName_a . '_' . $count . $fileName_b;
-}
-
-$filePath = $targetDir . DIRECTORY_SEPARATOR . $fileName;
-
-// Create target dir
-if (!file_exists($targetDir))
-	@mkdir($targetDir);
-
-// Remove old temp files	
-if ($cleanupTargetDir) {
-	if (is_dir($targetDir) && ($dir = opendir($targetDir))) {
-		while (($file = readdir($dir)) !== false) {
-			$tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;
-
-			// Remove temp file if it is older than the max age and is not the current file
-			if (preg_match('/\.part$/', $file) && (filemtime($tmpfilePath) < time() - $maxFileAge) && ($tmpfilePath != "{$filePath}.part")) {
-				@unlink($tmpfilePath);
-			}
-		}
-		closedir($dir);
-	} else {
-		die('{"jsonrpc" : "2.0", "error" : {"code": 100, "message": "Failed to open temp directory."}, "id" : "id"}');
-	}
-}	
-
-// Look for the content type header
-if (isset($_SERVER["HTTP_CONTENT_TYPE"]))
-	$contentType = $_SERVER["HTTP_CONTENT_TYPE"];
-
-if (isset($_SERVER["CONTENT_TYPE"]))
-	$contentType = $_SERVER["CONTENT_TYPE"];
-
-// Handle non multipart uploads older WebKit versions didn't support multipart in HTML5
-if (strpos($contentType, "multipart") !== false) {
-	if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {
-		// Open temp file
-		$out = @fopen("{$filePath}.part", $chunk == 0 ? "wb" : "ab");
-		if ($out) {
-			// Read binary input stream and append it to temp file
-			$in = @fopen($_FILES['file']['tmp_name'], "rb");
-
-			if ($in) {
-				while ($buff = fread($in, 4096))
-					fwrite($out, $buff);
-			} else
-				die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
-			@fclose($in);
-			@fclose($out);
-			@unlink($_FILES['file']['tmp_name']);
-		} else
-			die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
-	} else
-		die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Failed to move uploaded file."}, "id" : "id"}');
-} else {
-	// Open temp file
-	$out = @fopen("{$filePath}.part", $chunk == 0 ? "wb" : "ab");
-	if ($out) {
-		// Read binary input stream and append it to temp file
-		$in = @fopen("php://input", "rb");
-
-		if ($in) {
-			while ($buff = fread($in, 4096))
-				fwrite($out, $buff);
-		} else
-			die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Failed to open input stream."}, "id" : "id"}');
-
-		@fclose($in);
-		@fclose($out);
-	} else
-		die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
-}
-
-// Check if file has been uploaded
-if (!$chunks || $chunk == $chunks - 1) {
-	// Strip the temp .part suffix off 
-	rename("{$filePath}.part", $filePath);
-}
-
-die('{"jsonrpc" : "2.0", "result" : null, "id" : "id"}');
-- 
1.7.9.5

