Changeset 5720
- Timestamp:
- 03/14/12 15:15:03 (11 years ago)
- Location:
- trunk/prototype/modules/calendar/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/js/calendar.codecs.js
r5715 r5720 584 584 attachments: $.map(objEvent.attachments || [], function( attachment, i ){ 585 585 var attach = DataLayer.get('schedulableToAttachment', attachment, false); 586 attach.name = attach.name.length < 10 ? attach.name : ( attach.name.substr(0, 6) + attach.name.substr( attach.name.length-4, attach.name.length)); 586 var ext = attach.name.split('.'); 587 attach.name = attach.name.length < 10 ? attach.name : ( ext.length == 1 ? attach.name.substr(0, 10) : (attach.name.substr(0, 6) + '.' + ext[ext.length -1])); 587 588 attach.size = formatBytes(attach.size); 588 589 return attach; -
trunk/prototype/modules/calendar/js/helpers.js
r5715 r5720 1090 1090 text: false 1091 1091 }); 1092 1092 var maxSizeFile = 2000000; 1093 1093 $('#fileupload').fileupload({ 1094 1094 sequentialUploads: true, 1095 1095 add: function (e, data) { 1096 if(data.files[0].size < 2000000)1096 if(data.files[0].size < maxSizeFile) 1097 1097 data.submit(); 1098 1098 }, … … 1101 1101 var attach = {}; 1102 1102 attach.fileName = file.name; 1103 var ext = file.name.split('.'); 1103 1104 if(file.name.length > 10) 1104 attach.fileName = file.name.substr(0, 6) + file.name.substr(file.name.length-4, file.name.length);1105 attach.fileName = ext.length == 1 ? file.name.substr(0, 10) : file.name.substr(0, 6) + '.' + ext[ext.length -1]; 1105 1106 attach.fileSize = formatBytes(file.size); 1106 if(file.size > 2000000)1107 if(file.size > maxSizeFile) 1107 1108 attach.error = 'Tamanho de arquivo nao permitido!!' 1108 1109 1109 1110 $('.attachments-list').append(DataLayer.render(path+'templates/attachment_add_itemlist.ejs', {file : attach})); 1110 1111 1111 if(file.size < 2000000){1112 if(file.size < maxSizeFile){ 1112 1113 $('.fileinput-button.new').append(data.fileInput[0]).removeClass('new'); 1113 1114 $('.attachments-list').find('[type=file]').addClass('hidden');
Note: See TracChangeset
for help on using the changeset viewer.