Changeset 6276 for sandbox/2.4.1-3
- Timestamp:
- 05/23/12 10:24:51 (12 years ago)
- Location:
- sandbox/2.4.1-3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js
r6232 r6276 3500 3500 } 3501 3501 3502 function draw_email_box(name, email, valid, parent){ 3503 var edit = parent.clone(); 3504 edit.css("display","none"); 3505 edit.removeClass("email-text"); 3506 DataLayer.render("../prototype/modules/mail/templates/emailBox.ejs", {valid : valid, value : (name? name : email)}, function(html){ 3507 parent.before(html); 3508 parent.parent().find("div:last").click(function(){ 3509 $(".email-area div").removeClass("box-selected"); 3510 $(this).addClass("box-selected"); 3511 }).append(edit); 3512 }); 3513 } 3514 3502 3515 function input_binds(input, ID){ 3516 3517 input.click(function(e){ 3518 if(e.target == $(this)[0]){ 3519 $(this).find("div").removeClass("box-selected"); 3520 } 3521 $(this).find(".email-text").focus(); 3522 }).focusout(function(){ 3523 $(this).find("div").removeClass("box-selected"); 3524 }); 3503 3525 var mySource = new Array(); 3504 3526 var myArray = contacts.split(","); … … 3510 3532 mySource.push({name : "", email: teste[0], value :teste[0]}); 3511 3533 } 3512 input.bind( "keydown", function( event ) { 3513 if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { 3514 event.preventDefault(); 3515 } 3516 if((event.keyCode) == 120){ 3534 input.find("input").bind( "keydown", function( e ) { 3535 input_text = $(e.target); 3536 if(parseInt(preferences.use_dynamic_contacts)){ 3537 if ( e.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { 3538 e.preventDefault(); 3539 } 3540 if( (e.keyCode == 27) && $( this ).data( "autocomplete" ).menu.active ){ 3541 e.stopPropagation(); 3542 e.preventDefault(); 3543 } 3544 } 3545 3546 if((e.keyCode) == 120){ 3517 3547 emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3518 }else if( (event.keyCode == 27) && $( this ).data( "autocomplete" ).menu.active ){ 3519 event.stopPropagation(); 3520 event.preventDefault(); 3521 } 3522 }).autocomplete({ 3523 minLength: 0, 3524 source: function( request, response ) { 3525 response( $.ui.autocomplete.filter( 3526 mySource, extractLast( request.term ) ) ); 3527 }, 3528 focus: function() { 3548 e.preventDefault(); 3529 3549 return false; 3530 }, 3531 select: function( event, ui ) { 3532 var terms = mySplit( this.value ); 3533 terms.pop(); 3534 terms.push( (ui.item.name != "" ? "\""+ui.item.name+"\" " : "") + (ui.item.email ? "<"+ui.item.email+">" : "")); 3535 terms.push( "" ); 3536 this.value = terms.join( ", " ); 3537 return false; 3538 }, 3539 autoFocus: true 3540 }).data( "autocomplete" )._renderItem = function( ul, item ) { 3541 ul.css({"max-height" : "115px", "overflow-y" : "auto"}); 3542 if( $(ul).find("li").length > 10 ){ 3550 } 3551 var reEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$/; 3552 var reEmail2 = /<([^<]*)>[\s]*$/; 3553 3554 if(e.keyCode == 13 || e.keyCode == 9 || (e.keyCode == 188 && !e.shiftKey) || (e.keyCode == 191 && !e.shiftKey) ){ 3555 if(input_text.val() != ""){ 3556 if(e.keyCode != 9) 3557 e.preventDefault(); 3558 draw_email_box(undefined, input_text.val(), reEmail.test(input_text.val()), $(this)); 3559 } 3560 input_text.val(""); 3561 } 3562 3563 if(e.keyCode == 32){ 3564 if(!input_text.val().length){ 3565 e.preventDefault(); 3566 return; 3567 }else{ 3568 var texto = input_text.val(); 3569 texto = texto.substring(0, getPosition(input_text[0])); 3570 if(texto.split('"').length-1 == 0){ 3571 if(input_text.val().split('"').length-1 == 0){ 3572 e.preventDefault(); 3573 draw_email_box(undefined, input_text.val(), reEmail.test(input_text.val()), $(this)); 3574 input_text.val(""); 3575 return; 3576 } 3577 } 3578 } 3579 } 3580 3581 if(e.keyCode == 190 && e.shiftKey && input_text.val().length == getPosition(input_text[0])){ 3582 var oi = input_text.val().split('"'); 3583 input_text.val(input_text.val()+">"); 3584 if(oi.length == 2){ 3585 if(oi[0].length == 0){ 3586 draw_email_box(undefined, oi[1], reEmail.test(oi[1]), $(this)); 3587 }else{ 3588 draw_email_box(oi[0], oi[1]+">", (reEmail.test(((oi[1]+">").match(/<([^<]*)>[\s]*$/)[1]))), $(this)); 3589 } 3590 }else if(oi.length == 3){ 3591 oi.shift(); 3592 if(oi[0].length == 0){ 3593 draw_email_box(undefined, oi[1], reEmail.test(oi[1]), $(this)); 3594 }else{ 3595 draw_email_box(oi[0], oi[1]+">", (reEmail.test(((oi[1]+">").match(/<([^<]*)>[\s]*$/)[1]))), $(this)); 3596 } 3597 }else{ 3598 draw_email_box(oi[oi.length-2], oi[oi.length-1]+">", (reEmail.test(((oi[oi.length-1]+">").match(/<([^<]*)>[\s]*$/)[1]))), $(this)); 3599 } 3600 e.preventDefault(); 3601 input_text.val(""); 3602 } 3603 3604 setTimeout(function(){ 3605 input_text.css("width", 15+(input_text.val().length * 8)); 3606 input.scrollTo(":last"); 3607 }, 100); 3608 }); 3609 input.keydown(function(e){ 3610 if($(this).find("div").length == 0 || $(this).find(".email-text").val().length) 3543 3611 return; 3544 } 3545 return $( "<li></li>" ) 3546 .data( "item.autocomplete", item ) 3547 .append( "<a>" + item.name + " - " + item.email + "</a>" ) 3548 .appendTo( ul ); 3549 }; 3612 if(e.keyCode == 37){ 3613 if($(this).find(".box-selected").length){ 3614 $(this).find(".box-selected").prev().trigger("click"); 3615 }else if($(this).find("div").length && !($(".email-text").val().length)){ 3616 $(this).find("div:last").trigger("click"); 3617 } 3618 }else if (e.keyCode == 39){ 3619 if($(this).find(".box-selected").length){ 3620 if($(this).find(".box-selected").next().hasClass("email-text")) 3621 $(this).find(".box-selected").removeClass("box-selected"); 3622 else 3623 $(this).find(".box-selected").next().trigger("click"); 3624 } 3625 }else if(e.keyCode == 36){ 3626 if($(this).find("div").length){ 3627 $(this).find("div:first").trigger("click"); 3628 } 3629 }else if(e.keyCode == 35){ 3630 if($(this).find("div").length){ 3631 $(this).find("div:last").trigger("click"); 3632 } 3633 }else if(e.keyCode == 46){ 3634 if($(this).find(".box-selected").next().hasClass("email-box")){ 3635 var oi = $(this).find(".box-selected").next(); 3636 } 3637 $(this).find(".box-selected").remove(); 3638 oi.addClass("box-selected"); 3639 }else if(e.keyCode == 8){ 3640 if($(this).find(".box-selected").length){ 3641 if($(this).find(".box-selected").prev().hasClass("email-box")){ 3642 var oi = $(this).find(".box-selected").prev(); 3643 } 3644 $(this).find(".box-selected").remove(); 3645 oi.addClass("box-selected"); 3646 }else if($(this).find("div").length){ 3647 $(this).find("div:last").trigger("click"); 3648 } 3649 } 3650 }); 3651 if(parseInt(preferences.use_dynamic_contacts)){ 3652 input.find("input").autocomplete({ 3653 minLength: 0, 3654 source: function( request, response ) { 3655 response( $.ui.autocomplete.filter( 3656 mySource, extractLast( request.term ) ) ); 3657 }, 3658 focus: function() { 3659 return false; 3660 }, 3661 select: function( event, ui ) { 3662 var terms = mySplit( this.value ); 3663 terms.pop(); 3664 terms.push( (ui.item.name != "" ? "\""+ui.item.name+"\" " : "") + (ui.item.email ? "<"+ui.item.email+">" : "")); 3665 terms.push( "" ); 3666 this.value = terms.join( ", " ); 3667 return false; 3668 }, 3669 autoFocus: true 3670 }).data( "autocomplete" )._renderItem = function( ul, item ) { 3671 ul.css({"max-height" : "115px", "overflow-y" : "auto"}); 3672 if( $(ul).find("li").length > 10 ){ 3673 return; 3674 } 3675 return $( "<li></li>" ) 3676 .data( "item.autocomplete", item ) 3677 .append( "<a>" + item.name + " - " + item.email + "</a>" ) 3678 .appendTo( ul ); 3679 }; 3680 } 3550 3681 input.parents("tr:first").find("button").button().click(function(){ 3551 emQuickSearch($(this).parents("tr:first").find(" textarea").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true);3682 emQuickSearch($(this).parents("tr:first").find("input").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3552 3683 }); 3553 3684 } … … 3603 3734 button.toggleClass("expressomail-button-icon-ative"); 3604 3735 field.toggle(); 3605 field.find("textarea").val("").focus(); 3606 if(!field.find("textarea").hasClass("elastic")){ 3607 field.find("textarea").css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("elastic").elastic().unbind('blur'); 3608 input_binds(field.find("textarea"), ID); 3736 field.find("textarea").val("").parent().find("input").focus(); 3737 field.find(".email-area div").remove(); 3738 if(!field.find("textarea").hasClass("track")){ 3739 field.find("textarea").css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("track"); 3740 input_binds(field.find(".email-area"), ID); 3609 3741 } 3610 3742 } 3611 3743 3612 input_binds(content.find('[name="input_ to"]').css({"max-height" : "115px", "overflow-y" : "auto"}).addClass("elastic").elastic().unbind('blur').focus(), ID);3744 input_binds(content.find('[name="input_aux_to"]').css("max-width" , parseInt($(".email-area").css("width"))-5).focus().parent().css({"max-height" : "115px", "overflow-y" : "auto"}), ID); 3613 3745 3614 3746 //Botão TextoRico/TextoSimples -
sandbox/2.4.1-3/expressoMail1_2/js/main.js
r6199 r6276 2391 2391 return; 2392 2392 } 2393 stringEmail = content.find('[name="input_to"]').val(); 2394 2395 if ( content.find('[name="input_cco"]').length) 2396 if(content.find(".cco-tr").css("display") != "none") 2397 stringEmail += content.find('[name="input_cco"]').val() =='' ? "":", "+content.find('[name="input_cco"]').val(); 2393 //stringEmail = content.find('[name="input_to"]').val(); 2394 var stringEmail = ""; 2395 var array = content.find(".to-tr").find(".email-box"); 2396 $.each(array, function(index, value){ 2397 stringEmail += $(value).find("input").val() + ","; 2398 }); 2399 content.find('[name="input_to"]').val(stringEmail); 2400 if ( content.find('[name="input_cco"]').length){ 2401 if(content.find(".cco-tr").css("display") != "none"){ 2402 var array = content.find(".cco-tr").find(".email-box"); 2403 $.each(array, function(index, value){ 2404 stringEmail += $(value).find("input").val() + ","; 2405 }); 2406 content.find('[name="input_cco"]').val(stringEmail); 2407 } 2408 } 2398 2409 2399 2410 if(content.find(".cc-tr").css("display") != "none") 2400 stringEmail += content.find('[name="input_cc"]').val() =='' ? "":", "+content.find('[name="input_cc"]').val(); 2411 { 2412 var array = content.find(".cc-tr").find(".email-box"); 2413 $.each(array, function(index, value){ 2414 stringEmail += $(value).find("input").val() + ","; 2415 }); 2416 content.find('[name="input_cc"]').val(stringEmail); 2417 } 2401 2418 2402 2419 if (expresso_offline) { -
sandbox/2.4.1-3/expressoMail1_2/templates/default/main.css
r6233 r6276 1255 1255 } 1256 1256 1257 1257 1258 button.expressomail-button-icon-ative{color:#E17009 !important; border: 1px solid #E17009 !important;background: none repeat scroll 0 0 #FFE1CC !important;} 1259 1260 .email-box{ 1261 background-color: #96B3D3; 1262 border-radius: 5px; 1263 border: 1px solid black; 1264 display: inline-block; 1265 cursor : pointer; 1266 margin-top : 1px; 1267 margin-right: 1px; 1268 } 1269 1270 .invalid-email-box{ 1271 background-color: red; 1272 } 1273 1274 .email-area{ 1275 border-radius: 5px; 1276 width: 98.5%; 1277 padding: 5px; 1278 border : 1px solid #BBBBBB; 1279 heigth : auto; 1280 max-height : 115px; 1281 overflow-y: auto; 1282 } 1283 .email-text{ 1284 outline:none; 1285 width:15px; 1286 border : none; 1287 } 1288 1289 .box-selected{ 1290 background-color : #BBBBBB; 1291 } 1292 1293 .hidden { 1294 display : none; 1295 } 1296 1297 .loading { 1298 background: url(../../../prototype/modules/mail/img/loader.gif) !important; 1299 background-position: 0 0 !important; 1300 background-repeat : no-repeat !important; 1301 } -
sandbox/2.4.1-3/prototype/modules/mail/templates/new_message.ejs
r6220 r6276 61 61 </td> 62 62 <td class="value" style="width: 100%;"> 63 <textarea class="new-message-input to" name="input_to" style="width:99%; resize: none;"></textarea> 63 <div class="email-area"> 64 <input class="new-message-input to email-text" name="input_aux_to" type="text" value="" autocomplete="off"/> 65 </div> 66 <textarea class="new-message-input to" name="input_to" style="width:99%; resize: none;display : none;"></textarea> 64 67 </td> 65 68 </tr> … … 71 74 </td> 72 75 <td class="value"> 73 <textarea class="new-message-input cc" name="input_cc" style="width:99%; resize: none;"></textarea> 76 <div class="email-area"> 77 <input class="new-message-input cc email-text" name="input_aux_cc" type="text" value="" autocomplete="off"/> 78 </div> 79 <textarea class="new-message-input cc" name="input_cc" style="width:99%; resize: none;display : none;"></textarea> 74 80 </td> 75 81 </tr> … … 81 87 </td> 82 88 <td class="value"> 83 <textarea class="new-message-input cco" name="input_cco" style="width:99%; resize: none;"></textarea> 89 <div class="email-area"> 90 <input class="new-message-input cco email-text" name="input_aux_cco" type="text" value="" autocomplete="off"/> 91 </div> 92 <textarea class="new-message-input cco" name="input_cco" style="width:99%; resize: none;display : none;"></textarea> 84 93 </td> 85 94 </tr>
Note: See TracChangeset
for help on using the changeset viewer.