draw_message.prototype.draw_message_header = function(header,border_id){
this.id = border_id;
var table_message = createAndSet("TABLE",['id','border','width'],['table_message_'+border_id,"0","100%"]);
table_message.id = 'table_message_'+border_id;
var tbody_message = document.createElement("TBODY");
if (!this.make_options_message(header,tbody_message))
return;
table_message.appendChild(tbody_message);
var content = document.getElementById('content_id_' + border_id);
content.style.height = (window.innerHeight ? window.innerHeight : document.body.offsetHeight) - 180;
content.appendChild(table_message);
loading_img = content.appendChild(loading_img);
};
draw_message.prototype.draw_message_body = function (info_msg){
var table_message = Element('table_message_'+this.id);
var tbody_message = table_message.childNodes[0];
var _bodymsg_otheropt = document.createElement("TBODY");
var tr1 = document.createElement("TR");
tr1.className = "tr_message_header";
var td1 = createAndSet('TD',['width'],['7%'],get_lang("From: "));
td1.appendChild(deny_email(info_msg.from.email));
var id=this.id;
if (info_msg.sender){
var tr111 = document.createElement("TR");
tr111.className = "tr_message_header";
var td111 = createAndSet('TD',['noWrap'],['true'],get_lang("Sent by")+": ");
td111.appendChild(deny_email(info_msg.sender.email));
var sender = document.createElement("TD");
sender.className = "header_message_field";
sender.id = "sender_"+id;
sender.innerHTML += this.draw_plugin_cc(info_msg.sender.full);
var sender_values = createAndSet("INPUT",['id','type','value'],["sender_values_"+id,"HIDDEN",info_msg.sender.full]);
_bodymsg_otheropt.appendChild(appendChilds(tr111, td111, sender, sender_values));
}
var from = createAndSet('TD',['id','class'],["from_"+this.id,"header_message_field"],info_msg.from.full);
if (info_msg.Draft != "X"){
from.innerHTML += this.draw_plugin_cc(info_msg.from);
_bodymsg_otheropt.appendChild(tr1);
}
var from_values = createAndSet('INPUT',['id','type','value'],["from_values_"+id,"HIDDEN",info_msg.from.full]);
var local_message = createAndSet("INPUT",['id','name','type','value'],["is_local_"+this.id,"is_local","HIDDEN",(info_msg.local_message)?"1":"0"]);
appendChilds(tr1,td1,from,from_values,local_message);
if(typeof(info_msg.signature) != 'undefined'){
if(info_msg.signature.length > 0){
var aux_signature = '';
for (i=0; i < info_msg.signature.length; i++)
aux_signature += ''+info_msg.signature[i]+'
';
var tr7 = document.createElement("TR");
tr7.className = "tr_message_header";
var td7 = document.createElement("TD");
td7.innerHTML = 'Assinatura
Digital:';
td7.vAlign = 'top';
var _certs = createAndSet('TD',['id', 'class'],["certs_"+this.id, "header_message_field"],aux_signature);
_bodymsg_otheropt.appendChild(appendChilds(tr7,td7,_certs));
}
}
if (info_msg.reply_to){
var tr11 = document.createElement("TR");
tr11.className = "tr_message_header";
var _td11 = createAndSet('TD',['noWrap'],['true'],get_lang("Reply to")+": ");
var _reply_to = createAndSet('TD',['id', 'class'],["reply_to_"+id, "header_message_field"],this.draw_plugin_cc(info_msg.reply_to));
var _reply_to_values = createAndSet('INPUT',['id', 'type', 'value'],["reply_to_values_"+id,"HIDDEN",info_msg.reply_to]);
_bodymsg_otheropt.appendChild(appendChilds(tr11,_td11,_reply_to,_reply_to_values));
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
var tr2 = document.createElement("TR");
tr2.className = "tr_message_header";
var td2 = document.createElement("TD");
td2.innerHTML = get_lang("To: ");
var to = document.createElement("TD");
to.id = "to_"+id;
var _to_values = createAndSet('INPUT',['id', 'type', 'value'],["to_values_"+id, "HIDDEN", info_msg.toaddress2]);
// Salva a pasta da mensagem
var _input_cfolder = createAndSet('INPUT',['id', 'name', 'type', 'value'],["input_folder_"+id, "input_folder", "hidden", info_msg.msg_folder]);
td2.appendChild(_input_cfolder);
toaddress_array[id] = info_msg.toaddress2.split(",");
if (toaddress_array[id].length > 1){
to.innerHTML += this.draw_plugin_cc(toaddress_array[id][0]);
var _div_toaddrs = createAndSet('SPAN',['id','style'],["div_toaddress_"+id,'display: inline']," ("+get_lang('more')+")");
to.appendChild(_div_toaddrs);
}
else {
toAdd = toaddress_array[id].toString().replace("<","<");
toAdd = toAdd.replace(">",">");
to.innerHTML += this.draw_plugin_cc(toAdd);
}
to.className = "header_message_field";
_bodymsg_otheropt.appendChild(appendChilds(tr2,td2,to,_to_values));
if (info_msg.cc){
var tr3 = document.createElement("TR");
tr3.className = "tr_message_header";
var td3 = document.createElement("TD");
td3.innerHTML = "CC: ";
var cc = createAndSet("TD",['id', 'class'],["cc_"+this.id,"header_message_field"]);
var cc_values = createAndSet("INPUT",['id', 'type', 'value'],["cc_values_"+this.id, "HIDDEN", info_msg.cc]);
ccaddress_array[this.id] = info_msg.cc.split(",");
if (ccaddress_array[this.id].length > 1){
var div_ccaddress = document.createElement("SPAN");
div_ccaddress.id = "div_ccaddress_"+this.id;
var div_ccaddress_full = createAndSet("SPAN",['id', 'style'],["div_ccaddress_full_"+this.id, "display: inline"]);
cc.innerHTML = this.draw_plugin_cc(ccaddress_array[this.id][0]);
div_ccaddress.innerHTML += " ("+get_lang('more')+")";
cc.appendChild(div_ccaddress);
}
else{
cc.innerHTML = this.draw_plugin_cc(info_msg.cc);
}
_bodymsg_otheropt.appendChild(appendChilds(tr3,td3,cc,cc_values));
}
if (info_msg.bcc)
{
_bodymsg_otheropt.appendChild(this.getBcc(info_msg.bcc));
}
var tr4 = document.createElement("TR");
tr4.className = "tr_message_header";
var td4 = document.createElement("TD");
td4.innerHTML = get_lang("Date: ");
var msgFull = info_msg.fulldate.split(' ');
var date = createAndSet('TD',['id','class'],["date_"+id,"header_message_field"],info_msg.fulldate);
var date_day = createAndSet('INPUT',['id', 'type', 'value'],["date_day_"+id, "HIDDEN", msgFull[0]]);
var date_hour = createAndSet('INPUT',['id', 'type', 'value'],["date_hour_"+id, "HIDDEN", msgFull[1]]);
_bodymsg_otheropt.appendChild(appendChilds(tr4,td4,date,date_day,date_hour));
var tr5 = document.createElement("TR");
tr5.className = "tr_message_header";
var td5 = document.createElement("TD");
td5.innerHTML = get_lang("Subject");
var subject = createAndSet('TD',['id', 'class'],["subject_"+this.id, "header_message_field"],info_msg.subject);
_bodymsg_otheropt.appendChild(appendChilds(tr5,td5,subject));
if ( info_msg.attachments && info_msg.attachments.length > 0){
var tr6 = document.createElement("TR");
tr6.className = "tr_message_header";
var td6 = document.createElement("TD");
td6.innerHTML = get_lang("Attachments: ");
var attachments = document.createElement("TD");
attachments.align='left';
td6.vAlign = "top";
var zipped_attachments = '';
if(info_msg.attachments.length >= 1) {
var zipped_attachments = createAndSet("TABLE",['style','cellPadding','cellSpacing'],['margin-bottom: 4px','0','0']);
var td = document.createElement("TD");
if(info_msg.attachments.length > 1) {
var link_attachment = document.createElement("A");
if(proxy_mensagens.is_local_folder(current_folder))
link_attachment.setAttribute("href", "javascript:expresso_local_messages._downalllocalatt('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
else
link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments');
link_attachment.innerHTML += '
';
td.appendChild(link_attachment);
}
var tr = document.createElement("TR");
if(parseInt(preferences.remove_attachments_function))
{
var del_attachments = document.createElement("A");
del_attachments.setAttribute("href", "javascript:remove_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
del_attachments.innerHTML = get_lang('remove all attachments');
del_attachments.appendChild(document.createElement('BR'));
td.appendChild(del_attachments);
tr.appendChild(td);
}
tr.appendChild(td);
zipped_attachments.appendChild(tr);
attachments.appendChild(zipped_attachments);
}
attachments.id = "attachments_" + this.id;
for (var i=0; i';
attachments.appendChild(link_attachment);
}
}
tr6.appendChild(td6);
tr6.appendChild(attachments);
_bodymsg_otheropt.appendChild(tr6);
}
var div = document.createElement("DIV");
div.id = "div_message_scroll_"+this.id;
div.style.background = 'WHITE';
div.style.overflow = "auto";
div.style.width = "100%";
var table_msg_details = createAndSet("TABLE",['id','width','class'],['table_msg_details_' + this.id, '100%','table_message']);
table_msg_details.style.display = 'none';
table_msg_details.appendChild(_bodymsg_otheropt);
div.appendChild(table_msg_details);
var tr = document.createElement("TR");
var td = document.createElement("TD");
td.colSpan = '2';
var newBody = this.blockImage(info_msg,this.id,td);
td.appendChild(div);
tr.appendChild(td);
tbody_message.appendChild(tr);
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Make the body message.
///////////////////////////////////////////////////////////////////////////////////////////////////////
var tr = document.createElement("TR");
tr.className = "tr_message_body";
var td = document.createElement("TD");
//td.setAttribute("colSpan","2");
newBody = newBody.replace(""+newBody+"
";
function mailto( link )
{
var mail = link.href.substr( 7 );
link.onclick = function( )
{
new_message_to( mail );
return false;
};
}
var links = div.getElementsByTagName( 'a' );
for ( var i = 0; i < links.length; i++ ){
try{
if ( links.item( i ).href.indexOf( 'mailto:' ) === 0 ){
mailto( links.item( i ) );
}
else{
if ( links.item( i ).href.indexOf( 'javascript:' ) !== 0 )
links.item( i ).setAttribute( 'target', '_blank' );
}
}catch(e){
}
}
if ((info_msg.thumbs)&&(info_msg.thumbs.length > 0)){
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Make the thumbs of the message.
//////////////////////////////////////////////////////////////////////////////////////////////////////
div.appendChild(this.getThumbs(info_msg.attachments, info_msg.thumbs, info_msg.msg_number, info_msg.msg_folder));
}
var msg_number = createAndSet("INPUT",['id','type','value'],["msg_number_" + this.id, "hidden", info_msg.msg_number]);
var content = document.getElementById('content_id_' + this.id);
try{
loading_img = content.removeChild( loading_img );
}
catch(e){
delete_border(this.id);
setTimeout('expresso.connector.cacheNextRequest();'+
'cExecute("expressoMail1_2.imap_functions.get_info_msg&msg_number='+ info_msg.msg_number + '&msg_folder=" + current_folder, show_msg)',200);
};
content.appendChild(msg_number);
//////////////////////////////////////////////////////////////////////////////////////////////////////
//Exibe o cabecalho da mensagem totalmente aberto caso esteja setado nas preferencias do usuario
if (preferences.show_head_msg_full == 1)
{
option_hide_more.onclick();
if (Element('div_toaddress_'+this.id) != null)
{
show_div_address_full(this.id,'to');
}
if (Element('div_ccaddress_'+this.id) != null)
{
show_div_address_full(this.id,'cc');
}
}
};
draw_message.prototype.make_options_message = function(info_msg, tbody_message){
var tr0 = document.createElement("TR");
tr0.className = "tr_message_header";
var td0 = document.createElement("TD");
var table_message_options = createAndSet("TABLE",['border','width','class'],["0","100%",'table_message']);
var tbody_message_options = document.createElement("TBODY");
var tr = document.createElement("TR");
var td = document.createElement("TD");
td.setAttribute("noWrap","true");
var _name = '';
var menuHidden = Element("folderscol").style.display == 'none' ? true : false;
var folder_id = info_msg.msg_number;
var folder = document.getElementById(folder_id);
if (!folder){
delete_border(this.id);
return false;
}
var next_previous_msg_td = this.createNxtPrevButtons(info_msg.msg_folder,folder_id);
if (typeof(next_previous_msg_td) == 'undefined')
return false;
var _maxChar = menuHidden ? 40 : 15;
if (info_msg.from.name)
{
var spanName = document.createElement("SPAN");
spanName.innerHTML = info_msg.from.name;
_name = spanName.innerHTML.length > _maxChar ? spanName.innerHTML.substring(0,_maxChar) + "..." : spanName.innerHTML;
}
else
_name = info_msg.from.email.length > _maxChar ? info_msg.from.email.substring(0,_maxChar) + "..." : info_msg.from.email;
var id = this.id;
td.innerHTML = _name.bold() + ', ' +strDateShow(info_msg.udate)+' ';
if (info_msg.attachment.names.length > 0)
td.innerHTML += " ";
if(typeof(info_msg.signature) != 'undefined')
{
if(info_msg.signature[0].indexOf('Message untouched') >= 0)
td.innerHTML += " ";
else
td.innerHTML += " ";
}
if (info_msg.DispositionNotificationTo)
{
td.innerHTML += ' ';
}
// NORMAL MSG
if(info_msg.Draft != 'X')
{
var options = createAndSet("TD",['noWrap','width','align'],['true','30%','right']);
var option_hide_more = createAndSet("SPAN",['class','value','id'],['message_options','more_options','option_hide_more_'+id],get_lang('show details'));
option_hide_more.onclick = function(){
if (this.value != 'hide_options'){
this.innerHTML = ""+get_lang('hide details')+"";
this.value = 'hide_options';
Element('table_msg_details_'+id).style.display = '';
}
else{
this.innerHTML = get_lang('show details');
this.value = 'more_options';
Element('table_msg_details_'+id).style.display = 'none';
}
resizeWindow();
};
option_hide_more.onmouseover=function () { this.className='message_options_active'; };
option_hide_more.onmouseout=function () { this.className='message_options' };
var option_mark = createAndSet("TD",['width','align'],['50%','left']);
var option_mark_as = ''+get_lang("Mark as")+': ';
var option_mark_as_unseen = document.createElement("SPAN");
option_mark_as_unseen.className = "message_options";
option_mark_as_unseen.onclick = function () { changeLinkState(this,'seen');
set_messages_flag('unseen',folder_id);
write_msg(get_lang('Message marked as ')+get_lang("Unseen"));
};
option_mark_as_unseen.onmouseover=function () { this.className='message_options_active'; };
option_mark_as_unseen.onmouseout=function () { this.className='message_options' };
option_mark_as_unseen.innerHTML = get_lang("Unseen");
var option_mark_important = document.createElement("SPAN");
option_mark_important.className = 'message_options';
option_mark_important.style.paddingLeft = "10px";
option_mark_important.onmouseover=function () { this.className='message_options_active'; };
option_mark_important.onmouseout=function () { this.className='message_options' };
if (info_msg.Flagged == "F"){
option_mark_important.onclick = function() { changeLinkState(this,'important');
set_messages_flag('unflagged',folder_id);
write_msg(get_lang('Message marked as ')+get_lang("Normal"));
};
option_mark_important.innerHTML = get_lang("Normal");
}
else{
option_mark_important.onclick = function() { changeLinkState(this,'normal');
set_messages_flag('flagged',folder_id);
write_msg(get_lang('Message marked as ')+get_lang("Important"));
};
option_mark_important.innerHTML = get_lang("Important");
}
option_mark.innerHTML = option_mark_as;
option_mark.appendChild(option_mark_as_unseen);
option_mark.appendChild(option_mark_important);
var option_forward = createAndSet("SPAN",['id','class'],['msg_opt_forward_'+this.id, 'message_options'],get_lang('Forward'));
option_forward.onmouseover=function () { this.className='message_options_active'; };
option_forward.onmouseout=function () { this.className='message_options' };
option_forward.onclick = function(){new_message('forward', id);};
appendChilds(options,option_hide_more,createAndSet('SPAN',false,false,' | '),option_forward);
var option_reply_options = createAndSet("IMG",['id', 'src', 'value'],['msg_opt_reply_options_'+id,URL_SERVER+'expressoMail1_2/templates/default/images/down.png','show']);
option_reply_options.onmouseover = function(){
option_reply_options.src= URL_SERVER+'expressoMail1_2/templates/default/images/over.png';
};
option_reply_options.onmouseout = function(){
if (this.value == 'show')
{
option_reply_options.src= URL_SERVER+'expressoMail1_2/templates/default/images/down.png';
}
else
{
option_reply_options.src= URL_SERVER+'expressoMail1_2/templates/default/images/pressed.png';
}
};
option_reply_options.onclick = function(){
if (this.value != 'hide'){
this.value = 'hide';
option_reply_options.src= URL_SERVER+'expressoMail1_2/templates/default/images/pressed.png';
Element('tr_other_options_'+id).style.display = '';
}
else{
this.value = 'show';
option_reply_options.src= URL_SERVER+'expressoMail1_2/templates/default/images/down.png';
Element('tr_other_options_'+id).style.display = 'none';
}
};
var _option_reply = createAndSet("SPAN",['id','class'],['msg_opt_reply_'+id,'message_options'],get_lang('Reply'));
_option_reply.onmouseover=function () { this.className='message_options_active'; };
_option_reply.onmouseout=function () { this.className='message_options' };
_option_reply.onclick = function(){new_message('reply_with_history', id);};
appendChilds(options,createAndSet('SPAN',false,false,' | '),option_reply_options,_option_reply);
appendChilds(tr,td,option_mark,options,next_previous_msg_td);
tbody_message_options.appendChild(tr);
////////// OTHER OPTIONS ////////////////////
var _tr_other_options = createAndSet("TR",['id'],['tr_other_options_' + id]);
_tr_other_options.style.display = 'none';
var div_other_options = document.createElement("DIV");
var option_mark_as_unseen = ''+get_lang("Unseen")+', ';
var _optmarkimportant = ''+get_lang("Important")+', ';
var option_mark_as_normal = ''+get_lang("Normal")+' | ';
var _opt_rplywithout_hist = ''+get_lang("Reply without history")+'';
var option_reply_to_all = ''+get_lang("Reply to all")+' | ';
var _optreply_allwhithout_hist = ''+get_lang("Reply to all without history")+' | ';
div_other_options.innerHTML = option_reply_to_all + _optreply_allwhithout_hist + _opt_rplywithout_hist;
if (use_spam_filter) {
if(info_msg.msg_folder == 'INBOX'+cyrus_delimiter+'Spam')
div_other_options.innerHTML += ' | '+get_lang("Not Spam")+'';
else
div_other_options.innerHTML += ' | '+get_lang("Mark as Spam")+'';
}
var td_other_options = createAndSet("TD",['colSpan','align','noWrap'],['3','right','true']);
td_other_options.appendChild(div_other_options);
_tr_other_options.appendChild(td_other_options);
tbody_message_options.appendChild(_tr_other_options);
////////// END OTHER OPTIONS ////////////////
table_message_options.appendChild(tbody_message_options);
td0.appendChild(table_message_options);
tr0.appendChild(td0);
tbody_message.appendChild(tr0);
//if (info_msg.signature && info_msg.signature.length > 0)
//{
//tbody_message.appendChild(draw_msg.putSignature(this.id,info_msg,td));
//alert(info_msg.signature);
//}
}
else // IF DRAFT
{
var options = createAndSet('TD',['width','noWrap','align'],['1%','true','right']);
var option_hide_more = createAndSet("SPAN",['class','value','id'],['message_options','more_options','option_hide_more_'+this.id],get_lang('Show details'));
option_hide_more.onclick = function(){
var _height = Element("div_message_scroll_"+id).style.height;
_height = parseInt(_height.replace("px",""));
var _offset = 35;
if (this.value != 'hide_options'){
this.innerHTML = ""+get_lang('Hide details')+"";
this.value = 'hide_options';
Element("div_message_scroll_"+id).style.height = (_height - _offset)+"px";
Element('table_msg_details_'+id).style.display = '';
}
else{
this.innerHTML = get_lang('show details');
this.value = 'more_options';
Element("div_message_scroll_"+id).style.height = (_height + _offset)+"px";
Element('table_msg_details_'+id).style.display = 'none';
}
};
var option_edit = createAndSet('SPAN',['class'],['message_options'], get_lang('Edit'));
option_edit.onclick= function () { new_message('edit',this.id); };
appendChilds(options, option_hide_more, createAndSet('SPAN',false,false," | "), option_edit);
tbody_message_options.appendChild(appendChilds(tr, td, options, next_previous_msg_td));
table_message_options.appendChild(tbody_message_options);
td0.appendChild(table_message_options);
tr0.appendChild(td0);
tbody_message.appendChild(tr0);
}
return true;
};
/* Class draw_message */
function draw_message(){
this.id=0;
}
draw_message.prototype.createNxtPrevButtons = function(msg_folder,folder_id){
var next_previous_msg_td = createAndSet("TD",[ "noWrap", "align", "width" ], [ "true", "right", "40px"]);
var img_next_msg = createAndSet("IMG", [ 'id', 'src', 'title' ], [
'msg_opt_next_' + this.id,
URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/down.button.png',
get_lang('Next') ]);
img_next_msg.style.cursor = 'pointer';
var folder = document.getElementById(folder_id);
if (folder){ // mensagem local criptografada nao tem ID da pasta local
if (folder.nextSibling){
var nextMsgBox = folder.nextSibling.name?folder.nextSibling.name:msg_folder;
if (nextMsgBox == "INBOX/decifradas")// teste para ver se a mensagem vem da pasta oculta decifradas
nextMsgBox = get_current_folder();
img_next_msg.onclick = function()
{
openTab.type[currentTab] = 2;
if ( nextMsgBox == undefined )
nextMsgBox = current_folder;
for (var i=0; i < draw_box.headers_msgs.length; i++)
if (draw_box.headers_msgs[i].msg_number == folder.nextSibling.id){
var nextHeader = draw_box.headers_msgs[i];
break;
}
proxy_mensagens.get_msg(nextHeader,nextMsgBox,true,show_msg,currentTab);
};
}
else
{
img_next_msg.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/down.gray.button.png';
img_next_msg.style.cursor = 'default';
}
}
else
{
img_next_msg.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/down.gray.button.png';
img_next_msg.style.cursor = 'default';
if (!proxy_mensagens.is_local_folder(get_current_folder()) && !(msg_folder == "INBOX/decifradas")) // testa se a mensagem e local
{
img_next_msg.onclick = function()
{
delete_border(this.id);
};
}
}
var img_space = document.createElement("SPAN");
img_space.innerHTML = " ";
var img_previous_msg = createAndSet("IMG",['id','src','title'],['msg_opt_previous_' + this.id,
URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/up.button.png',
get_lang('Previous')]);
img_previous_msg.style.cursor = 'pointer';
if (!folder){
delete_border(this.id);
return;
}
if (folder){ // mensagem local criptografada nao tem this.id da pasta local
if (folder.previousSibling)
{
var previousMsgBox = folder.previousSibling.name?folder.previousSibling.name:msg_folder;
if (previousMsgBox == "INBOX/decifradas") // teste para ver se a mensagem vem da pasta oculta decifradas
previousMsgBox = get_current_folder();
img_previous_msg.onclick = function()
{
openTab.type[currentTab] = 2;
if ( previousMsgBox == undefined )
previousMsgBox = current_folder;
for (var i=0; i < draw_box.headers_msgs.length; i++)
if (draw_box.headers_msgs[i].msg_number == folder.previousSibling.id){
var previousHeader = draw_box.headers_msgs[i];
break;
}
proxy_mensagens.get_msg(previousHeader,previousMsgBox,true,show_msg,currentTab);
};
}
else
{
img_previous_msg.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/up.gray.button.png';
img_previous_msg.style.cursor = 'default';
}
}
else
{
img_previous_msg.src = URL_SERVER + 'expressoMail1_2/templates/'+template+'/images/up.gray.button.png';
img_previous_msg.style.cursor = 'default';
if (!proxy_mensagens.is_local_folder(get_current_folder()) && !(msg_folder == "INBOX/decifradas")) // testa se a mensagem e local
{
img_previous_msg.onclick = function()
{
delete_border(this.id);
};
}
}
next_previous_msg_td.appendChild(img_previous_msg);
next_previous_msg_td.appendChild(img_space);
next_previous_msg_td.appendChild(img_next_msg);
return next_previous_msg_td;
};
var idx_cc = 0;
draw_message.prototype.draw_plugin_cc = function(addrs)
{
expresso.connector.loadScript("jscode/ccQuickAdd");
var id=this.id;
var array_addrs = '';
var array_name = '';
var cc_data = new Array();
if(typeof(addrs.name) != 'undefined') {
array_name = LTrim(addrs.name).split(" ");
array_addrs = new Array(addrs.email);
}
else {
array_addrs = (typeof addrs == 'object' ? addrs.toString().split("\" ") : addrs.split("\" "));
array_name = LTrim(array_addrs[0]).replace('"','').split(" ");
}
var _split = array_name[0].split('@');
cc_data[0] = _split[0];
cc_data[1] = _split[0];
cc_data[2] = '';
for (i=1; i < array_name.length; i++)
cc_data[2] += array_name[i] + " ";
if(array_addrs.length > 1)
cc_data[3] = array_addrs[1] ? array_addrs[1].replace("<",'').replace(">",'') : '';
else
cc_data[3] = array_addrs[0];
var sm_envelope_img1 = '';
var to_addybook_add = "";
to_addybook_add += addrs;
to_addybook_add += sm_envelope_img1;
idx_cc++;
to_addybook_add += "";
return to_addybook_add;
};
draw_message.prototype.getThumbs = function(attachments, thumbs, msg_number, msg_folder){
var table_message_thumbs = document.createElement("TABLE");
table_message_thumbs.width = "80%";
table_message_thumbs.style.borderTop = "2px solid rgb(170, 170, 170)";
var tbody_message_thumbs = document.createElement("TBODY");
var tr = document.createElement("TR");
tr.className = "tr_message_body";
var td = document.createElement("TD");
td.setAttribute("colSpan","2");
td.id = "body_thumbs_"+msg_number;
td.innerHTML += " "+attachments.length+" "+get_lang("attachment")+(attachments.length > 1 ? "s" : "")+" "+get_lang("in this message")+"";
var _link_attachments = '';
if(thumbs.length > 1){
_link_attachments = document.createElement("A");
_link_attachments.className = "message_options";
if(proxy_mensagens.is_local_folder(current_folder))
_link_attachments.setAttribute("href", "javascript:expresso_local_messages._downalllocalatt('"+msg_folder+"','"+msg_number+"')");
else
_link_attachments.setAttribute("href", "javascript:download_all_attachments('"+msg_folder+"','"+msg_number+"')");
_link_attachments.innerHTML = get_lang('Download all atachments');
}
if(_link_attachments){
td.innerHTML += " :: ";
td.appendChild(_link_attachments);
}
td.innerHTML += "
"+get_lang("Tip: For faster save, click over the image with right button.");
td.innerHTML += "
";
for (var i=0; i";
td.innerHTML += thumbs[i];
td.innerHTML += " ";
}
tr.appendChild(td);
tbody_message_thumbs.appendChild(tr);
table_message_thumbs.appendChild(tbody_message_thumbs);
return table_message_thumbs;
};
draw_message.prototype.getBcc = function(bccField){
/*
* @AUTHOR Rodrigo Souza dos Santos
* @MODIFY-DATE 2008/09/11
* @BRIEF Adding routine to create bcc (blind carbon copy) field if there is one.
*/
var tr3 = document.createElement("tr");
tr3.className = "tr_message_header";
var td3 = document.createElement("td");
td3.innerHTML = get_lang("BCC") + " : ";
var cco = document.createElement("td");
cco.id = "cco_"+this.id;
var cco_values = createAndSet("INPUT",['id', 'type', 'value'],["cco_values_"+this.id,"hidden",bccField]);
ccoaddress_array[this.id] = bccField.split(",");
if (ccoaddress_array[this.id].length > 1){
var div_ccoaddress = document.createElement("SPAN");
div_ccoaddress.id = "div_ccoaddress_"+this.id;
var div_ccoaddress_full = createAndSet("SPAN",['id', 'style'],["div_ccoaddress_full_"+this.id, "display:inline"]);
/*
* The function below is ugly, doesn't possible use this.
* The problem is that the code's function was written
* on a hardcode concept.
*/
//cco.innerHTML = this.draw_plugin_cc(ccoaddress_array[this.id][0]);
cco.innerHTML = ccoaddress_array[this.id][0];
div_ccoaddress.innerHTML += " ("+get_lang('more')+")";
cco.appendChild(div_ccoaddress);
}
else{
/*
* The function below is ugly, it is not possible to use this.
* The problem is that the code's function was written
* on a hardcode concept.
*/
//cco.innerHTML = this.draw_plugin_cc(info_msg.cco);
cco.innerHTML = bccField;
}
cco.className = "header_message_field";
return appendChilds(tr3,td3,cco,cco_values);
};
draw_message.prototype.blockImage = function(info_msg,ID,td){
var imgTag = info_msg.body.match(/(]*src[^>=]*=['"]?[^'">]*["']?[^>]*>)|(<[^>]*(style[^=>]*=['"][^>]*background(-image)?:[^:;>]*url\()[^>]*>)/gi);
var newBody = info_msg.body;
if(!info_msg.showImg && imgTag)
{
var domains = '';
var blocked = false;
var forbidden = true;
if (preferences.notification_domains != null && typeof(preferences.notification_domains) != 'undefined')
{
domains = preferences.notification_domains.split(',');
for(var j = 0; j < imgTag.length; j++)
{
for (var i = 0; i < domains.length; i++)
{
if (imgTag[j].match(/cid:([\w\d]){5,}/) || imgTag[j].match(/src=\"\.\/inc\/show_embedded_attach\.php/g))
{
forbidden = false;
continue;
}
imgSource = imgTag[j].match(/=['"](http:\/\/)+[^'"\/]*/);
if (imgSource && imgSource.toString().substr(5).match(domains[i]))
forbidden = false;
}
if (forbidden)
{
newBody = newBody.replace(imgTag[j],"");
blocked=true;
}
}
if (blocked)
{
var showImgLink = document.createElement('DIV');
showImgLink.id="show_img_link_"+ID;
showImgLink.onclick = function(){show_msg_img(info_msg.msg_number,info_msg.msg_folder)};
showImgLink.className="show_img_link";
showImgLink.innerHTML = get_lang("Show images from")+": "+info_msg.from.email;
td.appendChild(showImgLink);
}
}
}
return newBody;
};
draw_msg = new draw_message();