From b79626a48830ea8397295dde3a71afa95186963d Mon Sep 17 00:00:00 2001 From: "vit.jonas@gmail.com" Date: Thu, 9 Jun 2011 07:33:00 +0000 Subject: [PATCH] * fixed Issue 78: Fix plupload for Chrome git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@142 5e329b0b-a2ee-ea63-e329-299493fc886d --- app/views/dmsf/_multi_upload.html.erb | 2 +- assets/javascripts/plupload/plupload.html5.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views/dmsf/_multi_upload.html.erb b/app/views/dmsf/_multi_upload.html.erb index 8444872d..4fca01db 100644 --- a/app/views/dmsf/_multi_upload.html.erb +++ b/app/views/dmsf/_multi_upload.html.erb @@ -81,7 +81,7 @@ uploader.html("
"); uploader = jQuery("div",uploader); uploader.plupload({ - runtimes : 'gears,html5,flash,html4', + runtimes : 'html5,flash,html4', url : '<%= url_for({:controller => "dmsf_upload", :action => "upload_file", :id => @project, :folder_id => @folder}) %>', max_file_size : "100mb", max_file_count: '<%= Setting.plugin_redmine_dmsf["dmsf_max_file_upload"].to_i if Setting.plugin_redmine_dmsf["dmsf_max_file_upload"].to_i > 0 %>', diff --git a/assets/javascripts/plupload/plupload.html5.js b/assets/javascripts/plupload/plupload.html5.js index e70cdf80..35fe451b 100644 --- a/assets/javascripts/plupload/plupload.html5.js +++ b/assets/javascripts/plupload/plupload.html5.js @@ -13,6 +13,11 @@ (function(window, document, plupload, undef) { var fakeSafariDragDrop; + + if ((typeof File !== 'undefined') && !File.prototype.slice) { + if (File.prototype.webkitSlice) File.prototype.slice = File.prototype.webkitSlice; + if (File.prototype.mozSlice) File.prototype.slice = File.prototype.mozSlice; + } /* Introduce sendAsBinary for latest WebKits having support for BlobBuilder and typed arrays: credits: http://javascript0.org/wiki/Portable_sendAsBinary,