* fixed plupload errors displaying

* modified plupload ui max_file_counr behavior

git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@23 5e329b0b-a2ee-ea63-e329-299493fc886d
This commit is contained in:
vit.jonas@gmail.com 2011-05-09 07:31:08 +00:00
parent 02c8da4011
commit e6fbbab6a0
3 changed files with 20 additions and 8 deletions

View File

@ -258,7 +258,7 @@ form_tag({:action => "entries_operation", :id => @project, :folder_id => @folder
uploader.plupload({ uploader.plupload({
runtimes : 'gears,html5,flash,html4', runtimes : 'gears,html5,flash,html4',
url : '<%= url_for({:controller => "dmsf_detail", :action => "upload_file", :id => @project, :folder_id => @folder}) %>', url : '<%= url_for({:controller => "dmsf_detail", :action => "upload_file", :id => @project, :folder_id => @folder}) %>',
max_file_size : '100mb', max_file_size : "100mb",
max_file_count: <%= Setting.plugin_redmine_dmsf["dmsf_max_file_upload"].to_i %>, max_file_count: <%= Setting.plugin_redmine_dmsf["dmsf_max_file_upload"].to_i %>,
multipart: true, multipart: true,
multipart_params : {authenticity_token : jQuery("input[name=authenticity_token]").val()}, multipart_params : {authenticity_token : jQuery("input[name=authenticity_token]").val()},

View File

@ -33,6 +33,11 @@ function renderUI(obj) {
'<div class="plupload_wrapper">' + '<div class="plupload_wrapper">' +
'<div class="ui-widget-content plupload_container">' + '<div class="ui-widget-content plupload_container">' +
'<div class="plupload">' + '<div class="plupload">' +
'<div class="ui-state-default ui-widget-header plupload_header">' +
'<div class="plupload_header_content">' +
'</div>' +
'</div>' +
'<div class="plupload_content">' + '<div class="plupload_content">' +
'<table class="plupload_filelist">' + '<table class="plupload_filelist">' +
'<tr class="ui-widget-header plupload_filelist_header">' + '<tr class="ui-widget-header plupload_filelist_header">' +
@ -214,9 +219,10 @@ $.widget("ui.plupload", {
if (self.options.max_file_count) { if (self.options.max_file_count) {
uploader.bind('FilesAdded', function(up, files) { uploader.bind('FilesAdded', function(up, files) {
var length = files.length, removed = []; var length = files.length, removed = [];
length += up.files.length;
if (length > self.options.max_file_count) { if (length > self.options.max_file_count) {
removed = files.splice(self.options.max_file_count); removed = files.splice(self.options.max_file_count - up.files.length);
up.trigger('Error', { up.trigger('Error', {
code : self.FILE_COUNT_ERROR, code : self.FILE_COUNT_ERROR,

View File

@ -13,12 +13,13 @@
.plupload .plupload_filelist_footer {border-width: 1px 0 0 0} .plupload .plupload_filelist_footer {border-width: 1px 0 0 0}
.plupload .plupload_filelist_header {border-width: 0 0 1px 0} .plupload .plupload_filelist_header {border-width: 0 0 1px 0}
div.plupload .plupload_file {border-width: 0 0 1px 0} div.plupload .plupload_file {border-width: 0 0 1px 0}
div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;} /* div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;} */
.plupload_file .ui-icon { .plupload_file .ui-icon {
cursor:pointer; cursor:pointer;
} }
/*
.plupload_header_content { .plupload_header_content {
background-image: url('../img/plupload.png'); background-image: url('../img/plupload.png');
background-repeat: no-repeat; background-repeat: no-repeat;
@ -27,6 +28,8 @@ div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;}
padding-left: 60px; padding-left: 60px;
position:relative; position:relative;
} }
*/
.plupload_header_content_bw {background-image: url('../img/plupload-bw.png');} .plupload_header_content_bw {background-image: url('../img/plupload-bw.png');}
.plupload_header_title { .plupload_header_title {
font: normal 18px sans-serif; font: normal 18px sans-serif;
@ -96,6 +99,7 @@ div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;}
.plupload_buttons, .plupload_upload_status {float: left} .plupload_buttons, .plupload_upload_status {float: left}
/*
.plupload_message { .plupload_message {
position: absolute; position: absolute;
top: 0px; top: 0px;
@ -103,6 +107,7 @@ div.plupload div.plupload_header {border-width: 0 0 1px 0; position: relative;}
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
*/
.plupload_message p { .plupload_message p {
padding:0.7em; padding:0.7em;
@ -127,10 +132,11 @@ plupload_message i {
border:none; border:none;
} }
/* updated by evilcroco */
.plupload_message_close { .plupload_message_close {
position:absolute; float:right;
top:5px; margin-top:5px;
right:5px; margin-right:5px;
cursor:pointer; cursor:pointer;
} }