Changeset 4826


Ignore:
Timestamp:
07/19/11 16:07:03 (13 years ago)
Author:
roberto.santosjunior
Message:

Ticket #1820 - Criada func update_local_box(), atualiza caixas de email locais.r4698

Location:
trunk/expressoMail1_2/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/draw_api.js

    r4821 r4826  
    345345         * Pastas locais 
    346346         */ 
    347         if(preferences.use_local_messages==1 || expresso_offline) { 
    348                 var local_folders = expresso_local_messages.list_local_folders(); 
    349                 var has_changes = false; 
    350                 for (var i in local_folders) { //Coloca as pastas locais. 
    351  
    352                         var new_caption = local_folders[i][0]; 
    353                         if(local_folders[i][0].indexOf("/")!="-1") { 
    354                                 final_pos = local_folders[i][0].lastIndexOf("/"); 
    355                                 new_caption = local_folders[i][0].substr(final_pos+1); 
    356                         } 
    357  
    358                         var folder_unseen = Element('dftree_local_'+local_folders[i][0]+'_unseen'); 
    359  
    360                         if ((folder_unseen) && (local_folders[i][1] > 0)) 
    361                         { 
    362                                 folder_unseen.innerHTML = local_folders[i][1]; 
    363                                 has_changes = true; 
    364                         } 
    365                         else if (local_folders[i][1] > 0) 
    366                         { 
    367                                 tree_folders.getNodeById("local_"+local_folders[i][0]).alter({caption:lang_folder(new_caption) + '<font style=color:red>&nbsp(</font><span id="dftree_local_'+local_folders[i][0]+'_unseen" style=color:red>'+local_folders[i][1]+'</span><font style=color:red>)</font>'}); 
    368                                 tree_folders.getNodeById("local_"+local_folders[i][0])._refresh(); 
    369                                 has_changes = true; 
    370                         } 
    371                         else if (local_folders[i][1] <= 0) 
    372                         { 
    373                                 tree_folders.getNodeById("local_"+local_folders[i][0]).alter({caption:lang_folder(new_caption)}); 
    374                                 tree_folders.getNodeById("local_"+local_folders[i][0])._refresh(); 
    375                                 has_changes = true; 
    376                         } 
     347                if(preferences.use_local_messages==1 || expresso_offline) { 
     348                        var local_folders = expresso_local_messages.list_local_folders(); 
     349                        var has_changes = false; 
     350                        for (var i in local_folders) { //Coloca as pastas locais. 
     351 
     352                                var new_caption = local_folders[i][0]; 
     353                                if(local_folders[i][0].indexOf("/")!="-1") { 
     354                                        final_pos = local_folders[i][0].lastIndexOf("/"); 
     355                                        new_caption = local_folders[i][0].substr(final_pos+1); 
     356                                } 
     357 
     358                                var folder_unseen = Element('dftree_local_'+local_folders[i][0]+'_unseen'); 
     359 
     360                                if ((folder_unseen) && (local_folders[i][1] > 0)) 
     361                                { 
     362                                        folder_unseen.innerHTML = local_folders[i][1]; 
     363                                        has_changes = true; 
     364                                } 
     365                                else if (local_folders[i][1] > 0) 
     366                                { 
     367                                        tree_folders.getNodeById("local_"+local_folders[i][0]).alter({caption:lang_folder(new_caption) + '<font style=color:red>&nbsp(</font><span id="dftree_local_'+local_folders[i][0]+'_unseen" style=color:red>'+local_folders[i][1]+'</span><font style=color:red>)</font>'}); 
     368                                        tree_folders.getNodeById("local_"+local_folders[i][0])._refresh(); 
     369                                        has_changes = true; 
     370                                } 
     371                                else if (local_folders[i][1] <= 0) 
     372                                { 
     373                                        tree_folders.getNodeById("local_"+local_folders[i][0]).alter({caption:lang_folder(new_caption)}); 
     374                                        tree_folders.getNodeById("local_"+local_folders[i][0])._refresh(); 
     375                                        has_changes = true; 
     376                                } 
    377377 
    378378                        if("local_"+local_folders[i][0] == get_current_folder()){ 
    379                                 var old_new_m = isNaN(parseInt(Element('new_m').innerHTML)) ? parseInt(Element('new_m').firstChild.innerHTML) : parseInt(Element('new_m').innerHTML); 
    380                                 if(!isNaN(old_new_m) && old_new_m < local_folders[i][1]){ 
    381                                         Element('tot_m').innerHTML = parseInt(Element('tot_m').innerHTML) + (parseInt(local_folders[i][1])-old_new_m); 
    382                                 } 
    383                                 Element('new_m').innerHTML = local_folders[i][1] ? '<font color="RED">'+local_folders[i][1]+'</font>' : 0; 
    384                                 draw_paging(Element('tot_m').innerHTML); 
    385                                 has_changes = true; 
    386                         } 
    387                 } 
    388                 if(has_changes) 
    389                         tree_folders.getNodeById("local_root").open(); 
    390  
    391         } 
     379                                        var old_new_m = isNaN(parseInt(Element('new_m').innerHTML)) ? parseInt(Element('new_m').firstChild.innerHTML) : parseInt(Element('new_m').innerHTML); 
     380                                        if(!isNaN(old_new_m) && old_new_m < local_folders[i][1]){ 
     381                                                Element('tot_m').innerHTML = parseInt(Element('tot_m').innerHTML) + (parseInt(local_folders[i][1])-old_new_m); 
     382                                        } 
     383                                        Element('new_m').innerHTML = local_folders[i][1] ? '<font color="RED">'+local_folders[i][1]+'</font>' : 0; 
     384                                        draw_paging(Element('tot_m').innerHTML); 
     385                                        has_changes = true; 
     386                        } 
     387                } 
     388                        if(has_changes) 
     389                                tree_folders.getNodeById("local_root").open(); 
     390        } 
     391} 
     392 
     393 
     394function update_local_box(){ 
     395    msg_range_end = (current_page*preferences.max_email_per_page); 
     396    msg_range_begin = (msg_range_end-(preferences.max_email_per_page)+1); 
     397    folder=get_current_folder(); 
     398    var msgs  = expresso_local_messages.get_local_range_msgs(folder.substr(6),msg_range_begin,preferences.max_email_per_page,sort_box_type,sort_box_reverse,search_box_type,preferences.preview_msg_subject,preferences.preview_msg_tip); 
     399    alternate_border(0); 
     400    draw_box(msgs, folder, true); 
     401    draw_paging(msgs.num_msgs); 
     402    Element("tot_m").innerHTML = msgs.num_msgs; 
     403    update_menu(); 
    392404} 
    393405 
     
    13891401                                var spanSender = document.createElement("SPAN"); 
    13901402                                spanSender.onmouseover = function (event) {this.style.textDecoration = "underline";try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};}; 
    1391                                 spanSender.onmouseout = function (){ try {this.style.textDecoration = "none"; clearTimeout(InfoContact.timeout);} catch(e){}}; 
     1403                                spanSender.onmouseout = function (){try {this.style.textDecoration = "none";clearTimeout(InfoContact.timeout);} catch(e){}}; 
    13921404                                spanSender.innerHTML =  headers_msgs.from.name != null ? headers_msgs.from.name : headers_msgs.from.email; 
    13931405                                if (spanSender.innerHTML.indexOf(" ") == '-1' && spanSender.innerHTML.length > 25){ 
     
    17261738        var option_hide_more = document.createElement("SPAN"); 
    17271739        option_hide_more.className = 'message_options'; 
    1728         option_hide_more.onmouseover=function () { this.className='message_options_active'; }; 
    1729         option_hide_more.onmouseout=function () { this.className='message_options' }; 
     1740        option_hide_more.onmouseover=function () {this.className='message_options_active';}; 
     1741        option_hide_more.onmouseout=function () {this.className='message_options'}; 
    17301742        options.align = 'right'; 
    17311743        option_hide_more.value = 'more_options'; 
     
    17501762        var option_mark_as_unseen = document.createElement("SPAN"); 
    17511763        option_mark_as_unseen.className = "message_options"; 
    1752         option_mark_as_unseen.onclick = function () { changeLinkState(this,'seen'); 
     1764        option_mark_as_unseen.onclick = function () {changeLinkState(this,'seen'); 
    17531765                proxy_mensagens.proxy_set_message_flag(folder_id,'unseen'); 
    17541766                write_msg(get_lang('Message marked as ')+get_lang("Unseen")); 
    17551767        }; 
    1756         option_mark_as_unseen.onmouseover=function () { this.className='message_options_active'; }; 
    1757         option_mark_as_unseen.onmouseout=function () { this.className='message_options' }; 
     1768        option_mark_as_unseen.onmouseover=function () {this.className='message_options_active';}; 
     1769        option_mark_as_unseen.onmouseout=function () {this.className='message_options'}; 
    17581770        option_mark_as_unseen.innerHTML = get_lang("Unseen"); 
    17591771 
     
    17611773        option_mark_important.className = 'message_options'; 
    17621774        option_mark_important.style.paddingLeft = "10px"; 
    1763         option_mark_important.onmouseover=function () { this.className='message_options_active'; }; 
    1764         option_mark_important.onmouseout=function () { this.className='message_options' }; 
     1775        option_mark_important.onmouseover=function () {this.className='message_options_active';}; 
     1776        option_mark_important.onmouseout=function () {this.className='message_options'}; 
    17651777 
    17661778        if (info_msg.Flagged == "F"){ 
     
    17781790        } 
    17791791        else{ 
    1780                 option_mark_important.onclick = function() { changeLinkState(this,'normal'); 
     1792                option_mark_important.onclick = function() {changeLinkState(this,'normal'); 
    17811793                        proxy_mensagens.proxy_set_message_flag(folder_id,'flagged'); 
    17821794                        write_msg(get_lang('Message marked as ')+get_lang("Important")); 
     
    18011813        option_forward.className = 'message_options'; 
    18021814        option_forward.onclick = function(){new_message('forward', ID);}; 
    1803         option_forward.onmouseover=function () { this.className='message_options_active'; }; 
    1804         option_forward.onmouseout=function () { this.className='message_options' }; 
     1815        option_forward.onmouseover=function () {this.className='message_options_active';}; 
     1816        option_forward.onmouseout=function () {this.className='message_options'}; 
    18051817        option_forward.innerHTML = get_lang('Forward'); 
    18061818        options.appendChild(space1); 
     
    18111823        option_reply.onclick = function(){new_message('reply_with_history', ID);}; 
    18121824        option_reply.innerHTML = get_lang('Reply'); 
    1813         option_reply.onmouseover=function () { this.className='message_options_active'; }; 
    1814         option_reply.onmouseout=function () { this.className='message_options' }; 
     1825        option_reply.onmouseover=function () {this.className='message_options_active';}; 
     1826        option_reply.onmouseout=function () {this.className='message_options'}; 
    18151827 
    18161828        options.appendChild(space2); 
     
    25652577                case 'important': 
    25662578                        { 
    2567                                 el.onclick = function(){changeLinkState(el,'normal');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'flagged'); write_msg(get_lang('Message marked as ')+get_lang("Important"))} 
     2579                                el.onclick = function(){changeLinkState(el,'normal');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'flagged');write_msg(get_lang('Message marked as ')+get_lang("Important"))} 
    25682580                                break; 
    25692581                        } 
     
    25832595                case 'unseen': 
    25842596                        { 
    2585                                 el.onclick = function(){  changeLinkState(el,'seen');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'unseen');write_msg(get_lang('Message marked as ')+get_lang("unseen"))} 
     2597                                el.onclick = function(){changeLinkState(el,'seen');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'unseen');write_msg(get_lang('Message marked as ')+get_lang("unseen"))} 
    25862598                                break; 
    25872599 
     
    25892601                case 'seen': 
    25902602                        { 
    2591                                 el.onclick = function(){  changeLinkState(el,'unseen');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'seen');write_msg(get_lang('Message marked as ')+get_lang("seen"))} 
     2603                                el.onclick = function(){changeLinkState(el,'unseen');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'seen');write_msg(get_lang('Message marked as ')+get_lang("seen"))} 
    25922604                                break; 
    25932605 
     
    27202732        input_replyto.style.width = "100%"; 
    27212733        input_replyto.setAttribute("wrap","soft"); 
    2722         input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);}; 
     2734        input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus', this.id);}; 
    27232735        input_replyto.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 
    27242736 
     
    28032815        input_to.style.width = "100%"; 
    28042816        input_to.setAttribute("wrap","soft"); 
    2805         input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);}; 
     2817        input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus', this.id);}; 
    28062818        input_to.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 
    28072819        if (!is_ie) 
     
    28992911        input_cc.setAttribute("tabIndex","1"); 
    29002912        input_cc.style.width = "100%"; 
    2901         input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus',this.id);}; 
     2913        input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus',this.id);}; 
    29022914        input_cc.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 
    29032915        if (!is_ie) 
     
    29812993        input_cco.setAttribute("tabIndex","1"); 
    29822994        input_cco.style.width = "100%"; 
    2983         input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus',this.id);}; 
     2995        input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus',this.id);}; 
    29842996        input_cco.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 
    29852997 
     
    30573069        a_cc_link.setAttribute("href","javascript:void(0)"); 
    30583070        a_cc_link.setAttribute("tabIndex","-1"); 
    3059         a_cc_link.onclick = function () {this.style.display='none';document.getElementById('tr_cc_'+ID).style.display='';document.getElementById('space_link_'+ID).style.display='none';input_cc.focus(); return false;} 
     3071        a_cc_link.onclick = function () {this.style.display='none';document.getElementById('tr_cc_'+ID).style.display='';document.getElementById('space_link_'+ID).style.display='none';input_cc.focus();return false;} 
    30603072        td2_link.appendChild(a_cc_link); 
    30613073        var space = document.createElement("span"); 
     
    30683080        a_cco_link.setAttribute("href","javascript:void(0)"); 
    30693081        a_cco_link.setAttribute("tabIndex","-1"); 
    3070         a_cco_link.onclick = function () {this.style.display='none';document.getElementById('tr_cco_'+ID).style.display='';document.getElementById('space_link_'+ID).style.display='none';input_cco.focus(); return false;} 
     3082        a_cco_link.onclick = function () {this.style.display='none';document.getElementById('tr_cco_'+ID).style.display='';document.getElementById('space_link_'+ID).style.display='none';input_cco.focus();return false;} 
    30713083        td2_link.appendChild(a_cco_link); 
    30723084        var space = document.createElement("span"); 
     
    30793091        a_replyto_link.setAttribute("href","javascript:void(0)"); 
    30803092        a_replyto_link.setAttribute("tabIndex","-1"); 
    3081         a_replyto_link.onclick = function () {this.style.display='none';document.getElementById('tr_replyto_'+ID).style.display='';document.getElementById('space_link_2_'+ID).style.display='none';input_replyto.focus(); return false;} 
     3093        a_replyto_link.onclick = function () {this.style.display='none';document.getElementById('tr_replyto_'+ID).style.display='';document.getElementById('space_link_2_'+ID).style.display='none';input_replyto.focus();return false;} 
    30823094        td2_link.appendChild(a_replyto_link); 
    30833095        tr_link.appendChild(td1_link); 
  • trunk/expressoMail1_2/js/messages_controller.js

    r4790 r4826  
    4444                        expresso_local_messages.delete_msgs(msgs_number, border_ID); 
    4545                        draw_tree_local_folders(); 
     46                         update_local_box(); 
    4647                } 
    4748        } 
     
    228229                                this.aux_interface_remove_mails(msgs_number, new_folder_name, border_ID); 
    229230                                draw_tree_local_folders(); 
     231                                update_local_box(); 
    230232                        } 
    231233                        else  
Note: See TracChangeset for help on using the changeset viewer.