Changeset 6358 for sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js
- Timestamp:
- 05/31/12 09:30:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.