Changeset 5533 for trunk/expressoMail1_2/js/search.js
- Timestamp:
- 02/22/12 18:04:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/search.js
r5506 r5533 16 16 this.elementChecked = false; 17 17 } 18 18 19 19 //Monta os forms dentro da janela; 20 20 searchE.prototype.showForms = function(value) … … 442 442 443 443 searchE.prototype.make_tr_message = function(aux,border_id,i) { 444 console.log(aux); 445 /** 446 * Preenche a estrutura de cache de mensagens para posterior consulta de 447 * informações sobre as mensagens no escopo global. 448 */ 449 if (!onceOpenedHeadersMessages[aux.boxname]) 450 onceOpenedHeadersMessages[aux.boxname] = {}; 451 onceOpenedHeadersMessages[aux.boxname][aux.uid] = aux; 452 444 453 var tr = document.createElement("TR"); 445 454 if(typeof(preferences.line_height) != 'undefined') 446 455 tr.style.height = preferences.line_height; 447 456 457 var msg_folder = get_current_folder(); 458 448 459 var mailbox = aux.boxname; 449 460 var uid_msg = aux.uid; … … 455 466 tr.setAttribute('name',mailbox); 456 467 tr.name = mailbox; 457 468 458 469 if ( aux.flag.match("U") ) 459 470 add_className(tr,'tr_msg_unread'); … … 466 477 }; 467 478 468 for(var j=0 ; j <= 1 0; j++)479 for(var j=0 ; j <= 11 ; j++) 469 480 { 470 481 var td = document.createElement("TD"); … … 519 530 { 520 531 td.setAttribute("width", colSizes[1][4]); 532 td.id = "td_message_followup_search_"+uid_msg; 533 td.setAttribute("class","search-result-item"); 534 //td1 = "<img src ='../prototype/modules/mail/img/flagDefault.png' title='"+get_lang('Followup')+"'>"; 535 td1 = '<div class="flag-edited" style="width:9px;height:6px;"><img src="../prototype/modules/mail/img/flagEditor.png"></div>'; 536 537 $(td).click(function(event, ui){ 538 var messageClickedId = $(this).attr('id').match(/td_message_followup_search_([\d]+)/)[1]; 539 var flagged = DataLayer.get('followupflagged', {filter: [ 540 'AND', 541 ['=', 'messageNumber', messageClickedId], 542 ['=', 'folderName', mailbox] 543 ]}); 544 if(flagged == '' || flagged == [] || flagged == 'undefined'){ 545 /** 546 * Aplica followupflag de Acompanhamento 547 */ 548 aux.followupflagged = { 549 uid : User.me.id, 550 folderName : mailbox, 551 messageNumber : messageClickedId, 552 alarmTime : false, 553 backgroundColor : '#FF2016', 554 followupflagId: '1', 555 followupflag: DataLayer.get('followupflag', '1') 556 }; 557 $(this).find(".flag-edited").css("background", aux.followupflagged.backgroundColor); 558 aux.followupflagged.id = DataLayer.put('followupflagged', aux.followupflagged); 559 560 }else if(aux.followupflagged.id){ 561 /** 562 * Remover followupflag de Acompanhamento (DFD0078:RI25) 563 */ 564 $(this).find(".flag-edited").css("background", "#cccccc"); 565 566 567 DataLayer.remove('followupflagged', flagged[0].id); 568 $('#td_message_followup_' + messageClickedId + ', ' + 569 '#td_message_followup_search_' + messageClickedId).find(".flag-edited") 570 .find("img").attr("src", "../prototype/modules/mail/img/flagEditor.png").css("margin-left","0"); 571 } else { 572 //TODO - open dialog 573 } 574 if(!DataLayer.commit()){} 575 576 }); 577 } 578 if (j == 5) 579 { 580 td.setAttribute("width", colSizes[1][5]); 581 td.id = "td_message_labels_search_"+uid_msg; 582 td.setAttribute("class","td-label-search"); 583 584 if (aux.labels) { 585 td1 = '<img src="../prototype/modules/mail/img/tag.png">'; 586 updateLabelsColumn(aux) 587 } else { 588 td1 = ''; 589 } 590 } 591 if (j == 6) 592 { 593 td.setAttribute("width", colSizes[1][6]); 521 594 td.id = "td_message_sent_"+uid_msg; 522 595 td1 = ''; 523 596 } 524 597 525 if ( j == 5)526 { 527 td.setAttribute("width", colSizes[1][ 5]);598 if ( j == 7 ) 599 { 600 td.setAttribute("width", colSizes[1][7]); 528 601 td.className = "td_resizable"; 529 602 td.onclick = _onclick; … … 536 609 537 610 var td1 = get_lang(td1).substr(get_lang(td1).length-1) == "*"?td1:get_lang(td1); 538 539 td1 = translateFolder(td1); 540 541 542 if( proxy_mensagens.is_local_folder(td1)) 543 { 611 td1 = translateFolder(td1); 612 613 if (proxy_mensagens.is_local_folder(td1)) { 544 614 var td1 = this.aux_local_folder_display(td1); 545 615 } 546 616 } 547 617 548 if( j == 6)618 if( j == 8 ) 549 619 { 550 620 var name; … … 557 627 name = name.substr(0,29) + "..."; 558 628 559 td.setAttribute("width", colSizes[1][ 6]);629 td.setAttribute("width", colSizes[1][8]); 560 630 td.className = "td_resizable"; 561 631 td.onclick = _onclick; … … 566 636 } 567 637 568 if( j == 7)638 if( j == 9 ) 569 639 { 570 640 var subject_encode = url_encode(subject); … … 575 645 aux.subject = aux.subject.substr(0,70) + "..."; 576 646 577 td.setAttribute("width", colSizes[1][ 7]);647 td.setAttribute("width", colSizes[1][9]); 578 648 td.className = "td_resizable td_msg_search_subject"; 579 649 td.onclick = _onclick; … … 584 654 } 585 655 586 if( j == 8)587 { 588 td.setAttribute("width", colSizes[1][ 8]);656 if( j == 10 ) 657 { 658 td.setAttribute("width", colSizes[1][10]); 589 659 td.className = "td_resizable"; 590 660 td.align = "center"; … … 609 679 } 610 680 611 if( j == 9)681 if( j == 11 ) 612 682 { 613 683 td.setAttribute("width", "9.4%");//alinhamento dos campos data e tamanho … … 623 693 } 624 694 625 if( j == 1 0)695 if( j == 12 ) 626 696 { 627 697 if (aux.flag.match("U")) … … 631 701 var td1 = ''; 632 702 } 633 if (j<1 0) {703 if (j<12) { 634 704 td.innerHTML = td1; 705 706 //Carregar os followupflag nos resultados. 707 if (aux.followupflagged) { 708 $(td).attr('title', aux.followupflagged.followupflag.name) 709 .find(".flag-edited").css("background",aux.followupflagged.backgroundColor); 710 if(aux.followupflagged.isDone == "1"){ 711 $(td).find(".flag-edited").find("img") 712 .attr("src", "../prototype/modules/mail/img/flagChecked.png") 713 .css("margin-left","-3px"); 714 } 715 } else { 716 $(td).find(".flag-edited").css("background","#cccccc"); 717 } 718 635 719 tr.appendChild(td); 636 720 } … … 692 776 scrollSpeed: 100, 693 777 containment: "#divAppbox" 694 }).bind("contextmenu", function(){ 695 if($(this).find("input:checkbox").attr("checked") != "checked"){ 696 $(this).find("input:checkbox").trigger('click'); 697 $(this).addClass("selected_msg"); 778 }).bind("mouseup", function(event){ 779 if(event.button == 2) 780 if($(this).find("input:checkbox").attr("checked") != "checked"){ 781 $(this).find("input:checkbox").trigger('click'); 782 $(this).addClass("selected_msg"); 698 783 } 699 784 }); … … 705 790 { 706 791 var data = ( Data['data'] ) ? Data['data'] : Data['data_gears']; 707 708 792 if ( data == undefined ) 709 793 return; 710 794 711 795 var cont = parseInt(0); 712 796 … … 859 943 td_element03 = createTDElement(1,3); 860 944 td_element04 = createTDElement(1,4); 861 td_element1 = createTDElement(1,5,"th_resizable","left"); 945 td_element05 = createTDElement(1,5); 946 td_element06 = createTDElement(1,6); 947 td_element1 = createTDElement(1,7,"th_resizable","left"); 862 948 863 949 var arrow_ascendant = function(Text) … … 865 951 return "<b>" + Text + "</b><img src='templates/"+template+"/images/arrow_ascendant.gif'>"; 866 952 } 867 953 868 954 // Ordernar Pasta 869 955 if ( sort_type == 'SORTBOX' /*|| sort_type == 'SORTBOX_REVERSE'*/ ) … … 894 980 895 981 // Ordernar Quem 896 td_element2 = createTDElement(1, 6,"th_resizable","left");982 td_element2 = createTDElement(1,8,"th_resizable","left"); 897 983 898 984 if (sort_type == 'SORTFROM' || sort_type == 'SORTWHO' /*|| sort_type == 'SORTWHO_REVERSE' || sort_type == 'SORTFROM_REVERSE'*/ ) … … 923 1009 924 1010 // Ordernar Subject 925 td_element3 = createTDElement(1, 7,"th_resizable","left");1011 td_element3 = createTDElement(1,9,"th_resizable","left"); 926 1012 927 1013 if (sort_type == 'SORTSUBJECT' /*|| sort_type == 'SORTSUBJECT_REVERSE'*/) … … 952 1038 953 1039 // Ordernar Data 954 td_element4 = createTDElement(1, 8,"th_resizable","center");1040 td_element4 = createTDElement(1,10,"th_resizable","center"); 955 1041 956 1042 if ( sort_type == 'SORTDATE' /*|| sort_type == 'SORTDATE_REVERSE'*/ ) … … 981 1067 982 1068 // Ordernar Tamanho 983 td_element5 = createTDElement(1, 9,"th_resizable","center");1069 td_element5 = createTDElement(1,11,"th_resizable","center"); 984 1070 985 1071 if ( sort_type == 'SORTSIZE' /*|| sort_type == 'SORTSIZE_REVERSE'*/ ) … … 1008 1094 td_element5.innerHTML = ( sort_type == 'SORTSIZE_REVERSE' ) ? arrow_ascendant(get_lang("size")) : get_lang("size"); 1009 1095 } 1096 1097 //Abrir a Tela de de Configuracao de Acompanhamento 1098 1010 1099 1011 1100 tr_element.appendChild(td_element0); … … 1014 1103 tr_element.appendChild(td_element03); 1015 1104 tr_element.appendChild(td_element04); 1105 tr_element.appendChild(td_element05); 1106 tr_element.appendChild(td_element06); 1016 1107 tr_element.appendChild(td_element1); 1017 1108 tr_element.appendChild(td_element2); … … 1022 1113 table_element.appendChild(tbody_element); 1023 1114 1115 1024 1116 var colgr_element = buildColGroup(1); 1025 1117 colgr_element.setAttribute("id","colgroup_head_"+numBox); … … 1624 1716 // Cria o objeto 1625 1717 var EsearchE = new searchE(); 1718 var EsearchE = new searchE();
Note: See TracChangeset
for help on using the changeset viewer.