Reverted #13319: Removed Plupload integration and removed contrib/plupload
authorErnesto Baschny <ernst@cron-it.de>
Sat, 22 Jan 2011 00:47:03 +0000 (00:47 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Sat, 22 Jan 2011 00:47:03 +0000 (00:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10237 709f56b5-9817-0410-a4d7-c38de5d9e867

30 files changed:
ChangeLog
typo3/alt_clickmenu.php
typo3/backend.php
typo3/classes/class.typo3_tcefile.php
typo3/contrib/plupload/changelog.txt [deleted file]
typo3/contrib/plupload/js/gears_init.js [deleted file]
typo3/contrib/plupload/js/jquery.plupload.queue.min.js [deleted file]
typo3/contrib/plupload/js/plupload.browserplus.min.js [deleted file]
typo3/contrib/plupload/js/plupload.flash.min.js [deleted file]
typo3/contrib/plupload/js/plupload.flash.swf [deleted file]
typo3/contrib/plupload/js/plupload.full.min.js [deleted file]
typo3/contrib/plupload/js/plupload.full.tmp.js [deleted file]
typo3/contrib/plupload/js/plupload.gears.min.js [deleted file]
typo3/contrib/plupload/js/plupload.html4.min.js [deleted file]
typo3/contrib/plupload/js/plupload.html5.min.js [deleted file]
typo3/contrib/plupload/js/plupload.min.js [deleted file]
typo3/contrib/plupload/js/plupload.silverlight.min.js [deleted file]
typo3/contrib/plupload/license.txt [deleted file]
typo3/contrib/plupload/readme.md [deleted file]
typo3/contrib/plupload/readme.txt [deleted file]
typo3/js/extjs/PluploadWindow.js
typo3/js/extjs/ext.ux.plupload.js
typo3/sysext/filelist/mod1/file_list.php
typo3/sysext/lang/locallang_misc.xml
typo3/sysext/setup/ext_tables.php
typo3/sysext/setup/locallang_csh_mod.xml
typo3/sysext/setup/mod/index.php
typo3/sysext/setup/mod/locallang.xml
typo3/sysext/t3skin/stylesheets/structure/module_file_upload.css
typo3/sysext/t3skin/stylesheets/visual/module_file_upload.css

index 494242a..e159e1c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
 
 2011-01-21  Ernesto Baschny  <ernst@cron-it.de>
 
+       * Reverted #13319: Removed Plupload integration and removed contrib/plupload
        * Fixed bug #17182: migrateWorkspaces in Install-Tool shows up even if nothing has to be done (Thanks to Tolleiv Nietsch)
        * Fixed bug #17184: Disable the CSRF protection in ExtDirect calls coming from the frontend (Thanks to Stefan Galinski)
        * Fixed bug #17201: The unit test for t3lib_formprotection_BackendFormProtection is broken (Thanks to Helmut Hummel)
index 2becac0..568f6be 100644 (file)
@@ -957,24 +957,16 @@ class clickMenu {
                $script = 'file_upload.php';
                $type = 'upload';
                $image = 'upload.gif';
-               if ($GLOBALS['BE_USER']->uc['enableFlashUploader'] == 1) {
+               if ($GLOBALS['BE_USER']->uc['enableFlashUploader']) {
                        $loc = 'top.content.list_frame';
 
                        $editOnClick = 'if (top.TYPO3.FileUploadWindow.isFlashAvailable()) { initFlashUploader("' . rawurlencode($path) . '"); } else if(' . $loc . '){' . $loc . ".location.href=top.TS.PATH_typo3+'".$script.'?target=' . rawurlencode($path) . "';}";
 
                        return $this->linkItem(
                                $this->label($type),
-                               $this->excludeIcon('<img' . t3lib_iconWorks::skinImg($this->PH_backPath, 'gfx/' . $image, 'width="12" height="12"').' alt="" />'),
+                               $this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/'.$image,'width="12" height="12"').' alt="" />'),
                                $editOnClick . 'top.nav.refresh();return hideCM();'
                                );
-               } elseif ($GLOBALS['BE_USER']->uc['enableFlashUploader'] == 2) {
-                       $editOnClick = 'top.TYPO3.configuration.FileUpload.targetDirectory = "' . $path . '"; top.TYPO3.PluploadWindow.reloadWindow = top.content.list_frame;   top.TYPO3.PluploadWindow.show();';
-                       return $this->linkItem(
-                               $this->label($type),
-                               $this->excludeIcon('<img' . t3lib_iconWorks::skinImg($this->PH_backPath, 'gfx/' . $image, 'width="12" height="12"') . ' alt="" />'),
-                               $editOnClick . 'return hideCM();'
-                       );
-
                } else {
                        return $this->FILE_launch($path, $script, $type, $image, true);
                }
index 43f89a1..acd3d41 100644 (file)
@@ -126,14 +126,11 @@ class TYPO3backend {
                        'swfupload.swfobject'   => 'contrib/swfupload/plugins/swfupload.swfobject.js',
                        'swfupload.cookies'     => 'contrib/swfupload/plugins/swfupload.cookies.js',
                        'swfupload.queue'       => 'contrib/swfupload/plugins/swfupload.queue.js',
-                       'plupload'              => 'contrib/plupload/js/plupload.full.min.js',
                        'md5'                   => 'md5.js',
                        'toolbarmanager'        => 'js/toolbarmanager.js',
                        'modulemenu'            => 'js/modulemenu.js',
                        'iecompatibility'       => 'js/iecompatibility.js',
                        'flashupload'           => 'js/flashupload.js',
-                       'pluploadPanel'         => 'js/extjs/ext.ux.plupload.js',
-                       'pluploadWindow'        => 'js/extjs/PluploadWindow.js',
                        'evalfield'             => '../t3lib/jsfunc.evalfield.js',
                        'flashmessages'         => '../t3lib/js/extjs/ux/flashmessages.js',
                        'tabclosemenu'          => '../t3lib/js/extjs/ux/ext.ux.tabclosemenu.js',
@@ -479,17 +476,11 @@ class TYPO3backend {
                        'fileUpload' => array(
                                'windowTitle',
                                'buttonSelectFiles',
-                               'buttonStartUpload',
                                'buttonCancelAll',
-                               'progressText',
                                'infoComponentMaxFileSize',
                                'infoComponentFileUploadLimit',
                                'infoComponentFileTypeLimit',
                                'infoComponentOverrideFiles',
-                               'infoFileQueueEmpty',
-                               'infoFileQueued',
-                               'infoFileFinished',
-                               'infoFileUploading',
                                'processRunning',
                                'uploadWait',
                                'uploadStarting',
@@ -600,9 +591,6 @@ class TYPO3backend {
                        'ContextHelpWindows' => array(
                                'width' => 600,
                                'height' => 400
-                       ),
-                       'FileUpload' => array(
-                               'maxFileSize' => t3lib_div::getMaxUploadFileSize()
                        )
                );
                if ($GLOBALS['LANG']->charSet !== 'utf-8') {
index 195a76f..8cabd96 100644 (file)
@@ -166,24 +166,13 @@ class TYPO3_tcefile {
                $this->init();
                $this->main();
                $errors = $this->fileProcessor->getErrorMessages();
-               $uploaderType = t3lib_div::_GP('uploaderType');
                if (count($errors)) {
                        $ajaxObj->setError(implode(',', $errors));
                } else {
-                       if ($uploaderType === 'plupload') {
-                               $ajaxObj->addContent('result', $this->fileData);
-                               if (count($this->fileData)) {
-                                       $ajaxObj->addContent('success', TRUE);
-                               } else {
-                                       $ajaxObj->addContent('success', FALSE);
-                               }
-                       } else {
-                               $ajaxObj->addContent('result', $this->fileData);
-                               if ($this->redirect) {
-                                       $ajaxObj->addContent('redirect', $this->redirect);
-                               }
+                       $ajaxObj->addContent('result', $this->fileData);
+                       if ($this->redirect) {
+                               $ajaxObj->addContent('redirect', $this->redirect);
                        }
-
                        $ajaxObj->setContentFormat('json');
                }
        }
diff --git a/typo3/contrib/plupload/changelog.txt b/typo3/contrib/plupload/changelog.txt
deleted file mode 100644 (file)
index b2b5dfd..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-Version 1.2.x (2010-xx-xx)\r
-       Added support for crossdomain loading of the XAP and SWF files and crossdomain upload.\r
-       Added preinit/init options to to ease up the binding of custom events to queueWidget and the Uploader class.\r
-       Added drag/drop support for Safari kind of a hack until they release official drag/drop support like Chrome.\r
-       Added events example file that show how to bind all events and display event specific data.\r
-       Fixed logic issue with the upload.php example file. Chunking wasn't working correctly.\r
-       Fixed issue with HTML4 not handling the form encoding correctly on older IE versions. Patch contributed by jinxdone.\r
-       Fixed so the HTML4 runtime only submits the defined multipart_params arguments.\r
-       Fixes issue where it wasn't possible to dynamically override url or mutlipart_params for the HTML4 runtime.\r
-       Fixed so all runtimes pass the name, chunk and chunks parameters as multipart parameters instead of querystring parameters.\r
-       Fixed so files are read using the newer FileReader class if it's available if not it tries the older getAsXXX on Gecko.\r
-       Fixed bug where IE 9 beta 1 wouldn't render Silverlight properly.\r
-Version 1.2.4 (2010-09-08)\r
-       Added new BeforeUpload event to make it easier to override settings before a file is uploaded.\r
-       Added new automatic usage of FileReference in Flash if it's possible. Contributed by Marcel Jackwerth.\r
-       Added new chunking support for Chrome 5 and Firefox 3.6 using the HTML 5 runtime.\r
-       Added new multipart upload support for WebKit using the HTML 5 runtime and the FormData object.\r
-       Added new image scaling method for the Flash runtime contributed by rcoopman.\r
-       Added new alert error message if the user selected invalid files.\r
-       Added new automatic unique name generation to the example.php script. Contributed by Brandon Kelly.\r
-       Changed so the default upload method is multipart and the default chunk size is 0.\r
-       Fixed progress issue with the HTML5 runtime running on Gecko.\r
-       Fixed so longer extensions can be used such as .tar.gz.\r
-       Fixed so the file extension is retained when using the unique_names option.\r
-Version 1.2.3 (2010-05-27)\r
-       Added new drag/drop support for HTML5 running on Chrome beta.\r
-       Added new multipart state for the features object. It's now possible to detect multipart support.\r
-       Added new getFeatures function to all runtime. Basic concept by Javier Martinez Fernandez.\r
-       Fixed bug where runtimes where initialized even if they didn't match the required_features setting.\r
-Version 1.2.2.1 (2010-05-04)\r
-       Added new headers option, enables you to set custom headers for the upload requests.\r
-       Fixed bug where the file extension checking was case sensitive.\r
-Version 1.2.2 (2010-04-26)\r
-       Added new file_data_name option that enables you to set the multipart file data param. Patch contributed by Alex Ganov.\r
-       Added new FILE_SIZE_ERROR type that will be triggered if the user selected a file that is to large or zero bytes.\r
-       Added new FILE_EXTENSION_ERROR type that will be triggered if you add a file with an invalid file extension.\r
-       Added new required_features setting, enables you to specify a list of required features that the runtime must have.\r
-       Fixed so the plupload.buildUrl function uses the UTF compatible encodeURIComponent method instead of escape.\r
-       Fixed so that all file types can be selected if you don't specify a filter setting.\r
-       Fixed so more valid HTTP status codes are accepted as valid responses.\r
-       Fixed so all runtimes fills the features object with available features.\r
-       Fixed some issues with the HTML4 runtime if there wasn't any existing forms on the page.\r
-       Fixed some conflict issues with HTML4 runtime and forms with the input names of action or target.\r
-       Fixed bug where some Gecko versions would produce exceptions when checking the HTTP status of a XHR.\r
-Version 1.2.1 (2010-03-22)\r
-       Fixed bug with incorrect aspect ratio in Flash image scaling.\r
-       Fixed bug where chunked uploads could get scrambled in the Flash runtime. Patch contributed by Grady Werner.\r
-       Fixed bug where a beta version of Chrome wouldn't handle drag/drop correctly because of missing drag effect.\r
-       Fixed so the HTML 4 runtime displays N/A for file sizes and the progress is based on uploaded files instead of bytes.\r
-       Fixed so chunking can be disabled properly in Flash but that will affect the progress bar.\r
-       Fixed so queue widget displays the drag/drop message if file queue is emptied.\r
-       Fixed small files are uploaded as one single chunk and not forced into 4 chunks in the Flash runtime.\r
-Version 1.2 (2010-03-09)\r
-       Added new rename file support for jQuery queue widget, click on a file name to rename it if it's enabled.\r
-       Added official ChunkUploaded event, it similar to FileUploaded but executed for each chunk.\r
-       Added bytes per second support to total queue progress.\r
-       Added better error handling to core API using the new Error event.\r
-       Added better error handling to jQuery queue widget.\r
-       Fixed so chunking uploads is dispatch from JS not from inside Flash/Silverlight.\r
-Version 1.1.1 (2010-02-25)\r
-       Added new setup setting to queue widget. Makes it easier to bind custom events to uploader instance.\r
-       Fixed so it's possible to disable chunking compleatly. It's now disabled by default.\r
-       Fixed bug where multipart mode was enabled all the time in the Flash runtime.\r
-       Fixed bug where chunked uploading in Silverlight would fail.\r
-       Fixed bug where the delete button was visible while uploading.\r
-       Fixed bug where unique_names setting wasn't working when the core API was used.\r
-       Fixed bug where the queue widget wouldn't display the currently uploaded file if the unique_names was enabled.\r
-Version 1.1 (2010-02-24)\r
-       Added new multipart and multipart_params support.\r
-       Added new container option, enables you to specify where flash/silverlight objects would be added.\r
-       Added chunking support to BrowserPlus runtime, contributed by Steve Spencer.\r
-       Added FileUploaded event that fires when a file is uploaded.\r
-       Added more easily understandable buttons to queue widget.\r
-       Added html4 runtime, contributed by Ryan Demmer.\r
-       Fixed issues with i18n support and added a Swedish and Danish language pack.\r
-       Fixed bug where the Flash runtime could do empty requests if the image was scaled down.\r
-       Fixed bug where uploading small images in Silverlight would produce an exception.\r
-       Fixed so the runtime list can include whitespace or missing runtimes. Patch contributed by √ėyvind Sean Kinsey.\r
-       Fixed so to large files are ignored and never dispatched to the FilesAdded event.\r
-Version 1.0 (2010-02-03)\r
-       First official release of Plupload.\r
diff --git a/typo3/contrib/plupload/js/gears_init.js b/typo3/contrib/plupload/js/gears_init.js
deleted file mode 100644 (file)
index 5f44f09..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2007, Google Inc.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-//  1. Redistributions of source code must retain the above copyright notice,
-//     this list of conditions and the following disclaimer.
-//  2. Redistributions in binary form must reproduce the above copyright notice,
-//     this list of conditions and the following disclaimer in the documentation
-//     and/or other materials provided with the distribution.
-//  3. Neither the name of Google Inc. nor the names of its contributors may be
-//     used to endorse or promote products derived from this software without
-//     specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Sets up google.gears.*, which is *the only* supported way to access Gears.
-//
-// Circumvent this file at your own risk!
-//
-// In the future, Gears may automatically define google.gears.* without this
-// file. Gears may use these objects to transparently fix bugs and compatibility
-// issues. Applications that use the code below will continue to work seamlessly
-// when that happens.
-
-(function() {
-  // We are already defined. Hooray!
-  if (window.google && google.gears) {
-    return;
-  }
-
-  var factory = null;
-
-  // Firefox
-  if (typeof GearsFactory != 'undefined') {
-    factory = new GearsFactory();
-  } else {
-    // IE
-    try {
-      factory = new ActiveXObject('Gears.Factory');
-      // privateSetGlobalObject is only required and supported on WinCE.
-      if (factory.getBuildInfo().indexOf('ie_mobile') != -1) {
-        factory.privateSetGlobalObject(this);
-      }
-    } catch (e) {
-      // Safari
-      if ((typeof navigator.mimeTypes != 'undefined')
-           && navigator.mimeTypes["application/x-googlegears"]) {
-        factory = document.createElement("object");
-        factory.style.display = "none";
-        factory.width = 0;
-        factory.height = 0;
-        factory.type = "application/x-googlegears";
-        document.documentElement.appendChild(factory);
-      }
-    }
-  }
-
-  // *Do not* define any objects if Gears is not installed. This mimics the
-  // behavior of Gears defining the objects in the future.
-  if (!factory) {
-    return;
-  }
-
-  // Now set up the objects, being careful not to overwrite anything.
-  //
-  // Note: In Internet Explorer for Windows Mobile, you can't add properties to
-  // the window object. However, global objects are automatically added as
-  // properties of the window object in all browsers.
-  if (!window.google) {
-    google = {};
-  }
-
-  if (!google.gears) {
-    google.gears = {factory: factory};
-  }
-})();
diff --git a/typo3/contrib/plupload/js/jquery.plupload.queue.min.js b/typo3/contrib/plupload/js/jquery.plupload.queue.min.js
deleted file mode 100644 (file)
index 2ef814c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(c){var d={};function a(e){return plupload.translate(e)||e}function b(f,e){e.contents().each(function(g,h){h=c(h);if(!h.is(".plupload")){h.remove()}});e.prepend('<div class="plupload_wrapper plupload_scroll"><div id="'+f+'_container" class="plupload_container"><div class="plupload"><div class="plupload_header"><div class="plupload_header_content"><div class="plupload_header_title">'+a("Select files")+'</div><div class="plupload_header_text">'+a("Add files to the upload queue and click the start button.")+'</div></div></div><div class="plupload_content"><div class="plupload_filelist_header"><div class="plupload_file_name">'+a("Filename")+'</div><div class="plupload_file_action">&nbsp;</div><div class="plupload_file_status"><span>'+a("Status")+'</span></div><div class="plupload_file_size">'+a("Size")+'</div><div class="plupload_clearer">&nbsp;</div></div><ul id="'+f+'_filelist" class="plupload_filelist"></ul><div class="plupload_filelist_footer"><div class="plupload_file_name"><div class="plupload_buttons"><a href="#" class="plupload_button plupload_add">'+a("Add files")+'</a><a href="#" class="plupload_button plupload_start">'+a("Start upload")+'</a></div><span class="plupload_upload_status"></span></div><div class="plupload_file_action"></div><div class="plupload_file_status"><span class="plupload_total_status">0%</span></div><div class="plupload_file_size"><span class="plupload_total_file_size">0 b</span></div><div class="plupload_progress"><div class="plupload_progress_container"><div class="plupload_progress_bar"></div></div></div><div class="plupload_clearer">&nbsp;</div></div></div></div></div><input type="hidden" id="'+f+'_count" name="'+f+'_count" value="0" /></div>')}c.fn.pluploadQueue=function(e){if(e){this.each(function(){var j,i,k;i=c(this);k=i.attr("id");if(!k){k=plupload.guid();i.attr("id",k)}j=new plupload.Uploader(c.extend({dragdrop:true,container:k},e));if(e.preinit){e.preinit(j)}d[k]=j;function h(l){var m;if(l.status==plupload.DONE){m="plupload_done"}if(l.status==plupload.FAILED){m="plupload_failed"}if(l.status==plupload.QUEUED){m="plupload_delete"}if(l.status==plupload.UPLOADING){m="plupload_uploading"}c("#"+l.id).attr("class",m).find("a").css("display","block")}function f(){c("span.plupload_total_status",i).html(j.total.percent+"%");c("div.plupload_progress_bar",i).css("width",j.total.percent+"%");c("span.plupload_upload_status",i).text("Uploaded "+j.total.uploaded+"/"+j.files.length+" files");if(j.total.uploaded==j.files.length){j.stop()}}function g(){var m=c("ul.plupload_filelist",i).html(""),n=0,l;c.each(j.files,function(p,o){l="";if(o.status==plupload.DONE){if(o.target_name){l+='<input type="hidden" name="'+k+"_"+n+'_tmpname" value="'+plupload.xmlEncode(o.target_name)+'" />'}l+='<input type="hidden" name="'+k+"_"+n+'_name" value="'+plupload.xmlEncode(o.name)+'" />';l+='<input type="hidden" name="'+k+"_"+n+'_status" value="'+(o.status==plupload.DONE?"done":"failed")+'" />';n++;c("#"+k+"_count").val(n)}m.append('<li id="'+o.id+'"><div class="plupload_file_name"><span>'+o.name+'</span></div><div class="plupload_file_action"><a href="#"></a></div><div class="plupload_file_status">'+o.percent+'%</div><div class="plupload_file_size">'+plupload.formatSize(o.size)+'</div><div class="plupload_clearer">&nbsp;</div>'+l+"</li>");h(o);c("#"+o.id+".plupload_delete a").click(function(q){c("#"+o.id).remove();j.removeFile(o);q.preventDefault()})});c("span.plupload_total_file_size",i).html(plupload.formatSize(j.total.size));if(j.total.queued===0){c("span.plupload_add_text",i).text(a("Add files."))}else{c("span.plupload_add_text",i).text(j.total.queued+" files queued.")}c("a.plupload_start",i).toggleClass("plupload_disabled",j.files.length===0);m[0].scrollTop=m[0].scrollHeight;f();if(!j.files.length&&j.features.dragdrop&&j.settings.dragdrop){c("#"+k+"_filelist").append('<li class="plupload_droptext">'+a("Drag files here.")+"</li>")}}j.bind("UploadFile",function(l,m){c("#"+m.id).addClass("plupload_current_file")});j.bind("Init",function(l,m){b(k,i);if(!e.unique_names&&e.rename){c("#"+k+"_filelist div.plupload_file_name span",i).live("click",function(s){var q=c(s.target),o,r,n,p="";o=l.getFile(q.parents("li")[0].id);n=o.name;r=/^(.+)(\.[^.]+)$/.exec(n);if(r){n=r[1];p=r[2]}q.hide().after('<input type="text" />');q.next().val(n).focus().blur(function(){q.show().next().remove()}).keydown(function(u){var t=c(this);if(u.keyCode==13){u.preventDefault();o.name=t.val()+p;q.text(o.name);t.blur()}})})}c("a.plupload_add",i).attr("id",k+"_browse");l.settings.browse_button=k+"_browse";if(l.features.dragdrop&&l.settings.dragdrop){l.settings.drop_element=k+"_filelist";c("#"+k+"_filelist").append('<li class="plupload_droptext">'+a("Drag files here.")+"</li>")}c("#"+k+"_container").attr("title","Using runtime: "+m.runtime);c("a.plupload_start",i).click(function(n){if(!c(this).hasClass("plupload_disabled")){j.start()}n.preventDefault()});c("a.plupload_stop",i).click(function(n){j.stop();n.preventDefault()});c("a.plupload_start",i).addClass("plupload_disabled")});j.init();j.bind("Error",function(l,o){var m=o.file,n;if(m){n=o.message;if(o.details){n+=" ("+o.details+")"}if(o.code==plupload.FILE_SIZE_ERROR){alert(a("Error: File to large: ")+m.name)}if(o.code==plupload.FILE_EXTENSION_ERROR){alert(a("Error: Invalid file extension: ")+m.name)}c("#"+m.id).attr("class","plupload_failed").find("a").css("display","block").attr("title",n)}});j.bind("StateChanged",function(){if(j.state===plupload.STARTED){c("li.plupload_delete a,div.plupload_buttons",i).hide();c("span.plupload_upload_status,div.plupload_progress,a.plupload_stop",i).css("display","block");c("span.plupload_upload_status",i).text("Uploaded 0/"+j.files.length+" files")}else{c("a.plupload_stop,div.plupload_progress",i).hide();c("a.plupload_delete",i).css("display","block")}});j.bind("QueueChanged",g);j.bind("StateChanged",function(l){if(l.state==plupload.STOPPED){g()}});j.bind("FileUploaded",function(l,m){h(m)});j.bind("UploadProgress",function(l,m){c("#"+m.id+" div.plupload_file_status",i).html(m.percent+"%");h(m);f()});if(e.setup){e.setup(j)}});return this}else{return d[c(this[0]).attr("id")]}}})(jQuery);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.browserplus.min.js b/typo3/contrib/plupload/js/plupload.browserplus.min.js
deleted file mode 100644 (file)
index 19f3fc9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(a){a.runtimes.BrowserPlus=a.addRuntime("browserplus",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(g,i){var e=window.BrowserPlus,h={},d=g.settings,c=d.resize;function f(n){var m,l,j=[],k,o;for(l=0;l<n.length;l++){k=n[l];o=a.guid();h[o]=k;j.push(new a.File(o,k.name,k.size))}if(l){g.trigger("FilesAdded",j)}}function b(){g.bind("PostInit",function(){var m,k=d.drop_element,o=g.id+"_droptarget",j=document.getElementById(k),l;function p(r,q){e.DragAndDrop.AddDropTarget({id:r},function(s){e.DragAndDrop.AttachCallbacks({id:r,hover:function(t){if(!t&&q){q()}},drop:function(t){if(q){q()}f(t)}},function(){})})}function n(){document.getElementById(o).style.top="-1000px"}if(j){if(document.attachEvent&&(/MSIE/gi).test(navigator.userAgent)){m=document.createElement("div");m.setAttribute("id",o);a.extend(m.style,{position:"absolute",top:"-1000px",background:"red",filter:"alpha(opacity=0)",opacity:0});document.body.appendChild(m);a.addEvent(j,"dragenter",function(r){var q,s;q=document.getElementById(k);s=a.getPos(q);a.extend(document.getElementById(o).style,{top:s.y+"px",left:s.x+"px",width:q.offsetWidth+"px",height:q.offsetHeight+"px"})});p(o,n)}else{p(k)}}a.addEvent(document.getElementById(d.browse_button),"click",function(v){var t=[],r,q,u=d.filters,s;v.preventDefault();for(r=0;r<u.length;r++){s=u[r].extensions.split(",");for(q=0;q<s.length;q++){t.push(a.mimeTypes[s[q]])}}e.FileBrowse.OpenBrowseDialog({mimeTypes:t},function(w){if(w.success){f(w.value)}})});j=m=null});g.bind("UploadFile",function(n,k){var m=h[k.id],j={},l=n.settings.chunk_size,o,p=[];function r(s,u){var t;if(k.status==a.FAILED){return}j.name=k.target_name||k.name;if(l){j.chunk=s;j.chunks=u}t=p.shift();e.Uploader.upload({url:a.buildUrl(n.settings.url,j),files:{file:t},cookies:document.cookies,postvars:n.settings.multipart_params,progressCallback:function(x){var w,v=0;o[s]=parseInt(x.filePercent*t.size/100,10);for(w=0;w<o.length;w++){v+=o[w]}k.loaded=v;n.trigger("UploadProgress",k)}},function(w){var v,x;if(w.success){v=w.value.statusCode;if(l){n.trigger("ChunkUploaded",k,{chunk:s,chunks:u,response:w.value.body,status:v})}if(p.length>0){r(++s,u)}else{k.status=a.DONE;n.trigger("FileUploaded",k,{response:w.value.body,status:v});if(v>=400){n.trigger("Error",{code:a.HTTP_ERROR,message:"HTTP Error.",file:k,status:v})}}}else{n.trigger("Error",{code:a.GENERIC_ERROR,message:"Generic Error.",file:k,details:w.error})}})}function q(s){k.size=s.size;if(l){e.FileAccess.chunk({file:s,chunkSize:l},function(v){if(v.success){var w=v.value,t=w.length;o=Array(t);for(var u=0;u<t;u++){o[u]=0;p.push(w[u])}r(0,t)}})}else{o=Array(1);p.push(s);r(0,1)}}if(c&&/\.(png|jpg|jpeg)$/i.test(k.name)){BrowserPlus.ImageAlter.transform({file:m,quality:c.quality||90,actions:[{scale:{maxwidth:c.width,maxheight:c.height}}]},function(s){if(s.success){q(s.value.file)}})}else{q(m)}});i({success:true})}if(e){e.init(function(k){var j=[{service:"Uploader",version:"3"},{service:"DragAndDrop",version:"1"},{service:"FileBrowse",version:"1"},{service:"FileAccess",version:"2"}];if(c){j.push({service:"ImageAlter",version:"4"})}if(k.success){e.require({services:j},function(l){if(l.success){b()}else{i()}})}else{i()}})}else{i()}}})})(plupload);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.flash.min.js b/typo3/contrib/plupload/js/plupload.flash.min.js
deleted file mode 100644 (file)
index d8a06a0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(c){var a={};function b(){var d;try{d=navigator.plugins["Shockwave Flash"];d=d.description}catch(f){try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(e){d="0.0"}}d=d.match(/\d+/g);return parseFloat(d[0]+"."+d[1])}c.flash={trigger:function(f,d,e){setTimeout(function(){var j=a[f],h,g;if(j){j.trigger("Flash:"+d,e)}},0)}};c.runtimes.Flash=c.addRuntime("flash",{getFeatures:function(){return{jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(g,l){var k,f,h,e,m=0,d=document.body;if(b()<10){l({success:false});return}a[g.id]=g;k=document.getElementById(g.settings.browse_button);f=document.createElement("div");f.id=g.id+"_flash_container";c.extend(f.style,{position:"absolute",top:"0px",background:g.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100%",height:"100%"});f.className="plupload flash";if(g.settings.container){d=document.getElementById(g.settings.container);d.style.position="relative"}d.appendChild(f);h="id="+escape(g.id);f.innerHTML='<object id="'+g.id+'_flash" width="100%" height="100%" style="outline:0" type="application/x-shockwave-flash" data="'+g.settings.flash_swf_url+'"><param name="movie" value="'+g.settings.flash_swf_url+'" /><param name="flashvars" value="'+h+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>';function j(){return document.getElementById(g.id+"_flash")}function i(){if(m++>5000){l({success:false});return}if(!e){setTimeout(i,1)}}i();k=f=null;g.bind("Flash:Init",function(){var p={},o,n=g.settings.resize||{};e=true;j().setFileFilters(g.settings.filters,g.settings.multi_selection);g.bind("UploadFile",function(q,r){var s=q.settings;j().uploadFile(p[r.id],c.buildUrl(s.url,{name:r.target_name||r.name}),{chunk_size:s.chunk_size,width:n.width,height:n.height,quality:n.quality||90,multipart:s.multipart,multipart_params:s.multipart_params,file_data_name:s.file_data_name,format:/\.(jpg|jpeg)$/i.test(r.name)?"jpg":"png",headers:s.headers,urlstream_upload:s.urlstream_upload})});g.bind("Flash:UploadProcess",function(r,q){var s=r.getFile(p[q.id]);if(s.status!=c.FAILED){s.loaded=q.loaded;s.size=q.size;r.trigger("UploadProgress",s)}});g.bind("Flash:UploadChunkComplete",function(q,s){var t,r=q.getFile(p[s.id]);t={chunk:s.chunk,chunks:s.chunks,response:s.text};q.trigger("ChunkUploaded",r,t);if(r.status!=c.FAILED){j().uploadNextChunk()}if(s.chunk==s.chunks-1){r.status=c.DONE;q.trigger("FileUploaded",r,{response:s.text})}});g.bind("Flash:SelectFiles",function(q,t){var s,r,u=[],v;for(r=0;r<t.length;r++){s=t[r];v=c.guid();p[v]=s.id;p[s.id]=v;u.push(new c.File(v,s.name,s.size))}if(u.length){g.trigger("FilesAdded",u)}});g.bind("Flash:SecurityError",function(q,r){g.trigger("Error",{code:c.SECURITY_ERROR,message:"Security error.",details:r.message,file:g.getFile(p[r.id])})});g.bind("Flash:GenericError",function(q,r){g.trigger("Error",{code:c.GENERIC_ERROR,message:"Generic error.",details:r.message,file:g.getFile(p[r.id])})});g.bind("Flash:IOError",function(q,r){g.trigger("Error",{code:c.IO_ERROR,message:"IO error.",details:r.message,file:g.getFile(p[r.id])})});g.bind("QueueChanged",function(q){g.refresh()});g.bind("FilesRemoved",function(q,s){var r;for(r=0;r<s.length;r++){j().removeFile(p[s[r].id])}});g.bind("StateChanged",function(q){g.refresh()});g.bind("Refresh",function(q){var r,s,t;j().setFileFilters(g.settings.filters,g.settings.multi_selection);r=document.getElementById(q.settings.browse_button);s=c.getPos(r,document.getElementById(q.settings.container));t=c.getSize(r);c.extend(document.getElementById(q.id+"_flash_container").style,{top:s.y+"px",left:s.x+"px",width:t.w+"px",height:t.h+"px"})});l({success:true})})}})})(plupload);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.flash.swf b/typo3/contrib/plupload/js/plupload.flash.swf
deleted file mode 100644 (file)
index b5ab53d..0000000
Binary files a/typo3/contrib/plupload/js/plupload.flash.swf and /dev/null differ
diff --git a/typo3/contrib/plupload/js/plupload.full.min.js b/typo3/contrib/plupload/js/plupload.full.min.js
deleted file mode 100644 (file)
index 304321c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(){var c=0,h=[],j={},f={},a={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g,b;function e(){this.returnValue=false}function g(){this.cancelBubble=true}(function(k){var l=k.split(/,/),m,o,n;for(m=0;m<l.length;m+=2){n=l[m+1].split(/ /);for(o=0;o<n.length;o++){f[n[o]]=l[m]}}})("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats,docx pptx xlsx,audio/mpeg,mpga mpega mp2 mp3,audio/x-wav,wav,image/bmp,bmp,image/gif,gif,image/jpeg,jpeg jpg jpe,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/html,htm html xhtml,text/rtf,rtf,video/mpeg,mpeg mpg mpe,video/quicktime,qt mov,video/x-flv,flv,video/vnd.rn-realvideo,rv,text/plain,asc txt text diff log,application/octet-stream,exe");var d={STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-700,mimeTypes:f,extend:function(k){d.each(arguments,function(l,m){if(m>0){d.each(l,function(o,n){k[n]=o})}});return k},cleanName:function(k){var l,m;m=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(l=0;l<m.length;l+=2){k=k.replace(m[l],m[l+1])}k=k.replace(/\s+/g,"_");k=k.replace(/[^a-z0-9_\-\.]+/gi,"");return k},addRuntime:function(k,l){l.name=k;h[k]=l;h.push(l);return l},guid:function(){var k=new Date().getTime().toString(32),l;for(l=0;l<5;l++){k+=Math.floor(Math.random()*65535).toString(32)}return(d.guidPrefix||"p")+k+(c++).toString(32)},buildUrl:function(l,k){var m="";d.each(k,function(o,n){m+=(m?"&":"")+encodeURIComponent(n)+"="+encodeURIComponent(o)});if(m){l+=(l.indexOf("?")>0?"&":"?")+m}return l},each:function(n,o){var m,l,k;if(n){m=n.length;if(m===b){for(l in n){if(n.hasOwnProperty(l)){if(o(n[l],l)===false){return}}}}else{for(k=0;k<m;k++){if(o(n[k],k)===false){return}}}}},formatSize:function(k){if(k===b){return d.translate("N/A")}if(k>1048576){return Math.round(k/1048576,1)+" MB"}if(k>1024){return Math.round(k/1024,1)+" KB"}return k+" b"},getPos:function(l,p){var q=0,o=0,s,r=document,m,n;l=l;p=p||r.body;function k(w){var u,v,t=0,z=0;if(w){v=w.getBoundingClientRect();u=r.compatMode==="CSS1Compat"?r.documentElement:r.body;t=v.left+u.scrollLeft;z=v.top+u.scrollTop}return{x:t,y:z}}if(l.getBoundingClientRect&&(navigator.userAgent.indexOf("MSIE")>0&&r.documentMode!==8)){m=k(l);n=k(p);return{x:m.x-n.x,y:m.y-n.y}}s=l;while(s&&s!=p&&s.nodeType){q+=s.offsetLeft||0;o+=s.offsetTop||0;s=s.offsetParent}s=l.parentNode;while(s&&s!=p&&s.nodeType){q-=s.scrollLeft||0;o-=s.scrollTop||0;s=s.parentNode}return{x:q,y:o}},getSize:function(k){return{w:k.clientWidth||k.offsetWidth,h:k.clientHeight||k.offsetHeight}},parseSize:function(k){var l;if(typeof(k)=="string"){k=/^([0-9]+)([mgk]+)$/.exec(k.toLowerCase().replace(/[^0-9mkg]/g,""));l=k[2];k=+k[1];if(l=="g"){k*=1073741824}if(l=="m"){k*=1048576}if(l=="k"){k*=1024}}return k},xmlEncode:function(k){return k?(""+k).replace(i,function(l){return a[l]?"&"+a[l]+";":l}):k},toArray:function(m){var l,k=[];for(l=0;l<m.length;l++){k[l]=m[l]}return k},addI18n:function(k){return d.extend(j,k)},translate:function(k){return j[k]||k},addEvent:function(l,k,m){if(l.attachEvent){l.attachEvent("on"+k,function(){var n=window.event;if(!n.target){n.target=n.srcElement}n.preventDefault=e;n.stopPropagation=g;m(n)})}else{if(l.addEventListener){l.addEventListener(k,m,false)}}}};d.Uploader=function(n){var l={},q,p=[],r,m;q=new d.QueueProgress();n=d.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},n);function o(){var s;if(this.state==d.STARTED&&r<p.length){s=p[r++];if(s.status==d.QUEUED){this.trigger("BeforeUpload",s);this.trigger("UploadFile",s)}else{o.call(this)}}else{this.stop()}}function k(){var t,s;q.reset();for(t=0;t<p.length;t++){s=p[t];if(s.size!==b){q.size+=s.size;q.loaded+=s.loaded}else{q.size=b}if(s.status==d.DONE){q.uploaded++}else{if(s.status==d.FAILED){q.failed++}else{q.queued++}}}if(q.size===b){q.percent=p.length>0?Math.ceil(q.uploaded/p.length*100):0}else{q.bytesPerSec=Math.ceil(q.loaded/((+new Date()-m||1)/1000));q.percent=q.size>0?Math.ceil(q.loaded/q.size*100):0}}d.extend(this,{state:d.STOPPED,features:{},files:p,settings:n,total:q,id:d.guid(),init:function(){var x=this,y,u,t,w=0,v;n.page_url=n.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(n.url)){n.url=n.page_url+n.url}n.chunk_size=d.parseSize(n.chunk_size);n.max_file_size=d.parseSize(n.max_file_size);x.bind("FilesAdded",function(z,C){var B,A,E=0,F,D=n.filters;if(D&&D.length){F=[];d.each(D,function(G){d.each(G.extensions.split(/,/),function(H){F.push("\\."+H.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))})});F=new RegExp(F.join("|")+"$","i")}for(B=0;B<C.length;B++){A=C[B];A.loaded=0;A.percent=0;A.status=d.QUEUED;if(F&&!F.test(A.name)){z.trigger("Error",{code:d.FILE_EXTENSION_ERROR,message:"File extension error.",file:A});continue}if(A.size!==b&&A.size>n.max_file_size){z.trigger("Error",{code:d.FILE_SIZE_ERROR,message:"File size error.",file:A});continue}p.push(A);E++}if(E){x.trigger("QueueChanged");x.refresh()}});if(n.unique_names){x.bind("UploadFile",function(z,A){var C=A.name.match(/\.([^.]+)$/),B="tmp";if(C){B=C[1]}A.target_name=A.id+"."+B})}x.bind("UploadProgress",function(z,A){if(A.status==d.QUEUED){A.status=d.UPLOADING}A.percent=A.size>0?Math.ceil(A.loaded/A.size*100):100;k()});x.bind("StateChanged",function(z){if(z.state==d.STARTED){m=(+new Date())}});x.bind("QueueChanged",k);x.bind("Error",function(z,A){if(A.file){A.file.status=d.FAILED;k();window.setTimeout(function(){o.call(x)})}});x.bind("FileUploaded",function(z,A){A.status=d.DONE;A.loaded=A.size;z.trigger("UploadProgress",A);o.call(x)});if(n.runtimes){u=[];v=n.runtimes.split(/\s?,\s?/);for(y=0;y<v.length;y++){if(h[v[y]]){u.push(h[v[y]])}}}else{u=h}function s(){var C=u[w++],B,z,A;if(C){B=C.getFeatures();z=x.settings.required_features;if(z){z=z.split(",");for(A=0;A<z.length;A++){if(!B[z[A]]){s();return}}}C.init(x,function(D){if(D&&D.success){x.features=B;x.trigger("Init",{runtime:C.name});x.trigger("PostInit");x.refresh()}else{s()}})}else{x.trigger("Error",{code:d.INIT_ERROR,message:"Init error."})}}s()},refresh:function(){this.trigger("Refresh")},start:function(){if(this.state!=d.STARTED){r=0;this.state=d.STARTED;this.trigger("StateChanged");o.call(this)}},stop:function(){if(this.state!=d.STOPPED){this.state=d.STOPPED;this.trigger("StateChanged")}},getFile:function(t){var s;for(s=p.length-1;s>=0;s--){if(p[s].id===t){return p[s]}}},removeFile:function(t){var s;for(s=p.length-1;s>=0;s--){if(p[s].id===t.id){return this.splice(s,1)[0]}}},splice:function(u,s){var t;t=p.splice(u,s);this.trigger("FilesRemoved",t);this.trigger("QueueChanged");return t},trigger:function(t){var v=l[t.toLowerCase()],u,s;if(v){s=Array.prototype.slice.call(arguments);s[0]=this;for(u=0;u<v.length;u++){if(v[u].func.apply(v[u].scope,s)===false){return false}}}return true},bind:function(s,u,t){var v;s=s.toLowerCase();v=l[s]||[];v.push({func:u,scope:t||this});l[s]=v},unbind:function(s,u){var v=l[s.toLowerCase()],t;if(v){for(t=v.length-1;t>=0;t--){if(v[t].func===u){v.splice(t,1)}}}}})};d.File=function(n,l,m){var k=this;k.id=n;k.name=l;k.size=m;k.loaded=0;k.percent=0;k.status=0};d.Runtime=function(){this.getFeatures=function(){};this.init=function(k,l){}};d.QueueProgress=function(){var k=this;k.size=0;k.loaded=0;k.uploaded=0;k.failed=0;k.queued=0;k.percent=0;k.bytesPerSec=0;k.reset=function(){k.size=k.loaded=k.uploaded=k.failed=k.queued=k.percent=k.bytesPerSec=0}};d.runtimes={};window.plupload=d})();(function(b){var c={};function a(i,e,k,j,d){var l,g,f,h;g=google.gears.factory.create("beta.canvas");g.decode(i);h=Math.min(e/g.width,k/g.height);if(h<1){e=Math.round(g.width*h);k=Math.round(g.height*h)}else{e=g.width;k=g.height}g.resize(e,k);return g.encode(d,{quality:j/100})}b.runtimes.Gears=b.addRuntime("gears",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(g,i){var h;if(!window.google||!google.gears){return i({success:false})}try{h=google.gears.factory.create("beta.desktop")}catch(f){return i({success:false})}function d(k){var j,e,l=[],m;for(e=0;e<k.length;e++){j=k[e];m=b.guid();c[m]=j.blob;l.push(new b.File(m,j.name,j.blob.length))}g.trigger("FilesAdded",l)}g.bind("PostInit",function(){var j=g.settings,e=document.getElementById(j.drop_element);if(e){b.addEvent(e,"dragover",function(k){h.setDropEffect(k,"copy");k.preventDefault()});b.addEvent(e,"drop",function(l){var k=h.getDragData(l,"application/x-gears-files");if(k){d(k.files)}l.preventDefault()});e=0}b.addEvent(document.getElementById(j.browse_button),"click",function(o){var n=[],l,k,m;o.preventDefault();for(l=0;l<j.filters.length;l++){m=j.filters[l].extensions.split(",");for(k=0;k<m.length;k++){n.push("."+m[k])}}h.openFiles(d,{singleFile:!j.multi_selection,filter:n})})});g.bind("UploadFile",function(o,l){var q=0,p,m,n=0,k=o.settings.resize,e;m=o.settings.chunk_size;e=m>0;p=Math.ceil(l.size/m);if(!e){m=l.size;p=1}if(k&&/\.(png|jpg|jpeg)$/i.test(l.name)){c[l.id]=a(c[l.id],k.width,k.height,k.quality||90,/\.png$/i.test(l.name)?"image/png":"image/jpeg")}l.size=c[l.id].length;function j(){var u,w,s=o.settings.multipart,r=0,v={name:l.target_name||l.name};function t(y){var x,C="----pluploadboundary"+b.guid(),A="--",B="\r\n",z;if(s){u.setRequestHeader("Content-Type","multipart/form-data; boundary="+C);x=google.gears.factory.create("beta.blobbuilder");b.each(o.settings.multipart_params,function(E,D){x.append(A+C+B+'Content-Disposition: form-data; name="'+D+'"'+B+B);x.append(E+B)});x.append(A+C+B+'Content-Disposition: form-data; name="'+o.settings.file_data_name+'"; filename="'+l.name+'"'+B+"Content-Type: application/octet-stream"+B+B);x.append(y);x.append(B+A+C+A+B);z=x.getAsBlob();r=z.length-y.length;y=z}u.send(y)}if(l.status==b.DONE||l.status==b.FAILED||o.state==b.STOPPED){return}if(e){v.chunk=q;v.chunks=p}w=Math.min(m,l.size-(q*m));u=google.gears.factory.create("beta.httprequest");u.open("POST",b.buildUrl(o.settings.url,v));if(!s){u.setRequestHeader("Content-Disposition",'attachment; filename="'+l.name+'"');u.setRequestHeader("Content-Type","application/octet-stream")}b.each(o.settings.headers,function(y,x){u.setRequestHeader(x,y)});u.upload.onprogress=function(x){l.loaded=n+x.loaded-r;o.trigger("UploadProgress",l)};u.onreadystatechange=function(){var x;if(u.readyState==4){if(u.status==200){x={chunk:q,chunks:p,response:u.responseText,status:u.status};o.trigger("ChunkUploaded",l,x);if(x.cancelled){l.status=b.FAILED;return}n+=w;if(++q>=p){l.status=b.DONE;o.trigger("FileUploaded",l,{response:u.responseText,status:u.status})}else{j()}}else{o.trigger("Error",{code:b.HTTP_ERROR,message:"HTTP Error.",file:l,chunk:q,chunks:p,status:u.status})}}};if(q<p){t(c[l.id].slice(q*m,w))}}j()});i({success:true})}})})(plupload);(function(c){var a={};function b(l){var k,j=typeof l,h,e,g,f;if(j==="string"){k="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+l.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(n,m){var i=k.indexOf(m);if(i+1){return"\\"+k.charAt(i+1)}n=m.charCodeAt().toString(16);return"\\u"+"0000".substring(n.length)+n})+'"'}if(j=="object"){e=l.length!==h;k="";if(e){for(g=0;g<l.length;g++){if(k){k+=","}k+=b(l[g])}k="["+k+"]"}else{for(f in l){if(l.hasOwnProperty(f)){if(k){k+=","}k+=b(f)+":"+b(l[f])}}k="{"+k+"}"}return k}if(l===h){return"null"}return""+l}function d(o){var r=false,f=null,k=null,g,h,i,q,j,m=0;try{try{k=new ActiveXObject("AgControl.AgControl");if(k.IsVersionSupported(o)){r=true}k=null}catch(n){var l=navigator.plugins["Silverlight Plug-In"];if(l){g=l.description;if(g==="1.0.30226.2"){g="2.0.30226.2"}h=g.split(".");while(h.length>3){h.pop()}while(h.length<4){h.push(0)}i=o.split(".");while(i.length>4){i.pop()}do{q=parseInt(i[m],10);j=parseInt(h[m],10);m++}while(m<i.length&&q===j);if(q<=j&&!isNaN(q)){r=true}}}}catch(p){r=false}return r}c.silverlight={trigger:function(j,f){var h=a[j],g,e;if(h){e=c.toArray(arguments).slice(1);e[0]="Silverlight:"+f;setTimeout(function(){h.trigger.apply(h,e)},0)}}};c.runtimes.Silverlight=c.addRuntime("silverlight",{getFeatures:function(){return{jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(l,m){var k,h="",j=l.settings.filters,g,f=document.body;if(!d("2.0.31005.0")||(window.opera&&window.opera.buildNumber)){m({success:false});return}a[l.id]=l;k=document.createElement("div");k.id=l.id+"_silverlight_container";c.extend(k.style,{position:"absolute",top:"0px",background:l.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100px",height:"100px",overflow:"hidden",opacity:l.settings.shim_bgcolor?"":0.01});k.className="plupload silverlight";if(l.settings.container){f=document.getElementById(l.settings.container);f.style.position="relative"}f.appendChild(k);for(g=0;g<j.length;g++){h+=(h!=""?"|":"")+j[g].title+" | *."+j[g].extensions.replace(/,/g,";*.")}k.innerHTML='<object id="'+l.id+'_silverlight" data="data:application/x-silverlight," type="application/x-silverlight-2" style="outline:none;" width="1024" height="1024"><param name="source" value="'+l.settings.silverlight_xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="id='+l.id+",filter="+h+'"/></object>';function e(){return document.getElementById(l.id+"_silverlight").content.Upload}l.bind("Silverlight:Init",function(){var i,n={};l.bind("Silverlight:StartSelectFiles",function(o){i=[]});l.bind("Silverlight:SelectFile",function(o,r,p,q){var s;s=c.guid();n[s]=r;n[r]=s;i.push(new c.File(s,p,q))});l.bind("Silverlight:SelectSuccessful",function(){if(i.length){l.trigger("FilesAdded",i)}});l.bind("Silverlight:UploadChunkError",function(o,r,p,s,q){l.trigger("Error",{code:c.IO_ERROR,message:"IO Error.",details:q,file:o.getFile(n[r])})});l.bind("Silverlight:UploadFileProgress",function(o,s,p,r){var q=o.getFile(n[s]);if(q.status!=c.FAILED){q.size=r;q.loaded=p;o.trigger("UploadProgress",q)}});l.bind("Refresh",function(o){var p,q,r;p=document.getElementById(o.settings.browse_button);q=c.getPos(p,document.getElementById(o.settings.container));r=c.getSize(p);c.extend(document.getElementById(o.id+"_silverlight_container").style,{top:q.y+"px",left:q.x+"px",width:r.w+"px",height:r.h+"px"})});l.bind("Silverlight:UploadChunkSuccessful",function(o,r,p,u,t){var s,q=o.getFile(n[r]);s={chunk:p,chunks:u,response:t};o.trigger("ChunkUploaded",q,s);if(q.status!=c.FAILED){e().UploadNextChunk()}if(p==u-1){q.status=c.DONE;o.trigger("FileUploaded",q,{response:t})}});l.bind("Silverlight:UploadSuccessful",function(o,r,p){var q=o.getFile(n[r]);q.status=c.DONE;o.trigger("FileUploaded",q,{response:p})});l.bind("FilesRemoved",function(o,q){var p;for(p=0;p<q.length;p++){e().RemoveFile(n[q[p].id])}});l.bind("UploadFile",function(o,q){var r=o.settings,p=r.resize||{};e().UploadFile(n[q.id],c.buildUrl(o.settings.url,{name:q.target_name||q.name}),b({chunk_size:r.chunk_size,image_width:p.width,image_height:p.height,image_quality:p.quality||90,multipart:!!r.multipart,multipart_params:r.multipart_params||{},headers:r.headers}))});m({success:true})})}})})(plupload);(function(c){var a={};function b(){var d;try{d=navigator.plugins["Shockwave Flash"];d=d.description}catch(f){try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(e){d="0.0"}}d=d.match(/\d+/g);return parseFloat(d[0]+"."+d[1])}c.flash={trigger:function(f,d,e){setTimeout(function(){var j=a[f],h,g;if(j){j.trigger("Flash:"+d,e)}},0)}};c.runtimes.Flash=c.addRuntime("flash",{getFeatures:function(){return{jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(g,l){var k,f,h,e,m=0,d=document.body;if(b()<10){l({success:false});return}a[g.id]=g;k=document.getElementById(g.settings.browse_button);f=document.createElement("div");f.id=g.id+"_flash_container";c.extend(f.style,{position:"absolute",top:"0px",background:g.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100%",height:"100%"});f.className="plupload flash";if(g.settings.container){d=document.getElementById(g.settings.container);d.style.position="relative"}d.appendChild(f);h="id="+escape(g.id);f.innerHTML='<object id="'+g.id+'_flash" width="100%" height="100%" style="outline:0" type="application/x-shockwave-flash" data="'+g.settings.flash_swf_url+'"><param name="movie" value="'+g.settings.flash_swf_url+'" /><param name="flashvars" value="'+h+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>';function j(){return document.getElementById(g.id+"_flash")}function i(){if(m++>5000){l({success:false});return}if(!e){setTimeout(i,1)}}i();k=f=null;g.bind("Flash:Init",function(){var p={},o,n=g.settings.resize||{};e=true;j().setFileFilters(g.settings.filters,g.settings.multi_selection);g.bind("UploadFile",function(q,r){var s=q.settings;j().uploadFile(p[r.id],c.buildUrl(s.url,{name:r.target_name||r.name}),{chunk_size:s.chunk_size,width:n.width,height:n.height,quality:n.quality||90,multipart:s.multipart,multipart_params:s.multipart_params,file_data_name:s.file_data_name,format:/\.(jpg|jpeg)$/i.test(r.name)?"jpg":"png",headers:s.headers,urlstream_upload:s.urlstream_upload})});g.bind("Flash:UploadProcess",function(r,q){var s=r.getFile(p[q.id]);if(s.status!=c.FAILED){s.loaded=q.loaded;s.size=q.size;r.trigger("UploadProgress",s)}});g.bind("Flash:UploadChunkComplete",function(q,s){var t,r=q.getFile(p[s.id]);t={chunk:s.chunk,chunks:s.chunks,response:s.text};q.trigger("ChunkUploaded",r,t);if(r.status!=c.FAILED){j().uploadNextChunk()}if(s.chunk==s.chunks-1){r.status=c.DONE;q.trigger("FileUploaded",r,{response:s.text})}});g.bind("Flash:SelectFiles",function(q,t){var s,r,u=[],v;for(r=0;r<t.length;r++){s=t[r];v=c.guid();p[v]=s.id;p[s.id]=v;u.push(new c.File(v,s.name,s.size))}if(u.length){g.trigger("FilesAdded",u)}});g.bind("Flash:SecurityError",function(q,r){g.trigger("Error",{code:c.SECURITY_ERROR,message:"Security error.",details:r.message,file:g.getFile(p[r.id])})});g.bind("Flash:GenericError",function(q,r){g.trigger("Error",{code:c.GENERIC_ERROR,message:"Generic error.",details:r.message,file:g.getFile(p[r.id])})});g.bind("Flash:IOError",function(q,r){g.trigger("Error",{code:c.IO_ERROR,message:"IO error.",details:r.message,file:g.getFile(p[r.id])})});g.bind("QueueChanged",function(q){g.refresh()});g.bind("FilesRemoved",function(q,s){var r;for(r=0;r<s.length;r++){j().removeFile(p[s[r].id])}});g.bind("StateChanged",function(q){g.refresh()});g.bind("Refresh",function(q){var r,s,t;j().setFileFilters(g.settings.filters,g.settings.multi_selection);r=document.getElementById(q.settings.browse_button);s=c.getPos(r,document.getElementById(q.settings.container));t=c.getSize(r);c.extend(document.getElementById(q.id+"_flash_container").style,{top:s.y+"px",left:s.x+"px",width:t.w+"px",height:t.h+"px"})});l({success:true})})}})})(plupload);(function(a){a.runtimes.BrowserPlus=a.addRuntime("browserplus",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(g,i){var e=window.BrowserPlus,h={},d=g.settings,c=d.resize;function f(n){var m,l,j=[],k,o;for(l=0;l<n.length;l++){k=n[l];o=a.guid();h[o]=k;j.push(new a.File(o,k.name,k.size))}if(l){g.trigger("FilesAdded",j)}}function b(){g.bind("PostInit",function(){var m,k=d.drop_element,o=g.id+"_droptarget",j=document.getElementById(k),l;function p(r,q){e.DragAndDrop.AddDropTarget({id:r},function(s){e.DragAndDrop.AttachCallbacks({id:r,hover:function(t){if(!t&&q){q()}},drop:function(t){if(q){q()}f(t)}},function(){})})}function n(){document.getElementById(o).style.top="-1000px"}if(j){if(document.attachEvent&&(/MSIE/gi).test(navigator.userAgent)){m=document.createElement("div");m.setAttribute("id",o);a.extend(m.style,{position:"absolute",top:"-1000px",background:"red",filter:"alpha(opacity=0)",opacity:0});document.body.appendChild(m);a.addEvent(j,"dragenter",function(r){var q,s;q=document.getElementById(k);s=a.getPos(q);a.extend(document.getElementById(o).style,{top:s.y+"px",left:s.x+"px",width:q.offsetWidth+"px",height:q.offsetHeight+"px"})});p(o,n)}else{p(k)}}a.addEvent(document.getElementById(d.browse_button),"click",function(v){var t=[],r,q,u=d.filters,s;v.preventDefault();for(r=0;r<u.length;r++){s=u[r].extensions.split(",");for(q=0;q<s.length;q++){t.push(a.mimeTypes[s[q]])}}e.FileBrowse.OpenBrowseDialog({mimeTypes:t},function(w){if(w.success){f(w.value)}})});j=m=null});g.bind("UploadFile",function(n,k){var m=h[k.id],j={},l=n.settings.chunk_size,o,p=[];function r(s,u){var t;if(k.status==a.FAILED){return}j.name=k.target_name||k.name;if(l){j.chunk=s;j.chunks=u}t=p.shift();e.Uploader.upload({url:a.buildUrl(n.settings.url,j),files:{file:t},cookies:document.cookies,postvars:n.settings.multipart_params,progressCallback:function(x){var w,v=0;o[s]=parseInt(x.filePercent*t.size/100,10);for(w=0;w<o.length;w++){v+=o[w]}k.loaded=v;n.trigger("UploadProgress",k)}},function(w){var v,x;if(w.success){v=w.value.statusCode;if(l){n.trigger("ChunkUploaded",k,{chunk:s,chunks:u,response:w.value.body,status:v})}if(p.length>0){r(++s,u)}else{k.status=a.DONE;n.trigger("FileUploaded",k,{response:w.value.body,status:v});if(v>=400){n.trigger("Error",{code:a.HTTP_ERROR,message:"HTTP Error.",file:k,status:v})}}}else{n.trigger("Error",{code:a.GENERIC_ERROR,message:"Generic Error.",file:k,details:w.error})}})}function q(s){k.size=s.size;if(l){e.FileAccess.chunk({file:s,chunkSize:l},function(v){if(v.success){var w=v.value,t=w.length;o=Array(t);for(var u=0;u<t;u++){o[u]=0;p.push(w[u])}r(0,t)}})}else{o=Array(1);p.push(s);r(0,1)}}if(c&&/\.(png|jpg|jpeg)$/i.test(k.name)){BrowserPlus.ImageAlter.transform({file:m,quality:c.quality||90,actions:[{scale:{maxwidth:c.width,maxheight:c.height}}]},function(s){if(s.success){q(s.value.file)}})}else{q(m)}});i({success:true})}if(e){e.init(function(k){var j=[{service:"Uploader",version:"3"},{service:"DragAndDrop",version:"1"},{service:"FileBrowse",version:"1"},{service:"FileAccess",version:"2"}];if(c){j.push({service:"ImageAlter",version:"4"})}if(k.success){e.require({services:j},function(l){if(l.success){b()}else{i()}})}else{i()}})}else{i()}}})})(plupload);(function(b){function a(i,l,j,c,k){var e,d,h,g,f;e=document.createElement("canvas");e.style.display="none";document.body.appendChild(e);d=e.getContext("2d");h=new Image();h.onload=function(){var o,m,n;f=Math.min(l/h.width,j/h.height);if(f<1){o=Math.round(h.width*f);m=Math.round(h.height*f)}else{o=h.width;m=h.height}e.width=o;e.height=m;d.drawImage(h,0,0,o,m);g=e.toDataURL(c);g=g.substring(g.indexOf("base64,")+7);g=atob(g);e.parentNode.removeChild(e);k({success:true,data:g})};h.src=i}b.runtimes.Html5=b.addRuntime("html5",{getFeatures:function(){var g,d,f,e,c;d=f=e=c=false;if(window.XMLHttpRequest){g=new XMLHttpRequest();f=!!g.upload;d=!!(g.sendAsBinary||g.upload)}if(d){e=!!(File&&File.prototype.getAsDataURL);c=!!(File&&File.prototype.slice)}return{html5:d,dragdrop:window.mozInnerScreenX!==undefined||c,jpgresize:e,pngresize:e,multipart:e||!!window.FileReader||!!window.FormData,progress:f,chunking:c||e}},init:function(f,g){var c={},d;function e(l){var j,h,k=[],m;for(h=0;h<l.length;h++){j=l[h];m=b.guid();c[m]=j;k.push(new b.File(m,j.fileName,j.fileSize))}if(k.length){f.trigger("FilesAdded",k)}}d=this.getFeatures();if(!d.html5){g({success:false});return}f.bind("Init",function(m){var q,o=[],l,p,j=m.settings.filters,k,n,h=document.body;q=document.createElement("div");q.id=m.id+"_html5_container";for(l=0;l<j.length;l++){k=j[l].extensions.split(/,/);for(p=0;p<k.length;p++){n=b.mimeTypes[k[p]];if(n){o.push(n)}}}b.extend(q.style,{position:"absolute",background:f.settings.shim_bgcolor||"transparent",width:"100px",height:"100px",overflow:"hidden",zIndex:99999,opacity:f.settings.shim_bgcolor?"":0});q.className="plupload html5";if(f.settings.container){h=document.getElementById(f.settings.container);h.style.position="relative"}h.appendChild(q);q.innerHTML='<input id="'+f.id+'_html5" style="width:100%;" type="file" accept="'+o.join(",")+'" '+(f.settings.multi_selection?'multiple="multiple"':"")+" />";document.getElementById(f.id+"_html5").onchange=function(){e(this.files);this.value=""}});f.bind("PostInit",function(){var h=document.getElementById(f.settings.drop_element);if(h){b.addEvent(h,"dragover",function(i){i.preventDefault()});b.addEvent(h,"drop",function(j){var i=j.dataTransfer;if(i&&i.files){e(i.files)}j.preventDefault()})}});f.bind("Refresh",function(h){var i,j,k;i=document.getElementById(f.settings.browse_button);j=b.getPos(i,document.getElementById(h.settings.container));k=b.getSize(i);b.extend(document.getElementById(f.id+"_html5_container").style,{top:j.y+"px",left:j.x+"px",width:k.w+"px",height:k.h+"px"})});f.bind("UploadFile",function(h,j){var k=h.settings,m,i;function l(n){var q=0,p=0;function o(){var u=n,C,D,y,z,A=0,r="----pluploadboundary"+b.guid(),t,w,s="--",B="\r\n",x="";if(j.status==b.DONE||j.status==b.FAILED||h.state==b.STOPPED){return}z={name:j.target_name||j.name};if(k.chunk_size&&d.chunking){t=k.chunk_size;y=Math.ceil(j.size/t);w=Math.min(t,j.size-(q*t));if(typeof(n)=="string"){u=n.substring(q*t,q*t+w)}else{u=n.slice(q*t,w)}z.chunk=q;z.chunks=y}else{w=j.size}C=new XMLHttpRequest();D=C.upload;if(D){D.onprogress=function(E){j.loaded=Math.min(j.size,p+E.loaded-A);h.trigger("UploadProgress",j)}}C.open("post",b.buildUrl(h.settings.url,z),true);C.onreadystatechange=function(){var E,G;if(C.readyState==4){try{E=C.status}catch(F){E=0}if(E>=400){h.trigger("Error",{code:b.HTTP_ERROR,message:"HTTP Error.",file:j,status:E})}else{if(y){G={chunk:q,chunks:y,response:C.responseText,status:E};h.trigger("ChunkUploaded",j,G);p+=w;if(G.cancelled){j.status=b.FAILED;return}j.loaded=Math.min(j.size,(q+1)*t)}else{j.loaded=j.size}h.trigger("UploadProgress",j);if(!y||++q>=y){j.status=b.DONE;h.trigger("FileUploaded",j,{response:C.responseText,status:E})}else{o()}}}};b.each(h.settings.headers,function(F,E){C.setRequestHeader(E,F)});if(h.settings.multipart&&d.multipart){if(!C.sendAsBinary){var v=new FormData();b.each(h.settings.multipart_params,function(F,E){v.append(E,F)});v.append(h.settings.file_data_name,u);C.send(v);return}C.setRequestHeader("Content-Type","multipart/form-data; boundary="+r);b.each(h.settings.multipart_params,function(F,E){x+=s+r+B+'Content-Disposition: form-data; name="'+E+'"'+B+B;x+=F+B});x+=s+r+B+'Content-Disposition: form-data; name="'+h.settings.file_data_name+'"; filename="'+j.name+'"'+B+"Content-Type: application/octet-stream"+B+B+u+B+s+r+s+B;A=x.length-u.length;u=x}else{C.setRequestHeader("Content-Type","application/octet-stream")}if(C.sendAsBinary){C.sendAsBinary(u)}else{C.send(u)}}o()}m=c[j.id];i=h.settings.resize;if(d.jpgresize){if(i&&/\.(png|jpg|jpeg)$/i.test(j.name)){a(m.getAsDataURL(),i.width,i.height,/\.png$/i.test(j.name)?"image/png":"image/jpeg",function(n){if(n.success){j.size=n.data.length;l(n.data)}else{l(m.getAsBinary())}})}else{l(m.getAsBinary())}}else{l(m)}});g({success:true})}})})(plupload);(function(a){a.runtimes.Html4=a.addRuntime("html4",{getFeatures:function(){return{multipart:true}},init:function(f,g){var d={},c,b;function e(l){var k,j,m=[],n,h;h=l.value.replace(/\\/g,"/");h=h.substring(h.length,h.lastIndexOf("/")+1);n=a.guid();k=new a.File(n,h);d[n]=k;k.input=l;m.push(k);if(m.length){f.trigger("FilesAdded",m)}}f.bind("Init",function(p){var h,x,v,t=[],o,u,m=p.settings.filters,l,s,r=/MSIE/.test(navigator.userAgent),k="javascript",w,j=document.body,n;if(f.settings.container){j=document.getElementById(f.settings.container);j.style.position="relative"}c=(typeof p.settings.form=="string")?document.getElementById(p.settings.form):p.settings.form;if(!c){n=document.getElementById(f.settings.browse_button);for(;n;n=n.parentNode){if(n.nodeName=="FORM"){c=n}}}if(!c){c=document.createElement("form");c.style.display="inline";n=document.getElementById(f.settings.container);n.parentNode.insertBefore(c,n);c.appendChild(n)}c.setAttribute("method","post");c.setAttribute("enctype","multipart/form-data");a.each(p.settings.multipart_params,function(z,y){var i=document.createElement("input");a.extend(i,{type:"hidden",name:y,value:z});c.appendChild(i)});b=document.createElement("iframe");b.setAttribute("src",k+':""');b.setAttribute("name",p.id+"_iframe");b.setAttribute("id",p.id+"_iframe");b.style.display="none";a.addEvent(b,"load",function(B){var C=B.target,z=f.currentfile,A;try{A=C.contentWindow.document||C.contentDocument||window.frames[C.id].document}catch(y){p.trigger("Error",{code:a.SECURITY_ERROR,message:"Security error.",file:z});return}if(A.location.href=="about:blank"||!z){return}var i=A.documentElement.innerText||A.documentElement.textContent;if(i!=""){z.status=a.DONE;z.loaded=1025;z.percent=100;if(z.input){z.input.removeAttribute("name")}p.trigger("UploadProgress",z);p.trigger("FileUploaded",z,{response:i});if(c.tmpAction){c.setAttribute("action",c.tmpAction)}if(c.tmpTarget){c.setAttribute("target",c.tmpTarget)}}});c.appendChild(b);if(r){window.frames[b.id].name=b.name}x=document.createElement("div");x.id=p.id+"_iframe_container";for(o=0;o<m.length;o++){l=m[o].extensions.split(/,/);for(u=0;u<l.length;u++){s=a.mimeTypes[l[u]];if(s){t.push(s)}}}a.extend(x.style,{position:"absolute",background:"transparent",width:"100px",height:"100px",overflow:"hidden",zIndex:99999,opacity:0});w=f.settings.shim_bgcolor;if(w){a.extend(x.style,{background:w,opacity:1})}x.className="plupload_iframe";j.appendChild(x);function q(){v=document.createElement("input");v.setAttribute("type","file");v.setAttribute("accept",t.join(","));v.setAttribute("size",1);a.extend(v.style,{width:"100%",height:"100%",opacity:0});if(r){a.extend(v.style,{filter:"alpha(opacity=0)"})}a.addEvent(v,"change",function(i){var y=i.target;if(y.value){q();y.style.display="none";e(y)}});x.appendChild(v);return true}q()});f.bind("Refresh",function(h){var i,j,k;i=document.getElementById(f.settings.browse_button);j=a.getPos(i,document.getElementById(h.settings.container));k=a.getSize(i);a.extend(document.getElementById(f.id+"_iframe_container").style,{top:j.y+"px",left:j.x+"px",width:k.w+"px",height:k.h+"px"})});f.bind("UploadFile",function(h,i){if(i.status==a.DONE||i.status==a.FAILED||h.state==a.STOPPED){return}if(!i.input){i.status=a.ERROR;return}i.input.setAttribute("name",h.settings.file_data_name);c.tmpAction=c.getAttribute("action");c.setAttribute("action",a.buildUrl(h.settings.url,{name:i.target_name||i.name}));c.tmpTarget=c.getAttribute("target");c.setAttribute("target",b.name);this.currentfile=i;c.submit()});f.bind("FilesRemoved",function(h,k){var j,l;for(j=0;j<k.length;j++){l=k[j].input;if(l){l.parentNode.removeChild(l)}}});g({success:true})}})})(plupload);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.full.tmp.js b/typo3/contrib/plupload/js/plupload.full.tmp.js
deleted file mode 100644 (file)
index 0e17539..0000000
+++ /dev/null
@@ -1,3447 +0,0 @@
-/**\r
- * plupload.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global window:false, escape:false */\r
-\r
-(function() {\r
-       var count = 0, runtimes = [], i18n = {}, mimes = {},\r
-               xmlEncodeChars = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'},\r
-               xmlEncodeRegExp = /[<>&\"\']/g, undef, delay = window.setTimeout;\r
-\r
-       // IE W3C like event funcs\r
-       function preventDefault() {\r
-               this.returnValue = false;\r
-       }\r
-\r
-       function stopPropagation() {\r
-               this.cancelBubble = true;\r
-       }\r
-\r
-       // Parses the default mime types string into a mimes lookup map\r
-       (function(mime_data) {\r
-               var items = mime_data.split(/,/), i, y, ext;\r
-\r
-               for (i = 0; i < items.length; i += 2) {\r
-                       ext = items[i + 1].split(/ /);\r
-\r
-                       for (y = 0; y < ext.length; y++) {\r
-                               mimes[ext[y]] = items[i];\r
-                       }\r
-               }\r
-       })(\r
-               "application/msword,doc dot," +\r
-               "application/pdf,pdf," +\r
-               "application/pgp-signature,pgp," +\r
-               "application/postscript,ps ai eps," +\r
-               "application/rtf,rtf," +\r
-               "application/vnd.ms-excel,xls xlb," +\r
-               "application/vnd.ms-powerpoint,ppt pps pot," +\r
-               "application/zip,zip," +\r
-               "application/x-shockwave-flash,swf swfl," +\r
-               "application/vnd.openxmlformats,docx pptx xlsx," +\r
-               "audio/mpeg,mpga mpega mp2 mp3," +\r
-               "audio/x-wav,wav," +\r
-               "image/bmp,bmp," +\r
-               "image/gif,gif," +\r
-               "image/jpeg,jpeg jpg jpe," +\r
-               "image/png,png," +\r
-               "image/svg+xml,svg svgz," +\r
-               "image/tiff,tiff tif," +\r
-               "text/html,htm html xhtml," +\r
-               "text/rtf,rtf," +\r
-               "video/mpeg,mpeg mpg mpe," +\r
-               "video/quicktime,qt mov," +\r
-               "video/x-flv,flv," +\r
-               "video/vnd.rn-realvideo,rv," +\r
-               "text/plain,asc txt text diff log," +\r
-               "application/octet-stream,exe"\r
-       );\r
-\r
-       /**\r
-        * Plupload class with some global constants and functions.\r
-        *\r
-        * @example\r
-        * // Encode entities\r
-        * console.log(plupload.xmlEncode("My string &lt;&gt;"));\r
-        *\r
-        * // Generate unique id\r
-        * console.log(plupload.guid());\r
-        *\r
-        * @static\r
-        * @class plupload\r
-        */\r
-       var plupload = {\r
-               /**\r
-                * Inital state of the queue and also the state ones it's finished all it's uploads.\r
-                *\r
-                * @property STOPPED\r
-                * @final\r
-                */\r
-               STOPPED : 1,\r
-\r
-               /**\r
-                * Upload process is running\r
-                *\r
-                * @property STARTED\r
-                * @final\r
-                */\r
-               STARTED : 2,\r
-\r
-               /**\r
-                * File is queued for upload\r
-                *\r
-                * @property QUEUED\r
-                * @final\r
-                */\r
-               QUEUED : 1,\r
-\r
-               /**\r
-                * File is being uploaded\r
-                *\r
-                * @property UPLOADING\r
-                * @final\r
-                */\r
-               UPLOADING : 2,\r
-\r
-               /**\r
-                * File has failed to be uploaded\r
-                *\r
-                * @property FAILED\r
-                * @final\r
-                */\r
-               FAILED : 4,\r
-\r
-               /**\r
-                * File has been uploaded successfully\r
-                *\r
-                * @property DONE\r
-                * @final\r
-                */\r
-               DONE : 5,\r
-\r
-               // Error constants used by the Error event\r
-\r
-               /**\r
-                * Generic error for example if an exception is thrown inside Silverlight.\r
-                *\r
-                * @property GENERIC_ERROR\r
-                * @final\r
-                */\r
-               GENERIC_ERROR : -100,\r
-\r
-               /**\r
-                * HTTP transport error. For example if the server produces a HTTP status other than 200.\r
-                *\r
-                * @property HTTP_ERROR\r
-                * @final\r
-                */\r
-               HTTP_ERROR : -200,\r
-\r
-               /**\r
-                * Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.\r
-                *\r
-                * @property IO_ERROR\r
-                * @final\r
-                */\r
-               IO_ERROR : -300,\r
-\r
-               /**\r
-                * Generic I/O error. For exampe if it wasn't possible to open the file stream on local machine.\r
-                *\r
-                * @property SECURITY_ERROR\r
-                * @final\r
-                */\r
-               SECURITY_ERROR : -400,\r
-\r
-               /**\r
-                * Initialization error. Will be triggered if no runtime was initialized.\r
-                *\r
-                * @property INIT_ERROR\r
-                * @final\r
-                */\r
-               INIT_ERROR : -500,\r
-\r
-               /**\r
-                * File size error. If the user selects a file that is to large it will be blocked and an error of this type will be triggered.\r
-                *\r
-                * @property FILE_SIZE_ERROR\r
-                * @final\r
-                */\r
-               FILE_SIZE_ERROR : -600,\r
-\r
-               /**\r
-                * File extension error. If the user selects a file that isn't valid according to the filters setting.\r
-                *\r
-                * @property FILE_EXTENSION_ERROR\r
-                * @final\r
-                */\r
-               FILE_EXTENSION_ERROR : -700,\r
-\r
-               /**\r
-                * Mime type lookup table.\r
-                *\r
-                * @property mimeTypes\r
-                * @type Object\r
-                * @final\r
-                */\r
-               mimeTypes : mimes,\r
-\r
-               /**\r
-                * Extends the specified object with another object.\r
-                *\r
-                * @method extend\r
-                * @param {Object} target Object to extend.\r
-                * @param {Object..} obj Multiple objects to extend with.\r
-                * @return {Object} Same as target, the extended object.\r
-                */\r
-               extend : function(target) {\r
-                       plupload.each(arguments, function(arg, i) {\r
-                               if (i > 0) {\r
-                                       plupload.each(arg, function(value, key) {\r
-                                               target[key] = value;\r
-                                       });\r
-                               }\r
-                       });\r
-\r
-                       return target;\r
-               },\r
-\r
-               /**\r
-                * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _.\r
-                *\r
-                * @method cleanName\r
-                * @param {String} s String to clean up.\r
-                * @return {String} Cleaned string.\r
-                */\r
-               cleanName : function(name) {\r
-                       var i, lookup;\r
-\r
-                       // Replace diacritics\r
-                       lookup = [\r
-                               /[\300-\306]/g, 'A', /[\340-\346]/g, 'a',\r
-                               /\307/g, 'C', /\347/g, 'c',\r
-                               /[\310-\313]/g, 'E', /[\350-\353]/g, 'e',\r
-                               /[\314-\317]/g, 'I', /[\354-\357]/g, 'i',\r
-                               /\321/g, 'N', /\361/g, 'n',\r
-                               /[\322-\330]/g, 'O', /[\362-\370]/g, 'o',\r
-                               /[\331-\334]/g, 'U', /[\371-\374]/g, 'u'\r
-                       ];\r
-\r
-                       for (i = 0; i < lookup.length; i += 2) {\r
-                               name = name.replace(lookup[i], lookup[i + 1]);\r
-                       }\r
-\r
-                       // Replace whitespace\r
-                       name = name.replace(/\s+/g, '_');\r
-\r
-                       // Remove anything else\r
-                       name = name.replace(/[^a-z0-9_\-\.]+/gi, '');\r
-\r
-                       return name;\r
-               },\r
-\r
-               /**\r
-                * Adds a specific upload runtime like for example flash or gears.\r
-                *\r
-                * @method addRuntime\r
-                * @param {String} name Runtime name for example flash.\r
-                * @param {Object} obj Object containing init/destroy method.\r
-                */\r
-               addRuntime : function(name, runtime) {\r
-                       runtime.name = name;\r
-                       runtimes[name] = runtime;\r
-                       runtimes.push(runtime);\r
-\r
-                       return runtime;\r
-               },\r
-\r
-               /**\r
-                * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers.\r
-                * The only way a user would be able to get the same ID is if the two persons at the same exact milisecond manages\r
-                * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique.\r
-                * It's more probable for the earth to be hit with an ansteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property\r
-                * to an user unique key.\r
-                *\r
-                * @method guid\r
-                * @return {String} Virtually unique id.\r
-                */\r
-               guid : function() {\r
-                       var guid = new Date().getTime().toString(32), i;\r
-\r
-                       for (i = 0; i < 5; i++) {\r
-                               guid += Math.floor(Math.random() * 65535).toString(32);\r
-                       }\r
-\r
-                       return (plupload.guidPrefix || 'p') + guid + (count++).toString(32);\r
-               },\r
-\r
-               /**\r
-                * Builds a full url out of a base URL and an object with items to append as query string items.\r
-                *\r
-                * @param {String} url Base URL to append query string items to.\r
-                * @param {Object} items Name/value object to serialize as a querystring.\r
-                * @return {String} String with url + serialized query string items.\r
-                */\r
-               buildUrl : function(url, items) {\r
-                       var query = '';\r
-\r
-                       plupload.each(items, function(value, name) {\r
-                               query += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\r
-                       });\r
-\r
-                       if (query) {\r
-                               url += (url.indexOf('?') > 0 ? '&' : '?') + query;\r
-                       }\r
-\r
-                       return url;\r
-               },\r
-\r
-               /**\r
-                * Executes the callback function for each item in array/object. If you return false in the\r
-                * callback it will break the loop.\r
-                *\r
-                * @param {Object} obj Object to iterate.\r
-                * @param {function} callback Callback function to execute for each item.\r
-                */\r
-               each : function(obj, callback) {\r
-                       var length, key, i;\r
-\r
-                       if (obj) {\r
-                               length = obj.length;\r
-\r
-                               if (length === undef) {\r
-                                       // Loop object items\r
-                                       for (key in obj) {\r
-                                               if (obj.hasOwnProperty(key)) {\r
-                                                       if (callback(obj[key], key) === false) {\r
-                                                               return;\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                               } else {\r
-                                       // Loop array items\r
-                                       for (i = 0; i < length; i++) {\r
-                                               if (callback(obj[i], i) === false) {\r
-                                                       return;\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-               },\r
-\r
-               /**\r
-                * Formats the specified number as a size string for example 1024 becomes 1 KB.\r
-                *\r
-                * @method formatSize\r
-                * @param {Number} size Size to format as string.\r
-                * @return {String} Formatted size string.\r
-                */\r
-               formatSize : function(size) {\r
-                       if (size === undef) {\r
-                               return plupload.translate('N/A');\r
-                       }\r
-\r
-                       // MB\r
-                       if (size > 1048576) {\r
-                               return Math.round(size / 1048576, 1) + " MB";\r
-                       }\r
-\r
-                       // KB\r
-                       if (size > 1024) {\r
-                               return Math.round(size / 1024, 1) + " KB";\r
-                       }\r
-\r
-                       return size + " b";\r
-               },\r
-\r
-               /**\r
-                * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields.\r
-                *\r
-                * @method getPos\r
-                * @param {Element} node HTML element or element id to get x, y position from.\r
-                * @param {Element} root Optional root element to stop calculations at.\r
-                * @return {object} Absolute position of the specified element object with x, y fields.\r
-                */\r
-                getPos : function(node, root) {\r
-                       var x = 0, y = 0, parent, doc = document, nodeRect, rootRect;\r
-\r
-                       node = node;\r
-                       root = root || doc.body;\r
-\r
-                       // Returns the x, y cordinate for an element on IE 6 and IE 7\r
-                       function getIEPos(node) {\r
-                               var bodyElm, rect, x = 0, y = 0;\r
-\r
-                               if (node) {\r
-                                       rect = node.getBoundingClientRect();\r
-                                       bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body;\r
-                                       x = rect.left + bodyElm.scrollLeft;\r
-                                       y = rect.top + bodyElm.scrollTop;\r
-                               }\r
-\r
-                               return {\r
-                                       x : x,\r
-                                       y : y\r
-                               };\r
-                       }\r
-\r
-                       // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode\r
-                       if (node.getBoundingClientRect && (navigator.userAgent.indexOf('MSIE') > 0 && doc.documentMode !== 8)) {\r
-                               nodeRect = getIEPos(node);\r
-                               rootRect = getIEPos(root);\r
-\r
-                               return {\r
-                                       x : nodeRect.x - rootRect.x,\r
-                                       y : nodeRect.y - rootRect.y\r
-                               };\r
-                       }\r
-\r
-                       parent = node;\r
-                       while (parent && parent != root && parent.nodeType) {\r
-                               x += parent.offsetLeft || 0;\r
-                               y += parent.offsetTop || 0;\r
-                               parent = parent.offsetParent;\r
-                       }\r
-\r
-                       parent = node.parentNode;\r
-                       while (parent && parent != root && parent.nodeType) {\r
-                               x -= parent.scrollLeft || 0;\r
-                               y -= parent.scrollTop || 0;\r
-                               parent = parent.parentNode;\r
-                       }\r
-\r
-                       return {\r
-                               x : x,\r
-                               y : y\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Returns the size of the specified node in pixels.\r
-                *\r
-                * @param {Node} node Node to get the size of.\r
-                * @return {Object} Object with a w and h property.\r
-                */\r
-               getSize : function(node) {\r
-                       return {\r
-                               w : node.clientWidth || node.offsetWidth,\r
-                               h : node.clientHeight || node.offsetHeight\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Parses the specified size string into a byte value. For example 10kb becomes 10240.\r
-                *\r
-                * @method parseSize\r
-                * @param {String/Number} size String to parse or number to just pass through.\r
-                * @return {Number} Size in bytes.\r
-                */\r
-               parseSize : function(size) {\r
-                       var mul;\r
-\r
-                       if (typeof(size) == 'string') {\r
-                               size = /^([0-9]+)([mgk]+)$/.exec(size.toLowerCase().replace(/[^0-9mkg]/g, ''));\r
-                               mul = size[2];\r
-                               size = +size[1];\r
-\r
-                               if (mul == 'g') {\r
-                                       size *= 1073741824;\r
-                               }\r
-\r
-                               if (mul == 'm') {\r
-                                       size *= 1048576;\r
-                               }\r
-\r
-                               if (mul == 'k') {\r
-                                       size *= 1024;\r
-                               }\r
-                       }\r
-\r
-                       return size;\r
-               },\r
-\r
-               /**\r
-                * Encodes the specified string.\r
-                *\r
-                * @method xmlEncode\r
-                * @param {String} s String to encode.\r
-                * @return {String} Encoded string.\r
-                */\r
-               xmlEncode : function(str) {\r
-                       return str ? ('' + str).replace(xmlEncodeRegExp, function(chr) {\r
-                               return xmlEncodeChars[chr] ? '&' + xmlEncodeChars[chr] + ';' : chr;\r
-                       }) : str;\r
-               },\r
-\r
-               /**\r
-                * Forces anything into an array.\r
-                *\r
-                * @method toArray\r
-                * @param {Object} obj Object with length field.\r
-                * @return {Array} Array object containing all items.\r
-                */\r
-               toArray : function(obj) {\r
-                       var i, arr = [];\r
-\r
-                       for (i = 0; i < obj.length; i++) {\r
-                               arr[i] = obj[i];\r
-                       }\r
-\r
-                       return arr;\r
-               },\r
-\r
-               /**\r
-                * Extends the language pack object with new items.\r
-                *\r
-                * @param {Object} pack Language pack items to add.\r
-                * @return {Object} Extended language pack object.\r
-                */\r
-               addI18n : function(pack) {\r
-                       return plupload.extend(i18n, pack);\r
-               },\r
-\r
-               /**\r
-                * Translates the specified string by checking for the english string in the language pack lookup.\r
-                *\r
-                * @param {String} str String to look for.\r
-                * @reutrn {String} Translated string or the input string if it wasn't found.\r
-                */\r
-               translate : function(str) {\r
-                       return i18n[str] || str;\r
-               },\r
-\r
-               /**\r
-                * Adds an event handler to the specified object.\r
-                *\r
-                * @param {Object} obj DOM element like object to add handler to.\r
-                * @param {String} name Name to add event listener to.\r
-                * @param {function} callback Function to call when event occurs.\r
-                */\r
-               addEvent : function(obj, name, callback) {\r
-                       if (obj.attachEvent) {\r
-                               obj.attachEvent('on' + name, function() {\r
-                                       var evt = window.event;\r
-\r
-                                       if (!evt.target) {\r
-                                               evt.target = evt.srcElement;\r
-                                       }\r
-\r
-                                       evt.preventDefault = preventDefault;\r
-                                       evt.stopPropagation = stopPropagation;\r
-\r
-                                       callback(evt);\r
-                               });\r
-                       } else if (obj.addEventListener) {\r
-                               obj.addEventListener(name, callback, false);\r
-                       }\r
-               }\r
-       };\r
-\r
-       /**\r
-        * Uploader class, an instance of this class will be created for each upload field.\r
-        *\r
-        * @example\r
-        * var uploader = new plupload.Uploader({\r
-        *     runtimes : 'gears,html5,flash',\r
-        *     browse_button : 'button_id'\r
-        * });\r
-        *\r
-        * uploader.bind('Init', function(up) {\r
-        *     alert('Supports drag/drop: ' + (!!up.features.dragdrop));\r
-        * });\r
-        *\r
-        * uploader.bind('FilesAdded', function(up, files) {\r
-        *     alert('Selected files: ' + files.length);\r
-        * });\r
-        *\r
-        * uploader.bind('QueueChanged', function(up) {\r
-        *     alert('Queued files: ' + uploader.files.length);\r
-        * });\r
-        *\r
-        * uploader.init();\r
-        *\r
-        * @class plupload.Uploader\r
-        */\r
-\r
-       /**\r
-        * Constructs a new uploader instance.\r
-        *\r
-        * @constructor\r
-        * @method Uploader\r
-        * @param {Object} settings Initialization settings, to be used by the uploader instance and runtimes.\r
-        */\r
-       plupload.Uploader = function(settings) {\r
-               var events = {}, total, files = [], fileIndex, startTime;\r
-\r
-               // Inital total state\r
-               total = new plupload.QueueProgress();\r
-\r
-               // Default settings\r
-               settings = plupload.extend({\r
-                       chunk_size : 0,\r
-                       multipart : true,\r
-                       multi_selection : true,\r
-                       file_data_name : 'file',\r
-                       filters : []\r
-               }, settings);\r
-\r
-               // Private methods\r
-               function uploadNext() {\r
-                       var file;\r
-\r
-                       if (this.state == plupload.STARTED && fileIndex < files.length) {\r
-                               file = files[fileIndex++];\r
-\r
-                               if (file.status == plupload.QUEUED) {\r
-                                       this.trigger('BeforeUpload', file);\r
-                                       this.trigger("UploadFile", file);\r
-                               } else {\r
-                                       uploadNext.call(this);\r
-                               }\r
-                       } else {\r
-                               this.stop();\r
-                       }\r
-               }\r
-\r
-               function calc() {\r
-                       var i, file;\r
-\r
-                       // Reset stats\r
-                       total.reset();\r
-\r
-                       // Check status, size, loaded etc on all files\r
-                       for (i = 0; i < files.length; i++) {\r
-                               file = files[i];\r
-\r
-                               if (file.size !== undef) {\r
-                                       total.size += file.size;\r
-                                       total.loaded += file.loaded;\r
-                               } else {\r
-                                       total.size = undef;\r
-                               }\r
-\r
-                               if (file.status == plupload.DONE) {\r
-                                       total.uploaded++;\r
-                               } else if (file.status == plupload.FAILED) {\r
-                                       total.failed++;\r
-                               } else {\r
-                                       total.queued++;\r
-                               }\r
-                       }\r
-\r
-                       // If we couldn't calculate a total file size then use the number of files to calc percent\r
-                       if (total.size === undef) {\r
-                               total.percent = files.length > 0 ? Math.ceil(total.uploaded / files.length * 100) : 0;\r
-                       } else {\r
-                               total.bytesPerSec = Math.ceil(total.loaded / ((+new Date() - startTime || 1) / 1000.0));\r
-                               total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0;\r
-                       }\r
-               }\r
-\r
-               // Add public methods\r
-               plupload.extend(this, {\r
-                       /**\r
-                        * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED.\r
-                        * These states are controlled by the stop/start methods. The default value is STOPPED.\r
-                        *\r
-                        * @property state\r
-                        * @type Number\r
-                        */\r
-                       state : plupload.STOPPED,\r
-\r
-                       /**\r
-                        * Map of features that are available for the uploader runtime. Features will be filled\r
-                        * before the init event is called, these features can then be used to alter the UI for the end user.\r
-                        * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize.\r
-                        *\r
-                        * @property features\r
-                        * @type Object\r
-                        */\r
-                       features : {},\r
-\r
-                       /**\r
-                        * Current upload queue, an array of File instances.\r
-                        *\r
-                        * @property files\r
-                        * @type Array\r
-                        * @see plupload.File\r
-                        */\r
-                       files : files,\r
-\r
-                       /**\r
-                        * Object with name/value settings.\r
-                        *\r
-                        * @property settings\r
-                        * @type Object\r
-                        */\r
-                       settings : settings,\r
-\r
-                       /**\r
-                        * Total progess information. How many files has been uploaded, total percent etc.\r
-                        *\r
-                        * @property total\r
-                        * @type plupload.QueueProgress\r
-                        */\r
-                       total : total,\r
-\r
-                       /**\r
-                        * Unique id for the Uploader instance.\r
-                        *\r
-                        * @property id\r
-                        * @type String\r
-                        */\r
-                       id : plupload.guid(),\r
-\r
-                       /**\r
-                        * Initializes the Uploader instance and adds internal event listeners.\r
-                        *\r
-                        * @method init\r
-                        */\r
-                       init : function() {\r
-                               var self = this, i, runtimeList, a, runTimeIndex = 0, items;\r
-\r
-                               if (typeof(settings.preinit) == "function") {\r
-                                       settings.preinit(self);\r
-                               } else {\r
-                                       plupload.each(settings.preinit, function(func, name) {\r
-                                               self.bind(name, func);\r
-                                       });\r
-                               }\r
-\r
-                               settings.page_url = settings.page_url || document.location.pathname.replace(/\/[^\/]+$/g, '/');\r
-\r
-                               // If url is relative force it absolute to the current page\r
-                               if (!/^(\w+:\/\/|\/)/.test(settings.url)) {\r
-                                       settings.url = settings.page_url + settings.url;\r
-                               }\r
-\r
-                               // Convert settings\r
-                               settings.chunk_size = plupload.parseSize(settings.chunk_size);\r
-                               settings.max_file_size = plupload.parseSize(settings.max_file_size);\r
-\r
-                               // Add files to queue\r
-                               self.bind('FilesAdded', function(up, selected_files) {\r
-                                       var i, file, count = 0, extensionsRegExp, filters = settings.filters;\r
-\r
-                                       // Convert extensions to regexp\r
-                                       if (filters && filters.length) {\r
-                                               extensionsRegExp = [];\r
-                                               \r
-                                               plupload.each(filters, function(filter) {\r
-                                                       plupload.each(filter.extensions.split(/,/), function(ext) {\r
-                                                               extensionsRegExp.push('\\.' + ext.replace(new RegExp('[' + ('/^$.*+?|()[]{}\\'.replace(/./g, '\\$&')) + ']', 'g'), '\\$&'));\r
-                                                       });\r
-                                               });\r
-\r
-                                               extensionsRegExp = new RegExp(extensionsRegExp.join('|') + '$', 'i');\r
-                                       }\r
-\r
-                                       for (i = 0; i < selected_files.length; i++) {\r
-                                               file = selected_files[i];\r
-                                               file.loaded = 0;\r
-                                               file.percent = 0;\r
-                                               file.status = plupload.QUEUED;\r
-\r
-                                               // Invalid file extension\r
-                                               if (extensionsRegExp && !extensionsRegExp.test(file.name)) {\r
-                                                       up.trigger('Error', {\r
-                                                               code : plupload.FILE_EXTENSION_ERROR,\r
-                                                               message : 'File extension error.',\r
-                                                               file : file\r
-                                                       });\r
-\r
-                                                       continue;\r
-                                               }\r
-\r
-                                               // Invalid file size\r
-                                               if (file.size !== undef && file.size > settings.max_file_size) {\r
-                                                       up.trigger('Error', {\r
-                                                               code : plupload.FILE_SIZE_ERROR,\r
-                                                               message : 'File size error.',\r
-                                                               file : file\r
-                                                       });\r
-\r
-                                                       continue;\r
-                                               }\r
-\r
-                                               // Add valid file to list\r
-                                               files.push(file);\r
-                                               count++;\r
-                                       }\r
-\r
-                                       // Only trigger QueueChanged event if any files where added\r
-                                       if (count) {\r
-                                               delay(function() {\r
-                                                       self.trigger("QueueChanged");\r
-                                                       self.refresh();\r
-                                               });\r
-                                       } else {\r
-                                               return false; // Stop the FilesAdded event from immediate propagation\r
-                                       }\r
-                               });\r
-\r
-                               // Generate unique target filenames\r
-                               if (settings.unique_names) {\r
-                                       self.bind("UploadFile", function(up, file) {\r
-                                               var matches = file.name.match(/\.([^.]+)$/), ext = "tmp";\r
-\r
-                                               if (matches) {\r
-                                                       ext = matches[1];\r
-                                               }\r
-\r
-                                               file.target_name = file.id + '.' + ext;\r
-                                       });\r
-                               }\r
-\r
-                               self.bind('UploadProgress', function(up, file) {\r
-                                       if (file.status == plupload.QUEUED) {\r
-                                               file.status = plupload.UPLOADING;\r
-                                       }\r
-\r
-                                       file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 100;\r
-                                       calc();\r
-                               });\r
-\r
-                               self.bind('StateChanged', function(up) {\r
-                                       if (up.state == plupload.STARTED) {\r
-                                               // Get start time to calculate bps\r
-                                               startTime = (+new Date());\r
-                                       }\r
-                               });\r
-\r
-                               self.bind('QueueChanged', calc);\r
-\r
-                               self.bind("Error", function(up, err) {\r
-                                       // Set failed status if an error occured on a file\r
-                                       if (err.file) {\r
-                                               err.file.status = plupload.FAILED;\r
-                                               calc();\r
-\r
-                                               // Upload next file but detach it from the error event\r
-                                               // since other custom listeners might want to stop the queue\r
-                                               delay(function() {\r
-                                                       uploadNext.call(self);\r
-                                               });\r
-                                       }\r
-                               });\r
-\r
-                               self.bind("FileUploaded", function(up, file) {\r
-                                       file.status = plupload.DONE;\r
-                                       file.loaded = file.size;\r
-                                       up.trigger('UploadProgress', file);\r
-\r
-                                       // Upload next file but detach it from the error event\r
-                                       // since other custom listeners might want to stop the queue\r
-                                       delay(function() {\r
-                                               uploadNext.call(self);\r
-                                       });\r
-                               });\r
-\r
-                               // Setup runtimeList\r
-                               if (settings.runtimes) {\r
-                                       runtimeList = [];\r
-                                       items = settings.runtimes.split(/\s?,\s?/);\r
-\r
-                                       for (i = 0; i < items.length; i++) {\r
-                                               if (runtimes[items[i]]) {\r
-                                                       runtimeList.push(runtimes[items[i]]);\r
-                                               }\r
-                                       }\r
-                               } else {\r
-                                       runtimeList = runtimes;\r
-                               }\r
-\r
-                               // Call init on each runtime in sequence\r
-                               function callNextInit() {\r
-                                       var runtime = runtimeList[runTimeIndex++], features, requiredFeatures, i;\r
-\r
-                                       if (runtime) {\r
-                                               features = runtime.getFeatures();\r
-\r
-                                               // Check if runtime supports required features\r
-                                               requiredFeatures = self.settings.required_features;\r
-                                               if (requiredFeatures) {\r
-                                                       requiredFeatures = requiredFeatures.split(',');\r
-\r
-                                                       for (i = 0; i < requiredFeatures.length; i++) {\r
-                                                               // Specified feature doesn't exist\r
-                                                               if (!features[requiredFeatures[i]]) {\r
-                                                                       callNextInit();\r
-                                                                       return;\r
-                                                               }\r
-                                                       }\r
-                                               }\r
-\r
-                                               // Try initializing the runtime\r
-                                               runtime.init(self, function(res) {\r
-                                                       if (res && res.success) {\r
-                                                               // Successful initialization\r
-                                                               self.features = features;\r
-                                                               self.trigger('Init', {runtime : runtime.name});\r
-                                                               self.trigger('PostInit');\r
-                                                               self.refresh();\r
-                                                       } else {\r
-                                                               callNextInit();\r
-                                                       }\r
-                                               });\r
-                                       } else {\r
-                                               // Trigger an init error if we run out of runtimes\r
-                                               self.trigger('Error', {\r
-                                                       code : plupload.INIT_ERROR,\r
-                                                       message : 'Init error.'\r
-                                               });\r
-                                       }\r
-                               }\r
-\r
-                               callNextInit();\r
-\r
-                               if (typeof(settings.init) == "function") {\r
-                                       settings.init(self);\r
-                               } else {\r
-                                       plupload.each(settings.init, function(func, name) {\r
-                                               self.bind(name, func);\r
-                                       });\r
-                               }\r
-                       },\r
-\r
-                       /**\r
-                        * Refreshes the upload instance by dispatching out a refresh event to all runtimes.\r
-                        * This would for example reposition flash/silverlight shims on the page.\r
-                        *\r
-                        * @method refresh\r
-                        */\r
-                       refresh : function() {\r
-                               this.trigger("Refresh");\r
-                       },\r
-\r
-                       /**\r
-                        * Starts uploading the queued files.\r
-                        *\r
-                        * @method start\r
-                        */\r
-                       start : function() {\r
-                               if (this.state != plupload.STARTED) {\r
-                                       fileIndex = 0;\r
-\r
-                                       this.state = plupload.STARTED;\r
-                                       this.trigger("StateChanged");\r
-\r
-                                       uploadNext.call(this);\r
-                               }\r
-                       },\r
-\r
-                       /**\r
-                        * Stops the upload of the queued files.\r
-                        *\r
-                        * @method stop\r
-                        */\r
-                       stop : function() {\r
-                               if (this.state != plupload.STOPPED) {\r
-                                       this.state = plupload.STOPPED;\r
-                                       this.trigger("StateChanged");\r
-                               }\r
-                       },\r
-\r
-                       /**\r
-                        * Returns the specified file object by id.\r
-                        *\r
-                        * @method getFile\r
-                        * @param {String} id File id to look for.\r
-                        * @return {plupload.File} File object or undefined if it wasn't found;\r
-                        */\r
-                       getFile : function(id) {\r
-                               var i;\r
-\r
-                               for (i = files.length - 1; i >= 0; i--) {\r
-                                       if (files[i].id === id) {\r
-                                               return files[i];\r
-                                       }\r
-                               }\r
-                       },\r
-\r
-                       /**\r
-                        * Removes a specific file.\r
-                        *\r
-                        * @method removeFile\r
-                        * @param {plupload.File} file File to remove from queue.\r
-                        */\r
-                       removeFile : function(file) {\r
-                               var i;\r
-\r
-                               for (i = files.length - 1; i >= 0; i--) {\r
-                                       if (files[i].id === file.id) {\r
-                                               return this.splice(i, 1)[0];\r
-                                       }\r
-                               }\r
-                       },\r
-\r
-                       /**\r
-                        * Removes part of the queue and returns the files removed. This will also trigger the FilesRemoved and QueueChanged events.\r
-                        *\r
-                        * @method splice\r
-                        * @param {Number} start (Optional) Start index to remove from.\r
-                        * @param {Number} length (Optional) Lengh of items to remove.\r
-                        * @return {Array} Array of files that was removed.\r
-                        */\r
-                       splice : function(start, length) {\r
-                               var removed;\r
-\r
-                               // Splice and trigger events\r
-                               removed = files.splice(start === undef ? 0 : start, length === undef ? files.length : length);\r
-\r
-                               this.trigger("FilesRemoved", removed);\r
-                               this.trigger("QueueChanged");\r
-\r
-                               return removed;\r
-                       },\r
-\r
-                       /**\r
-                        * Dispatches the specified event name and it's arguments to all listeners.\r
-                        *\r
-                        *\r
-                        * @method trigger\r
-                        * @param {String} name Event name to fire.\r
-                        * @param {Object..} Multiple arguments to pass along to the listener functions.\r
-                        */\r
-                       trigger : function(name) {\r
-                               var list = events[name.toLowerCase()], i, args;\r
-\r
-                               // console.log(name, arguments);\r
-\r
-                               if (list) {\r
-                                       // Replace name with sender in args\r
-                                       args = Array.prototype.slice.call(arguments);\r
-                                       args[0] = this;\r
-\r
-                                       // Dispatch event to all listeners\r
-                                       for (i = 0; i < list.length; i++) {\r
-                                               // Fire event, break chain if false is returned\r
-                                               if (list[i].func.apply(list[i].scope, args) === false) {\r
-                                                       return false;\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               return true;\r
-                       },\r
-\r
-                       /**\r
-                        * Adds an event listener by name.\r
-                        *\r
-                        * @method bind\r
-                        * @param {String} name Event name to listen for.\r
-                        * @param {function} func Function to call ones the event gets fired.\r
-                        * @param {Object} scope Optional scope to execute the specified function in.\r
-                        */\r
-                       bind : function(name, func, scope) {\r
-                               var list;\r
-\r
-                               name = name.toLowerCase();\r
-                               list = events[name] || [];\r
-                               list.push({func : func, scope : scope || this});\r
-                               events[name] = list;\r
-                       },\r
-\r
-                       /**\r
-                        * Removes the specified event listener.\r
-                        *\r
-                        * @method unbind\r
-                        * @param {String} name Name of event to remove.\r
-                        * @param {function} func Function to remove from listener.\r
-                        */\r
-                       unbind : function(name, func) {\r
-                               var list = events[name.toLowerCase()], i;\r
-\r
-                               if (list) {\r
-                                       for (i = list.length - 1; i >= 0; i--) {\r
-                                               if (list[i].func === func) {\r
-                                                       list.splice(i, 1);\r
-                                               }\r
-                                       }\r
-                               }\r
-                       }\r
-\r
-                       /**\r
-                        * Fires when the current RunTime has been initialized.\r
-                        *\r
-                        * @event Init\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires after the init event incase you need to perform actions there.\r
-                        *\r
-                        * @event PostInit\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when the silverlight/flash or other shim needs to move.\r
-                        *\r
-                        * @event Refresh\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        */\r
-       \r
-                       /**\r
-                        * Fires when the overall state is being changed for the upload queue.\r
-                        *\r
-                        * @event StateChanged\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when a file is to be uploaded by the runtime.\r
-                        *\r
-                        * @event UploadFile\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {plupload.File} file File to be uploaded.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when just before a file is uploaded. This event enables you to override settings\r
-                        * on the uploader instance before the file is uploaded.\r
-                        *\r
-                        * @event BeforeUpload\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {plupload.File} file File to be uploaded.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when the file queue is changed. In other words when files are added/removed to the files array of the uploader instance.\r
-                        *\r
-                        * @event QueueChanged\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        */\r
-       \r
-                       /**\r
-                        * Fires while a file is being uploaded. Use this event to update the current file upload progress.\r
-                        *\r
-                        * @event UploadProgress\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {plupload.File} file File that is currently being uploaded.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires while a file was removed from queue.\r
-                        *\r
-                        * @event FilesRemoved\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {Array} files Array of files that got removed.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires while when the user selects files to upload.\r
-                        *\r
-                        * @event FilesAdded\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {Array} files Array of file objects that was added to queue/selected by the user.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when a file is successfully uploaded.\r
-                        *\r
-                        * @event FileUploaded\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {plupload.File} file File that was uploaded.\r
-                        * @param {Object} response Object with response properties.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when file chunk is uploaded.\r
-                        *\r
-                        * @event ChunkUploaded\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {plupload.File} file File that the chunk was uploaded for.\r
-                        * @param {Object} response Object with response properties.\r
-                        */\r
-\r
-                       /**\r
-                        * Fires when a error occurs.\r
-                        *\r
-                        * @event Error\r
-                        * @param {plupload.Uploader} uploader Uploader instance sending the event.\r
-                        * @param {Object} error Contains code, message and sometimes file and other details.\r
-                        */\r
-               });\r
-       };\r
-\r
-       /**\r
-        * File instance.\r
-        *\r
-        * @class plupload.File\r
-        * @param {String} name Name of the file.\r
-        * @param {Number} size File size.\r
-        */\r
-\r
-       /**\r
-        * Constructs a new file instance.\r
-        *\r
-        * @constructor\r
-        * @method File\r
-        * @param {String} id Unique file id.\r
-        * @param {String} name File name.\r
-        * @param {Number} size File size in bytes.\r
-        */\r
-       plupload.File = function(id, name, size) {\r
-               var self = this; // Setup alias for self to reduce code size when it's compressed\r
-\r
-               /**\r
-                * File id this is a globally unique id for the specific file.\r
-                *\r
-                * @property id\r
-                * @type String\r
-                */\r
-               self.id = id;\r
-\r
-               /**\r
-                * File name for example "myfile.gif".\r
-                *\r
-                * @property name\r
-                * @type String\r
-                */\r
-               self.name = name;\r
-\r
-               /**\r
-                * File size in bytes.\r
-                *\r
-                * @property size\r
-                * @type Number\r
-                */\r
-               self.size = size;\r
-\r
-               /**\r
-                * Number of bytes uploaded of the files total size.\r
-                *\r
-                * @property loaded\r
-                * @type Number\r
-                */\r
-               self.loaded = 0;\r
-\r
-               /**\r
-                * Number of percentage uploaded of the file.\r
-                *\r
-                * @property percent\r
-                * @type Number\r
-                */\r
-               self.percent = 0;\r
-\r
-               /**\r
-                * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE.\r
-                *\r
-                * @property status\r
-                * @type Number\r
-                * @see plupload\r
-                */\r
-               self.status = 0;\r
-       };\r
-\r
-       /**\r
-        * Runtime class gets implemented by each upload runtime.\r
-        *\r
-        * @class plupload.Runtime\r
-        * @static\r
-        */\r
-       plupload.Runtime = function() {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               this.getFeatures = function() {\r
-               };\r
-\r
-               /**\r
-                * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. \r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback function to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               this.init = function(uploader, callback) {\r
-               };\r
-       };\r
-\r
-       /**\r
-        * Runtime class gets implemented by each upload runtime.\r
-        *\r
-        * @class plupload.QueueProgress\r
-        */\r
-\r
-       /**\r
-        * Constructs a queue progress.\r
-        *\r
-        * @constructor\r
-        * @method QueueProgress\r
-        */\r
-        plupload.QueueProgress = function() {\r
-               var self = this; // Setup alias for self to reduce code size when it's compressed\r
-\r
-               /**\r
-                * Total queue file size.\r
-                *\r
-                * @property size\r
-                * @type Number\r
-                */\r
-               self.size = 0;\r
-\r
-               /**\r
-                * Total bytes uploaded.\r
-                *\r
-                * @property loaded\r
-                * @type Number\r
-                */\r
-               self.loaded = 0;\r
-\r
-               /**\r
-                * Number of files uploaded.\r
-                *\r
-                * @property uploaded\r
-                * @type Number\r
-                */\r
-               self.uploaded = 0;\r
-\r
-               /**\r
-                * Number of files failed to upload.\r
-                *\r
-                * @property failed\r
-                * @type Number\r
-                */\r
-               self.failed = 0;\r
-\r
-               /**\r
-                * Number of files yet to be uploaded.\r
-                *\r
-                * @property queued\r
-                * @type Number\r
-                */\r
-               self.queued = 0;\r
-\r
-               /**\r
-                * Total percent of the uploaded bytes.\r
-                *\r
-                * @property percent\r
-                * @type Number\r
-                */\r
-               self.percent = 0;\r
-\r
-               /**\r
-                * Bytes uploaded per second.\r
-                *\r
-                * @property bytesPerSec\r
-                * @type Number\r
-                */\r
-               self.bytesPerSec = 0;\r
-\r
-               /**\r
-                * Resets the progress to it's initial values.\r
-                *\r
-                * @method reset\r
-                */\r
-               self.reset = function() {\r
-                       self.size = self.loaded = self.uploaded = self.failed = self.queued = self.percent = self.bytesPerSec = 0;\r
-               };\r
-       };\r
-\r
-       // Create runtimes namespace\r
-       plupload.runtimes = {};\r
-\r
-       // Expose plupload namespace\r
-       window.plupload = plupload;\r
-})();\r
-/**\r
- * plupload.gears.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global plupload:false, google:false, window:false */\r
-\r
-(function(plupload) {\r
-       var blobs = {};\r
-\r
-       function scaleImage(image_blob, width, height, quality, mime) {\r
-               var percentage, canvas, context, scale;\r
-\r
-               // Setup canvas and scale\r
-               canvas = google.gears.factory.create('beta.canvas');\r
-               canvas.decode(image_blob);\r
-               scale = Math.min(width / canvas.width, height / canvas.height);\r
-\r
-               if (scale < 1) {\r
-                       width = Math.round(canvas.width * scale);\r
-                       height = Math.round(canvas.height * scale);\r
-               } else {\r
-                       width = canvas.width;\r
-                       height = canvas.height;\r
-               }\r
-\r
-               canvas.resize(width, height);\r
-\r
-               return canvas.encode(mime, {quality : quality / 100});\r
-       }\r
-\r
-       /**\r
-        * Gears implementation. This runtime supports these features: dragdrop, jpgresize, pngresize, chunks.\r
-        *\r
-        * @static\r
-        * @class plupload.runtimes.Gears\r
-        * @extends plupload.Runtime\r
-        */\r
-       plupload.runtimes.Gears = plupload.addRuntime("gears", {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               getFeatures : function() {\r
-                       return {\r
-                               dragdrop: true,\r
-                               jpgresize: true,\r
-                               pngresize: true,\r
-                               chunks: true,\r
-                               progress: true,\r
-                               multipart: true\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Initializes the upload runtime.\r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               init : function(uploader, callback) {\r
-                       var desktop;\r
-\r
-                       // Check for gears support\r
-                       if (!window.google || !google.gears) {\r
-                               return callback({success : false});\r
-                       }\r
-\r
-                       try {\r
-                               desktop = google.gears.factory.create('beta.desktop');\r
-                       } catch (e) {\r
-                               // Might fail on the latest Gecko build for some odd reason\r
-                               return callback({success : false});\r
-                       }\r
-\r
-                       function addSelectedFiles(selected_files) {\r
-                               var file, i, files = [], id;\r
-\r
-                               // Add the selected files to the file queue\r
-                               for (i = 0; i < selected_files.length; i++) {\r
-                                       file = selected_files[i];\r
-\r
-                                       // Store away gears blob internally\r
-                                       id = plupload.guid();\r
-                                       blobs[id] = file.blob;\r
-\r
-                                       files.push(new plupload.File(id, file.name, file.blob.length));\r
-                               }\r
-\r
-                               // Fire FilesAdded event\r
-                               uploader.trigger("FilesAdded", files);\r
-                       }\r
-\r
-                       // Add drop handler\r
-                       uploader.bind("PostInit", function() {\r
-                               var settings = uploader.settings, dropElm = document.getElementById(settings.drop_element);\r
-\r
-                               if (dropElm) {\r
-                                       // Block browser default drag over\r
-                                       plupload.addEvent(dropElm, 'dragover', function(e) {\r
-                                               desktop.setDropEffect(e, 'copy');\r
-                                               e.preventDefault();\r
-                                       });\r
-\r
-                                       // Attach drop handler and grab files from Gears\r
-                                       plupload.addEvent(dropElm, 'drop', function(e) {\r
-                                               var dragData = desktop.getDragData(e, 'application/x-gears-files');\r
-\r
-                                               if (dragData) {\r
-                                                       addSelectedFiles(dragData.files);\r
-                                               }\r
-\r
-                                               e.preventDefault();\r
-                                       });\r
-\r
-                                       // Prevent IE leak\r
-                                       dropElm = 0;\r
-                               }\r
-\r
-                               // Add browse button\r
-                               plupload.addEvent(document.getElementById(settings.browse_button), 'click', function(e) {\r
-                                       var filters = [], i, a, ext;\r
-\r
-                                       e.preventDefault();\r
-\r
-                                       for (i = 0; i < settings.filters.length; i++) {\r
-                                               ext = settings.filters[i].extensions.split(',');\r
-\r
-                                               for (a = 0; a < ext.length; a++) {\r
-                                                       filters.push('.' + ext[a]);\r
-                                               }\r
-                                       }\r
-\r
-                                       desktop.openFiles(addSelectedFiles, {singleFile : !settings.multi_selection, filter : filters});\r
-                               });\r
-                       });\r
-\r
-                       uploader.bind("UploadFile", function(up, file) {\r
-                               var chunk = 0, chunks, chunkSize, loaded = 0, resize = up.settings.resize, chunking;\r
-\r
-                               chunkSize = up.settings.chunk_size;\r
-                               chunking = chunkSize > 0;\r
-                               chunks = Math.ceil(file.size / chunkSize);\r
-\r
-                               // If chunking is disabled then upload the whole file in one huge chunk\r
-                               if (!chunking) {\r
-                                       chunkSize = file.size;\r
-                                       chunks = 1;\r
-                               }\r
-\r
-                               // If file is png or jpeg and resize is configured then resize it\r
-                               if (resize && /\.(png|jpg|jpeg)$/i.test(file.name)) {\r
-                                       blobs[file.id] = scaleImage(blobs[file.id], resize.width, resize.height, resize.quality || 90, /\.png$/i.test(file.name) ? 'image/png' : 'image/jpeg');\r
-                               }\r
-\r
-                               file.size = blobs[file.id].length;\r
-\r
-                               function uploadNextChunk() {\r
-                                       var req, curChunkSize, multipart = up.settings.multipart, multipartLength = 0, reqArgs = {name : file.target_name || file.name}, url = up.settings.url;\r
-\r
-                                       // Sends the binary blob multipart encoded or raw depending on config\r
-                                       function sendBinaryBlob(blob) {\r
-                                               var builder, boundary = '----pluploadboundary' + plupload.guid(), dashdash = '--', crlf = '\r\n', multipartBlob, mimeType;\r
-\r
-                                               // Build multipart request\r
-                                               if (multipart) {\r
-                                                       req.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);\r
-                                                       builder = google.gears.factory.create('beta.blobbuilder');\r
-\r
-                                                       // Append mutlipart parameters\r
-                                                       plupload.each(plupload.extend(reqArgs, up.settings.multipart_params), function(value, name) {\r
-                                                               builder.append(\r
-                                                                       dashdash + boundary + crlf +\r
-                                                                       'Content-Disposition: form-data; name="' + name + '"' + crlf + crlf\r
-                                                               );\r
-\r
-                                                               builder.append(value + crlf);\r
-                                                       });\r
-\r
-                                                       mimeType = plupload.mimeTypes[file.name.replace(/^.+\.([^.]+)/, '$1')] || 'application/octet-stream';\r
-\r
-                                                       // Add file header\r
-                                                       builder.append(\r
-                                                               dashdash + boundary + crlf +\r
-                                                               'Content-Disposition: form-data; name="' + up.settings.file_data_name + '"; filename="' + file.name + '"' + crlf +\r
-                                                               'Content-Type: ' + mimeType + crlf + crlf\r
-                                                       );\r
-\r
-                                                       // Add file data\r
-                                                       builder.append(blob);\r
-\r
-                                                       // Add footer\r
-                                                       builder.append(crlf + dashdash + boundary + dashdash + crlf);\r
-                                                       multipartBlob = builder.getAsBlob();\r
-                                                       multipartLength = multipartBlob.length - blob.length;\r
-                                                       blob = multipartBlob;\r
-                                               }\r
-\r
-                                               // Send blob or multipart blob depending on config\r
-                                               req.send(blob);\r
-                                       }\r
-\r
-                                       // File upload finished\r
-                                       if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) {\r
-                                               return;\r
-                                       }\r
-\r
-                                       // Only add chunking args if needed\r
-                                       if (chunking) {\r
-                                               reqArgs.chunk = chunk;\r
-                                               reqArgs.chunks = chunks;\r
-                                       }\r
-\r
-                                       // Setup current chunk size\r
-                                       curChunkSize = Math.min(chunkSize, file.size - (chunk  * chunkSize));\r
-\r
-                                       if (!multipart) {\r
-                                               url = plupload.buildUrl(up.settings.url, reqArgs);\r
-                                       }\r
-\r
-                                       req = google.gears.factory.create('beta.httprequest');\r
-                                       req.open('POST', url);\r
-\r
-                                       // Add disposition and type if multipart is disabled\r
-                                       if (!multipart) {\r
-                                               req.setRequestHeader('Content-Disposition', 'attachment; filename="' + file.name + '"');\r
-                                               req.setRequestHeader('Content-Type', 'application/octet-stream');\r
-                                       }\r
-\r
-                                       // Set custom headers\r
-                                       plupload.each(up.settings.headers, function(value, name) {\r
-                                               req.setRequestHeader(name, value);\r
-                                       });\r
-\r
-                                       req.upload.onprogress = function(progress) {\r
-                                               file.loaded = loaded + progress.loaded - multipartLength;\r
-                                               up.trigger('UploadProgress', file);\r
-                                       };\r
-\r
-                                       req.onreadystatechange = function() {\r
-                                               var chunkArgs;\r
-\r
-                                               if (req.readyState == 4) {\r
-                                                       if (req.status == 200) {\r
-                                                               chunkArgs = {\r
-                                                                       chunk : chunk,\r
-                                                                       chunks : chunks,\r
-                                                                       response : req.responseText,\r
-                                                                       status : req.status\r
-                                                               };\r
-\r
-                                                               up.trigger('ChunkUploaded', file, chunkArgs);\r
-\r
-                                                               // Stop upload\r
-                                                               if (chunkArgs.cancelled) {\r
-                                                                       file.status = plupload.FAILED;\r
-                                                                       return;\r
-                                                               }\r
-\r
-                                                               loaded += curChunkSize;\r
-\r
-                                                               if (++chunk >= chunks) {\r
-                                                                       file.status = plupload.DONE;\r
-                                                                       up.trigger('FileUploaded', file, {\r
-                                                                               response : req.responseText,\r
-                                                                               status : req.status\r
-                                                                       });\r
-                                                               } else {\r
-                                                                       uploadNextChunk();\r
-                                                               }\r
-                                                       } else {\r
-                                                               up.trigger('Error', {\r
-                                                                       code : plupload.HTTP_ERROR,\r
-                                                                       message : 'HTTP Error.',\r
-                                                                       file : file,\r
-                                                                       chunk : chunk,\r
-                                                                       chunks : chunks,\r
-                                                                       status : req.status\r
-                                                               });\r
-                                                       }\r
-                                               }\r
-                                       };\r
-\r
-                                       if (chunk < chunks) {\r
-                                               sendBinaryBlob(blobs[file.id].slice(chunk * chunkSize, curChunkSize));\r
-                                       }\r
-                               }\r
-\r
-                               // Start uploading chunks\r
-                               uploadNextChunk();\r
-                       });\r
-\r
-                       callback({success : true});\r
-               }\r
-       });\r
-})(plupload);\r
-/**\r
- * plupload.silverlight.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global plupload:false, ActiveXObject:false, window:false */\r
-\r
-(function(plupload) {\r
-       var uploadInstances = {};\r
-\r
-       function jsonSerialize(obj) {\r
-               var value, type = typeof obj, undef, isArray, i, key;\r
-\r
-               // Encode strings\r
-               if (type === 'string') {\r
-                       value = '\bb\tt\nn\ff\rr\""\'\'\\\\';\r
-\r
-                       return '"' + obj.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g, function(a, b) {\r
-                               var idx = value.indexOf(b);\r
-\r
-                               if (idx + 1) {\r
-                                       return '\\' + value.charAt(idx + 1);\r
-                               }\r
-\r
-                               a = b.charCodeAt().toString(16);\r
-\r
-                               return '\\u' + '0000'.substring(a.length) + a;\r
-                       }) + '"';\r
-               }\r
-\r
-               // Loop objects/arrays\r
-               if (type == 'object') {\r
-                       isArray = obj.length !== undef;\r
-                       value = '';\r
-\r
-                       if (isArray) {\r
-                               for (i = 0; i < obj.length; i++) {\r
-                                       if (value) {\r
-                                               value += ',';\r
-                                       }\r
-\r
-                                       value += jsonSerialize(obj[i]);\r
-                               }\r
-\r
-                               value = '[' + value + ']';\r
-                       } else {\r
-                               for (key in obj) {\r
-                                       if (obj.hasOwnProperty(key)) {\r
-                                               if (value) {\r
-                                                       value += ',';\r
-                                               }\r
-\r
-                                               value += jsonSerialize(key) + ':' + jsonSerialize(obj[key]);\r
-                                       }\r
-                               }\r
-\r
-                               value = '{' + value + '}';\r
-                       }\r
-\r
-                       return value;\r
-               }\r
-\r
-               // Treat undefined as null\r
-               if (obj === undef) {\r
-                       return 'null';\r
-               }\r
-\r
-               // Convert all other types to string\r
-               return '' + obj;\r
-       }\r
-\r
-       function isInstalled(version) {\r
-               var isVersionSupported = false, container = null, control = null, actualVer,\r
-                       actualVerArray, reqVerArray, requiredVersionPart, actualVersionPart, index = 0;\r
-\r
-               try {\r
-                       try {\r
-                               control = new ActiveXObject('AgControl.AgControl');\r
-\r
-                               if (control.IsVersionSupported(version)) {\r
-                                       isVersionSupported = true;\r
-                               }\r
-\r
-                               control = null;\r
-                       } catch (e) {\r
-                               var plugin = navigator.plugins["Silverlight Plug-In"];\r
-\r
-                               if (plugin) {\r
-                                       actualVer = plugin.description;\r
-\r
-                                       if (actualVer === "1.0.30226.2") {\r
-                                               actualVer = "2.0.30226.2";\r
-                                       }\r
-\r
-                                       actualVerArray = actualVer.split(".");\r
-\r
-                                       while (actualVerArray.length > 3) {\r
-                                               actualVerArray.pop();\r
-                                       }\r
-\r
-                                       while ( actualVerArray.length < 4) {\r
-                                               actualVerArray.push(0);\r
-                                       }\r
-\r
-                                       reqVerArray = version.split(".");\r
-\r
-                                       while (reqVerArray.length > 4) {\r
-                                               reqVerArray.pop();\r
-                                       }\r
-\r
-                                       do {\r
-                                               requiredVersionPart = parseInt(reqVerArray[index], 10);\r
-                                               actualVersionPart = parseInt(actualVerArray[index], 10);\r
-                                               index++;\r
-                                       } while (index < reqVerArray.length && requiredVersionPart === actualVersionPart);\r
-\r
-                                       if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart)) {\r
-                                               isVersionSupported = true;\r
-                                       }\r
-                               }\r
-                       }\r
-               } catch (e2) {\r
-                       isVersionSupported = false;\r
-               }\r
-\r
-               return isVersionSupported;\r
-       }\r
-\r
-       plupload.silverlight = {\r
-               trigger : function(id, name) {\r
-                       var uploader = uploadInstances[id], i, args;\r
-\r
-                       if (uploader) {\r
-                               args = plupload.toArray(arguments).slice(1);\r
-                               args[0] = 'Silverlight:' + name;\r
-\r
-                               // Detach the call so that error handling in the browser is presented correctly\r
-                               setTimeout(function() {\r
-                                       uploader.trigger.apply(uploader, args);\r
-                               }, 0);\r
-                       }\r
-               }\r
-       };\r
-\r
-       /**\r
-        * Silverlight implementation. This runtime supports these features: jpgresize, pngresize, chunks.\r
-        *\r
-        * @static\r
-        * @class plupload.runtimes.Silverlight\r
-        * @extends plupload.Runtime\r
-        */\r
-       plupload.runtimes.Silverlight = plupload.addRuntime("silverlight", {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               getFeatures : function() {\r
-                       return {\r
-                               jpgresize: true,\r
-                               pngresize: true,\r
-                               chunks: true,\r
-                               progress: true,\r
-                               multipart: true\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Initializes the upload runtime. This runtime supports these features: jpgresize, pngresize, chunks.\r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               init : function(uploader, callback) {\r
-                       var silverlightContainer, filter = '', filters = uploader.settings.filters, i, container = document.body;\r
-\r
-                       // Check if Silverlight is installed, Silverlight windowless parameter doesn't work correctly on Opera so we disable it for now\r
-                       if (!isInstalled('2.0.31005.0') || (window.opera && window.opera.buildNumber)) {\r
-                               callback({success : false});\r
-                               return;\r
-                       }\r
-\r
-                       uploadInstances[uploader.id] = uploader;\r
-\r
-                       // Create silverlight container and insert it at an absolute position within the browse button\r
-                       silverlightContainer = document.createElement('div');\r
-                       silverlightContainer.id = uploader.id + '_silverlight_container';\r
-\r
-                       plupload.extend(silverlightContainer.style, {\r
-                               position : 'absolute',\r
-                               top : '0px',\r
-                               background : uploader.settings.shim_bgcolor || 'transparent',\r
-                               zIndex : 99999,\r
-                               width : '100px',\r
-                               height : '100px',\r
-                               overflow : 'hidden',\r
-                               opacity : uploader.settings.shim_bgcolor || document.documentMode > 8 ? '' : 0.01 // Force transparent if bgcolor is undefined\r
-                       });\r
-\r
-                       silverlightContainer.className = 'plupload silverlight';\r
-\r
-                       if (uploader.settings.container) {\r
-                               container = document.getElementById(uploader.settings.container);\r
-                               container.style.position = 'relative';\r
-                       }\r
-\r
-                       container.appendChild(silverlightContainer);\r
-\r
-                       for (i = 0; i < filters.length; i++) {\r
-                               filter += (filter != '' ? '|' : '') + filters[i].title + " | *." + filters[i].extensions.replace(/,/g, ';*.');\r
-                       }\r
-\r
-                       // Insert the Silverlight object inide the Silverlight container\r
-                       silverlightContainer.innerHTML = '<object id="' + uploader.id + '_silverlight" data="data:application/x-silverlight," type="application/x-silverlight-2" style="outline:none;" width="1024" height="1024">' +\r
-                               '<param name="source" value="' + uploader.settings.silverlight_xap_url + '"/>' +\r
-                               '<param name="background" value="Transparent"/>' +\r
-                               '<param name="windowless" value="true"/>' +\r
-                               '<param name="enablehtmlaccess" value="true"/>' +\r
-                               '<param name="initParams" value="id=' + uploader.id + ',filter=' + filter + '"/>' +\r
-                               '</object>';\r
-\r
-                       function getSilverlightObj() {\r
-                               return document.getElementById(uploader.id + '_silverlight').content.Upload;\r
-                       }\r
-\r
-                       uploader.bind("Silverlight:Init", function() {\r
-                               var selectedFiles, lookup = {};\r
-\r
-                               uploader.bind("Silverlight:StartSelectFiles", function(up) {\r
-                                       selectedFiles = [];\r
-                               });\r
-\r
-                               uploader.bind("Silverlight:SelectFile", function(up, sl_id, name, size) {\r
-                                       var id;\r
-\r
-                                       // Store away silverlight ids\r
-                                       id = plupload.guid();\r
-                                       lookup[id] = sl_id;\r
-                                       lookup[sl_id] = id;\r
-\r
-                                       // Expose id, name and size\r
-                                       selectedFiles.push(new plupload.File(id, name, size));\r
-                               });\r
-\r
-                               uploader.bind("Silverlight:SelectSuccessful", function() {\r
-                                       // Trigger FilesAdded event if we added any\r
-                                       if (selectedFiles.length) {\r
-                                               uploader.trigger("FilesAdded", selectedFiles);\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("Silverlight:UploadChunkError", function(up, file_id, chunk, chunks, message) {\r
-                                       uploader.trigger("Error", {\r
-                                               code : plupload.IO_ERROR,\r
-                                               message : 'IO Error.',\r
-                                               details : message,\r
-                                               file : up.getFile(lookup[file_id])\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("Silverlight:UploadFileProgress", function(up, sl_id, loaded, total) {\r
-                                       var file = up.getFile(lookup[sl_id]);\r
-\r
-                                       if (file.status != plupload.FAILED) {\r
-                                               file.size = total;\r
-                                               file.loaded = loaded;\r
-\r
-                                               up.trigger('UploadProgress', file);\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("Refresh", function(up) {\r
-                                       var browseButton, browsePos, browseSize;\r
-\r
-                                       browseButton = document.getElementById(up.settings.browse_button);\r
-                                       browsePos = plupload.getPos(browseButton, document.getElementById(up.settings.container));\r
-                                       browseSize = plupload.getSize(browseButton);\r
-\r
-                                       plupload.extend(document.getElementById(up.id + '_silverlight_container').style, {\r
-                                               top : browsePos.y + 'px',\r
-                                               left : browsePos.x + 'px',\r
-                                               width : browseSize.w + 'px',\r
-                                               height : browseSize.h + 'px'\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("Silverlight:UploadChunkSuccessful", function(up, sl_id, chunk, chunks, text) {\r
-                                       var chunkArgs, file = up.getFile(lookup[sl_id]);\r
-\r
-                                       chunkArgs = {\r
-                                               chunk : chunk,\r
-                                               chunks : chunks,\r
-                                               response : text\r
-                                       };\r
-\r
-                                       up.trigger('ChunkUploaded', file, chunkArgs);\r
-\r
-                                       // Stop upload if file is maked as failed\r
-                                       if (file.status != plupload.FAILED) {\r
-                                               getSilverlightObj().UploadNextChunk();\r
-                                       }\r
-\r
-                                       // Last chunk then dispatch FileUploaded event\r
-                                       if (chunk == chunks - 1) {\r
-                                               file.status = plupload.DONE;\r
-\r
-                                               up.trigger('FileUploaded', file, {\r
-                                                       response : text\r
-                                               });\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("Silverlight:UploadSuccessful", function(up, sl_id, response) {\r
-                                       var file = up.getFile(lookup[sl_id]);\r
-\r
-                                       file.status = plupload.DONE;\r
-\r
-                                       up.trigger('FileUploaded', file, {\r
-                                               response : response\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("FilesRemoved", function(up, files) {\r
-                                       var i;\r
-\r
-                                       for (i = 0; i < files.length; i++) {\r
-                                               getSilverlightObj().RemoveFile(lookup[files[i].id]);\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("UploadFile", function(up, file) {\r
-                                       var settings = up.settings, resize = settings.resize || {};\r
-\r
-                                       getSilverlightObj().UploadFile(\r
-                                               lookup[file.id],\r
-                                               up.settings.url,\r
-                                               jsonSerialize({\r
-                                                       name : file.target_name || file.name,\r
-                                                       mime : plupload.mimeTypes[file.name.replace(/^.+\.([^.]+)/, '$1')] || 'application/octet-stream',\r
-                                                       chunk_size : settings.chunk_size,\r
-                                                       image_width : resize.width,\r
-                                                       image_height : resize.height,\r
-                                                       image_quality : resize.quality || 90,\r
-                                                       multipart : !!settings.multipart,\r
-                                                       multipart_params : settings.multipart_params || {},\r
-                                                       headers : settings.headers\r
-                                               })\r
-                                       );\r
-                               });\r
-\r
-                               callback({success : true});\r
-                       });\r
-               }\r
-       });\r
-})(plupload);\r
-/**\r
- * plupload.flash.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global plupload:false, ActiveXObject:false, escape:false */\r
-\r
-(function(plupload) {\r
-       var uploadInstances = {};\r
-\r
-       function getFlashVersion() {\r
-               var version;\r
-\r
-               try {\r
-                       version = navigator.plugins['Shockwave Flash'];\r
-                       version = version.description;\r
-               } catch (e1) {\r
-                       try {\r
-                               version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version');\r
-                       } catch (e2) {\r
-                               version = '0.0';\r
-                       }\r
-               }\r
-\r
-               version = version.match(/\d+/g);\r
-\r
-               return parseFloat(version[0] + '.' + version[1]);\r
-       }\r
-\r
-       plupload.flash = {\r
-               /**\r
-                * Will be executed by the Flash runtime when it sends out events.\r
-                *\r
-                * @param {String} id If for the upload instance.\r
-                * @param {String} name Event name to trigger.\r
-                * @param {Object} obj Parameters to be passed with event.\r
-                */\r
-               trigger : function(id, name, obj) {\r
-                       // Detach the call so that error handling in the browser is presented correctly\r
-                       setTimeout(function() {\r
-                               var uploader = uploadInstances[id], i, args;\r
-\r
-                               if (uploader) {\r
-                                       uploader.trigger('Flash:' + name, obj);\r
-                               }\r
-                       }, 0);\r
-               }\r
-       };\r
-\r
-       /**\r
-        * FlashRuntime implementation. This runtime supports these features: jpgresize, pngresize, chunks.\r
-        *\r
-        * @static\r
-        * @class plupload.runtimes.Flash\r
-        * @extends plupload.Runtime\r
-        */\r
-       plupload.runtimes.Flash = plupload.addRuntime("flash", {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               getFeatures : function() {\r
-                       return {\r
-                               jpgresize: true,\r
-                               pngresize: true,\r
-                               chunks: true,\r
-                               progress: true,\r
-                               multipart: true\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Initializes the upload runtime. This method should add necessary items to the DOM and register events needed for operation. \r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               init : function(uploader, callback) {\r
-                       var browseButton, flashContainer, flashVars, initialized, waitCount = 0, container = document.body;\r
-\r
-                       if (getFlashVersion() < 10) {\r
-                               callback({success : false});\r
-                               return;\r
-                       }\r
-\r
-                       uploadInstances[uploader.id] = uploader;\r
-\r
-                       // Find browse button and set to to be relative\r
-                       browseButton = document.getElementById(uploader.settings.browse_button);\r
-\r
-                       // Create flash container and insert it at an absolute position within the browse button\r
-                       flashContainer = document.createElement('div');\r
-                       flashContainer.id = uploader.id + '_flash_container';\r
-\r
-                       plupload.extend(flashContainer.style, {\r
-                               position : 'absolute',\r
-                               top : '0px',\r
-                               background : uploader.settings.shim_bgcolor || 'transparent',\r
-                               zIndex : 99999,\r
-                               width : '100%',\r
-                               height : '100%'\r
-                       });\r
-\r
-                       flashContainer.className = 'plupload flash';\r
-\r
-                       if (uploader.settings.container) {\r
-                               container = document.getElementById(uploader.settings.container);\r
-                               container.style.position = 'relative';\r
-                       }\r
-\r
-                       container.appendChild(flashContainer);\r
-\r
-                       flashVars = 'id=' + escape(uploader.id);\r
-\r
-                       // Insert the Flash inide the flash container\r
-                       flashContainer.innerHTML = '<object id="' + uploader.id + '_flash" width="100%" height="100%" style="outline:0" type="application/x-shockwave-flash" data="' + uploader.settings.flash_swf_url + '">' +\r
-                               '<param name="movie" value="' + uploader.settings.flash_swf_url + '" />' +\r
-                               '<param name="flashvars" value="' + flashVars + '" />' +\r
-                               '<param name="wmode" value="transparent" />' +\r
-                               '<param name="allowscriptaccess" value="always" /></object>';\r
-\r
-                       function getFlashObj() {\r
-                               return document.getElementById(uploader.id + '_flash');\r
-                       }\r
-\r
-                       function waitLoad() {\r
-                               // Wait for 5 sec\r
-                               if (waitCount++ > 5000) {\r
-                                       callback({success : false});\r
-                                       return;\r
-                               }\r
-\r
-                               if (!initialized) {\r
-                                       setTimeout(waitLoad, 1);\r
-                               }\r
-                       }\r
-\r
-                       waitLoad();\r
-\r
-                       // Fix IE memory leaks\r
-                       browseButton = flashContainer = null;\r
-\r
-                       // Wait for Flash to send init event\r
-                       uploader.bind("Flash:Init", function() {\r
-                               var lookup = {}, i, resize = uploader.settings.resize || {};\r
-\r
-                               initialized = true;\r
-                               getFlashObj().setFileFilters(uploader.settings.filters, uploader.settings.multi_selection);\r
-\r
-                               uploader.bind("UploadFile", function(up, file) {\r
-                                       var settings = up.settings;\r
-\r
-                                       getFlashObj().uploadFile(lookup[file.id], settings.url, {\r
-                                               name : file.target_name || file.name,\r
-                                               mime : plupload.mimeTypes[file.name.replace(/^.+\.([^.]+)/, '$1')] || 'application/octet-stream',\r
-                                               chunk_size : settings.chunk_size,\r
-                                               width : resize.width,\r
-                                               height : resize.height,\r
-                                               quality : resize.quality || 90,\r
-                                               multipart : settings.multipart,\r
-                                               multipart_params : settings.multipart_params || {},\r
-                                               file_data_name : settings.file_data_name,\r
-                                               format : /\.(jpg|jpeg)$/i.test(file.name) ? 'jpg' : 'png',\r
-                                               headers : settings.headers,\r
-                                               urlstream_upload : settings.urlstream_upload\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("Flash:UploadProcess", function(up, flash_file) {\r
-                                       var file = up.getFile(lookup[flash_file.id]);\r
-\r
-                                       if (file.status != plupload.FAILED) {\r
-                                               file.loaded = flash_file.loaded;\r
-                                               file.size = flash_file.size;\r
-\r
-                                               up.trigger('UploadProgress', file);\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("Flash:UploadChunkComplete", function(up, info) {\r
-                                       var chunkArgs, file = up.getFile(lookup[info.id]);\r
-\r
-                                       chunkArgs = {\r
-                                               chunk : info.chunk,\r
-                                               chunks : info.chunks,\r
-                                               response : info.text\r
-                                       };\r
-\r
-                                       up.trigger('ChunkUploaded', file, chunkArgs);\r
-\r
-                                       // Stop upload if file is maked as failed\r
-                                       if (file.status != plupload.FAILED) {\r
-                                               getFlashObj().uploadNextChunk();\r
-                                       }\r
-\r
-                                       // Last chunk then dispatch FileUploaded event\r
-                                       if (info.chunk == info.chunks - 1) {\r
-                                               file.status = plupload.DONE;\r
-\r
-                                               up.trigger('FileUploaded', file, {\r
-                                                       response : info.text\r
-                                               });\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("Flash:SelectFiles", function(up, selected_files) {\r
-                                       var file, i, files = [], id;\r
-\r
-                                       // Add the selected files to the file queue\r
-                                       for (i = 0; i < selected_files.length; i++) {\r
-                                               file = selected_files[i];\r
-\r
-                                               // Store away flash ref internally\r
-                                               id = plupload.guid();\r
-                                               lookup[id] = file.id;\r
-                                               lookup[file.id] = id;\r
-\r
-                                               files.push(new plupload.File(id, file.name, file.size));\r
-                                       }\r
-\r
-                                       // Trigger FilesAdded event if we added any\r
-                                       if (files.length) {\r
-                                               uploader.trigger("FilesAdded", files);\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("Flash:SecurityError", function(up, err) {\r
-                                       uploader.trigger('Error', {\r
-                                               code : plupload.SECURITY_ERROR,\r
-                                               message : 'Security error.',\r
-                                               details : err.message,\r
-                                               file : uploader.getFile(lookup[err.id])\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("Flash:GenericError", function(up, err) {\r
-                                       uploader.trigger('Error', {\r
-                                               code : plupload.GENERIC_ERROR,\r
-                                               message : 'Generic error.',\r
-                                               details : err.message,\r
-                                               file : uploader.getFile(lookup[err.id])\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("Flash:IOError", function(up, err) {\r
-                                       uploader.trigger('Error', {\r
-                                               code : plupload.IO_ERROR,\r
-                                               message : 'IO error.',\r
-                                               details : err.message,\r
-                                               file : uploader.getFile(lookup[err.id])\r
-                                       });\r
-                               });\r
-\r
-                               uploader.bind("QueueChanged", function(up) {\r
-                                       uploader.refresh();\r
-                               });\r
-\r
-                               uploader.bind("FilesRemoved", function(up, files) {\r
-                                       var i;\r
-\r
-                                       for (i = 0; i < files.length; i++) {\r
-                                               getFlashObj().removeFile(lookup[files[i].id]);\r
-                                       }\r
-                               });\r
-\r
-                               uploader.bind("StateChanged", function(up) {\r
-                                       uploader.refresh();\r
-                               });\r
-\r
-                               uploader.bind("Refresh", function(up) {\r
-                                       var browseButton, browsePos, browseSize;\r
-\r
-                                       // Set file filters incase it has been changed dynamically\r
-                                       getFlashObj().setFileFilters(uploader.settings.filters, uploader.settings.multi_selection);\r
-\r
-                                       browseButton = document.getElementById(up.settings.browse_button);\r
-                                       browsePos = plupload.getPos(browseButton, document.getElementById(up.settings.container));\r
-                                       browseSize = plupload.getSize(browseButton);\r
-\r
-                                       plupload.extend(document.getElementById(up.id + '_flash_container').style, {\r
-                                               top : browsePos.y + 'px',\r
-                                               left : browsePos.x + 'px',\r
-                                               width : browseSize.w + 'px',\r
-                                               height : browseSize.h + 'px'\r
-                                       });\r
-                               });\r
-\r
-                               callback({success : true});\r
-                       });\r
-               }\r
-       });\r
-})(plupload);\r
-/**\r
- * plupload.browserplus.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global plupload:false, BrowserPlus:false, window:false */\r
-\r
-(function(plupload) {\r
-       /**\r
-        * Yahoo BrowserPlus implementation. This runtime supports these features: dragdrop, jpgresize, pngresize.\r
-        *\r
-        * @static\r
-        * @class plupload.runtimes.BrowserPlus\r
-        * @extends plupload.Runtime\r
-        */\r
-       plupload.runtimes.BrowserPlus = plupload.addRuntime("browserplus", {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               getFeatures : function() {\r
-                       return {\r
-                               dragdrop : true,\r
-                               jpgresize : true,\r
-                               pngresize : true,\r
-                               chunks : true,\r
-                               progress: true,\r
-                               multipart: true\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Initializes the browserplus runtime.\r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               init : function(uploader, callback) {\r
-                       var browserPlus = window.BrowserPlus, browserPlusFiles = {}, settings = uploader.settings, resize = settings.resize;\r
-\r
-                       function addSelectedFiles(native_files) {\r
-                               var files, i, selectedFiles = [], file, id;\r
-\r
-                               // Add the native files and setup plupload files\r
-                               for (i = 0; i < native_files.length; i++) {\r
-                                       file = native_files[i];\r
-                                       id = plupload.guid();\r
-                                       browserPlusFiles[id] = file;\r
-\r
-                                       selectedFiles.push(new plupload.File(id, file.name, file.size));\r
-                               }\r
-\r
-                               // Any files selected fire event\r
-                               if (i) {\r
-                                       uploader.trigger("FilesAdded", selectedFiles);\r
-                               }\r
-                       }\r
-\r
-                       // Setup event listeners if browserplus was initialized\r
-                       function setup() {\r
-                               // Add drop handler\r
-                               uploader.bind("PostInit", function() {\r
-                                       var dropTargetElm, dropElmId = settings.drop_element,\r
-                                               dropTargetId = uploader.id + '_droptarget',\r
-                                               dropElm = document.getElementById(dropElmId),\r
-                                               lastState;\r
-\r
-                                       // Enable/disable drop support for the drop target\r
-                                       // this is needed to resolve IE bubbeling issues and make it possible to drag/drop\r
-                                       // files into gears runtimes on the same page\r
-                                       function addDropHandler(id, end_callback) {\r
-                                               // Add drop target and listener\r
-                                               browserPlus.DragAndDrop.AddDropTarget({id : id}, function(res) {\r
-                                                       browserPlus.DragAndDrop.AttachCallbacks({\r
-                                                               id : id,\r
-                                                               hover : function(res) {\r
-                                                                       if (!res && end_callback) {\r
-                                                                               end_callback();\r
-                                                                       }\r
-                                                               },\r
-                                                               drop : function(res) {\r
-                                                                       if (end_callback) {\r
-                                                                               end_callback();\r
-                                                                       }\r
-\r
-                                                                       addSelectedFiles(res);\r
-                                                               }\r
-                                                       }, function() {\r
-                                                       });\r
-                                               });\r
-                                       }\r
-\r
-                                       function hide() {\r
-                                               document.getElementById(dropTargetId).style.top = '-1000px';\r
-                                       }\r
-\r
-                                       if (dropElm) {\r
-                                               // Since IE has issues with bubbeling when it comes to the drop of files\r
-                                               // we need to do this hack where we show a drop target div element while dropping\r
-                                               if (document.attachEvent && (/MSIE/gi).test(navigator.userAgent)) {\r
-                                                       // Create drop target\r
-                                                       dropTargetElm = document.createElement('div');\r
-                                                       dropTargetElm.setAttribute('id', dropTargetId);\r
-                                                       plupload.extend(dropTargetElm.style, {\r
-                                                               position : 'absolute',\r
-                                                               top : '-1000px',\r
-                                                               background : 'red',\r
-                                                               filter : 'alpha(opacity=0)',\r
-                                                               opacity : 0\r
-                                                       });\r
-\r
-                                                       document.body.appendChild(dropTargetElm);\r
-\r
-                                                       plupload.addEvent(dropElm, 'dragenter', function(e) {\r
-                                                               var dropElm, dropElmPos;\r
-\r
-                                                               dropElm = document.getElementById(dropElmId);\r
-                                                               dropElmPos = plupload.getPos(dropElm);\r
-\r
-                                                               plupload.extend(document.getElementById(dropTargetId).style, {\r
-                                                                       top : dropElmPos.y + 'px',\r
-                                                                       left : dropElmPos.x + 'px',\r
-                                                                       width : dropElm.offsetWidth + 'px',\r
-                                                                       height : dropElm.offsetHeight + 'px'\r
-                                                               });\r
-                                                       });\r
-\r
-                                                       addDropHandler(dropTargetId, hide);\r
-                                               } else {\r
-                                                       addDropHandler(dropElmId);\r
-                                               }\r
-                                       }\r
-\r
-                                       plupload.addEvent(document.getElementById(settings.browse_button), 'click', function(e) {\r
-                                               var mimeTypes = [], i, a, filters = settings.filters, ext;\r
-\r
-                                               e.preventDefault();\r
-\r
-                                               // Convert extensions to mimetypes\r
-                                               for (i = 0; i < filters.length; i++) {\r
-                                                       ext = filters[i].extensions.split(',');\r
-\r
-                                                       for (a = 0; a < ext.length; a++) {\r
-                                                               mimeTypes.push(plupload.mimeTypes[ext[a]]);\r
-                                                       }\r
-                                               }\r
-\r
-                                               browserPlus.FileBrowse.OpenBrowseDialog({\r
-                                                       mimeTypes : mimeTypes\r
-                                               }, function(res) {\r
-                                                       if (res.success) {\r
-                                                               addSelectedFiles(res.value);\r
-                                                       }\r
-                                               });\r
-                                       });\r
-\r
-                                       // Prevent IE leaks\r
-                                       dropElm = dropTargetElm = null;\r
-                               });\r
-\r
-                               uploader.bind("UploadFile", function(up, file) {\r
-                                       var nativeFile = browserPlusFiles[file.id], reqParams = {},\r
-                                           chunkSize = up.settings.chunk_size, loadProgress, chunkStack = [];\r
-\r
-                                       function uploadFile(chunk, chunks) {\r
-                                               var chunkFile;\r
-\r
-                                               // Stop upload if file is maked as failed\r
-                                               if (file.status == plupload.FAILED) {\r
-                                                       return;\r
-                                               }\r
-\r
-                                               reqParams.name = file.target_name || file.name;\r
-\r
-                                               // Only send chunk parameters if chunk size is defined\r
-                                               if (chunkSize) {\r
-                                                       reqParams.chunk = "" + chunk;\r
-                                                       reqParams.chunks = "" + chunks;\r
-                                               }\r
-\r
-                                           chunkFile = chunkStack.shift();\r
-\r
-                                               browserPlus.Uploader.upload({\r
-                                                       url : up.settings.url,\r
-                                                       files : {file : chunkFile},\r
-                                                       cookies : document.cookies,\r
-                                                       postvars : plupload.extend(reqParams, up.settings.multipart_params),\r
-                                                       progressCallback : function(res) {\r
-                                                               var i, loaded = 0;\r
-\r
-                                                               // since more than 1 chunk can be sent at a time, keep track of how many bytes\r
-                                                               // of each chunk was sent\r
-                                                               loadProgress[chunk] = parseInt(res.filePercent * chunkFile.size / 100, 10);\r
-                                                               for (i = 0; i < loadProgress.length; i++) {\r
-                                                                       loaded += loadProgress[i];\r
-                                                               }\r
-\r
-                                                               file.loaded = loaded;\r
-                                                               up.trigger('UploadProgress', file);\r
-                                                       }\r
-                                               }, function(res) {\r
-                                                       var httpStatus, chunkArgs;\r
-\r
-                                                       if (res.success) {\r
-                                                               httpStatus = res.value.statusCode;\r
-\r
-                                                               if (chunkSize) {\r
-                                                                       up.trigger('ChunkUploaded', file, {\r
-                                                                               chunk : chunk,\r
-                                                                               chunks : chunks,\r
-                                                                               response : res.value.body,\r
-                                                                               status : httpStatus\r
-                                                                       });\r
-                                                               }\r
-\r
-                                                           if (chunkStack.length > 0) {\r
-                                                                       // More chunks to be uploaded\r
-                                                                       uploadFile(++chunk, chunks);\r
-                                                           } else {\r
-                                                                       file.status = plupload.DONE;\r
-\r
-                                                                       up.trigger('FileUploaded', file, {\r
-                                                                               response : res.value.body,\r
-                                                                               status : httpStatus\r
-                                                                       });\r
-\r
-                                                                       // Is error status\r
-                                                                       if (httpStatus >= 400) {\r
-                                                                               up.trigger('Error', {\r
-                                                                                       code : plupload.HTTP_ERROR,\r
-                                                                                       message : 'HTTP Error.',\r
-                                                                                       file : file,\r
-                                                                                       status : httpStatus\r
-                                                                               });\r
-                                                                       }\r
-                                                           }\r
-                                                       } else {\r
-                                                               up.trigger('Error', {\r
-                                                                       code : plupload.GENERIC_ERROR,\r
-                                                                       message : 'Generic Error.',\r
-                                                                       file : file,\r
-                                                                       details : res.error\r
-                                                               });\r
-                                                       }\r
-                                               });\r
-                                       }\r
-\r
-                                       function chunkAndUploadFile(native_file) {\r
-                                               file.size = native_file.size;\r
-                                               if (chunkSize) {\r
-                                                       browserPlus.FileAccess.chunk({file : native_file, chunkSize : chunkSize}, function(cr) {\r
-                                                               if (cr.success) {\r
-                                                                       var chunks = cr.value, len = chunks.length;\r
-\r
-                                                                       loadProgress = Array(len);\r
-\r
-                                                                       for (var i = 0; i < len; i++) {\r
-                                                                               loadProgress[i] = 0;\r
-                                                                               chunkStack.push(chunks[i]);\r
-                                                                       }\r
-\r
-                                                                       uploadFile(0, len);\r
-                                                               }\r
-                                                       });\r
-                                               } else {\r
-                                                       loadProgress = Array(1);\r
-                                                       chunkStack.push(native_file);\r
-                                                       uploadFile(0, 1);\r
-                                               }\r
-                                       }\r
-\r
-                                       // Resize image if it's a supported format and resize is enabled\r
-                                       if (resize && /\.(png|jpg|jpeg)$/i.test(file.name)) {\r
-                                               BrowserPlus.ImageAlter.transform({\r
-                                                       file : nativeFile,\r
-                                                       quality : resize.quality || 90,\r
-                                                       actions : [{\r
-                                                               scale : {\r
-                                                                       maxwidth : resize.width,\r
-                                                                       maxheight : resize.height\r
-                                                               }\r
-                                                       }]\r
-                                               }, function(res) {\r
-                                                       if (res.success) {\r
-                                                               chunkAndUploadFile(res.value.file);\r
-                                                       }\r
-                                               });\r
-                                       } else {\r
-                                               chunkAndUploadFile(nativeFile);\r
-                                       }\r
-                               });\r
-\r
-                               callback({success : true});\r
-                       }\r
-\r
-                       // Check for browserplus object\r
-                       if (browserPlus) {\r
-                               browserPlus.init(function(res) {\r
-                                       var services = [\r
-                                               {service: "Uploader", version: "3"},\r
-                                               {service: "DragAndDrop", version: "1"},\r
-                                               {service: "FileBrowse", version: "1"},\r
-                                               {service: "FileAccess", version: "2"}\r
-                                       ];\r
-\r
-                                       if (resize) {\r
-                                               services.push({service : 'ImageAlter', version : "4"});\r
-                                       }\r
-\r
-                                       if (res.success) {\r
-                                               browserPlus.require({\r
-                                                       services : services\r
-                                               }, function(sres) {\r
-                                                       if (sres.success) {\r
-                                                               setup();\r
-                                                       } else {\r
-                                                               callback();\r
-                                                       }\r
-                                               });\r
-                                       } else {\r
-                                               callback();\r
-                                       }\r
-                               });\r
-                       } else {\r
-                               callback();\r
-                       }\r
-               }\r
-       });\r
-})(plupload);\r
-/**\r
- * plupload.html5.js\r
- *\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global plupload:false, File:false, window:false, atob:false, FormData:false, FileReader:false */\r
-\r
-(function(plupload) {\r
-       var fakeSafariDragDrop;\r
-\r
-       function readFile(file, callback) {\r
-               var reader;\r
-\r
-               // Use FileReader if it's available\r
-               if ("FileReader" in window) {\r
-                       reader = new FileReader();\r
-                       reader.readAsDataURL(file);\r
-                       reader.onload = function() {\r
-                               callback(reader.result);\r
-                       };\r
-               } else {\r
-                       return callback(file.getAsDataURL());\r
-               }\r
-       }\r
-\r
-       function scaleImage(image_file, max_width, max_height, mime, callback) {\r
-               var canvas, context, img, data, scale;\r
-\r
-               readFile(image_file, function(data) {\r
-                       // Setup canvas and context\r
-                       canvas = document.createElement("canvas");\r
-                       canvas.style.display = 'none';\r
-                       document.body.appendChild(canvas);\r
-                       context = canvas.getContext('2d');\r
-\r
-                       // Load image\r
-                       img = new Image();\r
-                       img.onload = function() {\r
-                               var width, height, percentage;\r
-\r
-                               scale = Math.min(max_width / img.width, max_height / img.height);\r
-\r
-                               if (scale < 1) {\r
-                                       width = Math.round(img.width * scale);\r
-                                       height = Math.round(img.height * scale);\r
-                               } else {\r
-                                       width = img.width;\r
-                                       height = img.height;\r
-                               }\r
-\r
-                               // Scale image and canvas\r
-                               canvas.width = width;\r
-                               canvas.height = height;\r
-                               context.drawImage(img, 0, 0, width, height);\r
-\r
-                               // Remove data prefix information and grab the base64 encoded data and decode it\r
-                               data = canvas.toDataURL(mime);\r
-                               data = data.substring(data.indexOf('base64,') + 7);\r
-                               data = atob(data);\r
-\r
-                               // Remove canvas and execute callback with decoded image data\r
-                               canvas.parentNode.removeChild(canvas);\r
-                               callback({success : true, data : data});\r
-                       };\r
-\r
-                       img.src = data;\r
-               });\r
-       }\r
-\r
-       /**\r
-        * HMTL5 implementation. This runtime supports these features: dragdrop, jpgresize, pngresize.\r
-        *\r
-        * @static\r
-        * @class plupload.runtimes.Html5\r
-        * @extends plupload.Runtime\r
-        */\r
-       plupload.runtimes.Html5 = plupload.addRuntime("html5", {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               getFeatures : function() {\r
-                       var xhr, hasXhrSupport, hasProgress, dataAccessSupport, sliceSupport, win = window;\r
-\r
-                       hasXhrSupport = hasProgress = dataAccessSupport = sliceSupport = false;\r
-\r
-                       if (win.XMLHttpRequest) {\r
-                               xhr = new XMLHttpRequest();\r
-                               hasProgress = !!xhr.upload;\r
-                               hasXhrSupport = !!(xhr.sendAsBinary || xhr.upload);\r
-                       }\r
-\r
-                       // Check for support for various features\r
-                       if (hasXhrSupport) {\r
-                               // Set dataAccessSupport only for Gecko since BlobBuilder and XHR doesn't handle binary data correctly\r
-                               dataAccessSupport = !!(File && (File.prototype.getAsDataURL || win.FileReader) && xhr.sendAsBinary);\r
-                               sliceSupport = !!(File && File.prototype.slice);\r
-                       }\r
-\r
-                       // Sniff for Safari and fake drag/drop\r
-                       fakeSafariDragDrop = navigator.userAgent.indexOf('Safari') > 0;\r
-\r
-                       return {\r
-                               // Detect drag/drop file support by sniffing, will try to find a better way\r
-                               html5: hasXhrSupport, // This is a special one that we check inside the init call\r
-                               dragdrop: win.mozInnerScreenX !== undefined || sliceSupport || fakeSafariDragDrop,\r
-                               jpgresize: dataAccessSupport,\r
-                               pngresize: dataAccessSupport,\r
-                               multipart: dataAccessSupport || !!win.FileReader || !!win.FormData,\r
-                               progress: hasProgress,\r
-                               chunking: sliceSupport || dataAccessSupport\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Initializes the upload runtime.\r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               init : function(uploader, callback) {\r
-                       var html5files = {}, features;\r
-\r
-                       function addSelectedFiles(native_files) {\r
-                               var file, i, files = [], id;\r
-\r
-                               // Add the selected files to the file queue\r
-                               for (i = 0; i < native_files.length; i++) {\r
-                                       file = native_files[i];\r
-\r
-                                       // Store away gears blob internally\r
-                                       id = plupload.guid();\r
-                                       html5files[id] = file;\r
-\r
-                                       // Expose id, name and size\r
-                                       files.push(new plupload.File(id, file.fileName, file.fileSize));\r
-                               }\r
-\r
-                               // Trigger FilesAdded event if we added any\r
-                               if (files.length) {\r
-                                       uploader.trigger("FilesAdded", files);\r
-                               }\r
-                       }\r
-\r
-                       // No HTML5 upload support\r
-                       features = this.getFeatures();\r
-                       if (!features.html5) {\r
-                               callback({success : false});\r
-                               return;\r
-                       }\r
-\r
-                       uploader.bind("Init", function(up) {\r
-                               var inputContainer, mimes = [], i, y, filters = up.settings.filters, ext, type, container = document.body;\r
-\r
-                               // Create input container and insert it at an absolute position within the browse button\r
-                               inputContainer = document.createElement('div');\r
-                               inputContainer.id = up.id + '_html5_container';\r
-\r
-                               // Convert extensions to mime types list\r
-                               for (i = 0; i < filters.length; i++) {\r
-                                       ext = filters[i].extensions.split(/,/);\r
-\r
-                                       for (y = 0; y < ext.length; y++) {\r
-                                               type = plupload.mimeTypes[ext[y]];\r
-\r
-                                               if (type) {\r
-                                                       mimes.push(type);\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               plupload.extend(inputContainer.style, {\r
-                                       position : 'absolute',\r
-                                       background : uploader.settings.shim_bgcolor || 'transparent',\r
-                                       width : '100px',\r
-                                       height : '100px',\r
-                                       overflow : 'hidden',\r
-                                       zIndex : 99999,\r
-                                       opacity : uploader.settings.shim_bgcolor ? '' : 0 // Force transparent if bgcolor is undefined\r
-                               });\r
-\r
-                               inputContainer.className = 'plupload html5';\r
-\r
-                               if (uploader.settings.container) {\r
-                                       container = document.getElementById(uploader.settings.container);\r
-                                       container.style.position = 'relative';\r
-                               }\r
-\r
-                               container.appendChild(inputContainer);\r
-\r
-                               // Insert the input inide the input container\r
-                               inputContainer.innerHTML = '<input id="' + uploader.id + '_html5" ' +\r
-                                                                                       'style="width:100%;" type="file" accept="' + mimes.join(',') + '" ' +\r
-                                                                                       (uploader.settings.multi_selection ? 'multiple="multiple"' : '') + ' />';\r
-\r
-                               document.getElementById(uploader.id + '_html5').onchange = function() {\r
-                                       // Add the selected files from file input\r
-                                       addSelectedFiles(this.files);\r
-\r
-                                       // Clearing the value enables the user to select the same file again if they want to\r
-                                       this.value = '';\r
-                               };\r
-                       });\r
-\r
-                       // Add drop handler\r
-                       uploader.bind("PostInit", function() {\r
-                               var dropElm = document.getElementById(uploader.settings.drop_element);\r
-\r
-                               if (dropElm) {\r
-                                       // Lets fake drag/drop on Safari by moving a inpit type file in front of the mouse pointer when we drag into the drop zone\r
-                                       // TODO: Remove this logic once Safari has official drag/drop support\r
-                                       if (fakeSafariDragDrop) {\r
-                                               plupload.addEvent(dropElm, 'dragenter', function(e) {\r
-                                                       var dropInputElm, dropPos, dropSize;\r
-\r
-                                                       // Get or create drop zone\r
-                                                       dropInputElm = document.getElementById(uploader.id + "_drop");\r
-                                                       if (!dropInputElm) {\r
-                                                               dropInputElm = document.createElement("input");\r
-                                                               dropInputElm.setAttribute('type', "file");\r
-                                                               dropInputElm.setAttribute('id', uploader.id + "_drop");\r
-                                                               dropInputElm.setAttribute('multiple', 'multiple');\r
-\r
-                                                               dropInputElm.onchange = function() {\r
-                                                                       // Add the selected files from file input\r
-                                                                       addSelectedFiles(this.files);\r
-\r
-                                                                       // Clearing the value enables the user to select the same file again if they want to\r
-                                                                       this.value = '';\r
-                                                               };\r
-                                                       }\r
-\r
-                                                       dropPos = plupload.getPos(dropElm, document.getElementById(uploader.settings.container));\r
-                                                       dropSize = plupload.getSize(dropElm);\r
-\r
-                                                       plupload.extend(dropInputElm.style, {\r
-                                                               position : 'absolute',\r
-                                                               display : 'block',\r
-                                                               top : dropPos.y + 'px',\r
-                                                               left : dropPos.x + 'px',\r
-                                                               width : dropSize.w + 'px',\r
-                                                               height : dropSize.h + 'px',\r
-                                                               opacity : 0\r
-                                                       });\r
-\r
-                                                       dropElm.appendChild(dropInputElm);\r
-                                               });\r
-\r
-                                               return;\r
-                                       }\r
-\r
-                                       // Block browser default drag over\r
-                                       plupload.addEvent(dropElm, 'dragover', function(e) {\r
-                                               e.preventDefault();\r
-                                       });\r
-\r
-                                       // Attach drop handler and grab files\r
-                                       plupload.addEvent(dropElm, 'drop', function(e) {\r
-                                               var dataTransfer = e.dataTransfer;\r
-\r
-                                               // Add dropped files\r
-                                               if (dataTransfer && dataTransfer.files) {\r
-                                                       addSelectedFiles(dataTransfer.files);\r
-                                               }\r
-\r
-                                               e.preventDefault();\r
-                                       });\r
-                               }\r
-                       });\r
-\r
-                       uploader.bind("Refresh", function(up) {\r
-                               var browseButton, browsePos, browseSize;\r
-\r
-                               browseButton = document.getElementById(uploader.settings.browse_button);\r
-                               browsePos = plupload.getPos(browseButton, document.getElementById(up.settings.container));\r
-                               browseSize = plupload.getSize(browseButton);\r
-\r
-                               plupload.extend(document.getElementById(uploader.id + '_html5_container').style, {\r
-                                       top : browsePos.y + 'px',\r
-                                       left : browsePos.x + 'px',\r
-                                       width : browseSize.w + 'px',\r
-                                       height : browseSize.h + 'px'\r
-                               });\r
-                       });\r
-\r
-                       uploader.bind("UploadFile", function(up, file) {\r
-                               var settings = up.settings, nativeFile, resize;\r
-\r
-                               function sendBinaryBlob(blob) {\r
-                                       var chunk = 0, loaded = 0;\r
-\r
-                                       function uploadNextChunk() {\r
-                                               var chunkBlob = blob, xhr, upload, chunks, args, multipartDeltaSize = 0,\r
-                                                       boundary = '----pluploadboundary' + plupload.guid(), chunkSize, curChunkSize,\r
-                                                       dashdash = '--', crlf = '\r\n', multipartBlob = '', mimeType, url = up.settings.url;\r
-\r
-                                               // File upload finished\r
-                                               if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) {\r
-                                                       return;\r
-                                               }\r
-\r
-                                               // Standard arguments\r
-                                               args = {name : file.target_name || file.name};\r
-\r
-                                               // Only add chunking args if needed\r
-                                               if (settings.chunk_size && features.chunking) {\r
-                                                       chunkSize = settings.chunk_size;\r
-                                                       chunks = Math.ceil(file.size / chunkSize);\r
-                                                       curChunkSize = Math.min(chunkSize, file.size - (chunk  * chunkSize));\r
-\r
-                                                       // Blob is string so we need to fake chunking, this is not\r
-                                                       // ideal since the whole file is loaded into memory\r
-                                                       if (typeof(blob) == 'string') {\r
-                                                               chunkBlob = blob.substring(chunk * chunkSize, chunk * chunkSize + curChunkSize);\r
-                                                       } else {\r
-                                                               // Slice the chunk\r
-                                                               chunkBlob = blob.slice(chunk * chunkSize, curChunkSize);\r
-                                                       }\r
-\r
-                                                       // Setup query string arguments\r
-                                                       args.chunk = chunk;\r
-                                                       args.chunks = chunks;\r
-                                               } else {\r
-                                                       curChunkSize = file.size;\r
-                                               }\r
-\r
-                                               // Setup XHR object\r
-                                               xhr = new XMLHttpRequest();\r
-                                               upload = xhr.upload;\r
-\r
-                                               // Do we have upload progress support\r
-                                               if (upload) {\r
-                                                       upload.onprogress = function(e) {\r
-                                                               file.loaded = Math.min(file.size, loaded + e.loaded - multipartDeltaSize); // Loaded can be larger than file size due to multipart encoding\r
-                                                               up.trigger('UploadProgress', file);\r
-                                                       };\r
-                                               }\r
-\r
-                                               // Add name, chunk and chunks to query string on direct streaming\r
-                                               if (!up.settings.multipart || !features.multipart) {\r
-                                                       url = plupload.buildUrl(up.settings.url, args);\r
-                                               } else {\r
-                                                       args.name = file.target_name || file.name;\r
-                                               }\r
-\r
-                                               xhr.open("post", url, true);\r
-\r
-                                               xhr.onreadystatechange = function() {\r
-                                                       var httpStatus, chunkArgs;\r
-\r
-                                                       if (xhr.readyState == 4) {\r
-                                                               // Getting the HTTP status might fail on some Gecko versions\r
-                                                               try {\r
-                                                                       httpStatus = xhr.status;\r
-                                                               } catch (ex) {\r
-                                                                       httpStatus = 0;\r
-                                                               }\r
-\r
-                                                               // Is error status\r
-                                                               if (httpStatus >= 400) {\r
-                                                                       up.trigger('Error', {\r
-                                                                               code : plupload.HTTP_ERROR,\r
-                                                                               message : 'HTTP Error.',\r
-                                                                               file : file,\r
-                                                                               status : httpStatus\r
-                                                                       });\r
-                                                               } else {\r
-                                                                       // Handle chunk response\r
-                                                                       if (chunks) {\r
-                                                                               chunkArgs = {\r
-                                                                                       chunk : chunk,\r
-                                                                                       chunks : chunks,\r
-                                                                                       response : xhr.responseText,\r
-                                                                                       status : httpStatus\r
-                                                                               };\r
-\r
-                                                                               up.trigger('ChunkUploaded', file, chunkArgs);\r
-                                                                               loaded += curChunkSize;\r
-\r
-                                                                               // Stop upload\r
-                                                                               if (chunkArgs.cancelled) {\r
-                                                                                       file.status = plupload.FAILED;\r
-                                                                                       return;\r
-                                                                               }\r
-\r
-                                                                               file.loaded = Math.min(file.size, (chunk + 1) * chunkSize);\r
-                                                                       } else {\r
-                                                                               file.loaded = file.size;\r
-                                                                       }\r
-\r
-                                                                       up.trigger('UploadProgress', file);\r
-\r
-                                                                       // Check if file is uploaded\r
-                                                                       if (!chunks || ++chunk >= chunks) {\r
-                                                                               file.status = plupload.DONE;\r
-                                                                               up.trigger('FileUploaded', file, {\r
-                                                                                       response : xhr.responseText,\r
-                                                                                       status : httpStatus\r
-                                                                               });\r
-                                                                       } else {\r
-                                                                               // Still chunks left\r
-                                                                               uploadNextChunk();\r
-                                                                       }\r
-                                                               }\r
-                                                       }\r
-                                               };\r
-\r
-                                               // Set custom headers\r
-                                               plupload.each(up.settings.headers, function(value, name) {\r
-                                                       xhr.setRequestHeader(name, value);\r
-                                               });\r
-\r
-                                               // Build multipart request\r
-                                               if (up.settings.multipart && features.multipart) {\r
-                                                       // Has FormData support like Chrome 6+, Safari 5+, Firefox 4\r
-                                                       if (!xhr.sendAsBinary) {\r
-                                                               var data = new FormData();\r
-\r
-                                                               // Add multipart params\r
-                                                               plupload.each(plupload.extend(args, up.settings.multipart_params), function(value, name) {\r
-                                                                       data.append(name, value);\r
-                                                               });\r
-\r
-                                                               // Add file and send it\r
-                                                               data.append(up.settings.file_data_name, chunkBlob);\r
-                                                               xhr.send(data);\r
-\r
-                                                               return;\r
-                                                       }\r
-\r
-                                                       // Gecko multipart request\r
-                                                       xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);\r
-\r
-                                                       // Append multipart parameters\r
-                                                       plupload.each(plupload.extend(args, up.settings.multipart_params), function(value, name) {\r
-                                                               multipartBlob += dashdash + boundary + crlf +\r
-                                                                       'Content-Disposition: form-data; name="' + name + '"' + crlf + crlf;\r
-\r
-                                                               multipartBlob += value + crlf;\r
-                                                       });\r
-\r
-                                                       mimeType = plupload.mimeTypes[file.name.replace(/^.+\.([^.]+)/, '$1')] || 'application/octet-stream';\r
-\r
-                                                       // Build RFC2388 blob\r
-                                                       multipartBlob += dashdash + boundary + crlf +\r
-                                                               'Content-Disposition: form-data; name="' + up.settings.file_data_name + '"; filename="' + file.name + '"' + crlf +\r
-                                                               'Content-Type: ' + mimeType + crlf + crlf +\r
-                                                               chunkBlob + crlf +\r
-                                                               dashdash + boundary + dashdash + crlf;\r
-\r
-                                                       multipartDeltaSize = multipartBlob.length - chunkBlob.length;\r
-                                                       chunkBlob = multipartBlob;\r
-                                               } else {\r
-                                                       // Binary stream header\r
-                                                       xhr.setRequestHeader('Content-Type', 'application/octet-stream');\r
-                                               }\r
-\r
-                                               if (xhr.sendAsBinary) {\r
-                                                       xhr.sendAsBinary(chunkBlob); // Gecko\r
-                                               } else {\r
-                                                       xhr.send(chunkBlob); // WebKit\r
-                                               }\r
-                                       }\r
-\r
-                                       // Start uploading chunks\r
-                                       uploadNextChunk();\r
-                               }\r
-\r
-                               nativeFile = html5files[file.id];\r
-                               resize = up.settings.resize;\r
-\r
-                               if (features.jpgresize) {\r
-                                       // Resize image if it's a supported format and resize is enabled\r
-                                       if (resize && /\.(png|jpg|jpeg)$/i.test(file.name)) {\r
-                                               scaleImage(nativeFile, resize.width, resize.height, /\.png$/i.test(file.name) ? 'image/png' : 'image/jpeg', function(res) {\r
-                                                       // If it was scaled send the scaled image if it failed then\r
-                                                       // send the raw image and let the server do the scaling\r
-                                                       if (res.success) {\r
-                                                               file.size = res.data.length;\r
-                                                               sendBinaryBlob(res.data);\r
-                                                       } else {\r
-                                                               sendBinaryBlob(nativeFile.getAsBinary());\r
-                                                       }\r
-                                               });\r
-                                       } else {\r
-                                               sendBinaryBlob(nativeFile.getAsBinary());\r
-                                       }\r
-                               } else {\r
-                                       sendBinaryBlob(nativeFile);\r
-                               }\r
-                       });\r
-\r
-                       callback({success : true});\r
-               }\r
-       });\r
-})(plupload);\r
-/**\r
- * plupload.html4.js\r
- *\r
- * Copyright 2010, Ryan Demmer\r
- * Copyright 2009, Moxiecode Systems AB\r
- * Released under GPL License.\r
- *\r
- * License: http://www.plupload.com/license\r
- * Contributing: http://www.plupload.com/contributing\r
- */\r
-\r
-// JSLint defined globals\r
-/*global plupload:false, window:false */\r
-\r
-(function(plupload) {\r
-       function getById(id) {\r
-               return document.getElementById(id);\r
-       }\r
-\r
-       /**\r
-        * HTML4 implementation. This runtime has no special features it uses an form that posts files into an hidden iframe.\r
-        *\r
-        * @static\r
-        * @class plupload.runtimes.Html4\r
-        * @extends plupload.Runtime\r
-        */\r
-       plupload.runtimes.Html4 = plupload.addRuntime("html4", {\r
-               /**\r
-                * Returns a list of supported features for the runtime.\r
-                *\r
-                * @return {Object} Name/value object with supported features.\r
-                */\r
-               getFeatures : function() {\r
-                       // Only multipart feature\r
-                       return {\r
-                               multipart: true\r
-                       };\r
-               },\r
-\r
-               /**\r
-                * Initializes the upload runtime.\r
-                *\r
-                * @method init\r
-                * @param {plupload.Uploader} uploader Uploader instance that needs to be initialized.\r
-                * @param {function} callback Callback to execute when the runtime initializes or fails to initialize. If it succeeds an object with a parameter name success will be set to true.\r
-                */\r
-               init : function(uploader, callback) {\r
-                       uploader.bind("Init", function(up) {\r
-                               var container = document.body, iframe, url = "javascript", currentFile,\r
-                                       input, currentFileId, IE = /MSIE/.test(navigator.userAgent), mimes = [],\r
-                                       filters = up.settings.filters, i, ext, type, y;\r
-\r
-                               // Convert extensions to mime types list\r
-                               for (i = 0; i < filters.length; i++) {\r
-                                       ext = filters[i].extensions.split(/,/);\r
-\r
-                                       for (y = 0; y < ext.length; y++) {\r
-                                               type = plupload.mimeTypes[ext[y]];\r
-\r
-                                               if (type) {\r
-                                                       mimes.push(type);\r
-                                               }\r
-                                       }\r
-                               }\r
-\r
-                               mimes = mimes.join(',');\r
-\r
-                               function createForm() {\r
-                                       var form, input, bgcolor;\r
-\r
-                                       // Setup unique id for form\r
-                                       currentFileId = plupload.guid();\r
-\r
-                                       // Create form\r
-                                       form = document.createElement('form');\r
-                                       form.setAttribute('id', 'form_' + currentFileId);\r
-                                       form.setAttribute('method', 'post');\r
-                                       form.setAttribute('enctype', 'multipart/form-data');\r
-                                       form.setAttribute('encoding', 'multipart/form-data');\r
-                                       form.setAttribute("target", up.id + '_iframe');\r
-                                       form.style.position = 'absolute';\r
-\r
-                                       // Create input and set attributes\r
-                                       input = document.createElement('input');\r
-                                       input.setAttribute('id', 'input_' + currentFileId);\r
-                                       input.setAttribute('type', 'file');\r
-                                       input.setAttribute('accept', mimes);\r
-                                       input.setAttribute('size', 1);\r
-\r
-                                       // Set input styles\r
-                                       plupload.extend(input.style, {\r
-                                               width : '100%',\r
-                                               height : '100%',\r
-                                               opacity : 0\r
-                                       });\r
-\r
-                                       // Show the container if shim_bgcolor is specified\r
-                                       bgcolor = up.settings.shim_bgcolor;\r
-                                       if (bgcolor) {\r
-                                               form.style.background = bgcolor;\r
-                                       }\r
-\r
-                                       // no opacity in IE\r
-                                       if (IE) {\r
-                                               plupload.extend(input.style, {\r
-                                                       filter : "alpha(opacity=0)"\r
-                                               });\r
-                                       }\r
-\r
-                                       // add change event\r
-                                       plupload.addEvent(input, 'change', function(e) {\r
-                                               var element = e.target, name, files = [];\r
-\r
-                                               if (element.value) {\r
-                                                       getById('form_' + currentFileId).style.top = -0xFFFFF + "px";\r
-\r
-                                                       // Get file name\r
-                                                       name = element.value.replace(/\\/g, '/');\r
-                                                       name = name.substring(name.length, name.lastIndexOf('/') + 1);\r
-\r
-                                                       // Push files\r
-                                                       files.push(new plupload.File(currentFileId, name));\r
-\r
-                                                       // Create and position next form\r
-                                                       createForm();\r
-\r
-                                                       // Fire FilesAdded event\r
-                                                       if (files.length) {\r
-                                                               uploader.trigger("FilesAdded", files);\r
-                                                       }\r
-                                               }\r
-                                       });\r
-\r
-                                       // append to container\r
-                                       form.appendChild(input);\r
-                                       container.appendChild(form);\r
-\r
-                                       up.refresh();\r
-                               }\r
-\r
-\r
-                               function createIframe() {\r
-                                       // Create iframe and add it to the container\r
-                                       iframe = document.createElement('iframe');\r
-                                       iframe.setAttribute('src', url + ':""'); // javascript:"" for HTTPS issue on IE6, uses a variable to make an ignore for jslint\r
-                                       iframe.setAttribute('id', up.id + '_iframe');\r
-                                       iframe.setAttribute('name', up.id + '_iframe');\r
-                                       iframe.style.display = 'none';\r
-\r
-                                       container.appendChild(iframe);\r
-\r
-                                       // Add IFrame onload event\r
-                                       plupload.addEvent(iframe, 'load', function(e) {\r
-                                               var n = e.target, el, result;\r
-\r
-                                               // Ignore load event if there is no file\r
-                                               if (!currentFile) {\r
-                                                       return;\r
-                                               }\r
-\r
-                                               try {\r
-                                                       el = n.contentWindow.document || n.contentDocument || window.frames[n.id].document;\r
-                                               } catch (ex) {\r
-                                                       // Probably a permission denied error\r
-                                                       up.trigger('Error', {\r
-                                                               code : plupload.SECURITY_ERROR,\r
-                                                               message : 'Security error.',\r
-                                                               file : currentFile\r
-                                                       });\r
-\r
-                                                       return;\r
-                                               }\r
-\r
-                                               // Get result\r
-                                               result = el.documentElement.innerText || el.documentElement.textContent;\r
-\r
-                                               // Assume no error\r
-                                               if (result) {\r
-                                                       currentFile.status = plupload.DONE;\r
-                                                       currentFile.loaded = 1025;\r
-                                                       currentFile.percent = 100;\r
-\r
-                                                       up.trigger('UploadProgress', currentFile);\r
-                                                       up.trigger('FileUploaded', currentFile, {\r
-                                                               response : result\r
-                                                       });\r
-                                               }\r
-                                       });\r
-\r
-                                       // Upload file\r
-                                       up.bind("UploadFile", function(up, file) {\r
-                                               var form, input;\r
-\r
-                                               // File upload finished\r
-                                               if (file.status == plupload.DONE || file.status == plupload.FAILED || up.state == plupload.STOPPED) {\r
-                                                       return;\r
-                                               }\r
-\r
-                                               // Get the form and input elements\r
-                                               form = getById('form_' + file.id);\r
-                                               input = getById('input_' + file.id);\r
-\r
-                                               // Set input element name attribute which allows it to be submitted\r
-                                               input.setAttribute('name', up.settings.file_data_name);\r
-\r
-                                               // Store action\r
-                                               form.setAttribute("action", up.settings.url);\r
-\r
-                                               // Append multipart parameters\r
-                                               plupload.each(plupload.extend({name : file.target_name || file.name}, up.settings.multipart_params), function(value, name) {\r
-                                                       var input = document.createElement('input');\r
-\r
-                                                       plupload.extend(input, {\r
-                                                               type : 'hidden',\r
-                                                               name : name,\r
-                                                               value : value\r
-                                                       });\r
-\r
-                                                       form.insertBefore(input, form.firstChild);\r
-                                               });\r
-\r
-                                               currentFile = file;\r
-\r
-                                               // Hide the current form\r
-                                               getById('form_' + currentFileId).style.top = -0xFFFFF + "px";\r
-\r
-                                               form.submit();\r
-                                               form.parentNode.removeChild(form);\r
-                                       });\r
-                               }\r
-\r
-                               if (up.settings.container) {\r
-                                       container = getById(up.settings.container);\r
-                                       container.style.position = 'relative';\r
-                               }\r
-\r
-                               up.bind('StateChanged', function(up) {\r
-                                       if (up.state == plupload.STARTED) {\r
-                                               createIframe();\r
-                                       }\r
-\r
-                                       if (up.state == plupload.STOPPED) {\r
-                                               window.setTimeout(function() {\r
-                                                       iframe.parentNode.removeChild(iframe);\r
-                                               }, 0);\r
-                                       }\r
-                               });\r
-\r
-                               // Refresh button, will reposition the input form\r
-                               up.bind("Refresh", function(up) {\r
-                                       var browseButton, browsePos, browseSize;\r
-\r
-                                       browseButton = getById(up.settings.browse_button);\r
-                                       browsePos = plupload.getPos(browseButton, getById(up.settings.container));\r
-                                       browseSize = plupload.getSize(browseButton);\r
-\r
-                                       plupload.extend(getById('form_' + currentFileId).style, {\r
-                                               top : browsePos.y + 'px',\r
-                                               left : browsePos.x + 'px',\r
-                                               width : browseSize.w + 'px',\r
-                                               height : browseSize.h + 'px'\r
-                                       });\r
-                               });\r
-\r
-                               // Remove files\r
-                               uploader.bind("FilesRemoved", function(up, files) {\r
-                                       var i, n;\r
-\r
-                                       for (i = 0; i < files.length; i++) {\r
-                                               n = getById('form_' + files[i].id);\r
-                                               n.parentNode.removeChild(n);\r
-                                       }\r
-                               });\r
-\r
-                               // Create initial form\r
-                               createForm();\r
-                       });\r
-\r
-                       callback({success : true});\r
-               }\r
-       });\r
-})(plupload);\r
diff --git a/typo3/contrib/plupload/js/plupload.gears.min.js b/typo3/contrib/plupload/js/plupload.gears.min.js
deleted file mode 100644 (file)
index 517e8db..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(b){var c={};function a(i,e,k,j,d){var l,g,f,h;g=google.gears.factory.create("beta.canvas");g.decode(i);h=Math.min(e/g.width,k/g.height);if(h<1){e=Math.round(g.width*h);k=Math.round(g.height*h)}else{e=g.width;k=g.height}g.resize(e,k);return g.encode(d,{quality:j/100})}b.runtimes.Gears=b.addRuntime("gears",{getFeatures:function(){return{dragdrop:true,jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true}},init:function(g,i){var h;if(!window.google||!google.gears){return i({success:false})}try{h=google.gears.factory.create("beta.desktop")}catch(f){return i({success:false})}function d(k){var j,e,l=[],m;for(e=0;e<k.length;e++){j=k[e];m=b.guid();c[m]=j.blob;l.push(new b.File(m,j.name,j.blob.length))}g.trigger("FilesAdded",l)}g.bind("PostInit",function(){var j=g.settings,e=document.getElementById(j.drop_element);if(e){b.addEvent(e,"dragover",function(k){h.setDropEffect(k,"copy");k.preventDefault()});b.addEvent(e,"drop",function(l){var k=h.getDragData(l,"application/x-gears-files");if(k){d(k.files)}l.preventDefault()});e=0}b.addEvent(document.getElementById(j.browse_button),"click",function(o){var n=[],l,k,m;o.preventDefault();for(l=0;l<j.filters.length;l++){m=j.filters[l].extensions.split(",");for(k=0;k<m.length;k++){n.push("."+m[k])}}h.openFiles(d,{singleFile:!j.multi_selection,filter:n})})});g.bind("UploadFile",function(o,l){var q=0,p,m,n=0,k=o.settings.resize,e;m=o.settings.chunk_size;e=m>0;p=Math.ceil(l.size/m);if(!e){m=l.size;p=1}if(k&&/\.(png|jpg|jpeg)$/i.test(l.name)){c[l.id]=a(c[l.id],k.width,k.height,k.quality||90,/\.png$/i.test(l.name)?"image/png":"image/jpeg")}l.size=c[l.id].length;function j(){var u,w,s=o.settings.multipart,r=0,v={name:l.target_name||l.name};function t(y){var x,C="----pluploadboundary"+b.guid(),A="--",B="\r\n",z;if(s){u.setRequestHeader("Content-Type","multipart/form-data; boundary="+C);x=google.gears.factory.create("beta.blobbuilder");b.each(o.settings.multipart_params,function(E,D){x.append(A+C+B+'Content-Disposition: form-data; name="'+D+'"'+B+B);x.append(E+B)});x.append(A+C+B+'Content-Disposition: form-data; name="'+o.settings.file_data_name+'"; filename="'+l.name+'"'+B+"Content-Type: application/octet-stream"+B+B);x.append(y);x.append(B+A+C+A+B);z=x.getAsBlob();r=z.length-y.length;y=z}u.send(y)}if(l.status==b.DONE||l.status==b.FAILED||o.state==b.STOPPED){return}if(e){v.chunk=q;v.chunks=p}w=Math.min(m,l.size-(q*m));u=google.gears.factory.create("beta.httprequest");u.open("POST",b.buildUrl(o.settings.url,v));if(!s){u.setRequestHeader("Content-Disposition",'attachment; filename="'+l.name+'"');u.setRequestHeader("Content-Type","application/octet-stream")}b.each(o.settings.headers,function(y,x){u.setRequestHeader(x,y)});u.upload.onprogress=function(x){l.loaded=n+x.loaded-r;o.trigger("UploadProgress",l)};u.onreadystatechange=function(){var x;if(u.readyState==4){if(u.status==200){x={chunk:q,chunks:p,response:u.responseText,status:u.status};o.trigger("ChunkUploaded",l,x);if(x.cancelled){l.status=b.FAILED;return}n+=w;if(++q>=p){l.status=b.DONE;o.trigger("FileUploaded",l,{response:u.responseText,status:u.status})}else{j()}}else{o.trigger("Error",{code:b.HTTP_ERROR,message:"HTTP Error.",file:l,chunk:q,chunks:p,status:u.status})}}};if(q<p){t(c[l.id].slice(q*m,w))}}j()});i({success:true})}})})(plupload);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.html4.min.js b/typo3/contrib/plupload/js/plupload.html4.min.js
deleted file mode 100644 (file)
index 6a809ed..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(a){a.runtimes.Html4=a.addRuntime("html4",{getFeatures:function(){return{multipart:true}},init:function(f,g){var d={},c,b;function e(l){var k,j,m=[],n,h;h=l.value.replace(/\\/g,"/");h=h.substring(h.length,h.lastIndexOf("/")+1);n=a.guid();k=new a.File(n,h);d[n]=k;k.input=l;m.push(k);if(m.length){f.trigger("FilesAdded",m)}}f.bind("Init",function(p){var h,x,v,t=[],o,u,m=p.settings.filters,l,s,r=/MSIE/.test(navigator.userAgent),k="javascript",w,j=document.body,n;if(f.settings.container){j=document.getElementById(f.settings.container);j.style.position="relative"}c=(typeof p.settings.form=="string")?document.getElementById(p.settings.form):p.settings.form;if(!c){n=document.getElementById(f.settings.browse_button);for(;n;n=n.parentNode){if(n.nodeName=="FORM"){c=n}}}if(!c){c=document.createElement("form");c.style.display="inline";n=document.getElementById(f.settings.container);n.parentNode.insertBefore(c,n);c.appendChild(n)}c.setAttribute("method","post");c.setAttribute("enctype","multipart/form-data");a.each(p.settings.multipart_params,function(z,y){var i=document.createElement("input");a.extend(i,{type:"hidden",name:y,value:z});c.appendChild(i)});b=document.createElement("iframe");b.setAttribute("src",k+':""');b.setAttribute("name",p.id+"_iframe");b.setAttribute("id",p.id+"_iframe");b.style.display="none";a.addEvent(b,"load",function(B){var C=B.target,z=f.currentfile,A;try{A=C.contentWindow.document||C.contentDocument||window.frames[C.id].document}catch(y){p.trigger("Error",{code:a.SECURITY_ERROR,message:"Security error.",file:z});return}if(A.location.href=="about:blank"||!z){return}var i=A.documentElement.innerText||A.documentElement.textContent;if(i!=""){z.status=a.DONE;z.loaded=1025;z.percent=100;if(z.input){z.input.removeAttribute("name")}p.trigger("UploadProgress",z);p.trigger("FileUploaded",z,{response:i});if(c.tmpAction){c.setAttribute("action",c.tmpAction)}if(c.tmpTarget){c.setAttribute("target",c.tmpTarget)}}});c.appendChild(b);if(r){window.frames[b.id].name=b.name}x=document.createElement("div");x.id=p.id+"_iframe_container";for(o=0;o<m.length;o++){l=m[o].extensions.split(/,/);for(u=0;u<l.length;u++){s=a.mimeTypes[l[u]];if(s){t.push(s)}}}a.extend(x.style,{position:"absolute",background:"transparent",width:"100px",height:"100px",overflow:"hidden",zIndex:99999,opacity:0});w=f.settings.shim_bgcolor;if(w){a.extend(x.style,{background:w,opacity:1})}x.className="plupload_iframe";j.appendChild(x);function q(){v=document.createElement("input");v.setAttribute("type","file");v.setAttribute("accept",t.join(","));v.setAttribute("size",1);a.extend(v.style,{width:"100%",height:"100%",opacity:0});if(r){a.extend(v.style,{filter:"alpha(opacity=0)"})}a.addEvent(v,"change",function(i){var y=i.target;if(y.value){q();y.style.display="none";e(y)}});x.appendChild(v);return true}q()});f.bind("Refresh",function(h){var i,j,k;i=document.getElementById(f.settings.browse_button);j=a.getPos(i,document.getElementById(h.settings.container));k=a.getSize(i);a.extend(document.getElementById(f.id+"_iframe_container").style,{top:j.y+"px",left:j.x+"px",width:k.w+"px",height:k.h+"px"})});f.bind("UploadFile",function(h,i){if(i.status==a.DONE||i.status==a.FAILED||h.state==a.STOPPED){return}if(!i.input){i.status=a.ERROR;return}i.input.setAttribute("name",h.settings.file_data_name);c.tmpAction=c.getAttribute("action");c.setAttribute("action",a.buildUrl(h.settings.url,{name:i.target_name||i.name}));c.tmpTarget=c.getAttribute("target");c.setAttribute("target",b.name);this.currentfile=i;c.submit()});f.bind("FilesRemoved",function(h,k){var j,l;for(j=0;j<k.length;j++){l=k[j].input;if(l){l.parentNode.removeChild(l)}}});g({success:true})}})})(plupload);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.html5.min.js b/typo3/contrib/plupload/js/plupload.html5.min.js
deleted file mode 100644 (file)
index 3592fb9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(b){function a(i,l,j,c,k){var e,d,h,g,f;e=document.createElement("canvas");e.style.display="none";document.body.appendChild(e);d=e.getContext("2d");h=new Image();h.onload=function(){var o,m,n;f=Math.min(l/h.width,j/h.height);if(f<1){o=Math.round(h.width*f);m=Math.round(h.height*f)}else{o=h.width;m=h.height}e.width=o;e.height=m;d.drawImage(h,0,0,o,m);g=e.toDataURL(c);g=g.substring(g.indexOf("base64,")+7);g=atob(g);e.parentNode.removeChild(e);k({success:true,data:g})};h.src=i}b.runtimes.Html5=b.addRuntime("html5",{getFeatures:function(){var g,d,f,e,c;d=f=e=c=false;if(window.XMLHttpRequest){g=new XMLHttpRequest();f=!!g.upload;d=!!(g.sendAsBinary||g.upload)}if(d){e=!!(File&&File.prototype.getAsDataURL);c=!!(File&&File.prototype.slice)}return{html5:d,dragdrop:window.mozInnerScreenX!==undefined||c,jpgresize:e,pngresize:e,multipart:e||!!window.FileReader||!!window.FormData,progress:f,chunking:c||e}},init:function(f,g){var c={},d;function e(l){var j,h,k=[],m;for(h=0;h<l.length;h++){j=l[h];m=b.guid();c[m]=j;k.push(new b.File(m,j.fileName,j.fileSize))}if(k.length){f.trigger("FilesAdded",k)}}d=this.getFeatures();if(!d.html5){g({success:false});return}f.bind("Init",function(m){var q,o=[],l,p,j=m.settings.filters,k,n,h=document.body;q=document.createElement("div");q.id=m.id+"_html5_container";for(l=0;l<j.length;l++){k=j[l].extensions.split(/,/);for(p=0;p<k.length;p++){n=b.mimeTypes[k[p]];if(n){o.push(n)}}}b.extend(q.style,{position:"absolute",background:f.settings.shim_bgcolor||"transparent",width:"100px",height:"100px",overflow:"hidden",zIndex:99999,opacity:f.settings.shim_bgcolor?"":0});q.className="plupload html5";if(f.settings.container){h=document.getElementById(f.settings.container);h.style.position="relative"}h.appendChild(q);q.innerHTML='<input id="'+f.id+'_html5" style="width:100%;" type="file" accept="'+o.join(",")+'" '+(f.settings.multi_selection?'multiple="multiple"':"")+" />";document.getElementById(f.id+"_html5").onchange=function(){e(this.files);this.value=""}});f.bind("PostInit",function(){var h=document.getElementById(f.settings.drop_element);if(h){b.addEvent(h,"dragover",function(i){i.preventDefault()});b.addEvent(h,"drop",function(j){var i=j.dataTransfer;if(i&&i.files){e(i.files)}j.preventDefault()})}});f.bind("Refresh",function(h){var i,j,k;i=document.getElementById(f.settings.browse_button);j=b.getPos(i,document.getElementById(h.settings.container));k=b.getSize(i);b.extend(document.getElementById(f.id+"_html5_container").style,{top:j.y+"px",left:j.x+"px",width:k.w+"px",height:k.h+"px"})});f.bind("UploadFile",function(h,j){var k=h.settings,m,i;function l(n){var q=0,p=0;function o(){var u=n,C,D,y,z,A=0,r="----pluploadboundary"+b.guid(),t,w,s="--",B="\r\n",x="";if(j.status==b.DONE||j.status==b.FAILED||h.state==b.STOPPED){return}z={name:j.target_name||j.name};if(k.chunk_size&&d.chunking){t=k.chunk_size;y=Math.ceil(j.size/t);w=Math.min(t,j.size-(q*t));if(typeof(n)=="string"){u=n.substring(q*t,q*t+w)}else{u=n.slice(q*t,w)}z.chunk=q;z.chunks=y}else{w=j.size}C=new XMLHttpRequest();D=C.upload;if(D){D.onprogress=function(E){j.loaded=Math.min(j.size,p+E.loaded-A);h.trigger("UploadProgress",j)}}C.open("post",b.buildUrl(h.settings.url,z),true);C.onreadystatechange=function(){var E,G;if(C.readyState==4){try{E=C.status}catch(F){E=0}if(E>=400){h.trigger("Error",{code:b.HTTP_ERROR,message:"HTTP Error.",file:j,status:E})}else{if(y){G={chunk:q,chunks:y,response:C.responseText,status:E};h.trigger("ChunkUploaded",j,G);p+=w;if(G.cancelled){j.status=b.FAILED;return}j.loaded=Math.min(j.size,(q+1)*t)}else{j.loaded=j.size}h.trigger("UploadProgress",j);if(!y||++q>=y){j.status=b.DONE;h.trigger("FileUploaded",j,{response:C.responseText,status:E})}else{o()}}}};b.each(h.settings.headers,function(F,E){C.setRequestHeader(E,F)});if(h.settings.multipart&&d.multipart){if(!C.sendAsBinary){var v=new FormData();b.each(h.settings.multipart_params,function(F,E){v.append(E,F)});v.append(h.settings.file_data_name,u);C.send(v);return}C.setRequestHeader("Content-Type","multipart/form-data; boundary="+r);b.each(h.settings.multipart_params,function(F,E){x+=s+r+B+'Content-Disposition: form-data; name="'+E+'"'+B+B;x+=F+B});x+=s+r+B+'Content-Disposition: form-data; name="'+h.settings.file_data_name+'"; filename="'+j.name+'"'+B+"Content-Type: application/octet-stream"+B+B+u+B+s+r+s+B;A=x.length-u.length;u=x}else{C.setRequestHeader("Content-Type","application/octet-stream")}if(C.sendAsBinary){C.sendAsBinary(u)}else{C.send(u)}}o()}m=c[j.id];i=h.settings.resize;if(d.jpgresize){if(i&&/\.(png|jpg|jpeg)$/i.test(j.name)){a(m.getAsDataURL(),i.width,i.height,/\.png$/i.test(j.name)?"image/png":"image/jpeg",function(n){if(n.success){j.size=n.data.length;l(n.data)}else{l(m.getAsBinary())}})}else{l(m.getAsBinary())}}else{l(m)}});g({success:true})}})})(plupload);
\ No newline at end of file
diff --git a/typo3/contrib/plupload/js/plupload.min.js b/typo3/contrib/plupload/js/plupload.min.js
deleted file mode 100644 (file)
index d762ad1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-(function(){var c=0,h=[],j={},f={},a={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},i=/[<>&\"\']/g,b;function e(){this.returnValue=false}function g(){this.cancelBubble=true}(function(k){var l=k.split(/,/),m,o,n;for(m=0;m<l.length;m+=2){n=l[m+1].split(/ /);for(o=0;o<n.length;o++){f[n[o]]=l[m]}}})("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats,docx pptx xlsx,audio/mpeg,mpga mpega mp2 mp3,audio/x-wav,wav,image/bmp,bmp,image/gif,gif,image/jpeg,jpeg jpg jpe,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/html,htm html xhtml,text/rtf,rtf,video/mpeg,mpeg mpg mpe,video/quicktime,qt mov,video/x-flv,flv,video/vnd.rn-realvideo,rv,text/plain,asc txt text diff log,application/octet-stream,exe");var d={STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-700,mimeTypes:f,extend:function(k){d.each(arguments,function(l,m){if(m>0){d.each(l,function(o,n){k[n]=o})}});return k},cleanName:function(k){var l,m;m=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(l=0;l<m.length;l+=2){k=k.replace(m[l],m[l+1])}k=k.replace(/\s+/g,"_");k=k.replace(/[^a-z0-9_\-\.]+/gi,"");return k},addRuntime:function(k,l){l.name=k;h[k]=l;h.push(l);return l},guid:function(){var k=new Date().getTime().toString(32),l;for(l=0;l<5;l++){k+=Math.floor(Math.random()*65535).toString(32)}return(d.guidPrefix||"p")+k+(c++).toString(32)},buildUrl:function(l,k){var m="";d.each(k,function(o,n){m+=(m?"&":"")+encodeURIComponent(n)+"="+encodeURIComponent(o)});if(m){l+=(l.indexOf("?")>0?"&":"?")+m}return l},each:function(n,o){var m,l,k;if(n){m=n.length;if(m===b){for(l in n){if(n.hasOwnProperty(l)){if(o(n[l],l)===false){return}}}}else{for(k=0;k<m;k++){if(o(n[k],k)===false){return}}}}},formatSize:function(k){if(k===b){return d.translate("N/A")}if(k>1048576){return Math.round(k/1048576,1)+" MB"}if(k>1024){return Math.round(k/1024,1)+" KB"}return k+" b"},getPos:function(l,p){var q=0,o=0,s,r=document,m,n;l=l;p=p||r.body;function k(w){var u,v,t=0,z=0;if(w){v=w.getBoundingClientRect();u=r.compatMode==="CSS1Compat"?r.documentElement:r.body;t=v.left+u.scrollLeft;z=v.top+u.scrollTop}return{x:t,y:z}}if(l.getBoundingClientRect&&(navigator.userAgent.indexOf("MSIE")>0&&r.documentMode!==8)){m=k(l);n=k(p);return{x:m.x-n.x,y:m.y-n.y}}s=l;while(s&&s!=p&&s.nodeType){q+=s.offsetLeft||0;o+=s.offsetTop||0;s=s.offsetParent}s=l.parentNode;while(s&&s!=p&&s.nodeType){q-=s.scrollLeft||0;