Changeset 7889 for trunk/expressoMail1_2/js/draw_api.js
- Timestamp:
- 02/18/13 16:02:13 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/draw_api.js
r7872 r7889 4747 4747 emQuickSearch(($(this).parents("tr:first").find("textarea").val() ? $(this).parents("tr:first").find("textarea").val() : input_search), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 4748 4748 }); 4749 } 4750 4751 /* 4752 Anexa uma mensagem a mensagem sendo enviada. 4753 Parâmetros: 4754 folder_name: nome da pasta na qual a mensagem sendo anexada se encontra. 4755 message_number: id da mensagem sendo anexada. 4756 */ 4757 function attach_message (folder_name, message_number) { 4758 var ID = currentTab; 4759 var fileUploadMSG = $('#fileupload_msg'+ID); 4760 fileUploadMSG.find(' .attachments-list').show(); 4761 var att = new Object(); 4762 att.folder = folder_name; 4763 att.uid = message_number; 4764 att.type = 'imapMSG'; 4765 /* Substituída a variável onceOpenedMessages por onceOpenedHeadersMessages, 4766 porque essa última contem as mesmas informações da primeira, e está em escopo global.*/ 4767 att.name = Base64.encode(onceOpenedHeadersMessages[folder_name][message_number].subject + '.eml'); 4768 var idATT = JSON.stringify(att); 4769 addAttachment(ID, idATT); 4770 var attach = {}; 4771 attach.fileName = onceOpenedHeadersMessages[folder_name][message_number].subject + '.eml'; 4772 attach.fullFileName = onceOpenedHeadersMessages[folder_name][message_number].subject + '.eml'; 4773 if(attach.fileName.length > 20) 4774 { 4775 attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length - 9, attach.fileName.length); 4776 } 4777 4778 attach.error = false; 4779 attach.OK = true; 4780 attach.fileSize = formatBytes(onceOpenedHeadersMessages[folder_name][message_number].Size); 4781 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", { 4782 file: attach 4783 })); 4784 $("#content_id_" + currentTab + " .save").button("enable"); 4785 upload.find('.att-box-loading').remove(); 4786 upload.append('<input type="hidden" name="fileId[]" value=\'' + idATT + '\'/>'); 4787 4788 upload.find('.att-box-delete').click(function() 4789 { 4790 $("#content_id_" + currentTab + " .save").button("enable"); 4791 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4792 fileUploadMSG.find(' .attachments-list').find('input[value="' + idAttach + '"]').remove(); 4793 delAttachment(ID, idAttach); 4794 $(this).parent().qtip("destroy"); 4795 $(this).parent().remove(); 4796 if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length) 4797 { 4798 fileUploadMSG.find(' .attachments-list').hide(); 4799 } 4800 }); 4801 4802 fileUploadMSG.find('.attachments-list').append(upload); 4803 4804 upload.find('.att-box-loading').remove(); 4805 4806 fileUploadMSG.find('.attachments-list .att-box:last').qtip( 4807 { 4808 content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", { 4809 attach: attach 4810 }), 4811 position: { 4812 corner: { 4813 tooltip: 'bottomMiddle', 4814 target: 'topMiddle' 4815 }, 4816 adjust: { 4817 resize: true, 4818 scroll: true 4819 } 4820 }, 4821 show: { 4822 when: 'mouseover', 4823 // Don't specify a show event 4824 ready: false // Show the tooltip when ready 4825 }, 4826 hide: 'mouseout', 4827 // Don't specify a hide event 4828 style: { 4829 border: { 4830 width: 1, 4831 radius: 5 4832 }, 4833 width: { 4834 min: 75, 4835 max: 1000 4836 }, 4837 padding: 5, 4838 textAlign: 'center', 4839 tip: true, 4840 // Give it a speech bubble tip with automatic corner detection 4841 name: 'blue' // Style it according to the preset 'cream' style 4842 } 4843 }); 4749 4844 } 4750 4845 … … 5143 5238 jQuery.each(selectedMessages[folder_name], function(message_number, message) { 5144 5239 if (message) { 5145 fileUploadMSG.find(' .attachments-list').show(); 5146 var att = new Object(); 5147 att.folder = folder_name; 5148 att.uid = message_number; 5149 att.type = 'imapMSG'; 5150 att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml'); 5151 var idATT = JSON.stringify(att); 5152 addAttachment( ID , idATT); 5153 var attach = {}; 5154 attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 5155 attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 5156 if(attach.fileName.length > 20) 5157 attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length); 5158 5159 attach.error = false; 5160 attach.OK = true; 5161 attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size); 5162 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 5163 $("#content_id_"+currentTab+" .save").button("enable"); 5164 upload.find('.att-box-loading').remove(); 5165 upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>'); 5166 5167 upload.find('.att-box-delete').click(function(){ 5168 $("#content_id_"+currentTab+" .save").button("enable"); 5169 var elAttach = $(this).parent().find('input[name="fileId[]"]'); 5170 delAttachment(ID,$(elAttach).val()); 5171 $(elAttach).remove(); 5172 $(this).parent().qtip("destroy"); 5173 $(this).parent().remove(); 5174 if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){ 5175 fileUploadMSG.find(' .attachments-list').hide(); 5176 } 5177 }); 5178 5179 fileUploadMSG.find('.attachments-list').append(upload); 5180 5181 upload.find('.att-box-loading').remove(); 5182 5183 fileUploadMSG.find('.attachments-list .att-box:last').qtip({ 5184 content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}), 5185 position: { 5186 corner: { 5187 tooltip: 'bottomMiddle', 5188 target: 'topMiddle' 5189 }, 5190 adjust: { 5191 resize: true, 5192 scroll: true 5193 } 5194 }, 5195 show: { 5196 when: 'mouseover', // Don't specify a show event 5197 ready: false // Show the tooltip when ready 5198 }, 5199 hide: 'mouseout', // Don't specify a hide event 5200 style: { 5201 border: { 5202 width: 1, 5203 radius: 5 5204 }, 5205 width: { 5206 min: 75, 5207 max : 1000 5208 }, 5209 padding: 5, 5210 textAlign: 'center', 5211 tip: true, // Give it a speech bubble tip with automatic corner detection 5212 name: 'blue' // Style it according to the preset 'cream' style 5213 } 5214 }); 5240 /* Anexa a mensagem especificada (por folder e id_msg) 5241 na mensagem sendo criada.*/ 5242 attach_message(folder_name, message_number); 5215 5243 } 5216 5244 });
Note: See TracChangeset
for help on using the changeset viewer.