Changeset 6358
- Timestamp:
- 05/31/12 09:30:20 (11 years ago)
- 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 254 254 var signal = "+"; 255 255 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(","); 258 263 for(aux=0; aux<emails_adicionados.length -1; aux++) { 259 264 if(emails_adicionados[aux].match(/<([^<]*)>[\s]*$/)){ … … 583 588 var nome = $(contact).clone().find('.name').text(); 584 589 var email = $(contact).clone().find('.email').text(); 585 586 590 if(email == get_lang("No mail")){ 587 591 alert(get_lang("It is not possible to add this contact as a recipient because it does not have email")); … … 590 594 return; 591 595 } 592 593 596 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+">"; 611 598 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")); 618 601 button.onclick = function(){ 619 602 remove_contact_field(document.getElementById(divs).innerHTML, button, divs); 620 603 }; 621 604 var div = document.getElementById(divs); 622 623 605 div.ondblclick = function(){ 624 606 remove_contact_field(div.innerHTML, button, divs); 625 607 }; 626 627 608 button.innerHTML = '<span class="ui-button-text" style="">x</span>'; 628 609 } … … 634 615 function remove_contact_field(contact, button, divs) { 635 616 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 664 627 button.onclick = function(){ 665 628 add_contact_field(document.getElementById(divs).innerHTML, button, divs); 666 629 }; 667 668 630 var div = document.getElementById(divs); 669 670 631 div.ondblclick = function(){ 671 632 add_contact_field(div.innerHTML, button, divs); 672 633 }; 673 674 content.find(field_).trigger("update");675 634 button.innerHTML = '<span class="ui-button-text" style="">+</span>'; 676 635 } -
sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js
r6335 r6358 3534 3534 //PEGA TODO O CONTEUDO E SETA COMO SE FOSSE O EMAIL 3535 3535 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())); 3538 3538 break; 3539 3539 //CORRIGI ERRO DE DIGITAÇÃO COMO ( huahua"<huhau@hauhau.com>) ou (hahahaha"huahua@email.com) ou ainda (hahahaha"huahua@ema il.com) … … 3563 3563 //EVENTO DOS INPUTS PARA - CC - CCO 3564 3564 function input_keydowns(input, ID){ 3565 var f9 = false; 3565 3566 input.keydown(function(e){ 3567 f9 = false; 3566 3568 var reEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$/; 3567 3569 var reEmail2 = /<([^<]*)>[\s]*$/; … … 3589 3591 //BUSCA COM A TECLA F9 3590 3592 if((e.keyCode) == 120){ 3593 f9 = true; 3591 3594 emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3592 3595 e.preventDefault(); … … 3661 3664 //AO SAIR DO FOCO MONTAGEM DA CAIXA DE EMAIL 3662 3665 .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); 3668 3685 }); 3669 3686 //SE FOR EDIÇÃO DE EMAILS RECALCULA O INPUT E SETA O FOCO … … 3673 3690 } 3674 3691 } 3675 3692 var input_search = ""; 3676 3693 //EVENTOS DA CAIXA 3677 3694 function box_actions(box){ … … 3694 3711 case $.ui.keyCode.HOME: 3695 3712 //SELECIONO A PRIMEIRA CAIXA 3713 e.preventDefault(); 3696 3714 $(this).parents(".email-area").find("div:first").focus(); 3697 3715 break; 3698 3716 case $.ui.keyCode.END: 3699 3717 //SELECIONO A ULTIMA CAIXA 3718 e.preventDefault(); 3700 3719 $(this).parents(".email-area").find("div:last").focus(); 3701 3720 break; … … 3746 3765 }).focusout(function(){ 3747 3766 $(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 } 3748 3778 }); 3749 3779 } … … 3769 3799 if(!$(e.target).parents(".email-area:first").length) 3770 3800 $(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 } 3771 3811 }); 3772 3812 … … 3832 3872 return false; 3833 3873 }, 3834 autoFocus: true 3874 autoFocus: true, 3875 open : function(){ 3876 if($(this).val() == "") 3877 $(this).autocomplete( "close" ) 3878 } 3835 3879 }) 3836 3880 … … 3867 3911 //FUNÇÃO DOS BOTÕES PARA - CC - CCO 3868 3912 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); 3870 3914 }); 3871 3915 } -
sandbox/2.4.1-3/expressoMail1_2/templates/default/main.css
r6335 r6358 1264 1264 background-color: #96B3D3; 1265 1265 border-radius: 5px; 1266 border: 1px solid black;1266 border: 1px solid #201b41; 1267 1267 display: inline-block; 1268 1268 cursor : pointer; … … 1273 1273 } 1274 1274 1275 1275 1276 .box span{ 1276 1277 font-family: Verdana, Arial, Helvetica, sans-serif; 1277 1278 font-size: 13px; 1279 color : #201b41; 1278 1280 outline : none; 1279 1281 } 1280 1282 1281 1283 .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; 1283 1290 } 1284 1291 … … 1325 1332 background: url(images/linha.png) repeat-x 0 96% ; 1326 1333 } 1334 1335 .box-draggable-hover{ 1336 border : 1px solid #474747; 1337 }
Note: See TracChangeset
for help on using the changeset viewer.