Changeset 6045
- Timestamp:
- 04/26/12 15:20:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/draw_api.js
r6014 r6045 3663 3663 sequentialUploads: true, 3664 3664 add: function (e, data) { 3665 3665 3666 if(!maxAttachmentSise || data.files[0].size < maxAttachmentSise) { 3666 3667 setTimeout(function() { 3667 3668 $('#attDisposition'+ID).val('attachment'); 3669 delete data.fileInput; 3668 3670 data.submit(); 3669 3671 }, 5000); 3670 } 3672 } 3673 var attach = {}; 3674 attach.fullFileName = data.files[0].name; 3675 attach.fileName = data.files[0].name; 3676 if(data.files[0].name.length > 50) 3677 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); 3678 attach.fileSize = formatBytes(data.files[0].size); 3679 if(maxAttachmentSise && data.files[0].size > maxAttachmentSise) 3680 attach.error = 'Tamanho de arquivo nao permitido!!' 3681 3682 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 3683 upload.find('.button.close').button({ 3684 icons: { 3685 primary: "ui-icon-close" 3686 }, 3687 text: false 3688 }).click(function(){ 3689 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 3690 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 3691 delAttachment(ID, idAttach) 3692 $(this).parent().remove(); 3693 }); 3694 3695 fileUploadMSG.find('.attachments-list').append(upload); 3696 3697 if(!maxAttachmentSise || data.files[0].size < maxAttachmentSise) 3698 fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden'); 3699 else 3700 fileUploadMSG.find(' .fileinput-button.new').removeClass('new'); 3671 3701 }, 3672 change: function (e, data) {3673 $.each(data.files, function (index, file) {3674 var attach = {};3675 attach.fullFileName = file.name;3676 attach.fileName = file.name;3677 if(file.name.length > 50)3678 attach.fileName = file.name.substr(0, 32) + " ... " + file.name.substr(file.name.length-9, file.name.length);3679 attach.fileSize = formatBytes(file.size);3680 if(maxAttachmentSise && file.size > maxAttachmentSise)3681 attach.error = 'Tamanho de arquivo nao permitido!!'3682 3683 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));3684 upload.find('.button.close').button({3685 icons: {3686 primary: "ui-icon-close"3687 },3688 text: false3689 }).click(function(){3690 var idAttach = $(this).parent().find('input[name="fileId[]"]').val();3691 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove();3692 delAttachment(ID, idAttach)3693 $(this).parent().remove();3694 });3695 3696 fileUploadMSG.find('.attachments-list').append(upload);3697 3698 if(!maxAttachmentSise || file.size < maxAttachmentSise){3699 fileUploadMSG.find('.fileinput-button.new').append(data.fileInput[0]).removeClass('new');3700 fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden');3701 }else3702 fileUploadMSG.find(' .fileinput-button.new').removeClass('new');3703 3704 })},3705 3706 3702 done: function(e, data){ 3707 3703 if(!!data.result && data.result != "[]" ){ 3708 var newAttach = jQuery.parseJSON(data.result); 3709 3710 //Compatibilidade com Firefox3.6 3711 if(newAttach === null ) newAttach = jQuery.parseJSON(data.result.text()); 3712 3704 var newAttach = jQuery.parseJSON(data.result); 3713 3705 if(newAttach.rollback !== false) 3714 3706 {
Note: See TracChangeset
for help on using the changeset viewer.