Skip to content

Commit

Permalink
Fixed attachment size warning feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Oct 22, 2014
1 parent f230436 commit 4d84270
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions static/default/html/jsapi/compose/attachments.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@ Mailpile.Composer.Attachments.Uploader = function(settings) {
// Upload files
plupload.each(files, function(file) {

// Show image preview
if (_.indexOf(['image/jpg', 'image/jpeg', 'image/gif', 'image/png'], file.type) > -1) {
Mailpile.Composer.Attachments.UploaderImagePreview(file, settings.mid);
} else {
var attachment_html = '<li class="compose-attachment" aid="' + file.id + '"> <div class="compose-attachment-filename">' + file.name + '</div> ' + plupload.formatSize(file.size) + '</li>';
$('#compose-attachments-files-' + settings.mid).append(attachment_html);
}

// Show Warning for 10mb or larger
if (file.size > 10485760) {
// Show Warning for 50 mb or larger
if (file.size > 52428800) {
start_upload = false;
alert(file.name + ' is ' + plupload.formatSize(file.size) + '. Some people cannot receive attachments that are 50 mb or larger');
alert(file.name + ' {{_("is")}} ' + plupload.formatSize(file.size) + '. {{_("Some people cannot receive attachments larger than 50 Megabytes.")}}');
} else {
// Show image preview
if (_.indexOf(['image/jpg', 'image/jpeg', 'image/gif', 'image/png'], file.type) > -1) {
Mailpile.Composer.Attachments.UploaderImagePreview(file, settings.mid);
} else {
var attachment_html = '<li class="compose-attachment" aid="' + file.id + '"> <div class="compose-attachment-filename">' + file.name + '</div> ' + plupload.formatSize(file.size) + '</li>';
$('#compose-attachments-files-' + settings.mid).append(attachment_html);
}
}
});

Expand Down

0 comments on commit 4d84270

Please sign in to comment.