Changeset 6358 for sandbox/2.4.1-3


Ignore:
Timestamp:
05/31/12 09:30:20 (12 years ago)
Author:
gustavo
Message:

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

Location:
sandbox/2.4.1-3/expressoMail1_2
Files:
3 edited

Legend:

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

    r5911 r6358  
    254254                        var signal = "+"; 
    255255                        var btnClass = "add"; 
    256                         var emailList = content.find(field_).val(); 
    257                         var emails_adicionados = emailList.split(","); 
     256                        emails_adicionados = ""; 
     257                        var emailList = content.find(field_).filter("input").parent().find("div input"); 
     258                        //      var array = content.find(".to-tr").find(".box"); 
     259                        $.each(emailList, function(index, value){ 
     260                                emails_adicionados += $(value).val() + ","; 
     261                        }); 
     262                        emails_adicionados = emails_adicionados.split(","); 
    258263                        for(aux=0; aux<emails_adicionados.length -1; aux++) { 
    259264                                if(emails_adicionados[aux].match(/<([^<]*)>[\s]*$/)){ 
     
    583588                var nome = $(contact).clone().find('.name').text(); 
    584589                var email = $(contact).clone().find('.email').text(); 
    585                  
    586590                if(email == get_lang("No mail")){ 
    587591                        alert(get_lang("It is not possible to add this contact as a recipient because it does not have email")); 
     
    590594                        return; 
    591595                } 
    592                  
    593596                verifyEmails(email, divs); 
    594                  
    595                 final_contact = "\""+nome +"\" <"+email+">, "; 
    596                  
    597                 var emailList      = content.find(field_).val(); 
    598                 //remove os caracteres da busca 
    599                 emailList = emailList.substr(0,emailList.lastIndexOf(',')+1);  
    600                  
    601         if (emailList[0] != '"' && emailList.indexOf(",") < 0) 
    602                         emailList = emailList.substr(end_); 
    603         if(emailList.lastIndexOf(",") > 0){ 
    604                 if(emailList.substr(emailList.length-1, emailList.length) == "," || emailList.substr(emailList.length-2, 1) == ","){ 
    605                         emailList = emailList.substr(0, emailList.lastIndexOf(",") + 1); 
    606                 } else { 
    607                         emailList = emailList.substr(0, emailList.lastIndexOf("") + 1);          
    608                         final_contact = ","+final_contact; 
    609                 } 
    610         } 
     597                final_contact = "\""+nome +"\" <"+email+">"; 
    611598 
    612                 final_contact = final_contact.replace(/\/n/, ""); 
    613                 new_emailList = emailList + final_contact;     
    614         content.find(field_).val(new_emailList); 
    615                  
    616                 content.find(field_).trigger("update"); 
    617                  
     599                final_contact = final_contact.replace(/\/n/, "");   
     600                draw_email_box(final_contact, $(field_).filter("input")); 
    618601                button.onclick = function(){ 
    619602                        remove_contact_field(document.getElementById(divs).innerHTML, button, divs); 
    620603                }; 
    621604                var div = document.getElementById(divs); 
    622                  
    623605                div.ondblclick = function(){ 
    624606                        remove_contact_field(div.innerHTML, button, divs); 
    625607                }; 
    626                  
    627608                button.innerHTML = '<span class="ui-button-text" style="">x</span>'; 
    628609    } 
     
    634615        function remove_contact_field(contact, button, divs) { 
    635616                var email = $(contact).clone().find('.email').text(); 
    636                 var exist = false; 
    637                  
    638                 var emailList = content.find(field_).val(); 
    639                 var emails_adicionados = emailList.split(","); 
    640                  
    641                 verifyEmails(email, divs); 
    642                  
    643                 for(i=0; i<emails_adicionados.length -1; i++) { 
    644  
    645                         if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)){ 
    646                                 if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) { 
    647                                         emails_adicionados[i] = "%"; 
    648                                         exist = true; 
    649                                 } 
    650                         }else{ 
    651                                 if(emails_adicionados[i].toLowerCase() == email.toLowerCase()) { 
    652                                         emails_adicionados[i] = "%"; 
    653                                         exist = true; 
    654                                 } 
    655                         } 
    656                 } 
    657                  
    658                 if (exist == false)  
    659                         return false; 
    660                 var novos_contatos = emails_adicionados.join(",");   
    661                 novos_contatos = novos_contatos.replace(/%,/g, ""); 
    662                 content.find(field_).val(novos_contatos); 
    663                  
     617                var array = content.find(field_).parent().find("div input"); 
     618                $.each(array, function(index, value){ 
     619                        var validated_email = $(value).val(); 
     620                        if(validated_email.match(/<([^<]*)>[\s]*$/)){ 
     621                                if(validated_email.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) { 
     622                                        $(value).parent().remove(); 
     623                                } 
     624                        } 
     625                }); 
     626         
    664627                button.onclick = function(){ 
    665628                        add_contact_field(document.getElementById(divs).innerHTML, button, divs); 
    666629                }; 
    667                  
    668630                var div = document.getElementById(divs); 
    669                  
    670631                div.ondblclick = function(){ 
    671632                        add_contact_field(div.innerHTML, button, divs); 
    672633                }; 
    673                  
    674                 content.find(field_).trigger("update"); 
    675634                button.innerHTML = '<span class="ui-button-text" style="">+</span>'; 
    676635        } 
  • sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js

    r6335 r6358  
    35343534                //PEGA TODO O CONTEUDO E SETA COMO SE FOSSE O EMAIL 
    35353535                case 1: 
    3536                         ContactBox.email = email; 
    3537                         ContactBox.valid = reSimpleEmail.test(email.toLowerCase()); 
     3536                        ContactBox.email = $.trim(email); 
     3537                        ContactBox.valid = reSimpleEmail.test($.trim(email.toLowerCase())); 
    35383538                        break; 
    35393539                //CORRIGI ERRO DE DIGITAÇÃO COMO ( huahua"<huhau@hauhau.com>) ou (hahahaha"huahua@email.com) ou ainda (hahahaha"huahua@ema  il.com) 
     
    35633563//EVENTO DOS INPUTS PARA - CC - CCO 
    35643564function input_keydowns(input, ID){ 
     3565        var f9 = false; 
    35653566        input.keydown(function(e){ 
     3567                f9 = false; 
    35663568                var reEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$/; 
    35673569                var reEmail2 = /<([^<]*)>[\s]*$/; 
     
    35893591                //BUSCA COM A TECLA F9 
    35903592                if((e.keyCode) == 120){ 
     3593                        f9 = true; 
    35913594                        emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 
    35923595                        e.preventDefault(); 
     
    36613664        //AO SAIR DO FOCO MONTAGEM DA CAIXA DE EMAIL 
    36623665        .focusout(function(){ 
    3663                 if($(input).val() != "") 
    3664                         draw_email_box(input.val(), input); 
    3665                 if(input.hasClass("box-input")) 
    3666                         input.remove(); 
    3667                 input.val(""); 
     3666                if(!($(this).parents("tr:first").find("button").hasClass("ui-state-active") || f9 || $(".expressomail-qs-container").dialog("isOpen"))){ 
     3667                        if($(input).val() != "") 
     3668                                draw_email_box(input.val(), input); 
     3669                        if(input.hasClass("box-input")) 
     3670                                input.remove(); 
     3671                } 
     3672                input_search = $(input).val(); 
     3673                $(input).val(""); 
     3674        }).bind("paste", function(e){ 
     3675                $(this).trigger("keydown"); 
     3676                var pthis = $(this); 
     3677                setTimeout(function() { 
     3678                        var str = pthis.val().replace(/[,;\t\n]/gi, ","); 
     3679                        str = str.split(","); 
     3680                        $.each(str, function(index, value){ 
     3681                                draw_email_box(value, pthis); 
     3682                        }); 
     3683                        pthis.val(""); 
     3684                }, 50); 
    36683685        }); 
    36693686        //SE FOR EDIÇÃO DE EMAILS RECALCULA O INPUT E SETA O FOCO 
     
    36733690        } 
    36743691} 
    3675  
     3692var input_search = ""; 
    36763693//EVENTOS DA CAIXA 
    36773694function box_actions(box){ 
     
    36943711                        case $.ui.keyCode.HOME: 
    36953712                                //SELECIONO A PRIMEIRA CAIXA 
     3713                                e.preventDefault(); 
    36963714                                $(this).parents(".email-area").find("div:first").focus(); 
    36973715                                break; 
    36983716                        case $.ui.keyCode.END: 
    36993717                                //SELECIONO A ULTIMA CAIXA 
     3718                                e.preventDefault(); 
    37003719                                $(this).parents(".email-area").find("div:last").focus(); 
    37013720                                break; 
     
    37463765        }).focusout(function(){ 
    37473766                $(this).removeClass("box-selected"); 
     3767        }).draggable({ 
     3768                revert: 'invalid', 
     3769                helper : 'clone', 
     3770                stack: "body", 
     3771                containment : ".new-msg-head-data", 
     3772                start: function(e, ui){ 
     3773                        $(this).parent().droppable( "disable" ); 
     3774                }, 
     3775                stop : function(e, ui){ 
     3776                        $(this).parent().droppable( "enable" ); 
     3777                } 
    37483778        }); 
    37493779} 
     
    37693799                if(!$(e.target).parents(".email-area:first").length) 
    37703800                        $(this).find("div").removeClass("box-selected"); 
     3801        }).droppable({ 
     3802                hoverClass: "box-draggable-hover", 
     3803                accept : ".box", 
     3804                drop : function(e, ui){ 
     3805                        ui.draggable.parent().droppable( "enable" ); 
     3806                        var haha = ui.draggable.clone(); 
     3807                        box_actions(haha) 
     3808                        $(this).prepend(haha); 
     3809                        ui.draggable.remove(); 
     3810                } 
    37713811        }); 
    37723812         
     
    38323872                                return false; 
    38333873                        }, 
    3834                         autoFocus: true 
     3874                        autoFocus: true, 
     3875                        open : function(){ 
     3876                                if($(this).val() == "") 
     3877                                        $(this).autocomplete( "close" ) 
     3878                        } 
    38353879                }) 
    38363880                 
     
    38673911        //FUNÇÃO DOS BOTÕES PARA - CC - CCO 
    38683912        div.parents("tr:first").find("button").button().click(function(){ 
    3869                 emQuickSearch($(this).parents("tr:first").find("input").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 
     3913                emQuickSearch(($(this).parents("tr:first").find("input").val() ? $(this).parents("tr:first").find("input").val() : input_search), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 
    38703914        }); 
    38713915} 
  • sandbox/2.4.1-3/expressoMail1_2/templates/default/main.css

    r6335 r6358  
    12641264        background-color: #96B3D3; 
    12651265        border-radius: 5px; 
    1266         border: 1px solid black;  
     1266        border: 1px solid #201b41;  
    12671267        display: inline-block; 
    12681268        cursor : pointer; 
     
    12731273} 
    12741274 
     1275 
    12751276.box span{ 
    12761277        font-family: Verdana, Arial, Helvetica, sans-serif; 
    12771278        font-size: 13px; 
     1279        color : #201b41; 
    12781280        outline : none; 
    12791281} 
    12801282 
    12811283.invalid-email-box{ 
    1282         background-color: red; 
     1284        background-color: #F08080; 
     1285        border : 1px solid #540303 !important; 
     1286} 
     1287 
     1288.invalid-email-box span{ 
     1289        color: #540303; 
    12831290} 
    12841291 
     
    13251332        background: url(images/linha.png) repeat-x 0 96% ; 
    13261333} 
     1334 
     1335.box-draggable-hover{ 
     1336        border : 1px solid #474747; 
     1337} 
Note: See TracChangeset for help on using the changeset viewer.