Changeset 5911
- Timestamp:
- 04/11/12 11:35:15 (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/index.php
r5869 r5911 46 46 47 47 <link rel="stylesheet" type="text/css" href="../prototype/plugins/contextmenu/jquery.contextMenu.css"></link> 48 <link rel="stylesheet" type="text/css" href="../prototype/plugins/zebradialog/css/zebra_dialog.css"></link> 49 <link rel="stylesheet" type="text/css" href="../prototype/plugins/fileupload/jquery.fileupload-ui.css"></link> 48 <link rel="stylesheet" type="text/css" href="../prototype/plugins/zebradialog/css/zebra_dialog.css"></link> 50 49 51 50 <link rel="stylesheet" href="../prototype/plugins/farbtastic/farbtastic.css" type="text/css" > … … 59 58 <script type="text/javascript" src="../prototype/plugins/alphanumeric/jquery.alphanumeric.js"></script> 60 59 61 <script type="text/javascript" src="../prototype/plugins/jquery-elastic/jquery.elastic.source.js"></script>62 63 60 <script type="text/javascript" src="../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script> 64 61 <script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.contextMenu.js"></script> 65 <script type="text/javascript" src="../prototype/plugins/fileupload/jquery.fileupload.js"></script>66 <script type="text/javascript" src="../prototype/plugins/fileupload/jquery.iframe-transport.js"></script>67 62 <!-- <script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.ui.position.js"></script> --> 68 63 -
trunk/expressoMail1_2/js/QuickCatalogSearch.js
r5786 r5911 22 22 begin_ = begin; 23 23 end_ = end; 24 24 content = $("#content_id_"+ID); 25 25 26 keypress_read(data); 26 27 configure_slider(data); … … 253 254 var signal = "+"; 254 255 var btnClass = "add"; 255 var emailList = $("#" + field_ + "_" + id_).val();256 var emailList = content.find(field_).val(); 256 257 var emails_adicionados = emailList.split(","); 257 258 for(aux=0; aux<emails_adicionados.length -1; aux++) { … … 594 595 final_contact = "\""+nome +"\" <"+email+">, "; 595 596 596 var emailList = document.getElementById(field_ + "_" + id_).value;597 var emailList = content.find(field_).val(); 597 598 //remove os caracteres da busca 598 599 emailList = emailList.substr(0,emailList.lastIndexOf(',')+1); … … 611 612 final_contact = final_contact.replace(/\/n/, ""); 612 613 new_emailList = emailList + final_contact; 613 document.getElementById(field_ + "_" + id_).value = new_emailList;614 615 $("#"+field_+"_"+id_+"").trigger("update");614 content.find(field_).val(new_emailList); 615 616 content.find(field_).trigger("update"); 616 617 617 618 button.onclick = function(){ … … 635 636 var exist = false; 636 637 637 var emailList = $("#" + field_ + "_" + id_).val();638 var emailList = content.find(field_).val(); 638 639 var emails_adicionados = emailList.split(","); 639 640 … … 659 660 var novos_contatos = emails_adicionados.join(","); 660 661 novos_contatos = novos_contatos.replace(/%,/g, ""); 661 $("#" + field_ + "_" + id_).val(novos_contatos);662 content.find(field_).val(novos_contatos); 662 663 663 664 button.onclick = function(){ … … 671 672 }; 672 673 673 $("#"+field_+"_"+id_+"").trigger("update");674 content.find(field_).trigger("update"); 674 675 button.innerHTML = '<span class="ui-button-text" style="">+</span>'; 675 676 } … … 737 738 $(this).unbind('keydown'); 738 739 if (is_ie) { 739 var range= document.getElementById(field_ + "_" + id_).createTextRange();740 var range= content.find(field_).createTextRange(); 740 741 range.collapse(false); 741 742 range.select(); 742 743 } else { 743 document.getElementById(field_ + "_" + id_).focus();744 content.find(field_).focus(); 744 745 } 745 746 }, … … 762 763 $(this).dialog("close"); 763 764 if (is_ie) { 764 var range= document.getElementById(field_ + "_" + id_).createTextRange();765 var range= content.find(field_).createTextRange(); 765 766 range.collapse(false); 766 767 range.select(); 767 768 } else { 768 document.getElementById(field_ + "_" + id_).focus();769 content.find(field_).focus(); 769 770 } 770 771 }, -
trunk/expressoMail1_2/js/abas.js
r5765 r5911 473 473 function editTest(ID){ 474 474 var body = document.getElementById('body_'+ ID); 475 var content = $('#content_id_'+ ID); 475 476 if (body) 476 477 { 477 var save_link = Element("save_message_options_"+ID);478 var save_link = content.find(".save"); 478 479 if (openTab.toPreserve[ID] == undefined) 479 480 openTab.toPreserve[ID] = false; … … 554 555 //Caso for uma mensagem anexada tem que deletar ela da lixeira apos fechar a aba 555 556 var isPartMsg = false; 557 if(!parseInt(id2)) 558 return; 556 559 var id2 = ID.replace('_r',''); 557 560 for(var ii = 0; ii < partMsgs.length; ii++) -
trunk/expressoMail1_2/js/draw_api.js
r5882 r5911 3452 3452 } 3453 3453 3454 function mySplit( val ) { 3455 return val.split( /,\s*/ ); 3456 } 3457 3458 function extractLast( term ) { 3459 return mySplit( term ).pop(); 3460 } 3461 3454 3462 function draw_new_message(border_ID){ 3455 3463 connector.loadScript("color_palette"); 3456 3464 connector.loadScript('wfolders'); 3465 3457 3466 if(typeof(RichTextEditor) == 'undefined' || typeof(ColorPalette) == 'undefined' || typeof(wfolders) == 'undefined') 3458 3467 return false; 3459 3468 3469 if(typeof($.fn.elastic) == "undefined"){ 3470 $.lazy({ 3471 src: '../prototype/plugins/jquery-elastic/jquery.elastic.source.js', 3472 name: 'elastic' 3473 }); 3474 } 3475 if(typeof($.fn.fileupload) == "undefined"){ 3476 $.lazy({ 3477 src: '../prototype/plugins/fileupload/jquery.fileupload.js', 3478 name: 'fileupload', 3479 dependencies: { 3480 js: ['../prototype/plugins/fileupload/jquery.iframe-transport.js'], 3481 css: ['../prototype/plugins/fileupload/jquery.fileupload-ui.css'] 3482 } 3483 }); 3484 } 3460 3485 var ID = create_border("",border_ID); 3486 3461 3487 if (ID == 0) 3462 3488 return 0; 3463 3489 else if(ID == 'maximo') 3464 3490 return 'maximo'; 3491 3465 3492 hold_session = true; 3466 3493 3467 var footer_menu = Element("footer_menu"); 3468 if (footer_menu) { 3469 footer_menu.style.display = 'none'; 3470 } 3471 ///////////////////////////////////////////////////////////////////////////////////////////////////////// 3472 var form = document.createElement("FORM"); 3473 form.name = "form_message_"+ID; 3474 form.id = "form_message_"+ID; 3475 form.method = "POST"; 3476 form.action = "message:detail"; 3477 form.onsubmit = function(){return false;} 3478 if(!is_ie) 3479 form.enctype="multipart/form-data"; 3480 else 3481 form.encoding="multipart/form-data"; 3482 3483 var aba_id = document.createElement("INPUT"); 3484 aba_id.style.display='none'; 3485 aba_id.name = "abaID"; 3486 aba_id.value = ID; 3487 form.appendChild(aba_id); 3488 ///////////////////////////////////////////////////////////////////////////////////////////////////////// 3489 //ConstructMenuNewMessage(ID); 3490 //////////////////////////////////////////////////////////////////////////////////////////////////////// 3491 var content = Element('content_id_' + ID); 3492 var table_message = document.createElement("TABLE"); 3493 table_message.width = "100%"; 3494 var tbody_message = document.createElement("TBODY"); 3495 var tr0 = document.createElement("TR"); 3496 tr0.className = "tr_message_header"; 3497 var td0 = document.createElement("TD"); 3498 td0.colSpan = '2'; 3499 3500 var table_menu_new_message = document.createElement("TABLE"); 3501 table_menu_new_message.width = "100%"; 3502 table_menu_new_message.border = '0'; 3503 table_menu_new_message.className = 'table_message'; 3504 var tbody_menu_new_message = document.createElement("TBODY"); 3505 var tr_menu_new_message = document.createElement("TR"); 3506 tr_menu_new_message.width = "100%"; 3507 var td_menu_new_message = document.createElement("TD"); 3508 //td_menu_new_message.setAttribute("noWrap","true"); 3509 td_menu_new_message.className = "new-message-menu"; 3510 td_menu_new_message.width = "100%"; 3511 td_menu_new_message.height = "30px"; 3512 if ((preferences.save_in_folder == '-1') || (preferences.save_in_folder == '')){ 3513 var option_send = '<button title="Enviar Email" id="send_button_'+ID+'" class="header-button button small" onclick=send_message("'+ID+'","null","null");>'+get_lang("Send")+'</button>'; 3514 //var option_send = '<input type="button" id="send_button_'+ID+'" class="em_button_like_span" tabindex="1" value="'+get_lang("Send and not file")+'" onclick=send_message("'+ID+'","null","null");>' + ' | '; 3515 if(!expresso_offline) 3516 var option_send_and_file= '<button id="send_and_custom_save_'+ID+'" class="header-button button small" onclick=wfolders.makeWindow("'+ID+'","send_and_file");>'+get_lang("Send and file")+'</button>'; 3517 else 3518 var option_send_and_file=''; 3519 } 3520 else{ 3521 var option_send = '<button title="'+get_lang("Send Mail")+'" id="send_button_'+ID+'" class="header-button button small" onclick="send_message(\''+ID+'\',\''+preferences.save_in_folder+'\',\'null\');">'+get_lang("Send")+'</button>'; 3522 //var option_send = '<input type="button" id="send_button_'+ID+'" class="em_button_like_span" tabindex="1" value="'+get_lang("Send")+'" onclick="send_message(\''+ID+'\',\''+preferences.save_in_folder+'\',\'null\');">' + ' | '; 3523 var option_send_and_file=''; 3524 wfolders.alert = true; 3525 } 3526 // var option_save_as = '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","save");>'+get_lang("Save as")+'</span> | '; 3494 if ($("#footer_menu").length){ 3495 $("#footer_menu").css('display','none'); 3496 } 3497 var content = $("#content_id_"+ID).html(DataLayer.render("../prototype/modules/mail/templates/new_message.ejs", {id: ID})); 3498 RichTextEditor.loadEditor2(ID); 3527 3499 3528 if (!expresso_offline) { 3529 var option_save = '<button title="'+get_lang("Save Mail")+'" id="save_message_options_'+ID+'" class="header-button button small" onclick="save_msg('+ID+');">'+get_lang("Save")+'</button>'; 3530 //var option_search = '<button class="header-button" onclick=openListUsers("'+ID+'");>'+get_lang("Search")+'</button>'; 3531 } 3532 else { 3533 var option_save = '<input type="hidden" id="save_message_options_'+ID+'">'; 3534 //var option_search = ''; 3535 } 3536 if (parseInt(preferences.use_important_flag)) 3537 var option_important = '<button title="'+get_lang("Important message")+'" name="important_message_'+ID+'" id="important_message_options_'+ID+'" class="send_option header-button button small"> </button>'; 3538 3539 var option_confLeitura = '<button title="'+get_lang("Return receipt")+'" name="return_receipt_'+ID+'" id="conf_leitura_message_options_'+ID+'" class="send_option header-button button small"> </button>'; 3500 //if(!expresso_offline) 3501 // draw_from_field(sel_from,tr1_1); 3540 3502 3541 td_menu_new_message.innerHTML = option_send + option_save + option_send_and_file + (option_important ? option_important: "") +option_confLeitura; //+ option_search; 3503 //content.find('name="input_to"').elastic().elastic("destroy"); 3504 draw_from_field(content.find(".from-select")[0], content.find(".from-tr")[0]); 3542 3505 3543 td_menu_another_adress = document.createElement("TD"); 3544 td_menu_another_adress.id = "another_adress_"+ID; 3545 //td_menu_another_adress.style.position = "absolute"; 3546 td_menu_another_adress.style.width = "1%"; 3547 td_menu_another_adress.setAttribute("noWrap","true"); 3548 $(td_menu_another_adress).css("text-align","right"); 3549 //td_menu_new_message.setAttribute("noWrap","true"); 3506 var check_input = function(field){ 3507 var check = field.attr("checked"); 3508 field.attr("checked", (!check ? true : false)); 3509 return (!check ? true : false); 3510 } 3550 3511 3551 tr_menu_new_message.appendChild(td_menu_new_message); 3552 tr_menu_new_message.appendChild(td_menu_another_adress); 3512 //AÇÃO GENERICA PARA ADICIONAR/REMOVER 3513 var change_text = function(field, text, to_text){ 3514 var text = (field.html() == text ? to_text : text); 3515 field.html(text); 3516 } 3553 3517 3518 //AÇÃO GENERICA PARA ADICIONAR/REMOVER CC & CCO 3519 var show_hide = function(field, button){ 3520 button.toggleClass("expressomail-button-icon-ative"); 3521 field.toggle(); 3522 field.find("textarea").val(""); 3523 if(!field.find("textarea").hasClass("elastic")){ 3524 field.find("textarea").addClass("elastic").elastic().unbind('blur'); 3525 input_binds(field.find("textarea")); 3526 } 3527 } 3554 3528 3555 tbody_menu_new_message.appendChild(tr_menu_new_message); 3556 table_menu_new_message.appendChild(tbody_menu_new_message); 3557 3558 content.appendChild(table_menu_new_message); 3559 tr0.appendChild(td0); 3560 tbody_message.appendChild(tr0); 3561 //////////////////////////////////////////////////////////////////////////////////////////////////////// 3562 var tr1_1 = document.createElement("TR"); 3563 tr1_1.style.display = 'none'; 3564 var td1_1 = document.createElement("TD"); 3565 td1_1.innerHTML = get_lang("From")+":"; 3566 //td1_1.setAttribute("noWrap","noWrap"); 3567 //td1_1.style.width = "1%"; 3529 var input_binds = function(input){ 3530 var mySource = new Array(); 3531 var myArray = contacts.split(","); 3532 for(var i in myArray){ 3533 var teste = myArray[i].split(";"); 3534 if(teste.length > 1) 3535 mySource.push({name : teste[0], email: teste[1], value : (teste[0] +" - "+teste[1])}); 3536 else 3537 mySource.push({name : "", email: teste[0], value :teste[0]}); 3538 } 3539 input.bind( "keydown", function( event ) { 3540 if ( event.keyCode === $.ui.keyCode.TAB && $( this ).data( "autocomplete" ).menu.active ) { 3541 event.preventDefault(); 3542 } 3543 if(event.keyCode == 13){ 3544 event.preventDefault(); 3545 }else if((event.keyCode) == 120){ 3546 emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3547 } 3548 }).autocomplete({ 3549 minLength: 0, 3550 source: function( request, response ) { 3551 response( $.ui.autocomplete.filter( 3552 mySource, extractLast( request.term ) ) ); 3553 }, 3554 focus: function() { 3555 return false; 3556 }, 3557 select: function( event, ui ) { 3558 var terms = mySplit( this.value ); 3559 terms.pop(); 3560 terms.push( (ui.item.name != "" ? "\""+ui.item.name+"\" " : "") + (ui.item.email ? "<"+ui.item.email+">" : "")); 3561 terms.push( "" ); 3562 this.value = terms.join( ", " ); 3563 return false; 3564 } 3565 }).data( "autocomplete" )._renderItem = function( ul, item ) { 3566 ul.css({"max-height" : "115px", "overflow-y" : "auto"}); 3567 if( $(ul).find("li").length > 10 ){ 3568 return; 3569 } 3570 return $( "<li></li>" ) 3571 .data( "item.autocomplete", item ) 3572 .append( "<a>" + item.name + " - " + item.email + "</a>" ) 3573 .appendTo( ul ); 3574 }; 3575 input.parents("tr:first").find("button").click(function(){ 3576 emQuickSearch($(this).parents("tr:first").find("textarea").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true); 3577 }); 3578 } 3568 3579 3569 var td_from = document.createElement("TD"); 3570 //td_from.setAttribute("noWrap","noWrap"); 3571 td_from.style.width = "100%"; 3572 //td_from.colSpan = "2"; 3573 var sel_from = document.createElement('SELECT'); 3574 sel_from.id = "from_"+ID; 3575 sel_from.name = "input_from"; 3576 sel_from.style.width = "100%"; 3577 //sel_from.setAttribute("wrap","soft"); 3578 td_from.appendChild(sel_from); 3579 tr1_1.appendChild(td1_1); 3580 tr1_1.appendChild(td_from); 3581 tbody_message.appendChild(tr1_1); 3582 /////////////////////////////////////////////////////////////////////// 3583 var tr1_2 = document.createElement("TR"); 3584 tr1_2.id = "tr_replyto_"+ID; 3585 var td1_2 = document.createElement("TD"); 3586 tr1_2.style.display = 'none'; 3587 td1_2.innerHTML = get_lang("Reply to")+":"; 3588 //td1_2.setAttribute("noWrap","true"); 3589 //td1_2.style.width = "1%"; 3590 3591 var td_replyto = document.createElement("TD"); 3592 //td_replyto.setAttribute("noWrap","true"); 3593 td_replyto.style.width = "100%"; 3594 //td_replyto.colSpan = "2"; 3595 var input_replyto = document.createElement('INPUT'); 3596 input_replyto.id = "replyto_"+ID; 3597 input_replyto.name = "input_replyto"; 3598 //input_replyto.setAttribute("tabIndex","1"); 3599 input_replyto.style.width = "100%"; 3600 //input_replyto.setAttribute("wrap","soft"); 3601 input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus', this.id);}; 3602 input_replyto.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 3603 3604 if (!is_ie) 3605 { 3606 input_replyto.rows = 2; 3607 input_replyto.onkeydown = function (e) 3608 { 3609 if ((e.keyCode) == 120) //F9 3610 { 3611 emQuickSearch(input_replyto.value, 'replyto', ID, undefined, true); 3612 } 3613 else 3614 { 3615 if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) 3616 { 3617 e.preventDefault(); 3618 search_contacts(e.keyCode,this.id); 3619 } 3620 } 3621 } 3622 input_replyto.onkeyup = function (e) 3623 { 3624 if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) 3625 { 3626 search_contacts(e.keyCode,this.id); 3627 } 3628 } 3629 } 3630 else 3631 { 3632 input_replyto.rows = 3; 3633 input_replyto.onkeyup = function (e) 3634 { 3635 if ((window.event.keyCode) == 120) //F9 3636 { 3637 emQuickSearch(input_replyto.value, 'replyto', ID, undefined, true); 3638 } 3639 else 3640 { 3641 search_contacts(window.event.keyCode,this.id); 3642 } 3643 } 3644 } 3645 td_replyto.appendChild(input_replyto); 3646 tr1_2.appendChild(td1_2); 3647 tr1_2.appendChild(td_replyto); 3648 tbody_message.appendChild(tr1_2); 3649 //////////////////////////////////////////////////////////////////////////////////////////////////////// 3650 var tr1 = document.createElement("TR"); 3651 var td1 = document.createElement("TD"); 3652 td1.innerHTML = '<button title="'+get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.')+'" id="to_button_'+ID+'" name="to" class="button small adress_button">'+get_lang("To")+':</button>'; 3653 //td1.setAttribute("noWrap","true"); 3654 td1.style.width = "70px"; 3655 3656 var td_to = document.createElement("TD"); 3657 //td_to.setAttribute("noWrap","true"); 3658 td_to.style.width = "100%"; 3659 3660 var input_to = document.createElement('TEXTAREA'); 3661 input_to.id = "to_"+ID; 3662 input_to.name = "input_to"; 3663 //input_to.setAttribute("tabIndex","1"); 3664 input_to.style.width = "100%"; 3665 input_to.style.padding = "1px"; 3666 input_to.className = "mail_fields"; 3667 //input_to.style.wrap="off"; 3668 //input_to.setAttribute("wrap","off"); 3669 input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus', this.id);}; 3670 input_to.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 3671 if (!is_ie) 3672 { 3673 input_to.rows = 1; 3674 input_to.onkeydown = function (e) 3675 { 3676 if ((e.keyCode) == 120) //F9 3677 { 3678 emQuickSearch(input_to.value, 'to', ID, undefined, true); 3679 } 3680 else 3681 { 3682 if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) 3683 { 3684 e.preventDefault(); 3685 search_contacts(e.keyCode,this.id); 3686 } 3687 } 3688 } 3689 input_to.onkeyup = function (e) 3690 { 3691 if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) 3692 { 3693 search_contacts(e.keyCode,this.id); 3694 } 3695 } 3696 } 3697 else 3698 { 3699 input_to.rows = 1; 3700 input_to.onkeyup = function (e) 3701 { 3702 if ((window.event.keyCode) == 120) //F9 3703 { 3704 emQuickSearch(input_to.value, 'to', ID, undefined, true); 3705 } 3706 else 3707 { 3708 search_contacts(window.event.keyCode,this.id); 3709 } 3710 } 3711 } 3712 td_to.appendChild(input_to); 3713 3714 var forwarded_local_message = document.createElement("INPUT"); //Hidden para indicar se é um forward de uma mensagem local 3715 forwarded_local_message.id = "is_local_forward"+ID; 3716 forwarded_local_message.name = "is_local_forward"; 3717 forwarded_local_message.type = "HIDDEN"; 3718 forwarded_local_message.value = "0"; 3719 td_to.appendChild(forwarded_local_message); 3580 input_binds(content.find('[name="input_to"]').addClass("elastic").elastic().unbind('blur')); 3720 3581 3721 //var td_to2 = document.createElement("TD"); 3722 //td_to2.id = "another_adress_"+ID; 3723 //td_to2.style.width = "200px"; 3724 //td_to2.setAttribute("noWrap","true"); 3582 //Botão TextoRico/TextoSimples 3583 content.find(".new-msg-head-right-buttons").find(".button").button().filter(".rich-button").click(function(){ 3584 RichTextEditor.setPlain(check_input(content.find('[name="textplain_rt_checkbox"]')), ID); 3585 change_text($(this).find(".ui-button-text"), get_lang("Rich Text"), get_lang("Simple Text")); 3586 }) 3725 3587 3726 tr1.appendChild(td1); 3727 tr1.appendChild(td_to); 3728 //tr1.appendChild(td_to2); 3729 tbody_message.appendChild(tr1); 3730 ////////////////////////////////////////////////////////////////////////////////////////////////////// 3731 var tr2 = document.createElement("TR"); 3732 tr2.id = "tr_cc_"+ID; 3733 tr2.style.display = 'none'; 3734 var td2 = document.createElement("TD"); 3735 td2.innerHTML = '<button title="'+get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.')+'" id="cc_button_'+ID+'" name="cc" class="button small adress_button">Cc:</button>'; 3736 //td2.setAttribute("noWrap","true"); 3737 //td2.style.width = "1%"; 3738 3739 var td_cc = document.createElement("TD"); 3740 //td_cc.setAttribute("noWrap","true"); 3741 td_cc.style.width = "100%"; 3742 //td_cc.colSpan = "2"; 3743 3744 var input_cc = document.createElement('TEXTAREA'); 3745 input_cc.id = "cc_"+ID; 3746 input_cc.name = "input_cc"; 3747 //input_cc.setAttribute("tabIndex","1"); 3748 input_cc.style.width = "100%"; 3749 input_cc.className = "mail_fields"; 3750 input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus',this.id);}; 3751 input_cc.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 3752 input_cc.rows = 1; 3753 //td_cc.setAttribute("noWrap","true"); 3754 if (!is_ie) 3755 { 3756 //input_cc.rows = 1; 3757 input_cc.onkeydown = function (e) 3758 { 3759 if ((e.keyCode) == 120) //F9 3760 { 3761 emQuickSearch(input_cc.value, 'cc', ID, undefined, true); 3762 } 3763 else 3764 { 3765 if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) 3766 { 3767 e.preventDefault(); 3768 search_contacts(e.keyCode,this.id); 3769 } 3770 } 3771 } 3772 input_cc.onkeyup = function (e) 3773 { 3774 if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) 3775 { 3776 search_contacts(e.keyCode,this.id); 3777 } 3778 } 3779 } 3780 else if (is_ie) 3781 { 3782 //input_cc.rows = 1; 3783 input_cc.onkeyup = function (e) 3784 { 3785 if ((window.event.keyCode) == 120) //F9 3786 { 3787 emQuickSearch(input_cc.value, 'cc', ID, undefined, true); 3788 } 3789 else 3790 { 3791 search_contacts(window.event.keyCode,this.id); 3792 } 3793 } 3794 } 3795 td_cc.appendChild(input_cc); 3796 tr2.appendChild(td2); 3797 tr2.appendChild(td_cc); 3798 tbody_message.appendChild(tr2); 3799 ////////////////////////////////////////////////////////////////////////////////////////////////////// 3800 3801 if( allow_hidden_copy ) 3802 { 3803 3804 var tr3 = document.createElement("TR"); 3805 tr3.id = "tr_cco_"+ID; 3806 tr3.style.display = 'none'; 3807 var td3 = document.createElement("TD"); 3808 //td3.setAttribute("noWrap","true"); 3809 td3.innerHTML = '<button title="'+get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.')+'" id="cc_button_'+ID+'" name="cco" class="button small adress_button">'+get_lang("CCo")+':</button>'; 3810 //td3.style.width = "1%"; 3811 3812 var td_cco = document.createElement("TD"); 3813 //td_cco.colSpan = "2"; 3814 //td_cco.setAttribute("noWrap","true"); 3815 td_cco.style.width = "100%"; 3816 3817 var input_cco = document.createElement('TEXTAREA'); 3818 input_cco.id = "cco_"+ID; 3819 input_cco.name = "input_cco"; 3820 //input_cco.setAttribute("tabIndex","1"); 3821 input_cco.style.width = "100%"; 3822 input_cco.className = "mail_fields"; 3823 input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus',this.id);}; 3824 input_cco.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 3825 input_cco.rows = 1; 3826 if (!is_ie) 3827 { 3828 3829 input_cco.onkeydown = function (e) 3830 { 3831 if ((e.keyCode) == 120) //F9 3832 { 3833 emQuickSearch(input_cco.value, 'cco', ID, undefined, true); 3834 } 3835 else 3836 { 3837 if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) 3838 { 3839 e.preventDefault(); 3840 search_contacts(e.keyCode,this.id); 3841 } 3842 } 3843 } 3844 input_cco.onkeyup = function (e) 3845 { 3846 if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) 3847 { 3848 search_contacts(e.keyCode,this.id); 3849 } 3850 } 3851 } 3852 else if (is_ie) 3853 { 3854 input_cco.onkeyup = function (e) 3855 { 3856 if ((window.event.keyCode) == 120) //F9 3857 { 3858 emQuickSearch(input_cco.value, 'cco', ID, undefined, true); 3859 } 3860 else 3861 { 3862 search_contacts(window.event.keyCode,this.id); 3863 } 3864 } 3865 } 3866 3867 td_cco.appendChild(input_cco); 3868 3869 tr3.appendChild(td3); 3870 tr3.appendChild(td_cco); 3871 tbody_message.appendChild(tr3); 3872 } 3873 ////////////////////////////////////////////////////////////////////////////////////////////////////// 3874 var a_cc_link = document.createElement('button'); 3875 a_cc_link.innerHTML = get_lang('Add CC'); 3876 a_cc_link.id = "a_cc_link_"+ID; 3877 a_cc_link.className = "button small another_adress"; 3878 //a_cc_link.setAttribute("tabIndex","-1"); 3879 var cc_load = ""; 3880 a_cc_link.onclick = function () { 3881 var rm = false; 3882 var remove = function(){ 3883 document.getElementById('tr_cc_'+ID).style.display = 'none'; 3884 $("#cc_"+ID).parent().find("div").remove(); 3885 $("#cc_"+ID).val(""); 3886 $("#a_cc_link_"+ID).toggleClass("expressomail-button-icon-ative"); 3887 rm = true; 3888 } 3889 if(!($("#cc_"+ID).parent().find("div")[0])){ 3890 document.getElementById('tr_cc_'+ID).style.display = ''; 3891 document.getElementById('cc_'+ID).style.width = "100%"; 3892 $(this).find("span").html(get_lang('Remove CC')); 3893 $("#cc_"+ID).elastic().unbind('blur'); 3894 $(this).toggleClass("expressomail-button-icon-ative"); 3895 } 3896 else{ 3897 if($("#cc_"+ID).val() != ""){ 3898 if(confirm("Tem certeza que deseja remover o campo CC")){ 3899 remove(); 3900 $(this).find("span").html(get_lang('Add CC')); 3901 } 3902 }else{ 3903 remove(); 3904 $(this).find("span").html(get_lang('Add CC')); 3905 } 3906 } 3907 if (rm) 3908 input_to.focus(); 3909 else 3910 input_cc.focus(); 3911 return false; 3912 }; 3913 3914 if( allow_hidden_copy ) 3915 { 3916 var a_cco_link = document.createElement('button'); 3917 a_cco_link.innerHTML = get_lang('Add BCC'); 3918 a_cco_link.id = "a_cco_link_"+ID; 3919 a_cco_link.className = "button small another_adress"; 3920 //a_cco_link.setAttribute("tabIndex","-1"); 3921 var cco_load = ""; 3922 a_cco_link.onclick = function () { 3923 var rm = false; 3924 var remove = function(){ 3925 document.getElementById('tr_cco_'+ID).style.display = 'none'; 3926 $("#cco_"+ID).parent().find("div").remove(); 3927 $("#cco_"+ID).val(""); 3928 $("#a_cco_link_"+ID).toggleClass("expressomail-button-icon-ative"); 3929 rm = true; 3930 } 3931 if(!($("#cco_"+ID).parent().find("div")[0])){ 3932 document.getElementById('tr_cco_'+ID).style.display=''; 3933 document.getElementById('cco_'+ID).style.width = "100%"; 3934 $(this).find("span").html(get_lang('Remove CCo')); 3935 $("#cco_"+ID).elastic().unbind('blur'); 3936 $(this).toggleClass("expressomail-button-icon-ative"); 3937 } 3938 else{ 3939 if($("#cco_"+ID).val() != ""){ 3940 if(confirm("Tem certeza que deseja remover o campo CCO")){ 3941 remove(); 3942 $(this).find("span").html(get_lang('Add BCC')); 3943 } 3944 }else{ 3945 remove(); 3946 $(this).find("span").html(get_lang('Add BCC')); 3947 } 3948 } 3949 if (rm) { 3950 if (Element('tr_cc_'+ID).style.display != 'none') 3951 input_cc.focus(); 3952 else 3953 input_to.focus(); 3954 } 3955 else 3956 input_cco.focus(); 3957 }; 3958 //td2_link.appendChild(a_cco_link); 3959 } 3960 3961 ////////////////////////////////////////////////////////////////////////////////////////////////////// 3962 var tr4 = document.createElement("TR"); 3963 var td4 = document.createElement("TD"); 3964 td4.innerHTML = get_lang("Subject")+":"; 3965 //td4.style.width = "1%"; 3966 var td_subject = document.createElement("TD"); 3967 var input_subject = document.createElement('input'); 3968 input_subject.id = "subject_"+ID; 3969 input_subject.name = "input_subject"; 3970 //input_subject.setAttribute("tabIndex","1"); 3971 input_subject.style.width = "100%"; 3972 input_subject.setAttribute("autocomplete","off"); 3973 input_subject.onkeydown = function(event){ 3974 var k; 3975 var e = event || window.event; 3976 if(window.event){ 3977 k = window.event.keyCode; 3978 }else{ 3979 k = event.keyCode; 3980 } 3981 if (k == 9){ 3982 if (e.shiftKey){ 3983 if (Element('tr_cco_'+ID).style.display != 'none'){ 3984 input_cco.focus(); 3985 } 3986 else if (Element('tr_cc_'+ID).style.display != 'none'){ 3987 input_cc.focus(); 3988 } 3989 else { 3990 Element("to_"+ID).focus(); 3991 } 3992 e.preventDefault(); 3993 } 3994 else{ 3995 RichTextEditor.focus(ID); 3996 return false; 3997 } 3998 } 3999 } 4000 //td_subject.colSpan = "2"; 4001 td_subject.appendChild(input_subject); 4002 tr4.appendChild(td4); 4003 tr4.appendChild(td_subject); 4004 tbody_message.appendChild(tr4); 4005 ////////////////////////////////////////////////////////////////////////////////////////////////////// 4006 var tr5 = document.createElement("TR"); 4007 var td_content = ''; 4008 4009 if((preferences.use_assinar_criptografar != '0')) { 4010 if(parseInt(preferences.use_signature_digital_cripto)==1) { 4011 var input_return_digital_chk = (parseInt(preferences.use_signature_digital)==1) ? 'checked="checked"' : ''; 4012 var input_return_digital = '<input type="checkbox" class="checkbox" name="input_return_digital" id="return_digital_'+ID+'" '+input_return_digital_chk+' />'; 4013 var label_return_digital = '<label for="return_digital_'+ID+'">'+get_lang("Digitally sign message?")+'</label>'; 4014 var button_return_digital = '<button title="'+get_lang("Include digital signature")+'" class="send_option header-button button small '+(input_return_digital_chk != "" ? "expressomail-button-icon-ative" : "")+'" name="return_digital_'+ID+'" id="return_digital_options_'+ID+'"> </button>'; 4015 td_content += input_return_digital + label_return_digital; 4016 $("#content_id_"+ID).find(".new-message-menu").append(button_return_digital); 4017 4018 var input_return_cripto_chk = (parseInt(preferences.use_signature_cripto)==1) ? 'checked="checked"' : ''; 4019 var input_return_cripto = '<input type="checkbox" class="checkbox" name="input_return_cripto" id="return_cripto_'+ID+' '+input_return_cripto_chk+' />'; 4020 var label_return_cripto = '<label for="return_cripto_'+ID+'">'+get_lang("Digitally crypt message?")+'</label>'; 4021 var button_return_cripto = '<button title="'+get_lang("Encrypted email")+'" class="send_option header-button button small '+(input_return_cripto_chk != "" ? "expressomail-button-icon-ative" : "")+'" name="return_cripto_'+ID+'" id="return_cripto_options_'+ID+'"> </button>'; 4022 $("#content_id_"+ID).find(".new-message-menu").append(button_return_cripto); 4023 td_content += input_return_cripto + label_return_cripto; 4024 } 4025 } 4026 4027 var input_return_receipt_chk = (preferences.return_recipient_deafault != '0') ? 'checked="checked"' : ''; 4028 var input_return_receipt = '<input type="checkbox" class="checkbox" name="input_return_receipt" id="return_receipt_'+ID+'" '+input_return_receipt_chk+' />'; 4029 var label_return_receipt = '<label for="return_receipt_'+ID+'">'+get_lang("Return receipt")+'</label>'; 4030 if(input_return_receipt_chk != ''){ 4031 $("#conf_leitura_message_options_"+ID).toggleClass("expressomail-button-icon-ative"); 4032 } 4033 td_content += input_return_receipt + label_return_receipt; 4034 4035 if (parseInt(preferences.use_important_flag)) 4036 { 4037 var input_important = '<input type="checkbox" class="checkbox" id="important_message_'+ID+'" name="input_important_message" />'; 4038 var label_important = '<label for="important_message_'+ID+'">'+get_lang("Important message")+'</label>'; 4039 //jQuery(tbody_message).append('<tr><td> </td><td>'+input_important+label_important+'</td</tr>'); 4040 4041 td_content += input_important + label_important; 4042 } 4043 4044 if (!expresso_offline) { 4045 var onclk_text_plain = 'javascript:RichTextEditor.setPlain(this.checked, '+ID+');'; 4046 var input_text_plain = '<input type="checkbox" class="checkbox" name="textplain_rt_checkbox" id="textplain_rt_checkbox_'+ID+'" onclick="'+onclk_text_plain+'"/>'; 4047 var label_text_plain = '<label for="textplain_rt_checkbox_'+ID+'">'+get_lang('Simple text mode')+'</label>'; 4048 4049 td_content += input_text_plain + label_text_plain; 4050 } 4051 4052 jQuery(tr5).append('<td> </td><td class="message-general-options" colspan="2">'+td_content+'</td>'); 4053 tr5.style.display = "none" 4054 tbody_message.appendChild(tr5); 4055 4056 var tr5 = document.createElement("TR"); 4057 var td5_link = document.createElement("TD"); 4058 var td5_input = document.createElement("TD"); 4059 td5_input.innerHTML = " " 4060 td5_link.setAttribute("valign","top"); 4061 $(td5_link).append('<div id="message-attach-dialog" title="'+get_lang('Select messages to attach...')+'"> </div>'); 4062 $(td5_link).prepend(DataLayer.render("../prototype/modules/mail/templates/attachment.ejs", {ID:ID})); 4063 tr5.appendChild(td5_input); 4064 tr5.appendChild(td5_link); 4065 4066 tbody_message.appendChild(tr5); 4067 var tr6 = document.createElement("TR"); 4068 var td6_link = document.createElement("TD"); 4069 var td6_input = document.createElement("TD"); 4070 tr6.appendChild(td6_link); 4071 4072 tr6.appendChild(td6_input); 4073 tbody_message.appendChild(tr6); 4074 4075 var tr7 = document.createElement("TR"); 4076 //var td5 = document.createElement("TD"); 4077 //td5.innerHTML = " "; 4078 var td_body = document.createElement("TD"); 4079 td_body.setAttribute("colSpan","2"); 4080 var div_body_position = document.createElement("DIV"); 4081 div_body_position.id = "body_position_" + ID; 4082 td_body.appendChild(div_body_position); 4083 //tr5.appendChild(td5); 4084 tr7.appendChild(td_body); 4085 tbody_message.appendChild(tr7); 4086 var _div = document.createElement("DIV"); 4087 _div.id = "div_message_scroll_"+ID; 4088 _div.style.overflow = "auto"; 4089 _div.style.width = "100%"; 4090 4091 // Hide the contac tips and re-position the pallete color. 4092 _div.onscroll = function() { 4093 var intElemScrollTop = Element("div_message_scroll_"+ID).scrollTop; 4094 if (!is_ie) 4095 ColorPalette.repos(intElemScrollTop); 4096 Tooltip.scrollChanged(); 4097 }; 4098 ////////////////////////////////////////////////////////////////////////////////////////////////////// 4099 _div.appendChild(form); 4100 content.appendChild(_div); 4101 table_message.appendChild(tbody_message); 4102 form.appendChild(table_message); 4103 4104 var attDisposition = document.createElement("INPUT"); 4105 attDisposition.style.display='none'; 4106 attDisposition.id = 'attDisposition'+ID; 4107 attDisposition.name = 'attDisposition'+ID; 4108 attDisposition.value = 'attachment'; 4109 form.appendChild(attDisposition); 4110 4111 RichTextEditor.loadEditor(ID); 4112 4113 var rich_button = document.createElement("button"); 4114 4115 if(preferences.plain_text_editor == 1){ 4116 var texto = get_lang("Rich Text"); 4117 }else{ 4118 var texto = get_lang("Simple Text"); 4119 } 4120 4121 rich_button.innerHTML = texto; 4122 rich_button.className = "button small rich-button"; 4123 rich_button.name = "textplain_rt_checkbox_"+ID; 4124 4125 ////////////////////////////////////////////////////////////////////////////////////////////////////// 4126 if(!expresso_offline) 4127 draw_from_field(sel_from,tr1_1); 4128 4129 resizeWindow(); 4130 4131 if ( ! expresso_offline ) 4132 { 4133 if ( mobile_device ) 4134 { 4135 text_plain.click( ); 4136 text_plain.parentNode.style.display = 'none'; 4137 } 4138 } 4139 //var a_cc_link2 = document.createElement("button"); 4140 4141 $("#another_adress_"+ID).append(a_cc_link); 4142 4143 if(a_cco_link != undefined) 4144 $("#another_adress_"+ID).append(a_cco_link); 4145 4146 $("#another_adress_"+ID).append(rich_button); 4147 4148 $("#to_"+ID).elastic().unbind('blur'); 4149 $(".another_adress").button(); 4150 $(".rich-button").button(); 4151 $(".rich-button").click(function(){ 4152 //TO-DO : Se o usuário clicar varias vezes no botão, a função de iniciar o ckeditor se perde e morre. 4153 $(this).button({disabled: true}); 4154 if($(this).find("span:first-child").html() == get_lang("Rich text")){ 4155 $(this).find("span:first-child").html(get_lang("Simple Text")); 4156 }else{ 4157 $(this).find("span:first-child").html(get_lang("Rich Text")); 4158 } 4159 4160 var check = $("#"+$(this).attr("name")).attr("checked"); 4161 $("#"+$(this).attr("name")).attr("checked", (!check ? true : false)); 4162 $("#"+$(this).attr("name")).trigger('click'); 4163 $("#"+$(this).attr("name")).attr("checked", (!check ? true : false)); 4164 //$(this).button({ disabled: false }); 4165 if (RichTextEditor.plain[id] != true) 4166 setTimeout("RichTextEditor.focus("+ID+")",100); 4167 else 4168 $('#body_'+ID).focus(); 3588 //Botão Adicionar/Remover CCO 3589 .end().filter(".cco-button").click(function(){ 3590 show_hide(content.find(".cco-tr"), $(this)); 3591 change_text($(this).find(".ui-button-text"), get_lang("Add BCC"), get_lang('Remove CCo')); 3592 }) 3593 //Botão Adicionar/Remover CC 3594 .end().filter(".cc-button").click(function(){ 3595 show_hide(content.find(".cc-tr"), $(this)); 3596 change_text($(this).find(".ui-button-text"), get_lang("Add CC"), get_lang('Remove CC')); 4169 3597 }); 4170 3598 4171 if($("#send_and_custom_save_"+ID)[0]) 4172 $("#send_and_custom_save_"+ID).button({ 4173 icons : { 4174 primary :"expressomail-icon-save_and_send" 4175 } 4176 }) 4177 $("#content_id_"+ID).find(".adress_button").button().click(function(){ 4178 emQuickSearch($("#"+($(this).attr("name"))+"_"+ID).val(), $(this).attr("name"), ID, undefined, true); 3599 //Botão Para, CC, CCO 3600 content.find(".adress_button").button().click(function(){ 3601 //var search_for = $(this).parents("tr:first").find(".new-message-input").val(); 4179 3602 }); 4180 3603 4181 $("#send_button_"+ID).button({ 3604 //BOTAO ENVIAR 3605 content.find(".send").button({ 4182 3606 icons : { 4183 3607 primary : "expressomail-icon-send" 4184 3608 } 4185 }).next().button({ 3609 }).click(function(){ 3610 send_message(ID,preferences.save_in_folder,null); 3611 }) 3612 //BOTAO SALVAR E ENVIAR 3613 .end().find(".save-and-send").button({ 3614 icons : { 3615 primary : "expressomail-icon-send" 3616 } 3617 }).click(function(){ 3618 wfolders.makeWindow(ID,"send_and_file"); 3619 }) 3620 //BOTAO SALVAR 3621 .end().find(".save").button({ 4186 3622 icons : { 4187 3623 primary : "expressomail-icon-save" 4188 3624 } 4189 }); 4190 $("#content_id_"+ID).find("[name=return_receipt_"+ID+"]").button({ 3625 }).click(function(){ 3626 save_msg(ID); 3627 }) 3628 //BOTAO CONF. LEITURA 3629 .end().find(".return-recept").button({ 4191 3630 icons : { 4192 3631 primary : "expressomail-icon-read-confirmation" 4193 3632 } 4194 }); 4195 $("#important_message_options_"+ID).button({ 3633 }).click(function(){ 3634 check_input(content.find('[name="input_return_receipt"]')); 3635 $(this).toggleClass("expressomail-button-icon-ative"); 3636 }) 3637 //BOTAO IMPORTANTE 3638 .end().find(".important").button({ 4196 3639 icons : { 4197 3640 primary : "expressomail-icon-important" 4198 3641 } 4199 }); 4200 $("#return_digital_options_"+ID).button({ 3642 }).click(function(){ 3643 check_input(content.find('[name="input_important_message"]')); 3644 $(this).toggleClass("expressomail-button-icon-ative"); 3645 }) 3646 //BOTAO ASS. DIGITAL 3647 .end().find(".return_digital").button({ 4201 3648 icons : { 4202 3649 primary : "expressomail-icon-signature" 4203 3650 } 4204 }); 4205 $("#return_cripto_options_"+ID).button({ 3651 }).click(function(){ 3652 check_input(content.find('[name="input_return_digital"]')); 3653 $(this).toggleClass("expressomail-button-icon-ative"); 3654 }) 3655 //BOTAO EMAIL CRYPT 3656 .end().find(".return_cripto").button({ 4206 3657 icons : { 4207 3658 primary : "expressomail-icon-encryption" 4208 3659 } 3660 }).click(function(){ 3661 check_input(content.find('[name="input_return_cripto"]')); 3662 $(this).toggleClass("expressomail-button-icon-ative"); 4209 3663 }); 4210 3664 4211 $("#content_id_"+ID).find(".send_option").click(function(){ 4212 var check = $("#"+$(this).attr("name")).attr("checked"); 4213 $("#"+$(this).attr("name")).attr("checked", (!check ? true : false)); 4214 $(this).toggleClass("expressomail-button-icon-ative"); 4215 }); 4216 4217 var fileUploadMSG = $('#fileupload_msg'+ID); 4218 var maxAttachmentSise = (preferences.max_attachment_size !== "" && preferences.max_attachment_size != 0) ? (parseInt(preferences.max_attachment_size.replace('M', '')) * 1048576 ) : false; 3665 content.find(".attachment td").filter(".value").prepend(DataLayer.render("../prototype/modules/mail/templates/attachment.ejs", {ID:ID})); 3666 var fileUploadMSG = $('#fileupload_msg'+ID); 3667 var maxAttachmentSise = (preferences.max_attachment_size !== "" && preferences.max_attachment_size != 0) ? (parseInt(preferences.max_attachment_size.replace('M', '')) * 1048576 ) : false; 4219 3668 4220 3669 fileUploadMSG.find(".button-files-upload").fileupload({ … … 4224 3673 setTimeout(function() { 4225 3674 $('#attDisposition'+ID).val('attachment'); 4226 delete data.fileInput;4227 3675 data.submit(); 4228 3676 }, 5000); 4229 } 4230 var attach = {}; 4231 attach.fullFileName = data.files[0].name; 4232 attach.fileName = data.files[0].name; 4233 if(data.files[0].name.length > 50) 4234 attach.fileName = data.files[0].name.substr(0, 32) + " ... " + data.files[0].name.substr(data.files[0].name.length-9, data.files[0].name.length); 4235 attach.fileSize = formatBytes(data.files[0].size); 4236 if(maxAttachmentSise && data.files[0].size > maxAttachmentSise) 4237 attach.error = 'Tamanho de arquivo nao permitido!!' 4238 4239 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 4240 upload.find('.button.close').button({ 4241 icons: { 4242 primary: "ui-icon-close" 4243 }, 4244 text: false 4245 }).click(function(){ 4246 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 4247 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 4248 delAttachment(ID, idAttach) 4249 $(this).parent().remove(); 4250 }); 4251 4252 fileUploadMSG.find('.attachments-list').append(upload); 4253 4254 if(!maxAttachmentSise || data.files[0].size < maxAttachmentSise) 4255 fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden'); 4256 else 4257 fileUploadMSG.find(' .fileinput-button.new').removeClass('new'); 3677 } 4258 3678 }, 3679 change: function (e, data) { 3680 $.each(data.files, function (index, file) { 3681 var attach = {}; 3682 attach.fullFileName = file.name; 3683 attach.fileName = file.name; 3684 if(file.name.length > 50) 3685 attach.fileName = file.name.substr(0, 32) + " ... " + file.name.substr(file.name.length-9, file.name.length); 3686 attach.fileSize = formatBytes(file.size); 3687 if(maxAttachmentSise && file.size > maxAttachmentSise) 3688 attach.error = 'Tamanho de arquivo nao permitido!!' 3689 3690 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach})); 3691 upload.find('.button.close').button({ 3692 icons: { 3693 primary: "ui-icon-close" 3694 }, 3695 text: false 3696 }).click(function(){ 3697 var idAttach = $(this).parent().find('input[name="fileId[]"]').val(); 3698 fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove(); 3699 delAttachment(ID, idAttach) 3700 $(this).parent().remove(); 3701 }); 3702 3703 fileUploadMSG.find('.attachments-list').append(upload); 3704 3705 if(!maxAttachmentSise || file.size < maxAttachmentSise){ 3706 fileUploadMSG.find('.fileinput-button.new').append(data.fileInput[0]).removeClass('new'); 3707 fileUploadMSG.find('.attachments-list').find('[type=file]').addClass('hidden'); 3708 }else 3709 fileUploadMSG.find(' .fileinput-button.new').removeClass('new'); 3710 3711 })}, 3712 4259 3713 done: function(e, data){ 4260 3714 if(!!data.result && data.result != "[]" ){ … … 4276 3730 } 4277 3731 }).find('[name="files[]"]').css({"height" : "20px", "width": "100px", "border-width": "0 0 0px 0px", "-moz-transform" : "none","-o-transform" : 'none'}); 4278 3732 3733 4279 3734 fileUploadMSG.find("span.message-attach-link").click(function(event){ 4280 3735 jQuery('#message-attach-dialog').html(DataLayer.render("../prototype/modules/attach_message/attach_message.ejs", {})); -
trunk/expressoMail1_2/js/main.js
r5891 r5911 283 283 { 284 284 away=false; 285 var save_link = Element("save_message_options_"+border_id);285 var save_link = content.find(".save"); 286 286 save_link.onclick = function onclick(event) {openTab.toPreserve[border_id] = true;save_msg(border_id);} ; 287 $("#save_message_options_"+border_id).button({disabled: false});287 save_link.button({disabled: false}); 288 288 $(".header-button").button(); 289 289 }; 290 291 var subject_obj = document.getElementById('subject_'+border_id); 290 var content = $("#content_id_"+border_id); 291 292 var subject_obj = content.find(".subject"); 292 293 if ( subject_obj.addEventListener ) 293 294 subject_obj.addEventListener('keypress', keypress_handler, false); … … 295 296 subject_obj.attachEvent('onkeypress', keypress_handler); 296 297 297 var to_obj = document.getElementById('to_'+border_id);298 var to_obj = content.find('[name="input_to"]'); 298 299 if ( to_obj.addEventListener ) 299 300 to_obj.addEventListener('keypress', keypress_handler, false); … … 301 302 to_obj.attachEvent('onkeypress', keypress_handler); 302 303 303 var cc_obj = document.getElementById('cc_'+border_id);304 var cc_obj = content.find('[name="input_cc"]'); 304 305 if ( cc_obj.addEventListener ) 305 306 cc_obj.addEventListener('keypress', keypress_handler, false); … … 307 308 cc_obj.attachEvent('onkeypress', keypress_handler); 308 309 309 if( document.getElementById('cco_'+border_id)){310 var cco_obj = document.getElementById('cco_'+border_id);310 if(content.find('[name="input_cco"]').length){ 311 var cco_obj = content.find('[name="input_cco"]'); 311 312 if ( cco_obj.addEventListener ) 312 313 cco_obj.addEventListener('keypress', keypress_handler, false); … … 1455 1456 if (type != 'edit') 1456 1457 { 1457 return new_border_ID; 1458 delete_border(currentTab); 1459 new_border_ID = draw_new_message(parseInt(border_ID)); 1458 1460 } 1459 1461 } else { … … 1560 1562 if(type!="new" && type!="edit" && document.getElementById("is_local_"+border_ID) != null) 1561 1563 data.is_local_message = (document.getElementById("is_local_"+border_ID).value=="1")?true:false; 1562 switch(type){ 1564 1565 if(typeof($.fn.elastic) == "undefined"){ 1566 $.lazy({ 1567 src: '../prototype/plugins/jquery-elastic/jquery.elastic.source.js', 1568 name: 'elastic' 1569 }); 1570 } 1571 var content = $("#content_id_"+new_border_ID); 1572 content.find('[name="msg_reply_from"]').val($("#msg_number_" + border_ID).val()); 1573 1574 switch(type){ 1563 1575 case "reply_without_history": 1564 1576 RichTextEditor.replyController = true; //Seta o editor como modo reply 1565 Element("to_" + new_border_ID).value = data.to;1577 content.find('[name="input_to"]').val(data.to); 1566 1578 title = "Re: " + data.subject; 1567 Element("subject_" + new_border_ID).value = "Re: " + data.subject; 1568 useOriginalAttachments(new_border_ID,border_ID); 1569 1579 content.find(".subject").val("Re: " + data.subject); 1580 useOriginalAttachments(new_border_ID,border_ID); 1570 1581 1571 1582 // Insert the signature automaticaly at message body if use_signature preference is set 1572 1583 if (preferences.use_signature == "1"){ 1573 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature ,true) ; 1574 } 1575 msg_reply_from = document.createElement('input'); 1576 msg_reply_from.id = "msg_reply_from_" + new_border_ID; 1577 msg_reply_from.type = "hidden"; 1578 msg_reply_from.value = Element("msg_number_" + border_ID).value; 1579 Element("content_id_" + new_border_ID).appendChild(msg_reply_from); 1584 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature ,true) ; 1585 } 1580 1586 break; 1581 1587 case "reply_with_history": … … 1583 1589 RichTextEditor.replyController = true; //Seta o editor como modo reply 1584 1590 title = "Re: " + data.subject; 1585 Element("subject_" + new_border_ID).value = "Re: " + data.subject;1586 Element("to_" + new_border_ID).value = data.to;1591 content.find(".subject").val("Re: " + data.subject); 1592 content.find('[name="input_to"]').val(data.to); 1587 1593 1588 1594 useOriginalAttachments(new_border_ID,border_ID); … … 1594 1600 else 1595 1601 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>'+ block_quoted_body,true); 1596 msg_reply_from = document.createElement('input');1597 msg_reply_from.id = "msg_reply_from_" + new_border_ID;1598 msg_reply_from.type = "hidden";1599 msg_reply_from.value = Element("msg_number_" + border_ID).value;1600 Element("content_id_" + new_border_ID).appendChild(msg_reply_from);1601 1602 break; 1602 1603 case "reply_to_all_without_history": … … 1610 1611 1611 1612 title = "Re: " + data.subject; 1612 Element("subject_" + new_border_ID).value = "Re: " + data.subject;1613 content.find(".subject").val("Re: " + data.subject); 1613 1614 1614 1615 if (data.to.indexOf(Element("user_email").value) > 0 ) 1615 Element("to_" + new_border_ID).value = data.to_all;1616 content.find('[name="input_to"]').val(data.to_all); 1616 1617 else 1617 Element("to_" + new_border_ID).value = data.to + ',' + data.to_all; 1618 //Element("to_" + new_border_ID).value = data.to; 1619 //Element("to_" + new_border_ID).value += ', ' + data.to_all; 1618 content.find('[name="input_to"]').val(data.to + ',' + data.to_all); 1619 1620 if (data.cc){ 1621 data.cc = new Array(); 1622 data.cc = removeUserEmail(_array_cc); 1623 data.cc = removeAlternative(data.cc,_array_to_alternative); 1624 if (data.cc != get_lang("undisclosed-recipient")) 1625 data.cc = data.cc.join(","); 1626 else 1627 data.cc = ""; 1628 if(data.cc != ""){ 1629 content.find('[name="input_cc"]').val(data.cc); 1630 content.find(".cc-tr").css("display"," ");//cc-button 1631 //document.getElementById("a_cc_link" + new_border_ID).value = data.cc; 1632 content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 1633 content.find(".cc-button").find("span").html("Remover CC"); 1634 content.find('[name="input_cc"]').elastic().unbind('blur'); 1635 content.find('[name="input_cc"]').trigger("update"); 1636 } 1637 } 1638 1639 useOriginalAttachments(new_border_ID,border_ID); 1640 if (preferences.use_signature == "1") 1641 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature,true); 1642 1643 break; 1644 case "reply_to_all_with_history": 1645 RichTextEditor.replyController = true; //Seta o editor como modo reply 1646 //delete user email from to_all array. 1647 data.to_all = new Array(); 1648 data.to_all = removeUserEmail(_array_to_all); 1649 data.to_all = removeAlternative(data.to_all,_array_to_alternative); 1650 1651 if (data.to_all != get_lang("undisclosed-recipient")) 1652 data.to_all = data.to_all.join(","); 1653 else 1654 data.to_all = ""; 1655 title = "Re: " + data.subject; 1620 1656 1657 if (data.to.indexOf(Element("user_email").value) > 0 ) 1658 content.find('[name="input_to"]').val(data.to_all); 1659 else 1660 content.find('[name="input_to"]').val(data.to + ',' + data.to_all); 1621 1661 if (data.cc){ 1622 1662 data.cc = new Array(); … … 1627 1667 else 1628 1668 data.cc = ""; 1629 if(data.cc == ""){ 1630 //document.getElementById("cc_" + new_border_ID).value = data.cc; 1631 document.getElementById("tr_cc_" + new_border_ID).style.display='none'; 1632 }else{ 1633 document.getElementById("cc_" + new_border_ID).value = data.cc; 1634 document.getElementById("tr_cc_" + new_border_ID).style.display=''; 1635 //document.getElementById("a_cc_link" + new_border_ID).value = data.cc; 1636 $("#a_cc_link_"+new_border_ID).toggleClass("expressomail-button-icon-ative"); 1637 $("#a_cc_link_"+new_border_ID).find("span").html("Remover CC"); 1638 $("#cc_"+new_border_ID).elastic().unbind('blur'); 1639 $("#cc_"+new_border_ID).trigger("update"); 1669 if(data.cc != ""){ 1670 content.find('[name="input_cc"]').val(data.cc); 1671 content.find(".cc-tr").show(); 1672 content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 1673 content.find(".cc-button").find("span").html("Remover CC"); 1674 content.find('[name="input_cc"]').elastic().unbind('blur'); 1675 content.find('[name="input_cc"]').trigger("update"); 1640 1676 } 1641 1677 } 1642 1643 useOriginalAttachments(new_border_ID,border_ID); 1644 1645 // Insert the signature automaticaly at message body if use_signature preference is set 1646 if (preferences.use_signature == "1") 1647 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature,true); 1648 msg_reply_from = document.createElement('input'); 1649 msg_reply_from.id = "msg_reply_from_" + new_border_ID; 1650 msg_reply_from.type = "hidden"; 1651 msg_reply_from.value = Element("msg_number_" + border_ID).value; 1652 Element("content_id_" + new_border_ID).appendChild(msg_reply_from); 1653 break; 1654 case "reply_to_all_with_history": 1655 RichTextEditor.replyController = true; //Seta o editor como modo reply 1656 //delete user email from to_all array. 1657 data.to_all = new Array(); 1658 data.to_all = removeUserEmail(_array_to_all); 1659 data.to_all = removeAlternative(data.to_all,_array_to_alternative); 1660 1661 if (data.to_all != get_lang("undisclosed-recipient")) 1662 data.to_all = data.to_all.join(","); 1663 else 1664 data.to_all = ""; 1665 title = "Re: " + data.subject; 1666 1667 if (data.to.indexOf(Element("user_email").value) > 0 ) 1668 Element("to_" + new_border_ID).value = data.to_all; 1669 else 1670 Element("to_" + new_border_ID).value = data.to + ',' + data.to_all; 1671 if (data.cc){ 1672 data.cc = new Array(); 1673 data.cc = removeUserEmail(_array_cc); 1674 data.cc = removeAlternative(data.cc,_array_to_alternative); 1675 if (data.cc != get_lang("undisclosed-recipient")) 1676 data.cc = data.cc.join(","); 1677 else 1678 data.cc = ""; 1679 if(data.cc == ""){ 1680 //document.getElementById("cc_" + new_border_ID).value = data.cc; 1681 document.getElementById("tr_cc_" + new_border_ID).style.display='none'; 1682 }else{ 1683 document.getElementById("cc_" + new_border_ID).value = data.cc; 1684 document.getElementById("tr_cc_" + new_border_ID).style.display=''; 1685 //document.getElementById("a_cc_link" + new_border_ID).value = data.cc; 1686 $("#a_cc_link_"+new_border_ID).toggleClass("expressomail-button-icon-ative"); 1687 $("#a_cc_link_"+new_border_ID).find("span").html("Remover CC"); 1688 $("#cc_"+new_border_ID).elastic().unbind('blur'); 1689 $("#cc_"+new_border_ID).trigger("update"); 1690 } 1691 } 1692 document.getElementById("subject_" + new_border_ID).value = "Re: " + data.subject; 1678 content.find(".subject").val("Re: " + data.subject); 1693 1679 useOriginalAttachments(new_border_ID,border_ID); 1694 1680 block_quoted_body = make_body_reply(data.body, data.to, data.date_day, data.date_hour); 1695 // Insert the signature automaticaly at message body if use_signature preference is set1681 1696 1682 if (preferences.use_signature == "1") 1697 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>'+ block_quoted_body,true); 1698 else 1699 RichTextEditor.setInitData(new_border_ID,block_quoted_body,true); 1700 msg_reply_from = document.createElement('input'); 1701 msg_reply_from.id = "msg_reply_from_" + new_border_ID; 1702 msg_reply_from.type = "hidden"; 1703 msg_reply_from.value = Element("msg_number_" + border_ID).value; 1704 Element("content_id_" + new_border_ID).appendChild(msg_reply_from); 1683 RichTextEditor.setInitData(new_border_ID,'<div><br type="_moz"></div>' + signature + '<div><br type="_moz"></div>'+ block_quoted_body,true); 1684 else 1685 RichTextEditor.setInitData(new_border_ID,block_quoted_body,true); 1686 1705 1687 break; 1706 1688 case "forward": 1707 1708 msg_forward_from = document.createElement('input');1709 msg_forward_from.id = "msg_forward_from_" + new_border_ID;1710 msg_forward_from.type = "hidden";1711 msg_forward_from.value = Element("msg_number_" + border_ID).value;1712 Element("content_id_" + new_border_ID).appendChild(msg_forward_from);1713 1689 title = "Fw: " + data.subject; 1714 document.getElementById("subject_" + new_border_ID).value = "Fw: " + data.subject;1690 content.find(".subject").val("Fw: " + data.subject); 1715 1691 var divFiles = Element("divFiles_"+new_border_ID); 1716 1692 var campo_arquivo; … … 1741 1717 } 1742 1718 } 1743 Element("to_" + new_border_ID).value = _to +',';1719 content.find('[name="input_to"]').val(_to +','); 1744 1720 Element('msg_number').value = ''; 1745 1721 } … … 1749 1725 RichTextEditor.setInitData(new_border_ID, '<div><br type="_moz"></div>' + signature); 1750 1726 else 1751 $('#to_'+new_border_ID).focus();1727 content.find('[name="input_to"]').focus(); 1752 1728 break; 1753 1729 case "edit": … … 1764 1740 } 1765 1741 1766 Element("to_" + new_border_ID).value = data.to;1742 content.find('[name="input_to"]').val(data.to); 1767 1743 if (data.cc){ 1768 1744 data.cc = data.cc.replace(/</gi,"<"); 1769 1745 data.cc = data.cc.replace(/>/gi,">"); 1770 Element("cc_" + new_border_ID).value = data.cc; 1771 Element("cc_" + new_border_ID).style.display = ""; 1772 Element("tr_cc_"+ new_border_ID).style.display = ''; 1773 Element("cc_" + new_border_ID).style.width = "100%"; 1774 $("#a_cc_link_"+new_border_ID).toggleClass("expressomail-button-icon-ative"); 1775 $("#a_cc_link_"+new_border_ID).find("span").html("Remover CC"); 1776 $("#cc_"+new_border_ID).elastic().unbind('blur'); 1777 $("#cc_"+new_border_ID).trigger("update"); 1778 //Element("a_cc_link_" + new_border_ID).style.display = 'none'; 1779 //if(Element("cco_" + new_border_ID) != null) 1780 // Element("space_link_" + new_border_ID).style.display = 'none'; 1746 content.find('[name="input_cc"]').val(data.cc); 1747 content.find(".cc-tr").show(); 1748 content.find(".cc-button").toggleClass("expressomail-button-icon-ative"); 1749 content.find(".cc-button").find("span").html(get_lang('Remove CC')); 1750 content.find('[name="input_cc"]').elastic().unbind('blur'); 1751 content.find('[name="input_cc"]').trigger("update"); 1781 1752 } 1782 1753 if (data.cco){ 1783 if(Element("cco_" + new_border_ID) != null){ 1784 Element("cco_" + new_border_ID).value = data.cco; 1785 Element("cco_" + new_border_ID).style.display = ''; 1786 Element("cco_" + new_border_ID).style.width = "100%"; 1787 Element("tr_cco_"+ new_border_ID).style.display = ''; 1788 $("#a_cco_link_"+new_border_ID).toggleClass("expressomail-button-icon-ative"); 1789 $("#a_cco_link_"+new_border_ID).find("span").html("Remover CC"); 1790 $("#cco_"+new_border_ID).elastic().unbind('blur'); 1791 $("#cco_"+new_border_ID).trigger("update"); 1792 //Element("space_link_" + new_border_ID).style.display = 'none'; 1793 //Element("a_cco_link_" + new_border_ID).style.display = 'none'; 1794 Element("tr_cco_"+ new_border_ID).style.display = ''; 1795 } 1796 } 1797 Element("subject_" + new_border_ID).value = data.subject; 1754 if(content.find('[name="input_cco"]').length){ 1755 content.find('[name="input_cco"]').val(data.cco); 1756 content.find(".cco-tr").show(); 1757 content.find(".cco-button").toggleClass("expressomail-button-icon-ative"); 1758 content.find(".cco-button").find("span").html(get_lang('Remove CCo')); 1759 content.find('[name="input_cco"]').elastic().unbind('blur'); 1760 content.find('[name="input_cco"]').trigger("update"); 1761 } 1762 } 1763 content.find(".subject").val(data.subject); 1798 1764 1799 if( Element("disposition_notification_" + border_ID)){1800 $("#return_receipt_"+new_border_ID).attr("checked", true);1801 $("[name=return_receipt_"+new_border_ID+"]").toggleClass("expressomail-button-icon-ative");1765 if( $("#disposition_notification_" + border_ID).length ){ 1766 content.find('[name="input_return_receipt"]').attr("checked", true); 1767 content.find(".return-recept").toggleClass("expressomail-button-icon-ative"); 1802 1768 //Element("return_receipt_" + new_border_ID).checked = true; 1803 1769 } … … 1806 1772 if(element_important_message) { 1807 1773 1808 if(Element("disposition_important_" + border_ID)){ 1809 $("#important_message_"+new_border_ID).attr("checked", true); 1810 $("[name=important_message_"+new_border_ID+"]").toggleClass("expressomail-button-icon-ative"); 1811 //element_important_message.checked = true; 1774 if($("#disposition_important_" + border_ID).length){ 1775 content.find('[name="input_important_message"]').attr("checked", true); 1776 content.find(".important").toggleClass("expressomail-button-icon-ative"); 1812 1777 } 1813 1778 } 1814 1779 1815 1780 if (Element("attachments_" + border_ID)) 1816 1781 addOriginalAttachments(new_border_ID,border_ID); 1817 1782 1818 1783 RichTextEditor.setInitData(new_border_ID, data.body, 'edit'); … … 1822 1787 } 1823 1788 1824 $("#to_"+new_border_ID).trigger("update");1825 var txtarea = Element('body_'+new_border_ID);1789 content.find('[name="input_to"]').trigger("update"); 1790 var txtarea = $('#body_'+new_border_ID); 1826 1791 var height = document.body.scrollHeight - 330; 1827 txtarea. style.overflowY = "auto";1828 txtarea. style.height = height;1792 txtarea.css("overflowY","auto"); 1793 txtarea.css("height",height); 1829 1794 //Insere o conteúdo da mensagem e a assinatura no editor de texto simples 1830 1831 1832 1833 1834 txtarea.value = data.body.replace( new RegExp('<pre>((.\n*)*)</pre>'),'$1');1835 1836 txtarea.value += '\n' + signature;1837 1838 1795 if (preferences.plain_text_editor == 1){ 1796 Element('textplain_rt_checkbox_'+new_border_ID).checked = true; 1797 if (txtarea != null){ 1798 if (data.body != undefined) 1799 txtarea.val(data.body.replace( new RegExp('<pre>((.\n*)*)</pre>'),'$1')); 1800 if (preferences.use_signature == "1") 1801 txtarea.val(txtarea.val + '\n' + signature); 1802 } 1803 } 1839 1804 Element("border_id_" + new_border_ID).title = title; 1840 1805 set_border_caption("border_id_" + new_border_ID, title); … … 1843 1808 return new_border_ID; //Preciso retornar o ID da nova mensagem. 1844 1809 } 1845 1846 1810 1847 1811 //Remove o email do usuario ao responder a todos … … 2204 2168 function send_valided_message(ID, folder, folder_name) 2205 2169 { 2206 2207 if (preferences.auto_save_draft == 1) 2208 autoSaveControl.status[ID] = true; 2209 2210 var save_link = Element("save_message_options_"+ID); 2211 var onClick = save_link.onclick; 2170 if (preferences.auto_save_draft == 1) 2171 autoSaveControl.status[ID] = true; 2172 var content = $("#content_id_"+ID); 2173 var save_link = $("#content_id_"+ID).find(".save"); 2174 var onClick = save_link.onclick; 2212 2175 save_link.onclick = ''; 2213 $("#save_message_options_"+ID).button({disabled: true});2176 save_link.button({disabled: true}); 2214 2177 2215 2178 ID_tmp = ID; … … 2294 2257 form.parentNode.appendChild(mail_type); 2295 2258 2296 var _subject = trim( Element("subject_"+ID).value);2259 var _subject = trim(content.find(".subject").val()); 2297 2260 if((_subject.length == 0) && !confirm(get_lang("Send this message without a subject?"))) { 2298 save_link.onclick = onClick;2299 Element("subject_"+ID).focus();2261 save_link.click(onClick); 2262 content.find(".subject").focus(); 2300 2263 return; 2301 2264 } 2302 stringEmail = Element("to_"+ID).value;2265 stringEmail = content.find('[name="input_to"]').val(); 2303 2266 2304 if ( Element("cco_"+ID) != null)2305 if( Element("tr_cco_"+ID).style.display!= "none")2306 stringEmail += Element("cco_"+ID).value =='' ? "":", "+Element("cco_"+ID).value;2267 if ( content.find('[name="input_cco"]').length) 2268 if(content.find(".cco-tr").css("display") != "none") 2269 stringEmail += content.find('[name="input_cco"]').val() =='' ? "":", "+content.find('[name="input_cco"]').val(); 2307 2270 2308 if( Element("tr_cc_"+ID).style.display!= "none")2309 stringEmail += Element("cc_"+ID).value =='' ? "":", "+Element("cc_"+ID).value;2271 if(content.find(".cc-tr").css("display") != "none") 2272 stringEmail += content.find('[name="input_cc"]').val() =='' ? "":", "+content.find('[name="input_cc"]').val(); 2310 2273 2311 2274 if (expresso_offline) { 2312 2275 2313 2276 var invalidEmail = searchEmail(stringEmail); 2314 if( Element("to_"+ID).value=="" && Element("cco_"+ID).value=="" && Element("cc_"+ID).value=="") {2277 if(content.find('[name="input_to"]').val()=="" && content.find('[name="input_cco"]').val()=="" && content.find('[name="input_cc"]').val()=="") { 2315 2278 write_msg(get_lang("message without receiver")); 2316 2279 return; -
trunk/expressoMail1_2/js/rich_text_editor.js
r5745 r5911 55 55 cRichTextEditor.prototype.fromJSON = function( value ) 56 56 { 57 return (new Function( "return " + this.decode64( value )))(); 57 if(!value) 58 return ''; 59 return (new Function( "return " + this.decode64( value )))(); 58 60 } 59 61 … … 111 113 RichTextEditor.active(pObj); 112 114 } 115 116 cRichTextEditor.prototype.loadEditor2 = function(ID) { 117 var pObj = "body_" + ID; 118 RichTextEditor.plain[ID] = false; 119 120 if(preferences.plain_text_editor == 1) 121 { 122 RichTextEditor.plain[ID] = true; 123 RichTextEditor.editorReady = true; 124 } 125 else 126 RichTextEditor.active(pObj); 127 } 128 113 129 114 130 cRichTextEditor.prototype.getSignaturesOptions = function() { … … 152 168 var editor = CKEDITOR.instances[inst]; 153 169 var id = inst.replace('body_',''); 170 var content = $("#content_id_"+id) 154 171 editor.document.on('keydown', function(event) 155 172 { 156 173 away = false; 157 var save_link = Element("save_message_options_"+id); 158 save_link.onclick = function onclick() {openTab.toPreserve[id] = true;save_msg(id);} ; 159 $("#save_message_options_"+id).button({ disabled: false }); 174 var save_link = content.find(".save"); 175 save_link.click(function(){ 176 openTab.toPreserve[id] = true;save_msg(id); 177 }); 178 save_link.button({ disabled: false }); 160 179 }); 161 180 … … 186 205 cRichTextEditor.prototype.setPlain = function (active,id){ 187 206 RichTextEditor.plain[id] = active; 207 var content = $("#content_id_"+id); 188 208 if(active === true) 189 209 { … … 194 214 $('#body_'+id).keydown(function(event) { 195 215 away = false; 196 var save_link = Element("save_message_options_"+id);216 save_link = content.find(".save")[0]; 197 217 save_link.onclick = function onclick() {openTab.toPreserve[id] = true;save_msg(id);} ; 198 218 $("#save_message_options_"+id).button({ disabled: false }); … … 305 325 height -= 375; 306 326 $('#'+id).ckeditor( 307 function() {RichTextEditor.execPosInstance(id)}, 308 { 309 toolbar:'mail', 310 height: height 311 }); 312 $("[name=textplain_rt_checkbox_"+just_id+"]").button({ disabled: false }); 327 function() { 328 RichTextEditor.execPosInstance(id) 329 }, 330 { 331 toolbar:'mail', 332 height: height 333 } 334 ); 335 //$("[name=textplain_rt_checkbox_"+just_id+"]").button({ disabled: false }); 313 336 } 314 337 cRichTextEditor.prototype.focus = function(id) -
trunk/expressoMail1_2/js/shortcut.js
r5904 r5911 324 324 { 325 325 //********************** 326 shortcut.add('up', function( )326 shortcut.add('up', function(e) 327 327 { 328 328 var search_in_focus = false; … … 340 340 341 341 342 shortcut.add('down', function( )342 shortcut.add('down', function(e) 343 343 { 344 344 var search_in_focus = false; -
trunk/expressoMail1_2/templates/default/main.css
r5877 r5911 42 42 /* todo o resto */ 43 43 table.expressomail-message-body {width:100%; height:100%;} 44 table.table_message {44 table.table_message, div.table_message { 45 45 background: #96b3d3; /* Old browsers */ 46 46 background: -moz-linear-gradient(top, #96b3d3 0%, #b4c9e4 30%, #d9e6ef 65%, #e2e9f1 70%, #e9f0f8 78%, #e8f1fa 83%, #dbe5ef 96%, #d9e3ed 100%); /* FF3.6+ */
Note: See TracChangeset
for help on using the changeset viewer.