Changeset 2708


Ignore:
Timestamp:
05/05/10 08:59:45 (14 years ago)
Author:
rafaelraymundo
Message:

Ticket #1063 - Acerta posicao do icone mensagem assinada

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/jscode/draw_api_messages.js

    r2705 r2708  
    215215 
    216216 
    217 function getSignature(ID,info_msg){ 
    218                         var tr_signature = document.createElement("TR"); 
    219                         var td_signature = document.createElement("TD"); 
    220                         td_signature.className = 'tr_message_header'; 
    221                         tr_signature.id = 'tr_signature_'+ID; 
    222                         td_signature.colSpan = "5"; 
    223                         tr_signature.style.display = 'none'; 
    224  
    225                         for (i=0; i < info_msg.signature.length; i++) 
    226                                 td_signature.innerHTML += '<span>'+info_msg.signature[i]+'</span> <br /> '; 
    227                         var signature_status_pos = info_msg.signature[0].indexOf('Message untouched'); 
    228                         td_signature.id = "td_signature_"+ID; 
    229                         if(signature_status_pos < 0 ) 
    230                         { 
    231                                 td.innerHTML += '&nbsp;<img style="cursor:pointer" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed_error.gif" title="'+get_lang("Details")+'">'; 
    232                                 tr_signature.style.display = ''; 
    233                         } 
    234                         else 
    235                         { 
    236                                 td.innerHTML += '&nbsp;<img style="cursor:pointer" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed_table.gif" title="'+get_lang("Details")+'">'; 
    237                         } 
    238                         td.onclick = function(){ 
    239                                 var _height = Element("div_message_scroll_"+ID).style.height; 
    240                                 _height = parseInt(_height.replace("px","")); 
    241                                 var _offset = 130; 
    242                                 if (this.value == 'more_cert'){ 
    243                                         //this.innerHTML += "<b><u>Mais Informacoes</u></b>"; 
    244                                         this.value = 'hide_cert'; 
    245                                         Element("div_message_scroll_"+ID).style.height = (_height + _offset)+"px"; 
    246                                         Element('tr_signature_'+ID).style.display = 'none'; 
    247                                         Element('td_signature_'+ID).style.display = 'none'; 
    248  
    249                                 } 
    250                                 else{ 
    251                                         //this.innerHTML += "Mais Informacoes"; 
    252                                         this.value = 'more_cert'; 
    253                                         Element("div_message_scroll_"+ID).style.height = (_height - _offset)+"px"; 
    254                                         Element('tr_signature_'+ID).style.display = ''; 
    255                                         Element('td_signature_'+ID).style.display = ''; 
    256                                 } 
    257                         }; 
    258  
    259                         tr_signature.appendChild(td_signature); 
    260                         return tr_signature; 
    261                         /******************************************* Old signature   ***********************************************/ 
    262                         //if (info_msg.signature != "void") 
    263                         //      td.innerHTML += '&nbsp;<img style="cursor:pointer" onclick="alert(\''+ get_lang("This message is signed, and you can trust.") + info_msg.signature +'\');" src="'+tpl_img_path+'/signed.gif">'; 
    264                         //else 
    265                         //      td.innerHTML += "&nbsp;<img style='cursor:pointer' onclick='alert(\""+get_lang("This message is signed, but it is invalid. You should not trust on it.")+"\");' title='"+get_lang("Voided message")+"' src='"+tpl_img_path+"/invalid.gif'>"; 
    266                         /*****************************************                                                                                                                      ********/ 
    267 } 
    268  
     217function show_signature_certificate_data(ID){ 
     218        var _height = Element("div_message_scroll_"+ID).style.height; 
     219        _height = parseInt(_height.replace("px","")); 
     220        var _offset = 130; 
     221        if (this.value == 'more_cert'){ 
     222                //this.innerHTML += "<b><u>Mais Informaᅵᅵes</u></b>"; 
     223                this.value = 'hide_cert'; 
     224                Element("div_message_scroll_"+ID).style.height = (_height + _offset)+"px"; 
     225                Element('tr_signature_'+ID).style.display = 'none'; 
     226                Element('td_signature_'+ID).style.display = 'none'; 
     227 
     228        } 
     229        else{ 
     230                //this.innerHTML += "Mais Informaᅵᅵes"; 
     231                this.value = 'more_cert'; 
     232                Element("div_message_scroll_"+ID).style.height = (_height - _offset)+"px"; 
     233                Element('tr_signature_'+ID).style.display = ''; 
     234                Element('td_signature_'+ID).style.display = ''; 
     235        } 
     236    } 
     237 
     238function putSignature(ID,info_msg,tdx){ 
     239        var tr_signature = document.createElement("TR"); 
     240        var td_signature = document.createElement("TD"); 
     241        td_signature.className = 'tr_message_header'; 
     242        tr_signature.id = 'tr_signature_'+ID; 
     243        td_signature.colSpan = "5"; 
     244        tr_signature.style.display = 'none'; 
     245 
     246        for (i=0; i < info_msg.signature.length; i++) 
     247                td_signature.innerHTML += '<span>'+info_msg.signature[i]+'</span> <br /> '; 
     248        td_signature.innerHTML += '<hr></hr>'; 
     249        var signature_status_pos = info_msg.signature[0].indexOf('Message untouched'); 
     250        td_signature.id = "td_signature_"+ID; 
     251        if(signature_status_pos < 0 ) 
     252        { 
     253                tdx.innerHTML += '&nbsp;<img style="cursor:pointer" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed_error.gif" title="'+get_lang("Details")+'" onclick="show_signature_certificate_data(\'' + ID + '\')">'; 
     254                tr_signature.style.display = ''; 
     255        } 
     256        else 
     257        { 
     258                tdx.innerHTML += '&nbsp;<img style="cursor:pointer" src="' + URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/signed_table.gif" title="'+get_lang("Details")+'" onclick="show_signature_certificate_data(\'' + ID + '\')">'; 
     259        } 
     260        tr_signature.appendChild(td_signature); 
     261        return tr_signature; 
     262    } 
    269263function make_options_message(info_msg, tbody_message){ 
    270264        var tr0 = document.createElement("TR"); 
     
    428422                tbody_message_options.appendChild(_tr_other_options); 
    429423                ////////// END OTHER OPTIONS //////////////// 
    430  
    431                 if (info_msg.signature && info_msg.signature.length > 0) 
    432                 { 
    433                         tbody_message_options.appendChild(getSignature(ID,info_msg)); 
    434                 } 
    435  
    436424                table_message_options.appendChild(tbody_message_options); 
    437425                td0.appendChild(table_message_options); 
    438426                tr0.appendChild(td0); 
    439427                tbody_message.appendChild(tr0); 
     428                if (info_msg.signature && info_msg.signature.length > 0) 
     429                { 
     430                        tbody_message.appendChild(putSignature(ID,info_msg,td)); 
     431                } 
    440432        } 
    441433        else    // IF DRAFT 
Note: See TracChangeset for help on using the changeset viewer.