Check attachment size when the user selects a file (#9667).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7926 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-11-25 22:32:07 +00:00
parent fe45251349
commit 7ed7d8984d
46 changed files with 58 additions and 1 deletions

View File

@@ -106,6 +106,18 @@ function removeFileField(el) {
}
}
function checkFileSize(el, maxSize, message) {
var files = el.files;
if (files) {
for (var i=0; i<files.length; i++) {
if (files[i].size > maxSize) {
alert(message);
el.value = "";
}
}
}
}
function showTab(name) {
var f = $$('div#content .tab-content');
for(var i=0; i<f.length; i++){