Ignore:
Timestamp:
06/04/12 15:49:25 (12 years ago)
Author:
gustavo
Message:

Ticket #2768 - Melhorias na criação de mensagens

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.1-3/expressoMail1_2/js/main.js

    r6405 r6406  
    16271627                        RichTextEditor.replyController = true; //Seta o editor como modo reply 
    16281628                        content.find('[name="input_to"]').val(data.to);                  
    1629                         array = data.to.split(","); 
    1630                         $.each(array, function(index, value){ 
    1631                                 draw_email_box(value, content.find(".to").filter("input")); 
    1632                         }); 
     1629                         
     1630                        draw_reply_boxes_by_field("to", data.to, content); 
    16331631                         
    16341632                        title = "Re: " + html_entities(data.subject); 
     
    16481646                        content.find(".subject").val("Re: " + data.subject); 
    16491647                        content.find('[name="input_to"]').val(data.to); 
    1650                         array = data.to.split(","); 
    1651                         $.each(array, function(index, value){ 
    1652                                 draw_email_box(value, content.find(".to").filter("input")); 
    1653                         }); 
     1648                         
     1649                        draw_reply_boxes_by_field("to", data.to, content); 
     1650                         
    16541651                        content.find('[name="msg_reply_from"]').val($("#msg_number_" + border_ID).val());        
    16551652 
     
    16831680                                content.find('[name="input_to"]').val(data.to + ',' + data.to_all); 
    16841681                         
    1685                         array = data.to_all.split(","); 
    1686                         $.each(array, function(index, value){ 
    1687                                 draw_email_box(value, content.find(".to").filter("input")); 
    1688                         }); 
     1682                        draw_reply_boxes_by_field("to", data.to_all, content); 
    16891683                         
    16901684                        if (data.cc){ 
     
    16981692                                if(data.cc != ""){ 
    16991693                                        content.find('[name="input_cc"]').val(data.cc); 
    1700                                         input_binds(content.find('[name="input_cc"]'), new_border_ID); 
     1694                                        input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 
    17011695                                        content.find(".cc-tr").show();//cc-button 
    17021696                                        //document.getElementById("a_cc_link" + new_border_ID).value = data.cc; 
    17031697                                        content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 
    17041698                                        content.find(".cc-button").find("span").html("Remover CC"); 
    1705                                         array = data.cc.split(","); 
    1706                                         $.each(array, function(index, value){ 
    1707                                                 draw_email_box(value, content.find(".cc").filter("input")); 
    1708                                         }); 
     1699                                        draw_reply_boxes_by_field("cc", data.cc, content); 
    17091700                                } 
    17101701                        } 
     
    17291720                                data.to_all = ""; 
    17301721 
    1731                         array = data.to_all.split(","); 
    1732                         $.each(array, function(index, value){ 
    1733                                 draw_email_box(value, content.find(".to").filter("input")); 
    1734                         }); 
     1722                        draw_reply_boxes_by_field("to", data.to_all, content); 
    17351723                         
    17361724                        title = "Re: " + html_entities(data.subject); 
     
    17501738                                if(data.cc != ""){ 
    17511739                                        content.find('[name="input_cc"]').val(data.cc); 
    1752                                         input_binds(content.find('[name="input_cc"]'), new_border_ID); 
     1740                                        input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 
    17531741                                        content.find(".cc-tr").show(); 
    17541742                                        content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 
    17551743                                        content.find(".cc-button").find("span").html("Remover CC"); 
    17561744                                         
    1757                                         array = data.cc.split(","); 
    1758                                         $.each(array, function(index, value){ 
    1759                                                 draw_email_box(value, content.find(".cc").filter("input")); 
    1760                                         }); 
     1745                                        draw_reply_boxes_by_field("cc", data.cc, content); 
    17611746                                } 
    17621747                        } 
     
    18391824                        } 
    18401825 
    1841                         array = data.to.split(","); 
    1842                         $.each(array, function(index, value){ 
    1843                                 draw_email_box(value, content.find(".to").filter("input")); 
    1844                         }); 
     1826                        draw_reply_boxes_by_field("to", data.to, content); 
    18451827                         
    18461828                        content.find('[name="input_to"]').val(data.to); 
     
    18491831                                data.cc = data.cc.replace(/>/gi,">"); 
    18501832                                content.find('[name="input_cc"]').val(data.cc); 
    1851                                 input_binds(content.find('[name="input_cc"]'), new_border_ID); 
     1833                                input_binds(content.find('[name="input_cc"]').parent(), new_border_ID); 
    18521834                                content.find(".cc-tr").show(); 
    18531835                                content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 
    18541836                                content.find(".cc-button").find("span").html(get_lang('Remove CC')); 
    1855                                 array = data.cc.split(","); 
    1856                                 $.each(array, function(index, value){ 
    1857                                         draw_email_box(value, content.find(".cc").filter("input")); 
    1858                                 }); 
     1837                                draw_reply_boxes_by_field("cc", data.cc, content); 
    18591838                        } 
    18601839                        if (data.cco){ 
     
    18641843                                        content.find(".cco-button").toggleClass("expressomail-button-icon-ative"); 
    18651844                                        content.find(".cco-button").find("span").html(get_lang('Remove CCo')); 
    1866                                         array = data.cco.split(","); 
    1867                                         $.each(array, function(index, value){ 
    1868                                                 draw_email_box(value, content.find(".cco").filter("input")); 
    1869                                         }); 
     1845                                        input_binds(content.find('[name="input_cco"]').parent(), new_border_ID); 
     1846                                        draw_reply_boxes_by_field("cco", data.cco, content); 
    18701847                                } 
    18711848                        } 
     
    19071884        resizeWindow(); 
    19081885        return new_border_ID; //Preciso retornar o ID da nova mensagem. 
     1886} 
     1887 
     1888//DESENHA OS RETANGULOS PARA OS E-MAIL NA OPÇÃO REPLY 
     1889function draw_reply_boxes_by_field(field, value, context){ 
     1890        array = value.split(","); 
     1891        $.each(array, function(index, value){ 
     1892                draw_email_box(value, context.find("."+field).filter("input")); 
     1893        }); 
    19091894} 
    19101895 
Note: See TracChangeset for help on using the changeset viewer.