Changeset 5856
- Timestamp:
- 03/30/12 18:02:50 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/draw_api.js
r5846 r5856 4184 4184 setTimeout(function() { 4185 4185 $('#attDisposition'+ID).val('attachment'); 4186 delete data.fileInput; 4186 4187 data.submit(); 4187 4188 }, 5000); 4188 } 4189 } 4190 var attach = {}; 4191 attach.fullFileName = data.files[0].name; 4192 attach.fileName = data.files[0].name; 4193 if(data.files[0].name.length > 50) 4194 attach.fileName = data.files[0].name.substr(0, 32) + " ... " + data.files[0].name.substr(data.files[0].name.length-9, data.files[0].name.length); 4195 attach.fileSize = formatBytes(data.files[0].size); 4196 if(maxAttachmentSise && data.files[0].size > maxAttachmentSise) 4197 attach.error = 'Tamanho de arquivo nao permitido!!' 4198 4199 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4200 upload.find('.button.close').button({ 4201 icons: { 4202 primary: "ui-icon-close" 4203 }, 4204 text: false 4205 }).click(function(){ 4206 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4207 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 4208 delAttachment(ID, idAttach) 4209 $(this).parent().remove(); 4210 }); 4211 4212 fileUploadMSG.find('.attachments-list').append(upload); 4213 4214 if(!maxAttachmentSise || data.files[0].size < maxAttachmentSise) 4215 fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden'); 4216 else 4217 fileUploadMSG.find(' .fileinput-button.new').removeClass('new'); 4189 4218 }, 4190 change: function (e, data) {4191 $.each(data.files, function (index, file) {4192 var attach = {};4193 attach.fullFileName = file.name;4194 attach.fileName = file.name;4195 if(file.name.length > 50)4196 attach.fileName = file.name.substr(0, 32) + " ... " + file.name.substr(file.name.length-9, file.name.length);4197 attach.fileSize = formatBytes(file.size);4198 if(maxAttachmentSise && file.size > maxAttachmentSise)4199 attach.error = 'Tamanho de arquivo nao permitido!!'4200 4201 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));4202 upload.find('.button.close').button({4203 icons: {4204 primary: "ui-icon-close"4205 },4206 text: false4207 }).click(function(){4208 var idAttach = $(this).parent().find('input[name="fileId[]"]').val();4209 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove();4210 delAttachment(ID, idAttach)4211 $(this).parent().remove();4212 });4213 4214 fileUploadMSG.find('.attachments-list').append(upload);4215 4216 if(!maxAttachmentSise || file.size < maxAttachmentSise){4217 fileUploadMSG.find('.fileinput-button.new').append(data.fileInput[0]).removeClass('new');4218 fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden');4219 }else4220 fileUploadMSG.find(' .fileinput-button.new').removeClass('new');4221 4222 })},4223 4224 4219 done: function(e, data){ 4225 4220 if(!!data.result && data.result != "[]" ){ … … 4241 4236 } 4242 4237 }).find('[name="files[]"]').css({"height" : "20px", "width": "100px", "border-width": "0 0 0px 0px", "-moz-transform" : "none","-o-transform" : 'none'}); 4243 4244 4238 4245 4239 fileUploadMSG.find("span.message-attach-link").click(function(event){ 4246 4240 jQuery('#message-attach-dialog').html(DataLayer.render("../prototype/modules/attach_message/attach_message.ejs", {}));
Note: See TracChangeset
for help on using the changeset viewer.