Changeset 6796 for sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
- Timestamp:
- 07/17/12 15:30:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
r6795 r6796 4534 4534 }, 4535 4535 add: function (e, data) { 4536 var jqXHR; 4536 4537 if(!maxAttachmentSize || data.files[0].size < maxAttachmentSize || is_ie) { 4537 4538 setTimeout(function() { 4538 4539 $('#attDisposition'+ID).val('attachment'); 4539 data.submit();4540 }, 3000);4540 jqXHR = data.submit(); 4541 }, 100); 4541 4542 } 4542 4543 fileUploadMSG.find(' .attachments-list').show(); … … 4562 4563 fileUploadMSG.find(' .attachments-list').hide(); 4563 4564 } 4565 if(jqXHR){ 4566 jqXHR.abort(); 4567 } 4564 4568 }); 4565 4569 … … 4593 4597 name: (typeof(attach.error) == 'boolean' ? 'light' : 'red') // Style it according to the preset 'cream' style 4594 4598 } 4595 }); 4599 })/*.progressbar({ 4600 value : 1 4601 })*/; 4602 4603 fileUploadMSG.find('.attachments-list .att-box:last').css('width', fileUploadMSG.find('.attachments-list .att-box:last div:first').css('width')); 4596 4604 4597 4605 if(!maxAttachmentSize || file.size < maxAttachmentSize){ … … 4652 4660 name: (attach.error == false ? 'blue' : 'red')// Style it according to the preset 'cream' style 4653 4661 } 4662 });/* 4663 fileUploadMSG.find(".att-box-loading:first").parents(".att-box").removeAttr("style").progressbar("destroy").find("div:first").removeAttr("style"); 4664 */ 4665 fileUploadMSG.find('.att-box-loading:first').remove(); 4666 }/*, 4667 progress : function(e, data){ 4668 var progress = parseInt(data.loaded / data.total * 100, 10); 4669 fileUploadMSG.find('.att-box-loading:first').parents(".att-box:first").progressbar({ 4670 value : progress 4654 4671 }); 4655 fileUploadMSG.find(' .att-box-loading:first').remove(); 4656 } 4672 }*/ 4657 4673 }).css({ 4658 4674 "height" : "20px", … … 4672 4688 close:function(event, ui) {event.stopPropagation();}, 4673 4689 autoOpen:false 4690 }); 4691 jQuery.getScript("../prototype/modules/attach_message/attach_message.js", function(){ 4692 jQuery('#message-attach-dialog').dialog('open'); 4693 jQuery('#message-attach-attach-btn').unbind('click'); 4694 jQuery('#message-attach-attach-btn').click(function(event){ 4695 jQuery.each(selectedMessages, function(folder_name, messages) { 4696 jQuery.each(selectedMessages[folder_name], function(message_number, message) { 4697 if (message) { 4698 fileUploadMSG.find(' .attachments-list').show(); 4699 var att = new Object(); 4700 att.folder = folder_name; 4701 att.uid = message_number; 4702 att.type = 'imapMSG'; 4703 att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml'); 4704 var idATT = JSON.stringify(att); 4705 addAttachment( ID , idATT); 4706 var attach = {}; 4707 attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 4708 attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 4709 if(attach.fileName.length > 20) 4710 attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length); 4711 4712 attach.error = false; 4713 attach.OK = true; 4714 attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size); 4715 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4716 upload.find('.att-box-loading').remove(); 4717 upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>'); 4718 4719 upload.find('.att-box-delete').click(function(){ 4720 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4721 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 4722 delAttachment(ID,idAttach); 4723 $(this).parent().qtip("destroy"); 4724 $(this).parent().remove(); 4725 if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){ 4726 fileUploadMSG.find(' .attachments-list').hide(); 4727 } 4728 }); 4729 4730 fileUploadMSG.find('.attachments-list').append(upload); 4731 4732 upload.find('.att-box-loading').remove(); 4733 4734 fileUploadMSG.find('.attachments-list .att-box:last').qtip({ 4735 content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}), 4736 position: { 4737 corner: { 4738 tooltip: 'bottomMiddle', 4739 target: 'topMiddle' 4740 }, 4741 adjust: { 4742 resize: true, 4743 scroll: true 4744 } 4745 }, 4746 show: { 4747 when: 'mouseover', // Don't specify a show event 4748 ready: false // Show the tooltip when ready 4749 }, 4750 hide: 'mouseout', // Don't specify a hide event 4751 style: { 4752 border: { 4753 width: 1, 4754 radius: 5 4755 }, 4756 padding: 5, 4757 textAlign: 'center', 4758 tip: true, // Give it a speech bubble tip with automatic corner detection 4759 name: 'blue' // Style it according to the preset 'cream' style 4760 } 4761 }); 4762 } 4763 }); 4764 }); 4765 jQuery('#message-attach-dialog').dialog('close'); 4674 4766 }); 4675 4676 4677 jQuery.getScript("../prototype/modules/attach_message/attach_message.js", function(){ 4678 jQuery('#message-attach-dialog').dialog('open'); 4679 jQuery('#message-attach-attach-btn').unbind('click'); 4680 jQuery('#message-attach-attach-btn').click(function(event){ 4681 jQuery.each(selectedMessages, function(folder_name, messages) { 4682 jQuery.each(selectedMessages[folder_name], function(message_number, message) { 4683 if (message) { 4684 fileUploadMSG.find(' .attachments-list').show(); 4685 var att = new Object(); 4686 att.folder = folder_name; 4687 att.uid = message_number; 4688 att.type = 'imapMSG'; 4689 att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml'); 4690 var idATT = JSON.stringify(att); 4691 addAttachment( ID , idATT); 4692 var attach = {}; 4693 attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 4694 attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml'; 4695 if(attach.fileName.length > 20) 4696 attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length); 4697 4698 attach.error = false; 4699 attach.OK = true; 4700 attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size); 4701 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4702 upload.find('.att-box-loading').remove(); 4703 upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>'); 4704 4705 upload.find('.att-box-delete').click(function(){ 4706 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4707 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 4708 delAttachment(ID,idAttach); 4709 $(this).parent().qtip("destroy"); 4710 $(this).parent().remove(); 4711 if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){ 4712 fileUploadMSG.find(' .attachments-list').hide(); 4713 } 4714 }); 4715 4716 fileUploadMSG.find('.attachments-list').append(upload); 4717 4718 upload.find('.att-box-loading').remove(); 4719 4720 fileUploadMSG.find('.attachments-list .att-box:last').qtip({ 4721 content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}), 4722 position: { 4723 corner: { 4724 tooltip: 'bottomMiddle', 4725 target: 'topMiddle' 4726 }, 4727 adjust: { 4728 resize: true, 4729 scroll: true 4730 } 4731 }, 4732 show: { 4733 when: 'mouseover', // Don't specify a show event 4734 ready: false // Show the tooltip when ready 4735 }, 4736 hide: 'mouseout', // Don't specify a hide event 4737 style: { 4738 border: { 4739 width: 1, 4740 radius: 5 4741 }, 4742 padding: 5, 4743 textAlign: 'center', 4744 tip: true, // Give it a speech bubble tip with automatic corner detection 4745 name: 'blue' // Style it according to the preset 'cream' style 4746 } 4747 }); 4748 } 4749 }); 4750 }); 4751 4752 jQuery('#message-attach-dialog').dialog('close'); 4753 4754 }); 4755 jQuery('#message-attach-cancel-btn').click(function(event){ 4756 jQuery('#message-attach-dialog').dialog('close'); 4757 }); 4758 }); 4767 jQuery('#message-attach-cancel-btn').click(function(event){ 4768 jQuery('#message-attach-dialog').dialog('close'); 4769 }); 4770 }); 4759 4771 }); 4760 4772 $(document).bind('drop dragover', function (e) {
Note: See TracChangeset
for help on using the changeset viewer.