[976] | 1 | var openTab = { |
---|
[607] | 2 | 'type' : [], // 8 types of tabs, further info. see expressolivre.org/dev/wiki/mail/Documentacao |
---|
[320] | 3 | 'content_id' : [], |
---|
[607] | 4 | 'imapUid' : [], // Stores the imap email number of current tab |
---|
| 5 | 'countFile' : [0,0,0,0,0,0,0,0,0,0], // Stores the number of files attached in current tab |
---|
| 6 | 'imapBox' : [], // Stores the folder name |
---|
[646] | 7 | 'toPreserve' : [], // Check if the message should be removed from draft after send |
---|
| 8 | 'autosave_timer' : [] // The timeout timer for autosave function |
---|
[607] | 9 | }; |
---|
| 10 | var tabTypes = { |
---|
| 11 | 'new':4, |
---|
| 12 | 'forward':6, |
---|
| 13 | 'reply_with_history':7, |
---|
[3143] | 14 | 'reply_to_all_with_history':8, |
---|
| 15 | 'reply_without_history':9, |
---|
| 16 | 'reply_to_all_without_history':10, |
---|
[607] | 17 | 'edit':5 |
---|
| 18 | } |
---|
| 19 | var currentTab,numBox = 0; // Open Tab and num of mailboxes opened at context |
---|
[1747] | 20 | // Objeto Map, talvez o ideal fosse adicionar este objeto à Api do egroupware, e carregá-lo |
---|
| 21 | // aqui no expressoMail. |
---|
| 22 | function Map() |
---|
| 23 | { |
---|
[3035] | 24 | this.keys = new Array(); |
---|
| 25 | this.values = new Array(); |
---|
[1747] | 26 | } |
---|
| 27 | |
---|
| 28 | Map.prototype.add = function(key, value) |
---|
| 29 | { |
---|
[3035] | 30 | this.keys.push(key); |
---|
| 31 | this.values.push(value); |
---|
[1747] | 32 | } |
---|
| 33 | |
---|
| 34 | Map.prototype.get = function(key) |
---|
| 35 | { |
---|
[3035] | 36 | result = new Array(); |
---|
| 37 | for (i = 0; i < this.keys.length; i++) |
---|
| 38 | { |
---|
| 39 | if (this.keys[i] == key) |
---|
| 40 | { |
---|
| 41 | result.push(this.values[i]); |
---|
| 42 | } |
---|
| 43 | } |
---|
[1747] | 44 | |
---|
[3035] | 45 | if (result.length == 0) |
---|
| 46 | { |
---|
| 47 | return null; |
---|
| 48 | } |
---|
[1747] | 49 | |
---|
[3035] | 50 | return result; |
---|
[1747] | 51 | } |
---|
| 52 | |
---|
| 53 | var translatedFolders = new Map(); |
---|
| 54 | |
---|
[2] | 55 | function draw_tree_folders(folders){ |
---|
| 56 | // Check if the tree folders alredy exist. |
---|
[3035] | 57 | translatedFolders = new Map(); |
---|
[51] | 58 | if (Element('dftree_tree_folders')){ |
---|
[1121] | 59 | if (!expresso_offline) { |
---|
| 60 | var update_tree_folders = function(data){ |
---|
| 61 | build_quota(data); |
---|
| 62 | var unseen_in_mailbox = 0; |
---|
| 63 | var unseen_in_shared_folders = 0; |
---|
| 64 | for (var i=0; i<data.length; i++){ |
---|
| 65 | if ( data[i].folder_unseen > 0 ) |
---|
| 66 | { |
---|
| 67 | unseen_in_mailbox = parseInt( unseen_in_mailbox + data[ i ].folder_unseen ); |
---|
| 68 | if ( data[i].folder_id.indexOf( 'INBOX' ) !== 0 ) |
---|
| 69 | unseen_in_shared_folders = parseInt( unseen_in_shared_folders + data[ i ].folder_unseen ); |
---|
| 70 | } |
---|
[3035] | 71 | |
---|
[1121] | 72 | var folder_unseen = Element('dftree_'+data[i].folder_id+'_unseen'); |
---|
[3035] | 73 | |
---|
[1121] | 74 | if ((folder_unseen) && (data[i].folder_unseen > 0)) |
---|
| 75 | { |
---|
| 76 | folder_unseen.innerHTML = data[i].folder_unseen; |
---|
| 77 | } |
---|
| 78 | else if (data[i].folder_unseen > 0) |
---|
| 79 | { |
---|
| 80 | tree_folders.getNodeById(data[i].folder_id).alter({caption:lang_folder(data[i].folder_name) + '<font style=color:red> (</font><span id="dftree_'+data[i].folder_id+'_unseen" style=color:red>'+data[i].folder_unseen+'</span><font style=color:red>)</font>'}); |
---|
| 81 | tree_folders.getNodeById(data[i].folder_id)._refresh(); |
---|
| 82 | } |
---|
| 83 | else if (data[i].folder_unseen <= 0) |
---|
| 84 | { |
---|
| 85 | tree_folders.getNodeById(data[i].folder_id).alter({caption:lang_folder(data[i].folder_name)}); |
---|
| 86 | tree_folders.getNodeById(data[i].folder_id)._refresh(); |
---|
| 87 | } |
---|
| 88 | |
---|
[3035] | 89 | if(data[i].folder_id == current_folder){ |
---|
[1121] | 90 | var old_new_m = isNaN(parseInt(Element('new_m').innerHTML)) ? parseInt(Element('new_m').firstChild.innerHTML) : parseInt(Element('new_m').innerHTML); |
---|
| 91 | Element('new_m').innerHTML = data[i].folder_unseen ? '<font color="RED">'+data[i].folder_unseen+'</font>' : 0; |
---|
| 92 | draw_paging(Element('tot_m').innerHTML); |
---|
| 93 | } |
---|
[790] | 94 | } |
---|
| 95 | |
---|
[1121] | 96 | var display_unseen_in_mailbox = tree_folders.getNodeById( 'root' ); |
---|
[3035] | 97 | display_unseen_in_mailbox.alter({caption:get_lang("My Folders")}); |
---|
[1121] | 98 | display_unseen_in_mailbox._refresh(); |
---|
[3035] | 99 | |
---|
[1121] | 100 | var display_unseen_in_shared_folders = tree_folders.getNodeById( 'user' ); |
---|
| 101 | if ( display_unseen_in_shared_folders ) |
---|
[2] | 102 | { |
---|
[1121] | 103 | if ( unseen_in_shared_folders ) |
---|
| 104 | display_unseen_in_shared_folders.alter({caption:'<font style=color:red>[</font><span id="dftree_user_unseen" style="color:red">' + unseen_in_shared_folders +'</span><font style=color:red>]</font> ' + get_lang("Shared folders")}); |
---|
| 105 | else |
---|
| 106 | display_unseen_in_shared_folders.alter({caption:get_lang("Shared folders")}); |
---|
| 107 | display_unseen_in_shared_folders._refresh(); |
---|
[2] | 108 | } |
---|
| 109 | } |
---|
[1121] | 110 | cExecute ("$this.imap_functions.get_folders_list&folder="+current_folder, update_tree_folders); |
---|
[2] | 111 | } |
---|
[3035] | 112 | |
---|
[2] | 113 | return; |
---|
| 114 | } |
---|
| 115 | else{ |
---|
[1121] | 116 | if (!expresso_offline) { |
---|
| 117 | tree_folders = new dFTree({name: 'tree_folders'}); |
---|
[3035] | 118 | |
---|
[1121] | 119 | var n_root = new dNode({id:'root', caption: get_lang("My Folders")}); |
---|
| 120 | tree_folders.add(n_root,'anything'); //Places the root; second argument can be anything. |
---|
[3035] | 121 | |
---|
[1121] | 122 | var unseen_in_mailbox = 0; |
---|
| 123 | var unseen_in_shared_folders = 0; |
---|
| 124 | for (var i=0; i<folders.length; i++){ |
---|
| 125 | if (folders[i].folder_unseen > 0) |
---|
| 126 | { |
---|
| 127 | unseen_in_mailbox = parseInt( unseen_in_mailbox + folders[ i ].folder_unseen ); |
---|
| 128 | if ( folders[i].folder_id.indexOf( 'INBOX' ) !== 0 ) |
---|
| 129 | unseen_in_shared_folders = parseInt( unseen_in_shared_folders + folders[ i ].folder_unseen ); |
---|
[790] | 130 | |
---|
[3035] | 131 | var nn = new dNode({id:folders[i].folder_id, caption:lang_folder(folders[i].folder_name) + '<font style=color:red> (</font><span id="dftree_'+folders[i].folder_id+'_unseen" style=color:red>'+folders[i].folder_unseen+'</span><font style=color:red>)</font>', onClick:"change_folder('"+folders[i].folder_id+"','"+folders[i].folder_name+"')", plusSign:folders[i].folder_hasChildren}); |
---|
| 132 | |
---|
[1121] | 133 | if( folders[i].folder_name.toLowerCase() == 'inbox' ) |
---|
| 134 | Element('new_m').innerHTML = '<font style="color:red">' + folders[i].folder_unseen + '</font>'; |
---|
[2] | 135 | } |
---|
[1121] | 136 | else |
---|
[3035] | 137 | var nn = new dNode({id:folders[i].folder_id, caption:lang_folder(folders[i].folder_name), onClick:"change_folder('"+folders[i].folder_id+"','"+folders[i].folder_name+"')", plusSign:folders[i].folder_hasChildren}); |
---|
| 138 | |
---|
[1121] | 139 | if (folders[i].folder_parent == '') |
---|
| 140 | folders[i].folder_parent = 'root'; |
---|
[3035] | 141 | else if (folders[i].folder_parent == 'user'){ |
---|
| 142 | |
---|
[1121] | 143 | if (!tree_folders.getNodeById('user')){ |
---|
[3035] | 144 | tmpFolderId = folders[i].folder_id.split(cyrus_delimiter).pop(); |
---|
| 145 | if (tmpFolderId != folders[i].folder_name) |
---|
| 146 | { |
---|
| 147 | translatedFolders.add(tmpFolderId, folders[i].folder_name); |
---|
| 148 | } |
---|
| 149 | var n_root_shared_folders = new dNode({id:'user', caption:get_lang("Shared folders"), plusSign:true}); |
---|
[1121] | 150 | tree_folders.add(n_root_shared_folders,'root'); |
---|
| 151 | } |
---|
| 152 | } |
---|
| 153 | tree_folders.add(nn,folders[i].folder_parent); |
---|
[2] | 154 | } |
---|
| 155 | } |
---|
[3178] | 156 | |
---|
| 157 | |
---|
| 158 | |
---|
| 159 | var handlerChannel = function(data){ |
---|
[3183] | 160 | if (data == null || typeof(data) == 'string') |
---|
[3178] | 161 | return; |
---|
| 162 | /* |
---|
| 163 | * RSS NEWS |
---|
| 164 | */ |
---|
| 165 | var root_rss = new dNode({ |
---|
| 166 | id: "news_root", |
---|
| 167 | caption: get_lang('News') |
---|
| 168 | }); |
---|
| 169 | tree_folders.add(root_rss, "root"); |
---|
| 170 | for(i=0; i < data.length; i++) |
---|
| 171 | { |
---|
| 172 | var nodeNews = new dNode({ |
---|
| 173 | id: "NEWS/"+data[i].name, |
---|
| 174 | caption: data[i].name, |
---|
| 175 | onClick: "open_rss('"+data[i].rss_url+"')", |
---|
| 176 | plusSign: 0 |
---|
| 177 | }); |
---|
| 178 | tree_folders.add(nodeNews,"news_root"); |
---|
| 179 | } |
---|
| 180 | var noden=document.getElementById('lnews_roottree_folders'); |
---|
| 181 | noden.style.backgroundImage="url(templates/"+template+"/images/menu/rss.png)"; |
---|
| 182 | } |
---|
[3267] | 183 | // cExecute('$this.rss.getChannels',handlerChannel); |
---|
[3178] | 184 | |
---|
| 185 | |
---|
[689] | 186 | /** |
---|
| 187 | * Pastas locais |
---|
| 188 | */ |
---|
[1121] | 189 | if (preferences.use_local_messages==1 || expresso_offline) { |
---|
[689] | 190 | if (!window.google || !google.gears) { |
---|
[1466] | 191 | if (!expresso_local_messages.installGears()) |
---|
[689] | 192 | preferences.use_local_messages=0; |
---|
| 193 | } |
---|
| 194 | else{ |
---|
[1518] | 195 | if (!window.google || !google.gears) { |
---|
[1701] | 196 | temp = confirm(get_lang("To use local messages you have to install google gears. Would you like to be redirected to gears installation page?")); |
---|
| 197 | if (temp) { |
---|
| 198 | location.href = "http://gears.google.com/?action=install&message="+ |
---|
| 199 | "Para utilizar o recurso de mensagens locais, instale o google gears&return=" + |
---|
| 200 | document.location.href; |
---|
[1518] | 201 | } |
---|
| 202 | else { |
---|
[1701] | 203 | preferences.use_local_messages=0; |
---|
| 204 | } |
---|
| 205 | } |
---|
| 206 | else{ |
---|
[3035] | 207 | if (expresso_offline) |
---|
[1701] | 208 | tree_folders = new dFTree({ |
---|
| 209 | name: 'tree_folders' |
---|
| 210 | }); |
---|
| 211 | var root_local = new dNode({ |
---|
| 212 | id: "local_root", |
---|
| 213 | caption: get_lang('local folders') |
---|
| 214 | }); |
---|
| 215 | tree_folders.add(root_local, "root"); //coloca root local |
---|
| 216 | var local_folders = expresso_local_messages.list_local_folders(); |
---|
| 217 | for (var i in local_folders) { //Coloca as pastas locais. |
---|
| 218 | var node_root = "local_root"; |
---|
| 219 | var new_caption = local_folders[i][0]; |
---|
| 220 | if (local_folders[i][0].indexOf("/") != "-1") { |
---|
| 221 | final_pos = local_folders[i][0].lastIndexOf("/"); |
---|
| 222 | node_root = "local_" + local_folders[i][0].substr(0, final_pos); |
---|
| 223 | new_caption = local_folders[i][0].substr(final_pos + 1); |
---|
| 224 | } |
---|
[3035] | 225 | if (local_folders[i][1] > 0) |
---|
[1701] | 226 | var nodeLocal = new dNode({ |
---|
| 227 | id: "local_" + local_folders[i][0], |
---|
| 228 | caption: lang_folder(new_caption) + '<font style=color:red> (</font><span id="local_unseen" style=color:red>' + local_folders[i][1] + '</span><font style=color:red>)</font>', |
---|
| 229 | onClick: "change_folder('local_" + local_folders[i][0] + "','" + new_caption + "')", |
---|
| 230 | plusSign: local_folders[i][2] |
---|
[689] | 231 | }); |
---|
[3035] | 232 | else |
---|
[1701] | 233 | var nodeLocal = new dNode({ |
---|
| 234 | id: "local_" + local_folders[i][0], |
---|
| 235 | caption: lang_folder(new_caption), |
---|
| 236 | onClick: "change_folder('local_" + local_folders[i][0] + "','" + new_caption + "')", |
---|
| 237 | plusSign: local_folders[i][2] |
---|
| 238 | }); |
---|
[1518] | 239 | tree_folders.add(nodeLocal, node_root); |
---|
| 240 | } |
---|
[689] | 241 | } |
---|
[3035] | 242 | } |
---|
[689] | 243 | } |
---|
| 244 | |
---|
[2] | 245 | tree_folders.draw(Element('content_folders')); |
---|
[1121] | 246 | if (!expresso_offline) { |
---|
| 247 | n_root.changeState(); |
---|
| 248 | tree_folders.getNodeById('INBOX')._select(); |
---|
| 249 | } |
---|
| 250 | else { |
---|
| 251 | root_local.changeState(); |
---|
| 252 | tree_folders.getNodeById('local_Inbox')._select(); |
---|
| 253 | } |
---|
[790] | 254 | |
---|
| 255 | var trash_span=document.getElementById('lINBOX/'+trashfolder+'tree_folders'); |
---|
| 256 | var draft_span=document.getElementById('lINBOX/'+draftsfolder+'tree_folders'); |
---|
[3287] | 257 | var sent_span=document.getElementById('l'+this.preferences.save_in_folder+'tree_folders'); |
---|
| 258 | var sent_span_default=document.getElementById('lINBOX/'+sentfolder+'tree_folders'); |
---|
[790] | 259 | var spam_span=document.getElementById('lINBOX/'+spamfolder+'tree_folders'); |
---|
[3287] | 260 | //local folders |
---|
| 261 | var sent_local_conf = this.preferences.save_in_folder.replace("INBOX/","local_"); |
---|
| 262 | var sent_local_conf_span=document.getElementById('l'+sent_local_conf+'tree_folders'); |
---|
| 263 | var trash_local_span=document.getElementById('llocal_'+trashfolder+'tree_folders'); |
---|
| 264 | var draft_local_span=document.getElementById('llocal_'+draftsfolder+'tree_folders'); |
---|
| 265 | var sent_span_default=document.getElementById('llocal_'+sentfolder+'tree_folders'); |
---|
[790] | 266 | |
---|
[3287] | 267 | |
---|
[790] | 268 | if (trash_span) |
---|
| 269 | trash_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_trash.png)"; |
---|
| 270 | |
---|
| 271 | if (draft_span) |
---|
| 272 | draft_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_draft.png)" |
---|
| 273 | |
---|
| 274 | if (sent_span) |
---|
| 275 | sent_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_sent.png)"; |
---|
| 276 | if (spam_span) |
---|
| 277 | spam_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_spam.png)"; |
---|
| 278 | |
---|
[3287] | 279 | if (sent_span_default) |
---|
| 280 | sent_span_default.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_sent.png)"; |
---|
| 281 | //Local folders |
---|
[1121] | 282 | |
---|
[3287] | 283 | if (sent_local_conf_span) |
---|
| 284 | sent_local_conf_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_sent.png)"; |
---|
| 285 | if (trash_local_span) |
---|
| 286 | trash_local_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_trash.png)"; |
---|
| 287 | if (draft_local_span) |
---|
| 288 | draft_local_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_draft.png)" |
---|
| 289 | if (sent_span_default) |
---|
| 290 | sent_span_default.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_sent.png)"; |
---|
| 291 | |
---|
| 292 | |
---|
[2] | 293 | draw_paging(Element('tot_m').innerHTML); |
---|
[1790] | 294 | if(document.getElementById("nINBOX/"+trashfolder+"tree_folders")) |
---|
[1752] | 295 | { |
---|
| 296 | var trash = document.createElement("SPAN"); |
---|
| 297 | trash.id = 'empty_trash'; |
---|
[1965] | 298 | trash.className = 'clean_folder'; |
---|
[1752] | 299 | trash.style.cursor = 'pointer'; |
---|
| 300 | trash.onclick = function () {empty_trash_imap();}; |
---|
| 301 | trash.innerHTML = "["+get_lang("Clean")+"]"; |
---|
[1965] | 302 | trash.title=get_lang("Empty trash"); |
---|
[1752] | 303 | trash.onmouseover = function() {trash.style.color="red";}; |
---|
[1965] | 304 | trash.onmouseout= function() {trash.style.color="#666666";}; |
---|
[1790] | 305 | document.getElementById("nINBOX/"+trashfolder+"tree_folders").appendChild(trash); |
---|
[1752] | 306 | } |
---|
[1965] | 307 | if(document.getElementById("nINBOX/"+spamfolder+"tree_folders")) |
---|
| 308 | { |
---|
[3035] | 309 | var spam = document.createElement("SPAN"); |
---|
| 310 | spam.id = 'empty_spam'; |
---|
| 311 | spam.className = 'clean_folder'; |
---|
| 312 | spam.style.cursor = 'pointer'; |
---|
| 313 | spam.style.padding = '0 0 0 6px'; |
---|
| 314 | spam.onclick = function () {empty_spam_imap();}; |
---|
| 315 | spam.innerHTML = "["+get_lang("Clean")+"]"; |
---|
| 316 | spam.title=get_lang("Empty Spam Folder"); |
---|
| 317 | spam.onmouseover = function() {spam.style.color="red";}; |
---|
| 318 | spam.onmouseout= function() {spam.style.color="#666666";}; |
---|
| 319 | document.getElementById("nINBOX/"+spamfolder+"tree_folders").appendChild(spam); |
---|
| 320 | } |
---|
[1752] | 321 | |
---|
[790] | 322 | |
---|
[1121] | 323 | if(!expresso_offline) |
---|
| 324 | var display_unseen_in_mailbox = tree_folders.getNodeById( 'root' ); |
---|
| 325 | else |
---|
| 326 | var display_unseen_in_mailbox = tree_folders.getNodeById( 'local_root' ); |
---|
[3035] | 327 | display_unseen_in_mailbox.alter({caption:get_lang("My Folders")}); |
---|
[790] | 328 | display_unseen_in_mailbox._refresh(); |
---|
| 329 | |
---|
| 330 | var display_unseen_in_shared_folders = tree_folders.getNodeById( 'user' ); |
---|
| 331 | if ( display_unseen_in_shared_folders ) |
---|
| 332 | { |
---|
| 333 | if ( unseen_in_shared_folders ) |
---|
| 334 | display_unseen_in_shared_folders.alter({caption:'<font style=color:red>[</font><span id="dftree_user_unseen" style="color:red">' + unseen_in_shared_folders +'</span><font style=color:red>]</font> ' + get_lang("Shared folders")}); |
---|
| 335 | else |
---|
| 336 | display_unseen_in_shared_folders.alter({caption:get_lang("Shared folders")}); |
---|
| 337 | display_unseen_in_shared_folders._refresh(); |
---|
| 338 | } |
---|
[2] | 339 | } |
---|
[790] | 340 | |
---|
[1121] | 341 | if (!expresso_offline) { |
---|
| 342 | var folder_create = ""; |
---|
| 343 | var nm1 = ""; |
---|
| 344 | if(tree_folders._folderPr.length > 0){ |
---|
| 345 | var nm_folder = ""; |
---|
| 346 | for(var i=0; i < tree_folders._folderPr.length; i++){ |
---|
| 347 | nm_folder = tree_folders._folderPr[i].split(cyrus_delimiter); |
---|
| 348 | if(nm_folder[0] == "INBOX"){ |
---|
| 349 | if(nm1 == ""){ |
---|
[2] | 350 | nm1 = nm_folder[1]; |
---|
[1121] | 351 | folder_create = "INBOX" + cyrus_delimiter + nm_folder[1] + ";"; |
---|
| 352 | }else{ |
---|
| 353 | if( nm1 != nm_folder[1]){ |
---|
| 354 | folder_create += "INBOX" + cyrus_delimiter + nm_folder[1] + ";"; |
---|
| 355 | nm1 = nm_folder[1]; |
---|
| 356 | } |
---|
[2] | 357 | } |
---|
| 358 | } |
---|
| 359 | } |
---|
| 360 | } |
---|
[1121] | 361 | if(folder_create != ""){ |
---|
| 362 | if(confirm(get_lang("There are folders with invalid format. Do you want to fix them?"))){ |
---|
| 363 | var handler_correct_folders = function(data){ |
---|
| 364 | //Timeout to release HTTPRequest , loadScript and update tree folders. |
---|
| 365 | if(data) |
---|
| 366 | setTimeout("connector.loadScript('TreeShow');ttreeBox.update_folder();",500); |
---|
| 367 | } |
---|
| 368 | cExecute("$this.imap_functions.create_extra_mailbox",handler_correct_folders,"nw_folders="+folder_create); |
---|
[2] | 369 | } |
---|
| 370 | } |
---|
| 371 | } |
---|
[3178] | 372 | |
---|
[2] | 373 | } |
---|
| 374 | |
---|
[1938] | 375 | function draw_tree_local_folders() { |
---|
| 376 | /** |
---|
| 377 | * Pastas locais |
---|
| 378 | */ |
---|
| 379 | if(preferences.use_local_messages==1 || expresso_offline) { |
---|
| 380 | var local_folders = expresso_local_messages.list_local_folders(); |
---|
| 381 | var has_changes = false; |
---|
| 382 | for (var i in local_folders) { //Coloca as pastas locais. |
---|
[3035] | 383 | |
---|
[1938] | 384 | var new_caption = local_folders[i][0]; |
---|
| 385 | if(local_folders[i][0].indexOf("/")!="-1") { |
---|
| 386 | final_pos = local_folders[i][0].lastIndexOf("/"); |
---|
| 387 | new_caption = local_folders[i][0].substr(final_pos+1); |
---|
| 388 | } |
---|
[3035] | 389 | |
---|
[1938] | 390 | var folder_unseen = Element('dftree_local_'+local_folders[i][0]+'_unseen'); |
---|
[3035] | 391 | |
---|
[1938] | 392 | if ((folder_unseen) && (local_folders[i][1] > 0)) |
---|
| 393 | { |
---|
| 394 | folder_unseen.innerHTML = local_folders[i][1]; |
---|
| 395 | has_changes = true; |
---|
| 396 | } |
---|
| 397 | else if (local_folders[i][1] > 0) |
---|
| 398 | { |
---|
| 399 | tree_folders.getNodeById("local_"+local_folders[i][0]).alter({caption:lang_folder(new_caption) + '<font style=color:red> (</font><span id="dftree_local_'+local_folders[i][0]+'_unseen" style=color:red>'+local_folders[i][1]+'</span><font style=color:red>)</font>'}); |
---|
| 400 | tree_folders.getNodeById("local_"+local_folders[i][0])._refresh(); |
---|
| 401 | has_changes = true; |
---|
| 402 | } |
---|
| 403 | else if (local_folders[i][1] <= 0) |
---|
| 404 | { |
---|
| 405 | tree_folders.getNodeById("local_"+local_folders[i][0]).alter({caption:lang_folder(new_caption)}); |
---|
| 406 | tree_folders.getNodeById("local_"+local_folders[i][0])._refresh(); |
---|
| 407 | has_changes = true; |
---|
| 408 | } |
---|
| 409 | |
---|
[3035] | 410 | if("local_"+local_folders[i][0] == get_current_folder()){ |
---|
[1938] | 411 | var old_new_m = isNaN(parseInt(Element('new_m').innerHTML)) ? parseInt(Element('new_m').firstChild.innerHTML) : parseInt(Element('new_m').innerHTML); |
---|
| 412 | if(!isNaN(old_new_m) && old_new_m < local_folders[i][1]){ |
---|
| 413 | Element('tot_m').innerHTML = parseInt(Element('tot_m').innerHTML) + (parseInt(local_folders[i][1])-old_new_m); |
---|
| 414 | } |
---|
| 415 | Element('new_m').innerHTML = local_folders[i][1] ? '<font color="RED">'+local_folders[i][1]+'</font>' : 0; |
---|
| 416 | draw_paging(Element('tot_m').innerHTML); |
---|
| 417 | has_changes = true; |
---|
| 418 | } |
---|
| 419 | } |
---|
| 420 | if(has_changes) |
---|
| 421 | tree_folders.getNodeById("local_root").open(); |
---|
| 422 | |
---|
[3035] | 423 | } |
---|
[1938] | 424 | } |
---|
| 425 | |
---|
[2] | 426 | function update_menu(data){ |
---|
[446] | 427 | /* |
---|
| 428 | * @AUTHOR Rodrigo Souza dos Santos |
---|
| 429 | * @DATE 2008/09/15 |
---|
| 430 | * @BRIEF When occurs a error in imap server show the message that is in file "error.html". |
---|
| 431 | */ |
---|
| 432 | if ( data && data.imap_error ) |
---|
| 433 | { |
---|
[1964] | 434 | if(preferences.use_local_messages==1 && expresso_local_messages.is_offline_installed){ |
---|
| 435 | conf = confirm(get_lang("The expresso imap server is currently down, expresso noticed you have offline mail module installed, would you like to use it?")); |
---|
| 436 | if(conf) { |
---|
| 437 | window.onresize = function() { |
---|
| 438 | var target = document.getElementById('divAppbox'); |
---|
| 439 | target.style.height= document.body.clientHeight - 83; |
---|
| 440 | } |
---|
| 441 | var target = document.getElementById('divAppbox'); |
---|
| 442 | document.getElementById("divAppboxHeader").innerHTML=""; |
---|
| 443 | target.style.height= document.body.clientHeight - 83; |
---|
| 444 | expresso_local_messages.set_as_logged(account_id,0,true); |
---|
| 445 | target.innerHTML = "<iframe src='offline.php?inside=1' width='100%' height='100%' frameBorder='0'></iframe>"; |
---|
| 446 | return false; |
---|
| 447 | } |
---|
| 448 | } |
---|
[790] | 449 | connector.newRequest('error.html', 'templates/'+template+'/error.html', 'GET', |
---|
[446] | 450 | function(data) |
---|
| 451 | { |
---|
| 452 | var target = document.getElementById('divAppbox'); |
---|
| 453 | if ( target ) |
---|
| 454 | target.innerHTML = data; |
---|
| 455 | } |
---|
| 456 | ); |
---|
| 457 | return false; |
---|
| 458 | } |
---|
| 459 | |
---|
[2] | 460 | draw_tree_folders(data); |
---|
| 461 | if(data) { |
---|
[3035] | 462 | build_quota(data); |
---|
[790] | 463 | var f_unseen = Element('dftree_'+current_folder+'_unseen'); |
---|
[2] | 464 | if(f_unseen && f_unseen.innerHTML) |
---|
| 465 | Element('new_m').innerHTML = '<font face="Verdana" size="1" color="RED">'+f_unseen.innerHTML+'</font>'; |
---|
| 466 | else |
---|
[320] | 467 | { |
---|
| 468 | if( parseInt(Element('new_m').innerHTML) == 0 ) |
---|
[3035] | 469 | Element('new_m').innerHTML = 0; |
---|
[320] | 470 | } |
---|
[2] | 471 | folders = data; |
---|
| 472 | } |
---|
| 473 | } |
---|
| 474 | |
---|
| 475 | var handler_draw_box = function(data){ |
---|
[320] | 476 | draw_box(data, 'INBOX', true); |
---|
| 477 | //alternate_border(0); |
---|
[2] | 478 | } |
---|
| 479 | |
---|
| 480 | // Action on change folders. |
---|
| 481 | function change_folder(folder, folder_name){ |
---|
[607] | 482 | if (openTab.imapBox[0] != folder) |
---|
[2] | 483 | { |
---|
| 484 | current_folder = folder; |
---|
| 485 | var handler_draw_box = function(data) |
---|
| 486 | { |
---|
| 487 | if(!verify_session(data)) |
---|
| 488 | return; |
---|
[320] | 489 | alternate_border(0); |
---|
[163] | 490 | Element("border_id_0").innerHTML = " " + lang_folder(folder_name) + ' <font face="Verdana" size="1" color="#505050">[<span id="new_m"> </span> / <span id="tot_m"></span>]</font>'; |
---|
[320] | 491 | draw_box(data, folder, true); |
---|
[2] | 492 | draw_paging(data.num_msgs); |
---|
| 493 | Element("tot_m").innerHTML = data.num_msgs; |
---|
| 494 | update_menu(); |
---|
[320] | 495 | return true; |
---|
[2] | 496 | } |
---|
[1752] | 497 | proxy_mensagens.messages_list(current_folder,1,preferences.max_email_per_page,sort_box_type,search_box_type,sort_box_reverse,preferences.preview_msg_subject,preferences.preview_msg_tip,handler_draw_box); |
---|
[689] | 498 | } |
---|
| 499 | else |
---|
[320] | 500 | alternate_border(0); |
---|
| 501 | } |
---|
| 502 | |
---|
| 503 | function open_folder(folder, folder_name){ |
---|
[790] | 504 | if (current_folder!= folder) { |
---|
[320] | 505 | current_folder = folder; |
---|
[325] | 506 | var handler_draw_box = function(data){ |
---|
[345] | 507 | if(!verify_session(data)) |
---|
| 508 | return false; |
---|
| 509 | numBox++; |
---|
| 510 | create_border(folder_name,numBox.toString()); |
---|
| 511 | draw_box(data, current_folder, false); |
---|
| 512 | alternate_border(numBox); |
---|
| 513 | return true; |
---|
[320] | 514 | } |
---|
[345] | 515 | cExecute ("$this.imap_functions.get_range_msgs2&folder="+current_folder+"&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type="+sort_box_type+ "&search_box_type="+ search_box_type +"&sort_box_reverse="+sort_box_reverse+"", handler_draw_box); |
---|
[2] | 516 | } |
---|
| 517 | else |
---|
[345] | 518 | alternate_border(numBox); |
---|
| 519 | return true; |
---|
[2] | 520 | } |
---|
| 521 | |
---|
| 522 | var lastPage = 1; |
---|
| 523 | var numPages = 5; |
---|
| 524 | var last_folder = 'INBOX'; |
---|
[3035] | 525 | function draw_paging(num_msgs){ |
---|
[2] | 526 | num_msgs = parseInt(num_msgs); |
---|
| 527 | total_pages = 1; |
---|
| 528 | |
---|
[790] | 529 | if(last_folder != current_folder){ |
---|
[2] | 530 | lastPage = 1; |
---|
| 531 | current_page = 1; |
---|
[790] | 532 | last_folder = current_folder; |
---|
[2] | 533 | } |
---|
| 534 | |
---|
[3035] | 535 | if(num_msgs > parseInt(preferences.max_email_per_page)) { |
---|
[2] | 536 | total_pages = parseInt(num_msgs/preferences.max_email_per_page); |
---|
| 537 | if((num_msgs/preferences.max_email_per_page) > total_pages) |
---|
[3035] | 538 | total_pages++; |
---|
[2] | 539 | } |
---|
| 540 | |
---|
| 541 | if(total_pages == 1) { |
---|
[3393] | 542 | if(span_paging = document.getElementById("span_paging")) { |
---|
[2] | 543 | span_paging.parentNode.removeChild(span_paging); |
---|
| 544 | } |
---|
| 545 | return; |
---|
| 546 | } |
---|
[3393] | 547 | span_paging = document.getElementById("span_paging"); |
---|
[2] | 548 | if(!span_paging){ |
---|
| 549 | span_paging = document.createElement("DIV"); |
---|
[3393] | 550 | span_paging.id = "span_paging"; |
---|
[1247] | 551 | span_paging.className = "boxHeaderText"; |
---|
[2] | 552 | span_paging.align="right"; |
---|
[3035] | 553 | document.getElementById("div_menu_c3").appendChild(span_paging); |
---|
[2] | 554 | } |
---|
[3035] | 555 | span_paging.style.width="100%"; |
---|
[2] | 556 | span_paging.innerHTML=""; |
---|
| 557 | msg_range_begin = 1; |
---|
| 558 | msg_range_end = preferences.max_email_per_page; |
---|
| 559 | if(current_page != 1) { |
---|
| 560 | lnk_page = document.createElement("A"); |
---|
[4081] | 561 | lnk_page.setAttribute("href", "javascript:current_page=1;kill_current_box(); draw_paging("+num_msgs+"); proxy_mensagens.messages_list(get_current_folder(),"+msg_range_begin+","+msg_range_end+",'"+sort_box_type+"','"+search_box_type+"',"+sort_box_reverse+","+preferences.preview_msg_subject+","+preferences.preview_msg_tip+",function handler(data){alternate_border(0); draw_box(data, get_current_folder());});"); |
---|
[2] | 562 | } |
---|
| 563 | else { |
---|
| 564 | lnk_page = document.createElement("SPAN"); |
---|
| 565 | } |
---|
| 566 | span_paging.appendChild(lnk_page); |
---|
| 567 | |
---|
| 568 | lnk_page.innerHTML = "<<"; |
---|
| 569 | lnk_page.title = get_lang("First"); |
---|
| 570 | span_paging.innerHTML += " "; |
---|
[3369] | 571 | |
---|
[2] | 572 | if(current_page == lastPage + numPages) |
---|
[3369] | 573 | lastPage = current_page - 1; |
---|
| 574 | else if((lastPage != 1 && lastPage == current_page) || current_page == total_pages) |
---|
[2] | 575 | lastPage = current_page - (numPages - 1); |
---|
| 576 | else if(current_page == 1) |
---|
| 577 | lastPage = 1; |
---|
| 578 | |
---|
| 579 | if(lastPage < 1) |
---|
| 580 | lastPage = 1; |
---|
| 581 | else if(lastPage > 1 && (lastPage > (total_pages -(numPages - 1)))) |
---|
| 582 | lastPage = total_pages -(numPages - 1); |
---|
| 583 | |
---|
| 584 | var hasMarked = false; |
---|
| 585 | |
---|
| 586 | for(i = lastPage; i <= total_pages; i++) { |
---|
[3369] | 587 | |
---|
| 588 | if(current_page == i || (i == total_pages && !hasMarked)) { |
---|
[2] | 589 | lnk_page = document.createElement("SPAN"); |
---|
| 590 | span_paging.appendChild(lnk_page); |
---|
| 591 | lnk_page.innerHTML = " <b>"+i+"</b> "; |
---|
| 592 | hasMarked = true; |
---|
| 593 | continue; |
---|
| 594 | } |
---|
[3369] | 595 | else{ |
---|
[2] | 596 | lnk_page = document.createElement("A"); |
---|
| 597 | span_paging.appendChild(lnk_page); |
---|
| 598 | msg_range_begin = ((i*preferences.max_email_per_page)-(preferences.max_email_per_page-1)); |
---|
| 599 | msg_range_end = (i*preferences.max_email_per_page); |
---|
[4081] | 600 | lnk_page.setAttribute("href", "javascript:current_page="+i+";kill_current_box(); draw_paging("+num_msgs+"); proxy_mensagens.messages_list(get_current_folder(),"+msg_range_begin+","+msg_range_end+",'"+sort_box_type+"','"+search_box_type+"',"+sort_box_reverse+","+preferences.preview_msg_subject+","+preferences.preview_msg_tip+",function handler(data){alternate_border(0); draw_box(data, get_current_folder());});"); |
---|
[2] | 601 | } |
---|
| 602 | lnk_page.innerHTML = " ... "; |
---|
| 603 | if(i == (lastPage + numPages)) |
---|
[3035] | 604 | break; |
---|
| 605 | else if(lastPage == 1 || i != lastPage) |
---|
[2] | 606 | lnk_page.innerHTML = " "+i+" "; |
---|
[3369] | 607 | span_paging.innerHTML += " "; |
---|
[2] | 608 | } |
---|
[3035] | 609 | |
---|
[2] | 610 | if(current_page != total_pages) { |
---|
| 611 | lnk_page = document.createElement("A"); |
---|
| 612 | msg_range_begin = ((total_pages*preferences.max_email_per_page)-(preferences.max_email_per_page-1)); |
---|
[3369] | 613 | msg_range_end = (total_pages*preferences.max_email_per_page); |
---|
[4081] | 614 | lnk_page.setAttribute("href", "javascript:current_page="+total_pages+";kill_current_box(); draw_paging("+num_msgs+"); proxy_mensagens.messages_list(get_current_folder(),"+msg_range_begin+","+msg_range_end+",'"+sort_box_type+"','"+search_box_type+"',"+sort_box_reverse+","+preferences.preview_msg_subject+","+preferences.preview_msg_tip+",function handler(data){alternate_border(0); draw_box(data, get_current_folder());});"); |
---|
[2] | 615 | } |
---|
| 616 | else { |
---|
| 617 | lnk_page = document.createElement("SPAN"); |
---|
| 618 | } |
---|
| 619 | span_paging.innerHTML += " "; |
---|
| 620 | span_paging.appendChild(lnk_page); |
---|
| 621 | |
---|
| 622 | lnk_page.title = get_lang("Last"); |
---|
| 623 | lnk_page.innerHTML = ">>"; |
---|
| 624 | } |
---|
| 625 | |
---|
| 626 | |
---|
| 627 | // Draw the inbox and another folders |
---|
[320] | 628 | function draw_box(headers_msgs, msg_folder, alternate){ |
---|
[3967] | 629 | |
---|
[4079] | 630 | /* |
---|
| 631 | * When the paging response is not in the correct folder you need to change folder |
---|
| 632 | * This occurs when the Ajax response is not fast enough and the user click in outher |
---|
| 633 | * folder before finishing the Ajax request |
---|
| 634 | */ |
---|
| 635 | if (msg_folder != headers_msgs['folder']) { |
---|
| 636 | |
---|
| 637 | if (headers_msgs['folder']) { |
---|
| 638 | array_folder = headers_msgs['folder'].split('/'); |
---|
| 639 | |
---|
| 640 | if (array_folder.length > 1) { |
---|
| 641 | name_folder = array_folder[1]; |
---|
| 642 | } |
---|
| 643 | else { |
---|
| 644 | name_folder = headers_msgs['folder']; |
---|
| 645 | } |
---|
| 646 | current_folder = headers_msgs['folder']; |
---|
| 647 | Element("border_id_0").innerHTML = " " + lang_folder(name_folder) + ' <font face="Verdana" size="1" color="#505050">[<span id="new_m"> </span> / <span id="tot_m"></span>]</font>'; |
---|
| 648 | |
---|
| 649 | Element('new_m').innerHTML = headers_msgs['tot_unseen'] ? '<font color="RED">'+headers_msgs['tot_unseen']+'</font>' : 0; |
---|
| 650 | Element("tot_m").innerHTML = headers_msgs['num_msgs']; |
---|
| 651 | |
---|
| 652 | tree_folders.getNodeById(headers_msgs['folder'])._select(); |
---|
| 653 | } |
---|
| 654 | } |
---|
| 655 | /* --- */ |
---|
| 656 | |
---|
[320] | 657 | if (alternate) |
---|
| 658 | kill_current_box(); |
---|
[3035] | 659 | |
---|
[2] | 660 | if(is_ie) |
---|
| 661 | document.getElementById("border_table").width = "99.5%"; |
---|
| 662 | |
---|
[3967] | 663 | |
---|
[3035] | 664 | openTab.content_id[numBox] = document.getElementById("content_id_"+numBox); |
---|
[3178] | 665 | openTab.content_id[numBox].innerHTML = ""; |
---|
[607] | 666 | openTab.imapBox[numBox] = msg_folder; |
---|
[790] | 667 | openTab.type[numBox] = 0; |
---|
[3035] | 668 | |
---|
[320] | 669 | table_message_header_box = document.getElementById("table_message_header_box_"+numBox); |
---|
[2] | 670 | if (table_message_header_box == null){ |
---|
| 671 | var table_element = document.createElement("TABLE"); |
---|
| 672 | var tbody_element = document.createElement("TBODY"); |
---|
[320] | 673 | table_element.setAttribute("id", "table_message_header_box_"+numBox); |
---|
[2] | 674 | table_element.className = "table_message_header_box"; |
---|
[3035] | 675 | |
---|
[2] | 676 | tr_element = document.createElement("TR"); |
---|
| 677 | tr_element.className = "message_header"; |
---|
| 678 | td_element1 = document.createElement("TD"); |
---|
| 679 | td_element1.setAttribute("width", "1%"); |
---|
| 680 | chk_box_element = document.createElement("INPUT"); |
---|
| 681 | chk_box_element.id = "chk_box_select_all_messages"; |
---|
| 682 | chk_box_element.setAttribute("type", "checkbox"); |
---|
| 683 | chk_box_element.className = "checkbox"; |
---|
| 684 | chk_box_element.onclick = function(){select_all_messages(this.checked);}; |
---|
| 685 | chk_box_element.onmouseover = function () {this.title=get_lang('Select all messages.')}; |
---|
| 686 | chk_box_element.onkeydown = function (e){ |
---|
| 687 | if (is_ie) |
---|
| 688 | { |
---|
| 689 | if ((window.event.keyCode) == 46) |
---|
[689] | 690 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 691 | } |
---|
| 692 | else |
---|
| 693 | { |
---|
| 694 | if ((e.keyCode) == 46) |
---|
[689] | 695 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 696 | } |
---|
| 697 | }; |
---|
[3035] | 698 | |
---|
[2] | 699 | td_element1.appendChild(chk_box_element); |
---|
[3035] | 700 | |
---|
[2] | 701 | td_element2 = document.createElement("TD"); |
---|
[1035] | 702 | td_element2.setAttribute("width", "7%"); |
---|
[2] | 703 | td_element3 = document.createElement("TD"); |
---|
[1035] | 704 | td_element3.setAttribute("width", "29%"); |
---|
[51] | 705 | td_element3.onclick = function () {sort_box(search_box_type,'SORTFROM');}; |
---|
[320] | 706 | td_element3.id = "message_header_SORTFROM_"+numBox; |
---|
[2] | 707 | td_element3.align = "left"; |
---|
| 708 | td_element3.innerHTML = get_lang("Who"); |
---|
[3035] | 709 | |
---|
[2] | 710 | td_element4 = document.createElement("TD"); |
---|
[1035] | 711 | td_element4.setAttribute("width", "38%"); |
---|
[51] | 712 | td_element4.onclick = function () {sort_box(search_box_type,'SORTSUBJECT');}; |
---|
[320] | 713 | td_element4.id = "message_header_SORTSUBJECT_"+numBox; |
---|
[2] | 714 | td_element4.align = "left"; |
---|
| 715 | td_element4.innerHTML = get_lang("Subject"); |
---|
[3035] | 716 | |
---|
[2] | 717 | td_element5 = document.createElement("TD"); |
---|
| 718 | td_element5.setAttribute("width", "14%"); |
---|
[51] | 719 | td_element5.onclick = function () {sort_box(search_box_type,'SORTARRIVAL');}; |
---|
[320] | 720 | td_element5.id = "message_header_SORTARRIVAL_"+numBox; |
---|
[2] | 721 | td_element5.align = "center"; |
---|
| 722 | td_element5.innerHTML = get_lang("Date"); |
---|
| 723 | td_element6 = document.createElement("TD"); |
---|
| 724 | td_element6.setAttribute("width", "14%"); |
---|
[51] | 725 | td_element6.onclick = function () {sort_box(search_box_type,'SORTSIZE');} |
---|
[320] | 726 | td_element6.id = "message_header_SORTSIZE_"+numBox; |
---|
[2] | 727 | td_element6.align = "left"; |
---|
| 728 | td_element6.innerHTML = get_lang("Size"); |
---|
[3035] | 729 | |
---|
[2] | 730 | tr_element.appendChild(td_element1); |
---|
[3035] | 731 | tr_element.appendChild(td_element2); |
---|
[998] | 732 | var td_element21 = document.createElement("TD"); |
---|
[999] | 733 | td_element21.innerHTML = " "; |
---|
[998] | 734 | var td_element22 = document.createElement("TD"); |
---|
[999] | 735 | td_element22.innerHTML = " "; |
---|
[998] | 736 | var td_element23 = document.createElement("TD"); |
---|
| 737 | td_element23.innerHTML = " "; |
---|
| 738 | tr_element.appendChild(td_element21); |
---|
| 739 | tr_element.appendChild(td_element22); |
---|
| 740 | tr_element.appendChild(td_element23); |
---|
[2] | 741 | tr_element.appendChild(td_element3); |
---|
| 742 | tr_element.appendChild(td_element4); |
---|
| 743 | tr_element.appendChild(td_element5); |
---|
| 744 | tr_element.appendChild(td_element6); |
---|
| 745 | tbody_element.appendChild(tr_element); |
---|
| 746 | table_element.appendChild(tbody_element); |
---|
[607] | 747 | openTab.content_id[numBox].appendChild(table_element); |
---|
[2] | 748 | } |
---|
| 749 | draw_header_box(); |
---|
| 750 | var table_element = document.createElement("TABLE"); |
---|
[3035] | 751 | var tbody_element = document.createElement("TBODY"); |
---|
[2] | 752 | table_element.id = "table_box"; |
---|
| 753 | table_element.className = "table_box"; |
---|
| 754 | table_element.borderColorDark = "#bbbbbb"; |
---|
| 755 | table_element.frame = "void"; |
---|
| 756 | table_element.rules = "rows"; |
---|
| 757 | table_element.cellPadding = "0"; |
---|
| 758 | table_element.cellSpacing = "0"; |
---|
[3035] | 759 | |
---|
[2] | 760 | table_element.onkeydown = function (e){ |
---|
| 761 | if (is_ie) |
---|
| 762 | { |
---|
| 763 | if ((window.event.keyCode) == 46) |
---|
| 764 | { |
---|
| 765 | //delete_all_selected_msgs_imap(); |
---|
[689] | 766 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 767 | } |
---|
| 768 | } |
---|
| 769 | else |
---|
| 770 | { |
---|
| 771 | if ((e.keyCode) == 46) |
---|
| 772 | { |
---|
| 773 | //delete_all_selected_msgs_imap(); |
---|
[689] | 774 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 775 | } |
---|
| 776 | } |
---|
| 777 | }; |
---|
| 778 | if (is_ie) |
---|
| 779 | table_element.style.cursor = "hand"; |
---|
[3035] | 780 | |
---|
[2] | 781 | tbody_element.setAttribute("id", "tbody_box"); |
---|
| 782 | table_element.appendChild(tbody_element); |
---|
[3035] | 783 | |
---|
[320] | 784 | var _divScroll = document.getElementById("divScrollMain_"+numBox); |
---|
| 785 | |
---|
[2] | 786 | |
---|
[3035] | 787 | if(!_divScroll){ |
---|
[2] | 788 | _divScroll = document.createElement("DIV"); |
---|
[320] | 789 | _divScroll.id = "divScrollMain_"+numBox; |
---|
[2] | 790 | } |
---|
[3035] | 791 | |
---|
| 792 | _divScroll.style.overflowY = "auto"; |
---|
[790] | 793 | _divScroll.style.overflowX = "hidden"; |
---|
| 794 | _divScroll.style.width ="100%"; |
---|
[3035] | 795 | |
---|
[790] | 796 | if (is_mozilla){ |
---|
[2] | 797 | _divScroll.style.overflow = "-moz-scrollbars-vertical"; |
---|
| 798 | _divScroll.style.width ="99.3%"; |
---|
| 799 | } |
---|
| 800 | _divScroll.appendChild(table_element); |
---|
[607] | 801 | openTab.content_id[numBox].appendChild(_divScroll); |
---|
[3035] | 802 | |
---|
[2] | 803 | var f_unseen = 0; |
---|
[139] | 804 | |
---|
| 805 | if (headers_msgs.num_msgs == 0){ |
---|
[3035] | 806 | var tr_info = document.createElement("TR"); |
---|
| 807 | var td_info = document.createElement("TD"); |
---|
| 808 | td_info.setAttribute("colspan", "10"); |
---|
[139] | 809 | td_info.setAttribute("background", "#FFF"); |
---|
[3145] | 810 | td_info.setAttribute("id", "msg_info"); |
---|
| 811 | td_info.id = "msg_info"; |
---|
[139] | 812 | td_info.align = "center"; |
---|
[3035] | 813 | td_info.style.padding = "25px"; |
---|
| 814 | td_info.style.fontWeight = "bold"; |
---|
| 815 | td_info.style.fontSize = "11pt"; |
---|
[139] | 816 | td_info.innerHTML = get_lang("This mail box is empty"); |
---|
[3035] | 817 | tr_info.appendChild(td_info); |
---|
[139] | 818 | tbody_element.appendChild(td_info); |
---|
| 819 | } |
---|
[2] | 820 | for (var i=0; i < headers_msgs.length; i++){ |
---|
| 821 | if ((headers_msgs[i].Unseen == 'U') || (headers_msgs[i].Recent == 'N')) |
---|
[3035] | 822 | f_unseen++; |
---|
[3493] | 823 | tr_element = make_tr_message(headers_msgs[i], msg_folder, headers_msgs.offsetToGMT); |
---|
[976] | 824 | if (tr_element){ |
---|
[790] | 825 | tbody_element.appendChild(tr_element); |
---|
[3035] | 826 | add_className(tr_element, i%2 != 0 ? 'tr_msg_read2' : 'tr_msg_read'); |
---|
[976] | 827 | } |
---|
[2] | 828 | _dragArea.makeDragged(tr_element, headers_msgs[i].msg_number, headers_msgs[i].subject, true); |
---|
| 829 | } |
---|
[3035] | 830 | |
---|
[128] | 831 | if ((preferences.use_shortcuts == '1') && (headers_msgs[0])) |
---|
[320] | 832 | select_msg(headers_msgs[0].msg_number, 'null', true); |
---|
[128] | 833 | |
---|
[2] | 834 | var tdFolders = Element("folderscol"); |
---|
| 835 | tdFolders.style.display = preferences.hide_folders == '1' ? "none" : ""; |
---|
[790] | 836 | if ( !currentTab ) |
---|
| 837 | alternate_border(numBox); |
---|
[3035] | 838 | draw_footer_box(headers_msgs.num_msgs); |
---|
[2] | 839 | Element('main_table').style.display = ''; |
---|
[3035] | 840 | if(is_ie6) // Stupid Fixing on IE6. |
---|
| 841 | setTimeout("resizeWindow()",1); |
---|
| 842 | else |
---|
| 843 | resizeWindow(); |
---|
[2] | 844 | if(debug) { |
---|
| 845 | var _eTime = new Date(); |
---|
| 846 | _eTime = _eTime.getTime(); |
---|
| 847 | alert("Carregou em "+(_eTime - _bTime)+" ms"); |
---|
| 848 | } |
---|
| 849 | var msg_folder = Element('msg_folder').value; |
---|
[3035] | 850 | var msg_number = Element('msg_number').value; |
---|
[2] | 851 | if(!msg_folder && msg_number) { |
---|
| 852 | new_message('new','null'); |
---|
| 853 | } |
---|
| 854 | else if(msg_folder && msg_number){ |
---|
[1691] | 855 | cExecute("$this.imap_functions.get_info_msg&msg_number="+ msg_number + "&msg_folder=" + url_encode(msg_folder), show_msg); |
---|
[2] | 856 | Element('msg_folder').value = ''; |
---|
| 857 | Element('msg_number').value = ''; |
---|
| 858 | } |
---|
[3068] | 859 | var scripts = new Array("InfoContact", |
---|
[3220] | 860 | "TreeShow"); |
---|
[3068] | 861 | connector.loadAllScripts(scripts); |
---|
[3369] | 862 | // Loading Quota View Folder Component (if exists...) |
---|
[3157] | 863 | if(Element("table_quota")) |
---|
[3158] | 864 | connector.loadScript("InfoQuota"); |
---|
[2] | 865 | } |
---|
[790] | 866 | |
---|
[3493] | 867 | // Passar o parâmetro offset para esta função |
---|
| 868 | function make_tr_message(headers_msgs, msg_folder, offsetToGMT){ |
---|
| 869 | if (typeof offsetToGMT == 'undefined') |
---|
| 870 | { |
---|
[3512] | 871 | // In older local messages headers_msgs.offsetToGMT is undefined. |
---|
| 872 | offsetToGMT = typeof headers_msgs.offsetToGMT != 'undefined'?headers_msgs.offsetToGMT:0; |
---|
[3493] | 873 | } |
---|
[320] | 874 | var tr_element = document.createElement('tr'); |
---|
[3069] | 875 | if(typeof(preferences.line_height) != 'undefined') |
---|
| 876 | tr_element.style.height = preferences.line_height; |
---|
[2] | 877 | tr_element.id = headers_msgs.msg_number; |
---|
[163] | 878 | |
---|
[1752] | 879 | tr_element.msg_sample = ""; |
---|
| 880 | //if(headers_msgs.msg_sample && headers_msgs.msg_sample.preview_msg_subject != "") |
---|
| 881 | if(headers_msgs.msg_sample && preferences.preview_msg_subject == "1") |
---|
| 882 | { |
---|
| 883 | tr_element.msg_sample = headers_msgs.msg_sample.body.substr(0,120) + "..."; //trecho do body que sera exibido com o assunto; |
---|
| 884 | } |
---|
| 885 | |
---|
| 886 | tr_element.tip = ""; |
---|
| 887 | if(headers_msgs.msg_sample && preferences.preview_msg_tip == "1") |
---|
| 888 | { |
---|
| 889 | tr_element.tip = headers_msgs.msg_sample.body.substr(3,300) + "..."; //trecho do body que sera exibido no tool-tip; |
---|
| 890 | } |
---|
| 891 | |
---|
[614] | 892 | if ((headers_msgs.Unseen == 'U') || (headers_msgs.Recent == 'N')){ |
---|
[3071] | 893 | if ((headers_msgs.Flagged == 'F') || parseInt(preferences.use_important_flag) && headers_msgs.Importance.toLowerCase().indexOf("high")!=-1 ) |
---|
[614] | 894 | add_className(tr_element, 'flagged_msg'); |
---|
[163] | 895 | add_className(tr_element, 'tr_msg_unread'); |
---|
[614] | 896 | } |
---|
| 897 | else{ |
---|
[3071] | 898 | if ((headers_msgs.Flagged == 'F') || parseInt(preferences.use_important_flag) && headers_msgs.Importance.toLowerCase().indexOf("high")!=-1 ) |
---|
[614] | 899 | add_className(tr_element,'flagged_msg'); |
---|
| 900 | } |
---|
[2] | 901 | |
---|
[790] | 902 | if ((headers_msgs.Unseen == 'U') || (headers_msgs.Recent == 'N')) |
---|
| 903 | add_className(tr_element, 'tr_msg_unread'); |
---|
[3035] | 904 | |
---|
[790] | 905 | if (headers_msgs.Flagged == 'F') |
---|
| 906 | add_className(tr_element,'flagged_msg'); |
---|
| 907 | |
---|
[2] | 908 | td_element1 = document.createElement("TD"); |
---|
[997] | 909 | td_element1.className = "td_msg"; |
---|
[2] | 910 | td_element1.setAttribute("width", "1%"); |
---|
| 911 | chk_box_element = document.createElement("INPUT"); |
---|
| 912 | chk_box_element.setAttribute("type", "checkbox"); |
---|
| 913 | chk_box_element.className = "checkbox"; |
---|
| 914 | chk_box_element.setAttribute("id", "check_box_message_"+headers_msgs.msg_number); |
---|
| 915 | chk_box_element.onclick = function(e){ |
---|
| 916 | if (is_ie) |
---|
| 917 | changeBgColor(window.event,headers_msgs.msg_number); |
---|
| 918 | else |
---|
| 919 | changeBgColor(e,headers_msgs.msg_number); |
---|
| 920 | }; |
---|
| 921 | td_element1.appendChild(chk_box_element); |
---|
[3035] | 922 | |
---|
[2] | 923 | td_element2 = document.createElement("TD"); |
---|
[997] | 924 | td_element2.className = "td_msg"; |
---|
[2] | 925 | td_element2.setAttribute("width", "2%"); |
---|
| 926 | if (headers_msgs.attachment && headers_msgs.attachment.number_attachments > 0) |
---|
[3035] | 927 | td_element2.innerHTML = "<img src ='templates/"+template+"/images/clip.gif' title='" + url_decode(headers_msgs.attachment.names) + "'>"; |
---|
| 928 | |
---|
[2] | 929 | td_element21 = document.createElement("TD"); |
---|
[997] | 930 | td_element21.className = "td_msg"; |
---|
[2] | 931 | td_element21.setAttribute("width", "1%"); |
---|
| 932 | td_element21.id = "td_message_answered_"+headers_msgs.msg_number; |
---|
| 933 | |
---|
[1035] | 934 | if (headers_msgs.attachment && headers_msgs.attachment.number_attachments > 0) { |
---|
| 935 | attach_name = headers_msgs.attachment.names.split(", "); |
---|
| 936 | for(var item in attach_name) |
---|
| 937 | { |
---|
| 938 | if (url_decode(attach_name[item]) != 'smime.p7s' && url_decode(attach_name[item]) != 'smime.p7m'){ |
---|
| 939 | td_element21.innerHTML = "<img src ='templates/"+template+"/images/clip.gif' title='" + url_decode(attach_name[item]) + "'>"; |
---|
| 940 | break; |
---|
| 941 | } |
---|
| 942 | } |
---|
| 943 | } |
---|
| 944 | |
---|
[2] | 945 | if ((headers_msgs.Forwarded == 'F') || (headers_msgs.Draft == 'X' && headers_msgs.Answered == 'A')){ |
---|
[994] | 946 | td_element21.innerHTML = "<img src ='templates/"+template+"/images/forwarded.gif' title='"+get_lang('Forwarded')+"'>"; |
---|
[3035] | 947 | headers_msgs.Draft = '' |
---|
[2] | 948 | headers_msgs.Answered = ''; |
---|
[1035] | 949 | headers_msgs.Forwarded = 'F'; |
---|
[2] | 950 | } |
---|
| 951 | else if (headers_msgs.Draft == 'X') |
---|
[994] | 952 | td_element21.innerHTML = "<img src ='templates/"+template+"/images/draft.gif' title='"+get_lang('Draft')+"'>"; |
---|
[2] | 953 | else if (headers_msgs.Answered == 'A') |
---|
[994] | 954 | td_element21.innerHTML = "<img src ='templates/"+template+"/images/answered.gif' title='"+get_lang('Answered')+"'>"; |
---|
[998] | 955 | else |
---|
| 956 | td_element21.innerHTML = " "; |
---|
[2] | 957 | |
---|
| 958 | td_element22 = document.createElement("TD"); |
---|
[997] | 959 | td_element22.className = "td_msg"; |
---|
[2] | 960 | td_element22.setAttribute("width", "1%"); |
---|
[1035] | 961 | td_element22.id = "td_message_signed_"+headers_msgs.msg_number; |
---|
[3035] | 962 | switch(headers_msgs.ContentType) |
---|
[1035] | 963 | { |
---|
[3035] | 964 | case "signature": |
---|
[1035] | 965 | { |
---|
| 966 | td_element22.innerHTML = "<img src ='templates/"+template+"/images/signed_msg.gif' title='" + get_lang('Signed message') + "'>"; |
---|
| 967 | break; |
---|
| 968 | } |
---|
[3035] | 969 | case "cipher": |
---|
[1035] | 970 | { |
---|
| 971 | td_element22.innerHTML = "<img src ='templates/"+template+"/images/lock.gif' title='" + get_lang('Crypted message') + "'>"; |
---|
| 972 | break; |
---|
| 973 | } |
---|
[3035] | 974 | default: |
---|
[1035] | 975 | { |
---|
| 976 | break; |
---|
| 977 | } |
---|
| 978 | } |
---|
| 979 | |
---|
[3035] | 980 | td_element23 = document.createElement("TD"); |
---|
[1035] | 981 | td_element23.className = "td_msg" |
---|
| 982 | td_element23.setAttribute("width", "1%"); |
---|
| 983 | td_element23.id = "td_message_important_"+headers_msgs.msg_number; |
---|
| 984 | |
---|
[3071] | 985 | if (headers_msgs.Flagged == 'F' || (parseInt(preferences.use_important_flag) && headers_msgs.Importance.toLowerCase().indexOf("high") != -1 )) |
---|
[790] | 986 | { |
---|
[1035] | 987 | td_element23.innerHTML = "<img src ='templates/"+template+"/images/important.gif' title='"+get_lang('Important')+"'>"; |
---|
[790] | 988 | } |
---|
[2] | 989 | else |
---|
[1035] | 990 | td_element23.innerHTML = " "; |
---|
[790] | 991 | |
---|
[1035] | 992 | td_element24 = document.createElement("TD"); |
---|
| 993 | td_element24.className = "td_msg"; |
---|
| 994 | td_element24.setAttribute("width", "1%"); |
---|
| 995 | td_element24.id = "td_message_sent_"+headers_msgs.msg_number; |
---|
| 996 | td_element24.innerHTML = " "; |
---|
[2] | 997 | // preload image |
---|
| 998 | var _img_sent = new Image(); |
---|
[790] | 999 | _img_sent.src = "templates/"+template+"/images/sent.gif"; |
---|
[2] | 1000 | |
---|
[3018] | 1001 | |
---|
| 1002 | |
---|
[3035] | 1003 | var td_element25 = document.createElement("TD"); |
---|
| 1004 | td_element25.className = "td_msg"; |
---|
| 1005 | td_element25.setAttribute("width", "1%"); |
---|
| 1006 | td_element25.id = "td_message_unseen_"+headers_msgs.msg_number; |
---|
| 1007 | if ((headers_msgs.Unseen == 'U') || (headers_msgs.Recent == 'N')) |
---|
| 1008 | td_element25.innerHTML = "<img src ='templates/"+template+"/images/unseen.gif' title='"+get_lang('Unseen')+"'>"; |
---|
| 1009 | else |
---|
| 1010 | td_element25.innerHTML = "<img src ='templates/"+template+"/images/seen.gif' title='"+get_lang('Seen')+"'>"; |
---|
[3018] | 1011 | |
---|
| 1012 | |
---|
[2] | 1013 | td_element3 = document.createElement("TD"); |
---|
[997] | 1014 | td_element3.className = "td_msg"; |
---|
[27] | 1015 | td_element3.id = "td_who_"+ headers_msgs.msg_number; |
---|
[1752] | 1016 | td_element3.setAttribute("width", "20%"); |
---|
[689] | 1017 | var _onclick = function(){InfoContact.hide();proxy_mensagens.get_msg(headers_msgs.msg_number, msg_folder,true, show_msg);}; |
---|
[2] | 1018 | td_element3.onclick = _onclick; |
---|
| 1019 | td_element3.innerHTML = ' '; |
---|
[3035] | 1020 | |
---|
[3245] | 1021 | test = true; |
---|
| 1022 | if(msg_folder.indexOf(sentfolder) !=-1 ||msg_folder.indexOf(preferences.save_in_folder) !=-1 || msg_folder.replace("local_","INBOX/").indexOf(preferences.save_in_folder) !=-1) |
---|
| 1023 | test = false; |
---|
| 1024 | |
---|
[3459] | 1025 | if(headers_msgs.from.email.toLowerCase() == Element("user_email").value.toLowerCase() && !(preferences.from_to_sent == "1" && test) && !(msg_folder.substr(0,5) == "user/")) |
---|
[3035] | 1026 | { |
---|
[2] | 1027 | td_element3.onmouseover = function () {this.title=headers_msgs.to.email;}; |
---|
| 1028 | if (headers_msgs.Draft == 'X') |
---|
| 1029 | td_element3.innerHTML += "<span style=\"color:red\">("+get_lang("Draft")+") </span>"; |
---|
[3035] | 1030 | else{ |
---|
| 1031 | if(headers_msgs.to.email != null && headers_msgs.to.email.toLowerCase() != Element("user_email").value) |
---|
[1035] | 1032 | td_element24.innerHTML = "<img valign='center' src ='templates/"+template+"/images/sent.gif' title='"+get_lang('Sent')+"'>"; |
---|
[3831] | 1033 | |
---|
| 1034 | if (headers_msgs.to) { |
---|
| 1035 | if (headers_msgs.to.name != null) |
---|
| 1036 | td_element3.innerHTML += headers_msgs.to.name; |
---|
| 1037 | else if(headers_msgs.to.email != null) { |
---|
| 1038 | td_element3.innerHTML += headers_msgs.to.email; |
---|
| 1039 | } |
---|
| 1040 | else { |
---|
| 1041 | td_element3.innerHTML += get_lang("without destination"); |
---|
| 1042 | } |
---|
[2] | 1043 | } |
---|
| 1044 | } |
---|
| 1045 | } |
---|
| 1046 | else{ |
---|
| 1047 | if (headers_msgs.Draft == 'X'){ |
---|
| 1048 | td_element3.innerHTML = "<span style=\"color:red\">("+get_lang("Draft")+") </span>"; |
---|
| 1049 | } |
---|
[3035] | 1050 | else{ |
---|
[1247] | 1051 | var spanSender = document.createElement("SPAN"); |
---|
| 1052 | spanSender.onmouseover = function (event) {this.style.textDecoration = "underline";try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};}; |
---|
| 1053 | spanSender.onmouseout = function (){ try {this.style.textDecoration = "none"; clearTimeout(InfoContact.timeout);} catch(e){}}; |
---|
| 1054 | spanSender.innerHTML = headers_msgs.from.name != null ? headers_msgs.from.name : headers_msgs.from.email; |
---|
| 1055 | if (spanSender.innerHTML.indexOf(" ") == '-1' && spanSender.innerHTML.length > 25){ |
---|
| 1056 | spanSender.innerHTML = spanSender.innerHTML.substring(0,25) + "..."; |
---|
| 1057 | } |
---|
| 1058 | else if (spanSender.innerHTML.length > 40 ){ |
---|
| 1059 | spanSender.innerHTML = spanSender.innerHTML.substring(0,40) + "..."; |
---|
[3035] | 1060 | } |
---|
| 1061 | td_element3.appendChild(spanSender); |
---|
[2] | 1062 | } |
---|
[3035] | 1063 | } |
---|
[2] | 1064 | td_element4 = document.createElement("TD"); |
---|
[994] | 1065 | td_element4.className = "td_msg"; |
---|
[1752] | 1066 | td_element4.setAttribute("width", "50%"); |
---|
[2] | 1067 | td_element4.onclick = _onclick; |
---|
[1752] | 1068 | td_element4.innerHTML = !is_ie ? "<a nowrap id='a_message_"+tr_element.id+"'> " : " "; |
---|
[3035] | 1069 | |
---|
[2] | 1070 | if ((headers_msgs.subject)&&(headers_msgs.subject.length > 50)) |
---|
[1752] | 1071 | { |
---|
[3593] | 1072 | //Modificacao para evitar que o truncamento do assunto quebre uma NCR - #1189 |
---|
| 1073 | pos = headers_msgs.subject.indexOf("&",45); |
---|
| 1074 | if ((pos > 0) && (pos <= 50) && ((headers_msgs.subject.charAt(pos+5) == ";") || (headers_msgs.subject.charAt(pos+6) == ";"))) |
---|
| 1075 | td_element4.innerHTML += headers_msgs.subject.substring(0,pos+6) + "..." + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample +"</span>"; |
---|
| 1076 | else |
---|
| 1077 | td_element4.innerHTML += headers_msgs.subject.substring(0,50) + "..." + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample +"</span>";//modificacao feita para exibir o trecho do body ao lado do assunto da mensagem; |
---|
[1752] | 1078 | } |
---|
[2] | 1079 | else |
---|
[1752] | 1080 | { |
---|
| 1081 | td_element4.innerHTML += headers_msgs.subject + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample + "</span>";//modificacao feita para exibir o trecho do body ao lado do assunto da mensagem; |
---|
| 1082 | } |
---|
[3035] | 1083 | |
---|
[1752] | 1084 | td_element4.title=tr_element.tip; |
---|
[2] | 1085 | if(!is_ie){ |
---|
| 1086 | td_element4.innerHTML += "</a>"; |
---|
| 1087 | } |
---|
| 1088 | |
---|
[3035] | 1089 | |
---|
[2] | 1090 | td_element5 = document.createElement("TD"); |
---|
[994] | 1091 | td_element5.className = "td_msg"; |
---|
[2] | 1092 | td_element5.setAttribute("width", "14%"); |
---|
| 1093 | td_element5.onclick = _onclick; |
---|
| 1094 | td_element5.setAttribute("align", "center"); |
---|
[3057] | 1095 | var norm = function (arg) {return (arg < 10 ? '0'+arg : arg);}; |
---|
| 1096 | var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; |
---|
[3493] | 1097 | |
---|
| 1098 | var today = new Date(); |
---|
[3927] | 1099 | today.setHours(23); |
---|
| 1100 | today.setMinutes(59); |
---|
| 1101 | today.setSeconds(59); |
---|
| 1102 | today.setMilliseconds(999) |
---|
[3493] | 1103 | |
---|
[3512] | 1104 | var udate_local = null; |
---|
| 1105 | var date_msg = null; |
---|
[3493] | 1106 | |
---|
[3512] | 1107 | // old local messages can capture headers_msgs.udate as "hh:mm" or "dd/mm/yyyy" |
---|
| 1108 | if (headers_msgs.udate.toString().match(/\d{2}:\d{2}/) || headers_msgs.udate.toString().match(/\d{2}\/\d{2}\/\d{4}/)) |
---|
| 1109 | { |
---|
| 1110 | temp_msg_day = headers_msgs.msg_day.split('/'); |
---|
| 1111 | temp_msg_hour = headers_msgs.msg_hour.split(':'); |
---|
| 1112 | date_msg = new Date(temp_msg_day[2], temp_msg_day[1]-1, temp_msg_day[0], temp_msg_hour[0], temp_msg_hour[1]); |
---|
| 1113 | } |
---|
| 1114 | else |
---|
| 1115 | { |
---|
| 1116 | // The new date implementation |
---|
| 1117 | // Using offset between user defined timezone and GMT |
---|
| 1118 | // Date object converts time to local timezone, so we have to adjust it |
---|
| 1119 | udate_local = headers_msgs.udate*1000 + offsetToGMT*1000 + today.getTimezoneOffset()*60*1000; |
---|
| 1120 | date_msg = new Date(udate_local); |
---|
| 1121 | } |
---|
| 1122 | |
---|
[3493] | 1123 | if (today.getTime() - date_msg.getTime() < 86400000) |
---|
[3057] | 1124 | td_element5.innerHTML = norm(date_msg.getHours()) + ':' + norm(date_msg.getMinutes()); |
---|
| 1125 | else |
---|
| 1126 | if (today.getTime() - date_msg.getTime() < 172800000) |
---|
| 1127 | td_element5.innerHTML = get_lang('Yesterday'); |
---|
| 1128 | else |
---|
| 1129 | if (today.getTime() - date_msg.getTime() < 259200000) |
---|
| 1130 | td_element5.innerHTML = get_lang(weekDays[date_msg.getDay()]); |
---|
| 1131 | else |
---|
| 1132 | td_element5.innerHTML = norm(date_msg.getDate()) + '/' + norm(date_msg.getMonth()+1) + '/' +date_msg.getFullYear(); |
---|
| 1133 | td_element5.title = norm(date_msg.getDate()) + '/' + norm(date_msg.getMonth()+1) + '/' +date_msg.getFullYear(); |
---|
| 1134 | td_element5.alt = td_element5.title; |
---|
[2] | 1135 | |
---|
[3057] | 1136 | |
---|
| 1137 | |
---|
[2] | 1138 | td_element6 = document.createElement("TD"); |
---|
[994] | 1139 | td_element6.className = "td_msg"; |
---|
[2] | 1140 | td_element6.setAttribute("width", "14%"); |
---|
| 1141 | td_element6.onclick = _onclick; |
---|
| 1142 | td_element6.setAttribute("noWrap","true"); |
---|
| 1143 | td_element6.setAttribute("align", "center"); |
---|
| 1144 | |
---|
[3028] | 1145 | td_element6.innerHTML = borkb(headers_msgs.Size); |
---|
| 1146 | |
---|
| 1147 | |
---|
[2] | 1148 | tr_element.appendChild(td_element1); |
---|
| 1149 | tr_element.appendChild(td_element2); |
---|
| 1150 | tr_element.appendChild(td_element21); |
---|
| 1151 | tr_element.appendChild(td_element22); |
---|
| 1152 | tr_element.appendChild(td_element23); |
---|
[3035] | 1153 | tr_element.appendChild(td_element24); |
---|
| 1154 | tr_element.appendChild(td_element25); |
---|
[2] | 1155 | tr_element.appendChild(td_element3); |
---|
| 1156 | tr_element.appendChild(td_element4); |
---|
| 1157 | tr_element.appendChild(td_element5); |
---|
| 1158 | tr_element.appendChild(td_element6); |
---|
| 1159 | return tr_element; |
---|
| 1160 | } |
---|
| 1161 | |
---|
[51] | 1162 | function sort_box(search, sort){ |
---|
| 1163 | var message_header = Element("message_header_"+search); |
---|
[2] | 1164 | var handler_draw_box = function(data){ |
---|
[790] | 1165 | draw_box(data, current_folder,true); |
---|
[406] | 1166 | //Mostrar as msgs nao lidas de acordo com o filtro de relevancia |
---|
[3392] | 1167 | var msgs_unseen = 0; |
---|
| 1168 | draw_paging(data.num_msgs); |
---|
| 1169 | Element("new_m").innerHTML = '<font style="color:'+(data.tot_unseen == 0 ? '': 'red')+'">' + data.tot_unseen + '</font>'; |
---|
| 1170 | Element("tot_m").innerHTML = data.num_msgs; |
---|
[427] | 1171 | } |
---|
[2] | 1172 | |
---|
[51] | 1173 | if(sort_box_type == sort && search_box_type == search){ |
---|
[46] | 1174 | sort_box_reverse = sort_box_reverse ? 0 : 1; |
---|
[51] | 1175 | } |
---|
| 1176 | else if(sort_box_type != sort){ |
---|
[163] | 1177 | if ( (sort == 'SORTFROM') || (sort == 'SORTSUBJECT') ) |
---|
| 1178 | sort_box_reverse = 0; |
---|
| 1179 | else |
---|
| 1180 | sort_box_reverse = 1; |
---|
[51] | 1181 | } |
---|
[3035] | 1182 | |
---|
[46] | 1183 | // Global variable. |
---|
[51] | 1184 | sort_box_type = sort; |
---|
| 1185 | search_box_type = search; |
---|
[46] | 1186 | |
---|
[1752] | 1187 | proxy_mensagens.messages_list(current_folder,1,preferences.max_email_per_page,sort,search,sort_box_reverse,preferences.preview_msg_subject,preferences.preview_msg_tip,handler_draw_box); |
---|
[2] | 1188 | current_page = 1; |
---|
[406] | 1189 | //Comentado para nao sobrepor o numero de msgs nao lidas ao utilizar os filtros |
---|
| 1190 | //update_menu(); |
---|
[2] | 1191 | } |
---|
| 1192 | function draw_header_box(){ |
---|
| 1193 | switch(sort_box_type){ |
---|
| 1194 | case 'SORTFROM': |
---|
| 1195 | type_name = get_lang("Who"); |
---|
| 1196 | break; |
---|
| 1197 | case 'SORTSUBJECT': |
---|
| 1198 | type_name = get_lang("Subject"); |
---|
| 1199 | break; |
---|
| 1200 | case 'SORTARRIVAL': |
---|
| 1201 | type_name = get_lang("Date"); |
---|
| 1202 | break; |
---|
| 1203 | case 'SORTSIZE': |
---|
| 1204 | type_name = get_lang("Size"); |
---|
[3035] | 1205 | break; |
---|
[2] | 1206 | default: |
---|
| 1207 | type_name = get_lang("Date"); |
---|
[72] | 1208 | break; |
---|
[2] | 1209 | } |
---|
[320] | 1210 | document.getElementById("message_header_SORTFROM_"+numBox).innerHTML = get_lang("Who"); |
---|
| 1211 | document.getElementById("message_header_SORTSUBJECT_"+numBox).innerHTML = get_lang("Subject"); |
---|
| 1212 | document.getElementById("message_header_SORTARRIVAL_"+numBox).innerHTML = get_lang("Date"); |
---|
[3035] | 1213 | document.getElementById("message_header_SORTSIZE_"+numBox).innerHTML = get_lang("Size"); |
---|
[790] | 1214 | document.getElementById("message_header_"+(sort_box_type.lastIndexOf("SORT") != "-1" ? sort_box_type : "SORTARRIVAL")+"_"+numBox ).innerHTML = "<B>"+type_name+"</B><img src ='templates/"+template+"/images/arrow_"+(sort_box_reverse == 1 ? 'desc' : 'asc')+"endant.gif'>"; |
---|
[2] | 1215 | } |
---|
| 1216 | function draw_message(info_msg, ID){ |
---|
| 1217 | var content = document.getElementById('content_id_' + ID); |
---|
[3035] | 1218 | |
---|
[2] | 1219 | var menuHidden = Element("folderscol").style.display == 'none' ? true : false; |
---|
| 1220 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1221 | //Make the next/previous buttom. |
---|
| 1222 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1223 | var next_previous_msg_td = document.createElement("TD"); |
---|
| 1224 | next_previous_msg_td.setAttribute("noWrap","true"); |
---|
| 1225 | next_previous_msg_td.align = "right"; |
---|
| 1226 | next_previous_msg_td.width = "40px"; |
---|
| 1227 | var img_next_msg = document.createElement("IMG"); |
---|
[128] | 1228 | img_next_msg.id = 'msg_opt_next_' + ID; |
---|
[790] | 1229 | img_next_msg.src = './templates/'+template+'/images/down.button.png'; |
---|
[2] | 1230 | img_next_msg.title = get_lang('Next'); |
---|
| 1231 | img_next_msg.style.cursor = 'pointer'; |
---|
[569] | 1232 | |
---|
[3394] | 1233 | var folder_id = ID.match(/\d+/)[0]; |
---|
| 1234 | var folder; |
---|
| 1235 | |
---|
| 1236 | //Correção para fazer funcionar e-mails assinados no formato encapsulado. |
---|
| 1237 | // folder_id = info_msg.original_ID ? info_msg.original_ID: info_msg.msg_number; |
---|
| 1238 | if ((folder = document.getElementById(info_msg.original_ID)) == null) |
---|
| 1239 | //if ((folder = document.getElementById(info_msg.msg_number)) == null) |
---|
| 1240 | folder = document.getElementById(info_msg.msg_number); |
---|
[607] | 1241 | if (!folder){ |
---|
| 1242 | delete_border(ID); |
---|
| 1243 | return; |
---|
| 1244 | } |
---|
[3035] | 1245 | if (folder){ // mensagem local criptografada nao tem ID da pasta local |
---|
| 1246 | if (folder.nextSibling){ |
---|
| 1247 | var nextMsgBox = folder.nextSibling.name?folder.nextSibling.name:info_msg.msg_folder; |
---|
[1035] | 1248 | |
---|
[3035] | 1249 | if (nextMsgBox == "INBOX/decifradas")// teste para ver se a mensagem vem da pasta oculta decifradas |
---|
| 1250 | nextMsgBox = get_current_folder(); |
---|
[1035] | 1251 | |
---|
[3035] | 1252 | img_next_msg.onclick = function() |
---|
| 1253 | { |
---|
| 1254 | currentTab = ID; |
---|
| 1255 | openTab.type[ID] = 2; |
---|
| 1256 | proxy_mensagens.get_msg(folder.nextSibling.id,nextMsgBox,true,show_msg); |
---|
| 1257 | }; |
---|
| 1258 | } |
---|
| 1259 | else |
---|
| 1260 | { |
---|
| 1261 | img_next_msg.src = "./templates/"+template+"/images/down.gray.button.png"; |
---|
| 1262 | img_next_msg.style.cursor = 'default'; |
---|
[1035] | 1263 | |
---|
[3035] | 1264 | } |
---|
| 1265 | } |
---|
| 1266 | else |
---|
| 1267 | { |
---|
| 1268 | img_next_msg.src = "./templates/"+template+"/images/down.gray.button.png"; |
---|
[1035] | 1269 | img_next_msg.style.cursor = 'default'; |
---|
| 1270 | if (!proxy_mensagens.is_local_folder(get_current_folder()) && !(info_msg.msg_folder == "INBOX/decifradas")) // testa se a mensagem e local |
---|
[569] | 1271 | { |
---|
[3035] | 1272 | img_next_msg.onclick = function() |
---|
| 1273 | { |
---|
| 1274 | delete_border(ID); |
---|
| 1275 | }; |
---|
| 1276 | } |
---|
| 1277 | } |
---|
[2] | 1278 | var img_space = document.createElement("SPAN"); |
---|
| 1279 | img_space.innerHTML = " "; |
---|
| 1280 | var img_previous_msg = document.createElement("IMG"); |
---|
[128] | 1281 | img_previous_msg.id = 'msg_opt_previous_' + ID; |
---|
[790] | 1282 | img_previous_msg.src = './templates/'+template+'/images/up.button.png'; |
---|
[2] | 1283 | img_previous_msg.title = get_lang('Previous'); |
---|
| 1284 | img_previous_msg.style.cursor = 'pointer'; |
---|
[569] | 1285 | |
---|
[607] | 1286 | if (!folder){ |
---|
[3035] | 1287 | delete_border(ID); |
---|
[607] | 1288 | return; |
---|
| 1289 | } |
---|
[3035] | 1290 | if (folder){ // mensagem local criptografada nao tem ID da pasta local |
---|
| 1291 | if (folder.previousSibling) |
---|
| 1292 | { |
---|
| 1293 | var previousMsgBox = folder.previousSibling.name?folder.previousSibling.name:info_msg.msg_folder; |
---|
[1035] | 1294 | |
---|
[3035] | 1295 | if (previousMsgBox == "INBOX/decifradas") // teste para ver se a mensagem vem da pasta oculta decifradas |
---|
| 1296 | previousMsgBox = get_current_folder(); |
---|
[1035] | 1297 | |
---|
[3035] | 1298 | img_previous_msg.onclick = function() |
---|
| 1299 | { |
---|
| 1300 | currentTab = ID; |
---|
| 1301 | openTab.type[ID] = 2; |
---|
| 1302 | proxy_mensagens.get_msg(folder.previousSibling.id,previousMsgBox,true,show_msg); |
---|
| 1303 | }; |
---|
| 1304 | } |
---|
| 1305 | else |
---|
| 1306 | { |
---|
| 1307 | img_previous_msg.src = "./templates/"+template+"/images/up.gray.button.png"; |
---|
| 1308 | img_previous_msg.style.cursor = 'default'; |
---|
| 1309 | } |
---|
[569] | 1310 | } |
---|
| 1311 | else |
---|
[1035] | 1312 | { |
---|
| 1313 | img_previous_msg.src = "./templates/"+template+"/images/up.gray.button.png"; |
---|
| 1314 | img_previous_msg.style.cursor = 'default'; |
---|
| 1315 | if (!proxy_mensagens.is_local_folder(get_current_folder()) && !(info_msg.msg_folder == "INBOX/decifradas")) // testa se a mensagem e local |
---|
[3035] | 1316 | { |
---|
| 1317 | img_previous_msg.onclick = function() |
---|
| 1318 | { |
---|
| 1319 | delete_border(ID); |
---|
| 1320 | }; |
---|
| 1321 | } |
---|
| 1322 | } |
---|
[2] | 1323 | next_previous_msg_td.appendChild(img_previous_msg); |
---|
| 1324 | next_previous_msg_td.appendChild(img_space); |
---|
| 1325 | next_previous_msg_td.appendChild(img_next_msg); |
---|
| 1326 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1327 | //Make the header message. |
---|
| 1328 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1329 | var table_message = document.createElement("TABLE"); |
---|
| 1330 | var tbody_message = document.createElement("TBODY"); |
---|
| 1331 | table_message.border = "0"; |
---|
[3035] | 1332 | table_message.width = "100%"; |
---|
[2] | 1333 | |
---|
| 1334 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1335 | //Make the options message. |
---|
| 1336 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1337 | var tr0 = document.createElement("TR"); |
---|
| 1338 | tr0.className = "tr_message_header"; |
---|
| 1339 | var td0 = document.createElement("TD"); |
---|
| 1340 | var table_message_options = document.createElement("TABLE"); |
---|
| 1341 | table_message_options.width = "100%"; |
---|
| 1342 | table_message_options.border = '0'; |
---|
| 1343 | table_message_options.className = 'table_message'; |
---|
| 1344 | var tbody_message_options = document.createElement("TBODY"); |
---|
| 1345 | var tr = document.createElement("TR"); |
---|
| 1346 | var td = document.createElement("TD"); |
---|
| 1347 | td.setAttribute("noWrap","true"); |
---|
| 1348 | var _name = ''; |
---|
| 1349 | var _maxChar = menuHidden ? 40 : 15; |
---|
[3035] | 1350 | |
---|
[2] | 1351 | if (info_msg.from.name) |
---|
[1416] | 1352 | { |
---|
| 1353 | var spanName = document.createElement("SPAN"); |
---|
| 1354 | spanName.innerHTML = info_msg.from.name; |
---|
| 1355 | _name = spanName.innerHTML.length > _maxChar ? spanName.innerHTML.substring(0,_maxChar) + "..." : spanName.innerHTML; |
---|
| 1356 | } |
---|
| 1357 | else |
---|
[2] | 1358 | _name = info_msg.from.email.length > _maxChar ? info_msg.from.email.substring(0,_maxChar) + "..." : info_msg.from.email; |
---|
| 1359 | |
---|
| 1360 | td.innerHTML = _name.bold() + ', ' + info_msg.smalldate; |
---|
[3035] | 1361 | if (info_msg.attachments && info_msg.attachments.length > 0) |
---|
[3369] | 1362 | td.innerHTML += " <img style='cursor:pointer' onclick='javascript:Element(\"option_hide_more_"+ID+"\").onclick()' src ='templates/"+template+"/images/clip.gif' title='"+info_msg.attachments[0].name+"'>"; |
---|
[3035] | 1363 | |
---|
[91] | 1364 | if (typeof(info_msg.signature) == 'string') |
---|
[3035] | 1365 | { |
---|
[109] | 1366 | if (info_msg.signature != "void") |
---|
[790] | 1367 | td.innerHTML += ' <img style="cursor:pointer" onclick="alert(\''+ get_lang("This message is signed, and you can trust.") + info_msg.signature +'\');" src="templates/'+template+'/images/signed.gif">'; |
---|
[91] | 1368 | else |
---|
[790] | 1369 | td.innerHTML += " <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='templates/"+template+"/images/invalid.gif'>"; |
---|
[91] | 1370 | } |
---|
[3798] | 1371 | |
---|
[320] | 1372 | if (info_msg.DispositionNotificationTo) |
---|
| 1373 | { |
---|
[3798] | 1374 | td.innerHTML += ' <img id="disposition_notification_'+ID+'" style="cursor:pointer" alt="'+ get_lang('Message with read notification') + '" title="'+ get_lang('Message with read notification') + '" src="templates/'+template+'/images/notification.gif">'; |
---|
[320] | 1375 | } |
---|
[3035] | 1376 | |
---|
[2] | 1377 | // NORMAL MSG |
---|
| 1378 | if(info_msg.Draft != 'X') |
---|
| 1379 | { |
---|
| 1380 | var options = document.createElement("TD"); |
---|
[790] | 1381 | options.width = "30%"; |
---|
[2] | 1382 | options.setAttribute("noWrap","true"); |
---|
| 1383 | var option_hide_more = document.createElement("SPAN"); |
---|
| 1384 | option_hide_more.className = 'message_options'; |
---|
[3036] | 1385 | option_hide_more.onmouseover=function () { this.className='message_options_active'; }; |
---|
| 1386 | option_hide_more.onmouseout=function () { this.className='message_options' }; |
---|
[24] | 1387 | options.align = 'right'; |
---|
[2] | 1388 | option_hide_more.value = 'more_options'; |
---|
| 1389 | option_hide_more.id = 'option_hide_more_'+ID; |
---|
| 1390 | option_hide_more.onclick = function(){ |
---|
| 1391 | if (this.value == 'more_options'){ |
---|
[3021] | 1392 | this.innerHTML = "<b><u>"+get_lang('Hide details')+"</u></b>"; |
---|
[2] | 1393 | this.value = 'hide_options'; |
---|
| 1394 | Element('table_message_others_options_'+ID).style.display = ''; |
---|
| 1395 | } |
---|
| 1396 | else{ |
---|
[3021] | 1397 | this.innerHTML = get_lang('Show details'); |
---|
[2] | 1398 | this.value = 'more_options'; |
---|
| 1399 | Element('table_message_others_options_'+ID).style.display = 'none'; |
---|
| 1400 | } |
---|
[3018] | 1401 | resizeWindow(); |
---|
[2] | 1402 | }; |
---|
[790] | 1403 | var option_mark = document.createElement('TD'); |
---|
| 1404 | option_mark.align = "left"; |
---|
| 1405 | option_mark.width = "50%"; |
---|
[3036] | 1406 | var option_mark_as = '<span>'+get_lang("Mark as")+'</span>: '; |
---|
| 1407 | var option_mark_as_unseen = document.createElement("SPAN"); |
---|
| 1408 | option_mark_as_unseen.className = "message_options"; |
---|
| 1409 | option_mark_as_unseen.onclick = function () { changeLinkState(this,'seen'); |
---|
[3716] | 1410 | proxy_mensagens.proxy_set_message_flag(folder_id,'unseen'); |
---|
[3036] | 1411 | write_msg(get_lang('Message marked as ')+get_lang("Unseen")); |
---|
| 1412 | }; |
---|
| 1413 | option_mark_as_unseen.onmouseover=function () { this.className='message_options_active'; }; |
---|
| 1414 | option_mark_as_unseen.onmouseout=function () { this.className='message_options' }; |
---|
| 1415 | option_mark_as_unseen.innerHTML = get_lang("Unseen"); |
---|
[3021] | 1416 | |
---|
[3036] | 1417 | var option_mark_important = document.createElement("SPAN"); |
---|
| 1418 | option_mark_important.className = 'message_options'; |
---|
| 1419 | option_mark_important.style.paddingLeft = "10px"; |
---|
| 1420 | option_mark_important.onmouseover=function () { this.className='message_options_active'; }; |
---|
| 1421 | option_mark_important.onmouseout=function () { this.className='message_options' }; |
---|
| 1422 | |
---|
| 1423 | if (info_msg.Flagged == "F"){ |
---|
[3806] | 1424 | option_mark_important.onclick = function() { |
---|
| 1425 | var _this = this; |
---|
| 1426 | proxy_mensagens.proxy_set_message_flag(folder_id,'unflagged', function(success){ |
---|
| 1427 | if (success) { |
---|
| 1428 | changeLinkState(_this, 'important'); |
---|
| 1429 | write_msg(get_lang('Message marked as ') + get_lang("Normal")); |
---|
| 1430 | } |
---|
| 1431 | } ); |
---|
| 1432 | |
---|
[3036] | 1433 | }; |
---|
| 1434 | option_mark_important.innerHTML = get_lang("Normal"); |
---|
| 1435 | } |
---|
| 1436 | else{ |
---|
| 1437 | option_mark_important.onclick = function() { changeLinkState(this,'normal'); |
---|
[3716] | 1438 | proxy_mensagens.proxy_set_message_flag(folder_id,'flagged'); |
---|
[3036] | 1439 | write_msg(get_lang('Message marked as ')+get_lang("Important")); |
---|
| 1440 | }; |
---|
| 1441 | option_mark_important.innerHTML = get_lang("Important"); |
---|
| 1442 | } |
---|
| 1443 | option_mark.innerHTML = option_mark_as; |
---|
| 1444 | option_mark.appendChild(option_mark_as_unseen); |
---|
| 1445 | option_mark.appendChild(option_mark_important); |
---|
[3021] | 1446 | option_hide_more.innerHTML = get_lang('Show details'); |
---|
[2] | 1447 | options.appendChild(option_hide_more); |
---|
[3021] | 1448 | |
---|
[24] | 1449 | var space0 = document.createElement("SPAN"); |
---|
[790] | 1450 | space0.innerHTML = ' | '; |
---|
[2] | 1451 | var space1 = document.createElement("SPAN"); |
---|
[790] | 1452 | space1.innerHTML = ' | '; |
---|
[2] | 1453 | var space2 = document.createElement("SPAN"); |
---|
[790] | 1454 | space2.innerHTML = ' | '; |
---|
[2] | 1455 | |
---|
| 1456 | var option_forward = document.createElement("SPAN"); |
---|
[128] | 1457 | option_forward.id = 'msg_opt_forward_'+ID; |
---|
[2] | 1458 | option_forward.className = 'message_options'; |
---|
| 1459 | option_forward.onclick = function(){new_message('forward', ID);}; |
---|
[3036] | 1460 | option_forward.onmouseover=function () { this.className='message_options_active'; }; |
---|
| 1461 | option_forward.onmouseout=function () { this.className='message_options' }; |
---|
[197] | 1462 | option_forward.innerHTML = get_lang('Forward'); |
---|
[2] | 1463 | options.appendChild(space1); |
---|
| 1464 | options.appendChild(option_forward); |
---|
| 1465 | var option_reply = document.createElement("SPAN"); |
---|
[128] | 1466 | option_reply.id = 'msg_opt_reply_'+ID; |
---|
[2] | 1467 | option_reply.className = 'message_options'; |
---|
| 1468 | option_reply.onclick = function(){new_message('reply_with_history', ID);}; |
---|
[197] | 1469 | option_reply.innerHTML = get_lang('Reply'); |
---|
[3036] | 1470 | option_reply.onmouseover=function () { this.className='message_options_active'; }; |
---|
| 1471 | option_reply.onmouseout=function () { this.className='message_options' }; |
---|
| 1472 | |
---|
[2] | 1473 | options.appendChild(space2); |
---|
[3021] | 1474 | |
---|
| 1475 | var option_reply_options = document.createElement('IMG'); |
---|
| 1476 | option_reply_options.id = 'msg_opt_reply_options_'+ID; |
---|
| 1477 | option_reply_options.src = '../expressoMail1_2/templates/default/images/down.png'; |
---|
| 1478 | option_reply_options.value = 'show'; |
---|
| 1479 | |
---|
| 1480 | option_reply_options.onmouseover = function(){ |
---|
| 1481 | option_reply_options.src= '../expressoMail1_2/templates/default/images/over.png'; |
---|
| 1482 | }; |
---|
| 1483 | option_reply_options.onmouseout = function(){ |
---|
| 1484 | if (this.value == 'show') |
---|
| 1485 | { |
---|
| 1486 | option_reply_options.src= '../expressoMail1_2/templates/default/images/down.png'; |
---|
| 1487 | } |
---|
| 1488 | else |
---|
| 1489 | { |
---|
| 1490 | option_reply_options.src= '../expressoMail1_2/templates/default/images/pressed.png'; |
---|
| 1491 | } |
---|
| 1492 | }; |
---|
| 1493 | option_reply_options.onclick = function(){ |
---|
| 1494 | if (this.value != 'hide'){ |
---|
| 1495 | this.value = 'hide'; |
---|
| 1496 | option_reply_options.src= '../expressoMail1_2/templates/default/images/pressed.png'; |
---|
| 1497 | Element('tr_other_options_'+ID).style.display = ''; |
---|
| 1498 | |
---|
| 1499 | } |
---|
| 1500 | else{ |
---|
| 1501 | this.value = 'show'; |
---|
| 1502 | option_reply_options.src= '../expressoMail1_2/templates/default/images/down.png'; |
---|
| 1503 | Element('tr_other_options_'+ID).style.display = 'none'; |
---|
| 1504 | } |
---|
| 1505 | }; |
---|
| 1506 | options.appendChild(option_reply_options); |
---|
[2] | 1507 | options.appendChild(option_reply); |
---|
[3035] | 1508 | |
---|
[2] | 1509 | tr.appendChild(td); |
---|
[790] | 1510 | tr.appendChild(option_mark); |
---|
[2] | 1511 | tr.appendChild(options); |
---|
| 1512 | tr.appendChild(next_previous_msg_td); |
---|
| 1513 | tbody_message_options.appendChild(tr); |
---|
[3035] | 1514 | |
---|
[2] | 1515 | ////////// OTHER OPTIONS //////////////////// |
---|
| 1516 | var tr_other_options = document.createElement("TR"); |
---|
| 1517 | tr_other_options.id = 'tr_other_options_' + ID; |
---|
| 1518 | tr_other_options.style.display = 'none'; |
---|
[3035] | 1519 | |
---|
[2] | 1520 | var td_other_options = document.createElement("TD"); |
---|
| 1521 | td_other_options.colSpan = '3'; |
---|
| 1522 | var div_other_options = document.createElement("DIV"); |
---|
| 1523 | |
---|
[3021] | 1524 | var option_mark_as_unseen = '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'unseen\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Unseen")+'.\');">'+get_lang("Unseen")+'</span>, '; |
---|
[689] | 1525 | var option_mark_as_important = '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'flagged\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Important")+'.\');">'+get_lang("Important")+'</span>, '; |
---|
| 1526 | var option_mark_as_normal = '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'unflagged\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Normal")+'.\');">'+get_lang("Normal")+'</span> | '; |
---|
[3035] | 1527 | |
---|
[3021] | 1528 | var option_move = '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","move_to");>'+get_lang("Move")+'</span> | '; |
---|
| 1529 | var option_reply_to_all = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=new_message("reply_to_all_with_history","'+ID+'");>'+get_lang("Reply to all")+'</span> | '; |
---|
| 1530 | var option_reply_without_history = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=new_message("reply_without_history","'+ID+'");>'+get_lang("Reply without history")+'</span> | '; |
---|
| 1531 | var option_reply_to_all_without_history = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=new_message("reply_to_all_without_history","'+ID+'");>'+get_lang("Reply to all without history")+'</span>'; |
---|
[2] | 1532 | |
---|
[3021] | 1533 | div_other_options.innerHTML = option_reply_to_all + option_reply_without_history + option_reply_to_all_without_history; |
---|
[69] | 1534 | if (use_spam_filter) { |
---|
[75] | 1535 | if(info_msg.msg_folder == 'INBOX'+cyrus_delimiter+'Spam') |
---|
[3035] | 1536 | div_other_options.innerHTML += ' | <span class="message_options" onclick="nospam('+info_msg.msg_number+',\'null\', \''+info_msg.msg_folder+'\')";>'+get_lang("Not Spam")+'</span>'; |
---|
[69] | 1537 | else |
---|
[3035] | 1538 | div_other_options.innerHTML += ' | <span class="message_options" onclick="spam(\''+info_msg.msg_folder+'\', '+info_msg.msg_number+',\'null\')";>'+get_lang("Mark as Spam")+'</span>'; |
---|
[69] | 1539 | } |
---|
[3021] | 1540 | td_other_options.align = 'right'; |
---|
| 1541 | td_other_options.style.paddingTop = '3px'; |
---|
[2] | 1542 | td_other_options.appendChild(div_other_options); |
---|
[3021] | 1543 | |
---|
| 1544 | |
---|
[2] | 1545 | tr_other_options.appendChild(td_other_options); |
---|
| 1546 | tbody_message_options.appendChild(tr_other_options); |
---|
| 1547 | ////////// END OTHER OPTIONS //////////////// |
---|
[1035] | 1548 | |
---|
[3035] | 1549 | ////////// BEGIN SIGNATURE ////////////////// |
---|
[1035] | 1550 | if (info_msg.signature && info_msg.signature.length > 0) |
---|
| 1551 | { |
---|
[3352] | 1552 | var tr_signature = document.createElement("TR"); |
---|
| 1553 | var td_signature = document.createElement("TD"); |
---|
| 1554 | td_signature.className = 'tr_message_header'; |
---|
| 1555 | tr_signature.id = 'tr_signature_'+ID; |
---|
| 1556 | td_signature.colSpan = "5"; |
---|
| 1557 | tr_signature.style.display = 'none'; |
---|
| 1558 | for (i in info_msg.signature) |
---|
| 1559 | { |
---|
| 1560 | if(typeof(info_msg.signature[i]) == 'object') |
---|
| 1561 | { |
---|
| 1562 | var aux = ''; |
---|
| 1563 | for (ii in info_msg.signature[i]) |
---|
| 1564 | { |
---|
| 1565 | if(info_msg.signature[i][ii].indexOf("###") > -1) |
---|
| 1566 | { |
---|
| 1567 | aux += get_lang(info_msg.signature[i][ii].substring(0,info_msg.signature[i][ii].indexOf("###"))) + info_msg.signature[i][ii].substring(info_msg.signature[i][ii].indexOf("###")+3); |
---|
| 1568 | } |
---|
| 1569 | else |
---|
| 1570 | { |
---|
| 1571 | aux += info_msg.signature[i][ii]; |
---|
| 1572 | } |
---|
| 1573 | } |
---|
| 1574 | td_signature.innerHTML += "<a onclick=\"javascript:alert('" + aux + "')\"><b><font color=\"#0000FF\">" + get_lang("More") + "...</font></b></a>"; |
---|
| 1575 | continue; |
---|
| 1576 | } |
---|
| 1577 | if(info_msg.signature[i].indexOf("#@#") > -1) |
---|
| 1578 | { |
---|
| 1579 | td_signature.innerHTML += '<span style=color:red><strong>'+get_lang(info_msg.signature[i].substring(0,info_msg.signature[i].indexOf("#@#")))+'</strong> '+info_msg.signature[i].substring(info_msg.signature[i].indexOf("#@#")+3)+'</span> <br /> '; |
---|
| 1580 | } |
---|
| 1581 | if(info_msg.signature[i].indexOf("###") > -1) |
---|
| 1582 | { |
---|
| 1583 | td_signature.innerHTML += '<span><strong>'+get_lang(info_msg.signature[i].substring(0,info_msg.signature[i].indexOf("###")))+'</strong> '+info_msg.signature[i].substring(info_msg.signature[i].indexOf("###")+3)+'</span> <br /> '; |
---|
| 1584 | } |
---|
| 1585 | } |
---|
| 1586 | var signature_status_pos = info_msg.signature[0].indexOf('Message untouched'); |
---|
| 1587 | td_signature.id = "td_signature_"+ID; |
---|
| 1588 | if(signature_status_pos < 0 ) |
---|
| 1589 | { |
---|
| 1590 | td.innerHTML += ' <img style="cursor:pointer" src="templates/'+template+'/images/signed_error.gif" title="'+get_lang("Details")+'">'; |
---|
| 1591 | tr_signature.style.display = ''; |
---|
| 1592 | } |
---|
| 1593 | else |
---|
| 1594 | { |
---|
| 1595 | td.innerHTML += ' <img style="cursor:pointer" src="templates/'+template+'/images/signed_table.gif" title="'+get_lang("Details")+'">'; |
---|
| 1596 | } |
---|
| 1597 | td.onclick = function(){ |
---|
| 1598 | var _height = Element("div_message_scroll_"+ID).style.height; |
---|
| 1599 | _height = parseInt(_height.replace("px","")); |
---|
| 1600 | var _offset = 130; |
---|
| 1601 | if (this.value == 'more_cert'){ |
---|
| 1602 | this.value = 'hide_cert'; |
---|
| 1603 | Element("div_message_scroll_"+ID).style.height = (_height + _offset)+"px"; |
---|
| 1604 | Element('tr_signature_'+ID).style.display = 'none'; |
---|
| 1605 | Element('td_signature_'+ID).style.display = 'none'; |
---|
[1035] | 1606 | |
---|
[3352] | 1607 | } |
---|
| 1608 | else{ |
---|
| 1609 | //this.innerHTML += "Mais Informaᅵᅵes"; |
---|
| 1610 | this.value = 'more_cert'; |
---|
| 1611 | Element("div_message_scroll_"+ID).style.height = (_height - _offset)+"px"; |
---|
| 1612 | Element('tr_signature_'+ID).style.display = ''; |
---|
| 1613 | Element('td_signature_'+ID).style.display = ''; |
---|
| 1614 | } |
---|
[1035] | 1615 | }; |
---|
| 1616 | |
---|
[3352] | 1617 | tr_signature.appendChild(td_signature); |
---|
| 1618 | tbody_message_options.appendChild(tr_signature); |
---|
[1035] | 1619 | } |
---|
| 1620 | //////////// END SIGNATURE //////////////// |
---|
| 1621 | |
---|
[2] | 1622 | table_message_options.appendChild(tbody_message_options); |
---|
| 1623 | td0.appendChild(table_message_options); |
---|
| 1624 | tr0.appendChild(td0); |
---|
| 1625 | tbody_message.appendChild(tr0); |
---|
| 1626 | } |
---|
| 1627 | // IF DRAFT |
---|
| 1628 | else |
---|
| 1629 | { |
---|
| 1630 | var options = document.createElement("TD"); |
---|
| 1631 | options.width = "1%"; |
---|
| 1632 | options.setAttribute("noWrap","true"); |
---|
[3021] | 1633 | var option_edit = ' | <span class="message_options" onclick="new_message(\'edit\',\''+ID+'\');">'+get_lang('Edit')+'</span>'; |
---|
| 1634 | var option_print = ' | <span class="message_options" onclick="print_msg(\''+info_msg.msg_folder+'\',\''+info_msg.msg_number+'\',\''+ID+'\');">'+get_lang('Print')+'</span>'; |
---|
[271] | 1635 | var option_hide_more = document.createElement("SPAN"); |
---|
| 1636 | option_hide_more.className = 'message_options'; |
---|
| 1637 | options.align = 'right'; |
---|
| 1638 | option_hide_more.value = 'more_options'; |
---|
| 1639 | option_hide_more.id = 'option_hide_more_'+ID; |
---|
[3021] | 1640 | option_hide_more.innerHTML = get_lang('Show details'); |
---|
[271] | 1641 | option_hide_more.onclick = function(){ |
---|
| 1642 | var _height = Element("div_message_scroll_"+ID).style.height; |
---|
| 1643 | _height = parseInt(_height.replace("px","")); |
---|
| 1644 | var _offset = 35; |
---|
| 1645 | if (this.value == 'more_options'){ |
---|
[3021] | 1646 | this.innerHTML = "<b><u>"+get_lang('Hide details')+"</u></b>"; |
---|
[271] | 1647 | this.value = 'hide_options'; |
---|
| 1648 | Element("div_message_scroll_"+ID).style.height = (_height - _offset)+"px"; |
---|
| 1649 | Element('table_message_others_options_'+ID).style.display = ''; |
---|
| 1650 | } |
---|
| 1651 | else{ |
---|
[3021] | 1652 | this.innerHTML = get_lang('Show details'); |
---|
[271] | 1653 | this.value = 'more_options'; |
---|
| 1654 | Element("div_message_scroll_"+ID).style.height = (_height + _offset)+"px"; |
---|
| 1655 | Element('table_message_others_options_'+ID).style.display = 'none'; |
---|
| 1656 | } |
---|
| 1657 | }; |
---|
| 1658 | options.appendChild(option_hide_more); |
---|
[3021] | 1659 | options_actions = document.createElement('SPAN'); |
---|
| 1660 | options_actions.innerHTML = option_edit + option_print; |
---|
| 1661 | options.appendChild(options_actions); |
---|
[2] | 1662 | tr.appendChild(td); |
---|
| 1663 | tr.appendChild(options); |
---|
| 1664 | tr.appendChild(next_previous_msg_td); |
---|
| 1665 | tbody_message_options.appendChild(tr); |
---|
| 1666 | table_message_options.appendChild(tbody_message_options); |
---|
| 1667 | td0.appendChild(table_message_options); |
---|
| 1668 | tr0.appendChild(td0); |
---|
| 1669 | tbody_message.appendChild(tr0); |
---|
[3798] | 1670 | |
---|
| 1671 | var important_message = document.createElement("INPUT"); |
---|
| 1672 | important_message.id = "is_important_"+ID; |
---|
| 1673 | important_message.name = "is_important"; |
---|
| 1674 | important_message.type = "HIDDEN"; |
---|
| 1675 | important_message.value = (info_msg.Importance == "" || info_msg.Importance == "Normal") ? "0": "1"; |
---|
| 1676 | |
---|
| 1677 | options.appendChild(important_message); |
---|
[2] | 1678 | } |
---|
| 1679 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1680 | // END options message. |
---|
| 1681 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1682 | |
---|
| 1683 | var table_message_others_options = document.createElement("TABLE"); |
---|
| 1684 | table_message_others_options.id = 'table_message_others_options_' + ID; |
---|
[3018] | 1685 | table_message_others_options.width = "100%"; |
---|
[2] | 1686 | table_message_others_options.style.display = 'none'; |
---|
| 1687 | table_message_others_options.className = "table_message"; |
---|
| 1688 | var tbody_message_others_options = document.createElement("TBODY"); |
---|
| 1689 | var tr1 = document.createElement("TR"); |
---|
| 1690 | tr1.className = "tr_message_header"; |
---|
| 1691 | var td1 = document.createElement("TD"); |
---|
[83] | 1692 | td1.innerHTML = get_lang("From: "); |
---|
[271] | 1693 | td1.appendChild(deny_email(info_msg.from.email)); |
---|
[2] | 1694 | td1.width = "7%"; |
---|
[3035] | 1695 | |
---|
[2] | 1696 | if (info_msg.sender){ |
---|
| 1697 | var tr111 = document.createElement("TR"); |
---|
| 1698 | tr111.className = "tr_message_header"; |
---|
| 1699 | var td111 = document.createElement("TD"); |
---|
| 1700 | td111.innerHTML = get_lang("Sent by")+": "; |
---|
[271] | 1701 | td111.appendChild(deny_email(info_msg.sender.email)); |
---|
[2] | 1702 | td111.setAttribute("noWrap","true"); |
---|
| 1703 | var sender = document.createElement("TD"); |
---|
| 1704 | sender.id = "sender_"+ID; |
---|
| 1705 | var sender_values = document.createElement("INPUT"); |
---|
| 1706 | sender_values.id = "sender_values_"+ID; |
---|
| 1707 | sender_values.type = "HIDDEN"; |
---|
| 1708 | sender_values.value = info_msg.sender.full; //Veio do IMAP, sem images nem links. |
---|
| 1709 | sender.innerHTML += draw_plugin_cc(ID, info_msg.sender.full); |
---|
| 1710 | sender.className = "header_message_field"; |
---|
| 1711 | tr111.appendChild(td111); |
---|
| 1712 | tr111.appendChild(sender); |
---|
| 1713 | tr111.appendChild(sender_values); |
---|
| 1714 | tbody_message_others_options.appendChild(tr111); |
---|
| 1715 | } |
---|
[3035] | 1716 | |
---|
[2] | 1717 | var from = document.createElement("TD"); |
---|
| 1718 | from.id = "from_"+ID; |
---|
| 1719 | from.innerHTML = info_msg.from.full; |
---|
| 1720 | if (info_msg.Draft != "X"){ |
---|
| 1721 | from.innerHTML += draw_plugin_cc(ID, info_msg.from); |
---|
| 1722 | tbody_message_others_options.appendChild(tr1); |
---|
| 1723 | } |
---|
| 1724 | from.className = "header_message_field"; |
---|
| 1725 | var from_values = document.createElement("INPUT"); |
---|
| 1726 | from_values.id = "from_values_"+ID; |
---|
| 1727 | from_values.type = "HIDDEN"; |
---|
| 1728 | from_values.value = info_msg.from.full; //Veio do IMAP, sem images nem links. |
---|
[790] | 1729 | |
---|
[689] | 1730 | var local_message = document.createElement("INPUT"); |
---|
| 1731 | local_message.id = "is_local_"+ID; |
---|
| 1732 | local_message.name = "is_local"; |
---|
| 1733 | local_message.type = "HIDDEN"; |
---|
| 1734 | local_message.value = (info_msg.local_message)?"1":"0"; |
---|
[790] | 1735 | |
---|
[2] | 1736 | tr1.appendChild(td1); |
---|
| 1737 | tr1.appendChild(from); |
---|
| 1738 | tr1.appendChild(from_values); |
---|
[689] | 1739 | tr1.appendChild(local_message); |
---|
| 1740 | |
---|
[2] | 1741 | if (info_msg.reply_to){ |
---|
| 1742 | var tr11 = document.createElement("TR"); |
---|
| 1743 | tr11.className = "tr_message_header"; |
---|
| 1744 | var td11 = document.createElement("TD"); |
---|
| 1745 | td11.innerHTML = get_lang("Reply to")+": "; |
---|
| 1746 | td11.setAttribute("noWrap","true"); |
---|
| 1747 | var reply_to = document.createElement("TD"); |
---|
| 1748 | reply_to.id = "reply_to_"+ID; |
---|
[3035] | 1749 | |
---|
[2] | 1750 | var reply_to_values = document.createElement("INPUT"); |
---|
| 1751 | reply_to_values.id = "reply_to_values_"+ID; |
---|
| 1752 | reply_to_values.type = "HIDDEN"; |
---|
| 1753 | reply_to_values.value = info_msg.reply_to; //Veio do IMAP, sem images nem links. |
---|
| 1754 | reply_to.innerHTML = draw_plugin_cc(ID, info_msg.reply_to); |
---|
| 1755 | reply_to.className = "header_message_field"; |
---|
| 1756 | tr11.appendChild(td11); |
---|
| 1757 | tr11.appendChild(reply_to); |
---|
| 1758 | tr11.appendChild(reply_to_values); |
---|
| 1759 | tbody_message_others_options.appendChild(tr11); |
---|
| 1760 | } |
---|
| 1761 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 1762 | var tr2 = document.createElement("TR"); |
---|
| 1763 | tr2.className = "tr_message_header"; |
---|
| 1764 | var td2 = document.createElement("TD"); |
---|
[83] | 1765 | td2.innerHTML = get_lang("To: "); |
---|
[2] | 1766 | var to = document.createElement("TD"); |
---|
| 1767 | to.id = "to_"+ID; |
---|
| 1768 | |
---|
| 1769 | var to_values = document.createElement("INPUT"); |
---|
| 1770 | to_values.id = "to_values_"+ID; |
---|
| 1771 | to_values.type = "HIDDEN"; |
---|
[3035] | 1772 | to_values.value = info_msg.toaddress2; //Veio do IMAP, sem images nem links. |
---|
[63] | 1773 | |
---|
| 1774 | // Salva a pasta da mensagem |
---|
[3035] | 1775 | var input_current_folder = document.createElement('input'); |
---|
[63] | 1776 | input_current_folder.id = "input_folder_"+ID; |
---|
| 1777 | input_current_folder.name = "input_folder"; |
---|
| 1778 | input_current_folder.type = "hidden"; |
---|
| 1779 | input_current_folder.value = info_msg.msg_folder; |
---|
[3035] | 1780 | td2.appendChild(input_current_folder); |
---|
[63] | 1781 | // fim |
---|
[3847] | 1782 | // ALEXANDRE LUIZ CORREIA |
---|
| 1783 | if(info_msg.toaddress2 != null ) |
---|
| 1784 | { |
---|
| 1785 | toaddress_array[ID] = info_msg.toaddress2.split(","); |
---|
| 1786 | |
---|
| 1787 | if (toaddress_array[ID].length > 1) |
---|
| 1788 | { |
---|
| 1789 | to.innerHTML += draw_plugin_cc(ID, toaddress_array[ID][0]); |
---|
| 1790 | var div_toaddress = document.createElement("SPAN"); |
---|
| 1791 | div_toaddress.id = "div_toaddress_"+ID; |
---|
| 1792 | div_toaddress.style.display=""; |
---|
| 1793 | div_toaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"','to');>"+get_lang('more')+"</a>)"; |
---|
| 1794 | to.appendChild(div_toaddress); |
---|
| 1795 | } |
---|
| 1796 | else |
---|
| 1797 | { |
---|
| 1798 | toAdd = toaddress_array[ID].toString() |
---|
| 1799 | if( trim(toAdd) != "" ) { |
---|
| 1800 | toAdd = toAdd.replace("<","<").replace(">",">"); |
---|
| 1801 | } else { |
---|
| 1802 | toAdd = get_lang("without destination"); |
---|
| 1803 | } |
---|
| 1804 | |
---|
| 1805 | to.innerHTML += draw_plugin_cc(ID,toAdd); |
---|
[3770] | 1806 | } |
---|
[3847] | 1807 | |
---|
| 1808 | to.className = "header_message_field"; |
---|
| 1809 | tr2.appendChild(td2); |
---|
| 1810 | tr2.appendChild(to); |
---|
| 1811 | tr2.appendChild(to_values); |
---|
[2] | 1812 | } |
---|
[3847] | 1813 | |
---|
[2] | 1814 | tbody_message_others_options.appendChild(tr2); |
---|
| 1815 | |
---|
| 1816 | if (info_msg.cc){ |
---|
| 1817 | var tr3 = document.createElement("TR"); |
---|
| 1818 | tr3.className = "tr_message_header"; |
---|
| 1819 | var td3 = document.createElement("TD"); |
---|
| 1820 | td3.innerHTML = "CC: "; |
---|
| 1821 | var cc = document.createElement("TD"); |
---|
| 1822 | cc.id = "cc_"+ID; |
---|
| 1823 | |
---|
| 1824 | var cc_values = document.createElement("INPUT"); |
---|
| 1825 | cc_values.id = "cc_values_"+ID; |
---|
| 1826 | cc_values.type = "HIDDEN"; |
---|
| 1827 | cc_values.value = info_msg.cc; |
---|
[3035] | 1828 | |
---|
| 1829 | ccaddress_array[ID] = info_msg.cc.split(","); |
---|
[13] | 1830 | if (ccaddress_array[ID].length > 1){ |
---|
[2] | 1831 | var div_ccaddress = document.createElement("SPAN"); |
---|
| 1832 | div_ccaddress.id = "div_ccaddress_"+ID; |
---|
| 1833 | var div_ccaddress_full = document.createElement("SPAN"); |
---|
[3035] | 1834 | div_ccaddress_full.id = "div_ccaddress_full_"+ID; |
---|
[2] | 1835 | div_ccaddress.style.display=""; |
---|
[13] | 1836 | cc.innerHTML = draw_plugin_cc(ID, ccaddress_array[ID][0]); |
---|
| 1837 | div_ccaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"','cc');>"+get_lang('more')+"</a>)"; |
---|
| 1838 | cc.appendChild(div_ccaddress); |
---|
[2] | 1839 | } |
---|
| 1840 | else{ |
---|
| 1841 | cc.innerHTML = draw_plugin_cc(ID, info_msg.cc); |
---|
| 1842 | } |
---|
| 1843 | cc.className = "header_message_field"; |
---|
| 1844 | tr3.appendChild(td3); |
---|
| 1845 | tr3.appendChild(cc); |
---|
| 1846 | tr3.appendChild(cc_values); |
---|
| 1847 | tbody_message_others_options.appendChild(tr3); |
---|
| 1848 | } |
---|
[427] | 1849 | |
---|
| 1850 | /* |
---|
| 1851 | * @AUTHOR Rodrigo Souza dos Santos |
---|
| 1852 | * @MODIFY-DATE 2008/09/11 |
---|
| 1853 | * @BRIEF Adding routine to create bcc field if there is one. |
---|
| 1854 | */ |
---|
| 1855 | if (info_msg.bcc) |
---|
| 1856 | { |
---|
| 1857 | var tr3 = document.createElement("tr"); |
---|
| 1858 | tr3.className = "tr_message_header"; |
---|
| 1859 | var td3 = document.createElement("td"); |
---|
| 1860 | td3.innerHTML = get_lang("BCC") + " : "; |
---|
| 1861 | var cco = document.createElement("td"); |
---|
| 1862 | cco.id = "cco_"+ID; |
---|
| 1863 | |
---|
| 1864 | var cco_values = document.createElement("input"); |
---|
| 1865 | cco_values.id = "cco_values_"+ID; |
---|
| 1866 | cco_values.type = "hidden"; |
---|
[1638] | 1867 | cco_values.value = info_msg.bcc; |
---|
[427] | 1868 | |
---|
[3035] | 1869 | ccoaddress_array[ID] = info_msg.bcc.split(","); |
---|
[427] | 1870 | if (ccoaddress_array[ID].length > 1){ |
---|
| 1871 | var div_ccoaddress = document.createElement("SPAN"); |
---|
| 1872 | div_ccoaddress.id = "div_ccoaddress_"+ID; |
---|
| 1873 | var div_ccoaddress_full = document.createElement("SPAN"); |
---|
[3035] | 1874 | div_ccoaddress_full.id = "div_ccoaddress_full_"+ID; |
---|
[427] | 1875 | div_ccoaddress.style.display=""; |
---|
| 1876 | |
---|
| 1877 | //cco.innerHTML = draw_plugin_cc(ID, ccoaddress_array[ID][0]); |
---|
| 1878 | cco.innerHTML = ccoaddress_array[ID][0]; |
---|
| 1879 | div_ccoaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"','cco');>"+get_lang('more')+"</a>)"; |
---|
| 1880 | cco.appendChild(div_ccoaddress); |
---|
| 1881 | } |
---|
| 1882 | else{ |
---|
| 1883 | //cco.innerHTML = draw_plugin_cc(ID, info_msg.cco); |
---|
| 1884 | cco.innerHTML = info_msg.bcc; |
---|
| 1885 | } |
---|
| 1886 | cco.className = "header_message_field"; |
---|
| 1887 | tr3.appendChild(td3); |
---|
| 1888 | tr3.appendChild(cco); |
---|
| 1889 | tr3.appendChild(cco_values); |
---|
| 1890 | tbody_message_others_options.appendChild(tr3); |
---|
| 1891 | } |
---|
| 1892 | |
---|
[2] | 1893 | var tr4 = document.createElement("TR"); |
---|
| 1894 | tr4.className = "tr_message_header"; |
---|
| 1895 | var td4 = document.createElement("TD"); |
---|
[83] | 1896 | td4.innerHTML = get_lang("Date: "); |
---|
[2] | 1897 | var date = document.createElement("TD"); |
---|
| 1898 | date.id = "date_"+ID; |
---|
| 1899 | date.innerHTML = info_msg.fulldate; |
---|
| 1900 | var date_day = document.createElement("INPUT"); |
---|
| 1901 | date_day.id = "date_day_"+ID; |
---|
| 1902 | date_day.type = "HIDDEN"; |
---|
| 1903 | date_day.value = info_msg.msg_day; |
---|
| 1904 | var date_hour = document.createElement("INPUT"); |
---|
| 1905 | date_hour.id = "date_hour_"+ID; |
---|
| 1906 | date_hour.type = "HIDDEN"; |
---|
| 1907 | date_hour.value = info_msg.msg_hour |
---|
| 1908 | date.className = "header_message_field"; |
---|
| 1909 | tr4.appendChild(td4); |
---|
| 1910 | tr4.appendChild(date); |
---|
| 1911 | tr4.appendChild(date_day); |
---|
| 1912 | tr4.appendChild(date_hour); |
---|
| 1913 | tbody_message_others_options.appendChild(tr4); |
---|
[3035] | 1914 | |
---|
[2] | 1915 | var tr5 = document.createElement("TR"); |
---|
| 1916 | tr5.className = "tr_message_header"; |
---|
| 1917 | var td5 = document.createElement("TD"); |
---|
[83] | 1918 | td5.innerHTML = get_lang("Subject"); |
---|
[2] | 1919 | var subject = document.createElement("TD"); |
---|
| 1920 | subject.id = "subject_"+ID; |
---|
| 1921 | subject.innerHTML = info_msg.subject; |
---|
| 1922 | subject.className = "header_message_field"; |
---|
| 1923 | tr5.appendChild(td5); |
---|
| 1924 | tr5.appendChild(subject); |
---|
| 1925 | tbody_message_others_options.appendChild(tr5); |
---|
[3035] | 1926 | if ( info_msg.attachments && info_msg.attachments.length > 0 ){ |
---|
[3018] | 1927 | var tr6 = document.createElement("TR"); |
---|
[2] | 1928 | tr6.className = "tr_message_header"; |
---|
| 1929 | var td6 = document.createElement("TD"); |
---|
[83] | 1930 | td6.innerHTML = get_lang("Attachments: "); |
---|
[673] | 1931 | |
---|
[2] | 1932 | var attachments = document.createElement("TD"); |
---|
| 1933 | td6.vAlign = "top"; |
---|
| 1934 | attachments.align='left'; |
---|
[673] | 1935 | if(info_msg.attachments.length >= 1) { |
---|
| 1936 | if(info_msg.attachments.length > 1) { |
---|
[3035] | 1937 | var link_attachment = document.createElement("A"); |
---|
| 1938 | if(proxy_mensagens.is_local_folder(current_folder)) |
---|
| 1939 | link_attachment.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); |
---|
| 1940 | else |
---|
| 1941 | link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); |
---|
[673] | 1942 | link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments'); |
---|
[3954] | 1943 | attachments.appendChild(link_attachment); |
---|
[673] | 1944 | } |
---|
[1291] | 1945 | if(parseInt(preferences.remove_attachments_function)) |
---|
[673] | 1946 | { |
---|
[3954] | 1947 | attachments.appendChild(document.createTextNode(' ')); |
---|
[673] | 1948 | var del_attachments = document.createElement("A"); |
---|
| 1949 | del_attachments.setAttribute("href", "javascript:remove_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); |
---|
| 1950 | del_attachments.innerHTML = get_lang('remove all attachments'); |
---|
[3954] | 1951 | attachments.appendChild(del_attachments); |
---|
[613] | 1952 | } |
---|
[3954] | 1953 | attachments.appendChild(document.createElement('BR')); |
---|
[673] | 1954 | } |
---|
[790] | 1955 | |
---|
[2] | 1956 | attachments.id = "attachments_" + ID; |
---|
| 1957 | for (var i=0; i<info_msg.attachments.length; i++){ |
---|
| 1958 | var link_attachment = document.createElement("A"); |
---|
[689] | 1959 | link_attachment.setAttribute("href", proxy_mensagens.link_anexo(info_msg,i)); |
---|
[2] | 1960 | link_attachment.innerHTML = url_decode(info_msg.attachments[i].name); |
---|
[3137] | 1961 | link_attachment.innerHTML += " ("+borkb(info_msg.attachments[i].fsize)+")"; |
---|
[3519] | 1962 | |
---|
| 1963 | if((url_decode(info_msg.attachments[i].name).indexOf(".ics")!=-1) || |
---|
| 1964 | (url_decode(info_msg.attachments[i].name).indexOf(".vcard")!=-1)) |
---|
| 1965 | { |
---|
[620] | 1966 | //Link para importar calendário |
---|
[673] | 1967 | var link_import_attachment = new Image(); |
---|
[790] | 1968 | link_import_attachment.src = "templates/"+template+"/images/new.png"; |
---|
[3519] | 1969 | link_import_attachment.setAttribute("onclick","javascript:import_calendar('"+info_msg.msg_folder+"&msg_number="+info_msg.msg_number+"&msg_part="+info_msg.attachments[i].pid+"&idx_file="+i+"&encoding="+info_msg.attachments[i].encoding+"'); return false;"); |
---|
[673] | 1970 | link_import_attachment.title = get_lang("Import to calendar"); |
---|
[3035] | 1971 | link_import_attachment.align = "top"; |
---|
[3519] | 1972 | link_import_attachment.style.marginLeft = "5px"; |
---|
[673] | 1973 | link_import_attachment.style.cursor = "pointer"; |
---|
[3519] | 1974 | link_attachment.appendChild(link_import_attachment); |
---|
[620] | 1975 | } |
---|
[3519] | 1976 | |
---|
| 1977 | link_attachment.innerHTML += '<br/>'; |
---|
| 1978 | attachments.appendChild(link_attachment); |
---|
[2] | 1979 | } |
---|
| 1980 | tr6.appendChild(td6); |
---|
| 1981 | tr6.appendChild(attachments); |
---|
| 1982 | tbody_message_others_options.appendChild(tr6); |
---|
| 1983 | } |
---|
| 1984 | |
---|
[59] | 1985 | |
---|
[2] | 1986 | var div = document.createElement("DIV"); |
---|
| 1987 | div.id = "div_message_scroll_"+ID; |
---|
| 1988 | div.style.background = 'WHITE'; |
---|
| 1989 | div.style.overflow = "auto"; |
---|
[3035] | 1990 | div.style.width = "100%"; |
---|
[2] | 1991 | table_message_others_options.appendChild(tbody_message_others_options); |
---|
| 1992 | var tr = document.createElement("TR"); |
---|
| 1993 | var td = document.createElement("TD"); |
---|
| 1994 | td.colSpan = '2'; |
---|
| 1995 | div.appendChild(table_message_others_options); |
---|
[3018] | 1996 | var imgTag = info_msg.body.match(/(<img[^>]*src[^>=]*=['"]?[^'">]*["']?[^>]*>)|(<[^>]*(style[^=>]*=['"][^>]*background(-image)?:[^:;>]*url\()[^>]*>)/gi); |
---|
[790] | 1997 | var newBody = info_msg.body; |
---|
| 1998 | if(!info_msg.showImg && imgTag) |
---|
| 1999 | { |
---|
| 2000 | var domains = ''; |
---|
| 2001 | var blocked = false; |
---|
| 2002 | var forbidden = true; |
---|
[1637] | 2003 | |
---|
| 2004 | if (preferences.notification_domains != null && typeof(preferences.notification_domains) != 'undefined') |
---|
| 2005 | { |
---|
[790] | 2006 | domains = preferences.notification_domains.split(','); |
---|
[1637] | 2007 | for(var j = 0; j < imgTag.length; j++) |
---|
[790] | 2008 | { |
---|
[1637] | 2009 | for (var i = 0; i < domains.length; i++) |
---|
| 2010 | { |
---|
[3035] | 2011 | if (imgTag[j].match(/cid:([\w\d]){5,}/) || imgTag[j].match(/src=\"\.\/inc\/show_embedded_attach\.php/g)) |
---|
[3018] | 2012 | { |
---|
| 2013 | forbidden = false; |
---|
| 2014 | continue; |
---|
| 2015 | } |
---|
[1637] | 2016 | imgSource = imgTag[j].match(/=['"](http:\/\/)+[^'"\/]*/); |
---|
| 2017 | if (imgSource && imgSource.toString().substr(5).match(domains[i])) |
---|
| 2018 | forbidden = false; |
---|
| 2019 | } |
---|
| 2020 | if (forbidden) |
---|
| 2021 | { |
---|
| 2022 | newBody = newBody.replace(imgTag[j],"<img src='templates/"+template+"/images/forbidden.jpg'>"); |
---|
| 2023 | blocked=true; |
---|
| 2024 | } |
---|
[790] | 2025 | } |
---|
[1637] | 2026 | if (blocked) |
---|
[790] | 2027 | { |
---|
[1637] | 2028 | var showImgLink = document.createElement('DIV'); |
---|
[1711] | 2029 | showImgLink.id="show_img_link_"+ID; |
---|
[1637] | 2030 | showImgLink.onclick = function(){show_msg_img(info_msg.msg_number,info_msg.msg_folder)}; |
---|
| 2031 | showImgLink.className="show_img_link"; |
---|
| 2032 | showImgLink.innerHTML = get_lang("Show images from")+": "+info_msg.from.email; |
---|
| 2033 | td.appendChild(showImgLink); |
---|
[790] | 2034 | } |
---|
| 2035 | } |
---|
| 2036 | } |
---|
[2] | 2037 | td.appendChild(div); |
---|
| 2038 | tr.appendChild(td) |
---|
| 2039 | tbody_message.appendChild(tr); |
---|
| 2040 | |
---|
| 2041 | |
---|
[3035] | 2042 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[2] | 2043 | //Make the body message. |
---|
[790] | 2044 | /////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[2] | 2045 | var tr = document.createElement("TR"); |
---|
| 2046 | tr.className = "tr_message_body"; |
---|
| 2047 | var td = document.createElement("TD"); |
---|
| 2048 | //td.setAttribute("colSpan","2"); |
---|
[790] | 2049 | newBody = newBody.replace("<body","<span"); |
---|
| 2050 | newBody = newBody.replace("<BODY","<span"); |
---|
[3035] | 2051 | while ( ( /<span[^>]*><span[^>]*>/ig ).test( newBody ) ) |
---|
| 2052 | newBody = newBody.replace( /(<span[^>]*>)<span[^>]*>/ig, '$1' ); |
---|
[3018] | 2053 | |
---|
[3035] | 2054 | var _body = document.createElement( 'div' ); |
---|
| 2055 | _body.id = 'body_' + ID; |
---|
| 2056 | _body.innerHTML = newBody; |
---|
[3238] | 2057 | _body.style.fontSize = '16px'; |
---|
[3018] | 2058 | |
---|
[3035] | 2059 | var _elements = _body.getElementsByTagName( '*' ); |
---|
| 2060 | for( var i = 0; i < _elements.length; i++ ) |
---|
| 2061 | if ( _elements[ i ].attributes && _elements[ i ].attributes.getNamedItem( 'id' ) ) |
---|
| 2062 | _elements[ i ].attributes.removeNamedItem( 'id' ); |
---|
[3018] | 2063 | |
---|
[3035] | 2064 | div.appendChild( _body ); |
---|
[3018] | 2065 | |
---|
[3035] | 2066 | function mailto( link ) |
---|
| 2067 | { |
---|
| 2068 | var mail = link.href.substr( 7 ); |
---|
| 2069 | link.onclick = function( ) |
---|
| 2070 | { |
---|
| 2071 | new_message_to( mail ); |
---|
| 2072 | return false; |
---|
| 2073 | }; |
---|
| 2074 | } |
---|
| 2075 | var links = div.getElementsByTagName( 'a' ); |
---|
| 2076 | for ( var i = 0; i < links.length; i++ ){ |
---|
| 2077 | try{ |
---|
| 2078 | if ( links.item( i ).href.indexOf( 'mailto:' ) === 0 ){ |
---|
| 2079 | mailto( links.item( i ) ); |
---|
| 2080 | } |
---|
| 2081 | else{ |
---|
[3393] | 2082 | var anchor_pattern = "http://"+location.host+location.pathname+"#"; |
---|
| 2083 | |
---|
| 2084 | if ( ( links.item( i ).href.indexOf( 'javascript:' ) !== 0 ) && |
---|
| 2085 | (links.item( i ).href.indexOf(anchor_pattern) !== 0) ) //se não for âncora |
---|
| 2086 | links.item( i ).setAttribute( 'target', '_blank' ); |
---|
[3035] | 2087 | } |
---|
| 2088 | }catch(e){ |
---|
| 2089 | } |
---|
[3369] | 2090 | } |
---|
[3035] | 2091 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[2] | 2092 | //Make the thumbs of the message. |
---|
| 2093 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2094 | if ((info_msg.thumbs)&&(info_msg.thumbs.length > 0)){ |
---|
| 2095 | var table_message_thumbs = document.createElement("TABLE"); |
---|
| 2096 | table_message_thumbs.width = "80%"; |
---|
| 2097 | table_message_thumbs.style.borderTop = "2px solid rgb(170, 170, 170)"; |
---|
| 2098 | var tbody_message_thumbs = document.createElement("TBODY"); |
---|
| 2099 | var tr = document.createElement("TR"); |
---|
| 2100 | tr.className = "tr_message_body"; |
---|
| 2101 | var td = document.createElement("TD"); |
---|
| 2102 | td.setAttribute("colSpan","2"); |
---|
| 2103 | td.id = "body_thumbs_"+ID; |
---|
| 2104 | td.innerHTML += " <font color='DARKBLUE' size='2'><b>"+info_msg.attachments.length+" "+get_lang("attachment")+(info_msg.attachments.length > 1 ? "s" : "")+" "+get_lang("in this message")+"</font></b>"; |
---|
| 2105 | var _link_attachments = ''; |
---|
| 2106 | if(info_msg.thumbs.length > 1){ |
---|
| 2107 | _link_attachments = document.createElement("A"); |
---|
| 2108 | _link_attachments.className = "message_options"; |
---|
[3035] | 2109 | if(proxy_mensagens.is_local_folder(current_folder)) |
---|
| 2110 | _link_attachments.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); |
---|
| 2111 | else |
---|
| 2112 | _link_attachments.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); |
---|
[2] | 2113 | _link_attachments.innerHTML = get_lang('Download all atachments'); |
---|
| 2114 | } |
---|
[3035] | 2115 | |
---|
[2] | 2116 | if(_link_attachments){ |
---|
| 2117 | td.innerHTML += " :: "; |
---|
| 2118 | td.appendChild(_link_attachments); |
---|
| 2119 | } |
---|
[3035] | 2120 | |
---|
[790] | 2121 | td.innerHTML += "<BR><img src='templates/"+template+"/images/menu/ktip.png'>"+get_lang("<b>Tip:</b> For faster save, click over the image with <u>right button</u>."); |
---|
[2] | 2122 | td.innerHTML += "<BR>"; |
---|
| 2123 | |
---|
| 2124 | for (var i=0; i<info_msg.thumbs.length; i++){ |
---|
| 2125 | if ((i % 4) == 0) |
---|
| 2126 | td.innerHTML += "<BR>"; |
---|
| 2127 | td.innerHTML += info_msg.thumbs[i]; |
---|
| 2128 | td.innerHTML += " "; |
---|
| 2129 | } |
---|
| 2130 | tr.appendChild(td); |
---|
| 2131 | tbody_message_thumbs.appendChild(tr); |
---|
| 2132 | table_message_thumbs.appendChild(tbody_message_thumbs); |
---|
| 2133 | div.appendChild(table_message_thumbs); |
---|
| 2134 | } |
---|
| 2135 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2136 | table_message.appendChild(tbody_message); |
---|
| 2137 | content.appendChild(table_message); |
---|
[3035] | 2138 | resizeWindow(); |
---|
[2] | 2139 | var msg_number = document.createElement('INPUT'); |
---|
| 2140 | msg_number.id = "msg_number_" + ID; |
---|
| 2141 | msg_number.type = "hidden"; |
---|
| 2142 | msg_number.value = info_msg.msg_number; |
---|
| 2143 | content.appendChild(msg_number); |
---|
| 2144 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[3165] | 2145 | |
---|
| 2146 | //Exibe o cabecalho da mensagem totalmente aberto caso esteja setado nas preferencias do usuario |
---|
| 2147 | if (preferences.show_head_msg_full == 1) |
---|
| 2148 | { |
---|
| 2149 | option_hide_more.onclick(); |
---|
[3168] | 2150 | if (Element('div_toaddress_'+ID) != null) |
---|
| 2151 | show_div_address_full(ID,'to'); |
---|
| 2152 | if (Element('div_ccaddress_'+ID) != null) |
---|
| 2153 | show_div_address_full(ID,'cc'); |
---|
[3165] | 2154 | } |
---|
| 2155 | |
---|
[2] | 2156 | } |
---|
[3035] | 2157 | function changeLinkState(el,state){ |
---|
| 2158 | el.innerHTML = get_lang(state); |
---|
| 2159 | switch (state){ |
---|
| 2160 | case 'important': |
---|
| 2161 | { |
---|
[3716] | 2162 | 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"))} |
---|
[3035] | 2163 | break; |
---|
| 2164 | } |
---|
| 2165 | case 'normal': |
---|
| 2166 | { |
---|
[3806] | 2167 | el.onclick = function(){ |
---|
| 2168 | var _this = this; |
---|
| 2169 | proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'unflagged', function(success){ |
---|
| 2170 | if (success) { |
---|
| 2171 | changeLinkState(_this, 'important'); |
---|
| 2172 | write_msg(get_lang('Message marked as ') + get_lang("Normal")); |
---|
| 2173 | } |
---|
| 2174 | } ); |
---|
| 2175 | } |
---|
[3035] | 2176 | break; |
---|
| 2177 | } |
---|
| 2178 | case 'unseen': |
---|
| 2179 | { |
---|
[3716] | 2180 | 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"))} |
---|
[3035] | 2181 | break; |
---|
[790] | 2182 | |
---|
[3035] | 2183 | } |
---|
| 2184 | case 'seen': |
---|
| 2185 | { |
---|
[3716] | 2186 | 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"))} |
---|
[3035] | 2187 | break; |
---|
[3021] | 2188 | |
---|
[3035] | 2189 | } |
---|
| 2190 | default: |
---|
| 2191 | { |
---|
| 2192 | break; |
---|
| 2193 | } |
---|
| 2194 | } |
---|
| 2195 | } |
---|
[271] | 2196 | function draw_new_message(border_ID){ |
---|
[3105] | 2197 | connector.loadScript("color_palette"); |
---|
[3068] | 2198 | connector.loadScript("rich_text_editor"); |
---|
[3105] | 2199 | connector.loadScript('wfolders'); |
---|
| 2200 | if(typeof(RichTextEditor) == 'undefined' || typeof(ColorPalette) == 'undefined' || typeof(wfolders) == 'undefined') |
---|
[3068] | 2201 | return false; |
---|
| 2202 | |
---|
[271] | 2203 | var ID = create_border("",border_ID); |
---|
[4136] | 2204 | if (ID == 0) |
---|
| 2205 | return 0; |
---|
[2] | 2206 | hold_session = true; |
---|
[3035] | 2207 | |
---|
| 2208 | var footer_menu = Element("footer_menu"); |
---|
[1701] | 2209 | if (footer_menu) { |
---|
| 2210 | footer_menu.style.display = 'none'; |
---|
| 2211 | } |
---|
[2] | 2212 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2213 | var form = document.createElement("FORM"); |
---|
| 2214 | form.name = "form_message_"+ID; |
---|
| 2215 | form.method = "POST"; |
---|
| 2216 | form.onsubmit = function(){return false;} |
---|
| 2217 | if(!is_ie) |
---|
| 2218 | form.enctype="multipart/form-data"; |
---|
| 2219 | else |
---|
| 2220 | form.encoding="multipart/form-data"; |
---|
| 2221 | ///////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2222 | //ConstructMenuNewMessage(ID); |
---|
[3035] | 2223 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[2] | 2224 | var content = Element('content_id_' + ID); |
---|
| 2225 | var table_message = document.createElement("TABLE"); |
---|
| 2226 | table_message.width = "100%"; |
---|
| 2227 | var tbody_message = document.createElement("TBODY"); |
---|
| 2228 | var tr0 = document.createElement("TR"); |
---|
| 2229 | tr0.className = "tr_message_header"; |
---|
| 2230 | var td0 = document.createElement("TD"); |
---|
| 2231 | td0.colSpan = '3'; |
---|
[3035] | 2232 | |
---|
[2] | 2233 | var table_menu_new_message = document.createElement("TABLE"); |
---|
| 2234 | table_menu_new_message.width = "100%"; |
---|
| 2235 | table_menu_new_message.border = '0'; |
---|
| 2236 | table_menu_new_message.className = 'table_message'; |
---|
| 2237 | var tbody_menu_new_message = document.createElement("TBODY"); |
---|
| 2238 | var tr_menu_new_message = document.createElement("TR"); |
---|
| 2239 | var td_menu_new_message = document.createElement("TD"); |
---|
| 2240 | td_menu_new_message.setAttribute("noWrap","true"); |
---|
[3035] | 2241 | |
---|
[2] | 2242 | if ((preferences.save_in_folder == '-1') || (preferences.save_in_folder == '')){ |
---|
[220] | 2243 | //var option_send = '<span class="message_options" onclick=send_message("'+ID+'","null","null");>'+get_lang("Send")+'</span> | '; |
---|
[3771] | 2244 | 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");>' + ' | '; |
---|
[4204] | 2245 | |
---|
[1121] | 2246 | if(!expresso_offline) |
---|
| 2247 | var option_send_and_file= '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","send_and_file");>'+get_lang("Send and file")+'</span> | '; |
---|
[4204] | 2248 | else |
---|
[1121] | 2249 | var option_send_and_file=''; |
---|
[2] | 2250 | } |
---|
| 2251 | else{ |
---|
[249] | 2252 | //var option_send = '<span class="message_options" onclick="send_message(\''+ID+'\',\''+preferences.save_in_folder+'\',\'null\');">'+get_lang("Send")+'</span> | '; |
---|
| 2253 | 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\');">' + ' | '; |
---|
[2] | 2254 | var option_send_and_file=''; |
---|
| 2255 | wfolders.alert = true; |
---|
| 2256 | } |
---|
[271] | 2257 | // var option_save_as = '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","save");>'+get_lang("Save as")+'</span> | '; |
---|
[1121] | 2258 | if (!expresso_offline) { |
---|
| 2259 | var option_save = '<span id="save_message_options_'+ID+'" class="message_options" onclick="openTab.toPreserve['+ID+'] = true; save_msg('+ID+');">'+get_lang("Save")+'</span> | '; |
---|
| 2260 | var option_search = '<span class="message_options" onclick=openListUsers("'+ID+'");>'+get_lang("Search")+'</span>'; |
---|
| 2261 | } |
---|
| 2262 | else { |
---|
| 2263 | var option_save = '<input type="hidden" id="save_message_options_'+ID+'">'; |
---|
| 2264 | var option_search = ''; |
---|
| 2265 | } |
---|
[2] | 2266 | td_menu_new_message.innerHTML = option_send + option_send_and_file + option_save + option_search; |
---|
[3035] | 2267 | |
---|
[2] | 2268 | tr_menu_new_message.appendChild(td_menu_new_message); |
---|
[4202] | 2269 | |
---|
[2] | 2270 | tbody_menu_new_message.appendChild(tr_menu_new_message); |
---|
| 2271 | table_menu_new_message.appendChild(tbody_menu_new_message); |
---|
[3035] | 2272 | |
---|
[2] | 2273 | content.appendChild(table_menu_new_message); |
---|
| 2274 | tr0.appendChild(td0); |
---|
| 2275 | tbody_message.appendChild(tr0); |
---|
| 2276 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2277 | var tr1_1 = document.createElement("TR"); |
---|
| 2278 | tr1_1.style.display = 'none'; |
---|
| 2279 | var td1_1 = document.createElement("TD"); |
---|
| 2280 | td1_1.innerHTML = get_lang("From")+":"; |
---|
| 2281 | td1_1.setAttribute("noWrap","true"); |
---|
| 2282 | td1_1.style.width = "1%"; |
---|
[3035] | 2283 | |
---|
[2] | 2284 | var td_from = document.createElement("TD"); |
---|
| 2285 | td_from.setAttribute("noWrap","true"); |
---|
| 2286 | td_from.style.width = "100%"; |
---|
[3035] | 2287 | |
---|
| 2288 | var sel_from = document.createElement('SELECT'); |
---|
[2] | 2289 | sel_from.id = "from_"+ID; |
---|
| 2290 | sel_from.name = "input_from"; |
---|
| 2291 | sel_from.style.width = "70%"; |
---|
| 2292 | sel_from.setAttribute("wrap","soft"); |
---|
[3035] | 2293 | td_from.appendChild(sel_from); |
---|
[2] | 2294 | tr1_1.appendChild(td1_1); |
---|
| 2295 | tr1_1.appendChild(td_from); |
---|
[3035] | 2296 | tbody_message.appendChild(tr1_1); |
---|
[3527] | 2297 | /////////////////////////////////////////////////////////////////////// |
---|
| 2298 | var tr1_2 = document.createElement("TR"); |
---|
| 2299 | tr1_2.id = "tr_replyto_"+ID; |
---|
| 2300 | var td1_2 = document.createElement("TD"); |
---|
| 2301 | tr1_2.style.display = 'none'; |
---|
| 2302 | td1_2.innerHTML = get_lang("Reply to")+":"; |
---|
| 2303 | td1_2.setAttribute("noWrap","true"); |
---|
| 2304 | td1_2.style.width = "1%"; |
---|
| 2305 | |
---|
| 2306 | var td_replyto = document.createElement("TD"); |
---|
| 2307 | td_replyto.setAttribute("noWrap","true"); |
---|
| 2308 | td_replyto.style.width = "100%"; |
---|
| 2309 | |
---|
| 2310 | var input_replyto = document.createElement('INPUT'); |
---|
| 2311 | input_replyto.id = "replyto_"+ID; |
---|
| 2312 | input_replyto.name = "input_replyto"; |
---|
| 2313 | input_replyto.setAttribute("tabIndex","1"); |
---|
| 2314 | input_replyto.style.width = "100%"; |
---|
| 2315 | input_replyto.setAttribute("wrap","soft"); |
---|
| 2316 | input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);}; |
---|
| 2317 | input_replyto.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; |
---|
| 2318 | |
---|
| 2319 | if (!is_ie) |
---|
| 2320 | { |
---|
| 2321 | input_replyto.rows = 2; |
---|
[3967] | 2322 | input_replyto.onkeydown = function (e) |
---|
[3527] | 2323 | { |
---|
| 2324 | if ((e.keyCode) == 120) //F9 |
---|
| 2325 | { |
---|
| 2326 | emQuickSearch(input_replyto.value, 'replyto', ID); |
---|
| 2327 | } |
---|
| 2328 | else |
---|
| 2329 | { |
---|
| 2330 | if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) |
---|
| 2331 | { |
---|
| 2332 | e.preventDefault(); |
---|
| 2333 | search_contacts(e.keyCode,this.id); |
---|
| 2334 | } |
---|
| 2335 | } |
---|
| 2336 | } |
---|
| 2337 | input_replyto.onkeyup = function (e) |
---|
| 2338 | |
---|
| 2339 | { |
---|
| 2340 | if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) |
---|
| 2341 | { |
---|
| 2342 | search_contacts(e.keyCode,this.id); |
---|
| 2343 | } |
---|
| 2344 | } |
---|
| 2345 | } |
---|
| 2346 | else |
---|
| 2347 | { |
---|
| 2348 | input_replyto.rows = 3; |
---|
| 2349 | input_replyto.onkeyup = function (e) |
---|
| 2350 | { |
---|
| 2351 | if ((window.event.keyCode) == 120) //F9 |
---|
| 2352 | { |
---|
| 2353 | emQuickSearch(input_replyto.value, 'replyto', ID); |
---|
| 2354 | } |
---|
| 2355 | else |
---|
| 2356 | { |
---|
| 2357 | search_contacts(window.event.keyCode,this.id); |
---|
| 2358 | } |
---|
| 2359 | } |
---|
| 2360 | } |
---|
| 2361 | td_replyto.appendChild(input_replyto); |
---|
| 2362 | |
---|
| 2363 | var img_search = document.createElement("IMG"); |
---|
| 2364 | img_search.src = "./templates/"+template+"/images/search.gif"; |
---|
| 2365 | img_search.onclick = function () {emQuickSearch(document.getElementById('replyto_'+ID).value, 'replyto', ID)} |
---|
| 2366 | img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.'); |
---|
| 2367 | var span_search = document.createElement("SPAN"); |
---|
| 2368 | span_search.innerHTML = get_lang('Search'); |
---|
| 2369 | |
---|
| 2370 | var td1_2_img_search = document.createElement("TD"); |
---|
| 2371 | td1_2_img_search.setAttribute("noWrap","true"); |
---|
| 2372 | var td1_2_span_search = document.createElement("TD"); |
---|
| 2373 | td1_2_span_search.setAttribute("noWrap","true"); |
---|
| 2374 | |
---|
| 2375 | td1_2_img_search.appendChild(img_search); |
---|
| 2376 | td1_2_span_search.appendChild(span_search); |
---|
| 2377 | |
---|
| 2378 | tr1_2.appendChild(td1_2); |
---|
| 2379 | tr1_2.appendChild(td_replyto); |
---|
| 2380 | tr1_2.appendChild(td1_2_img_search); |
---|
| 2381 | tbody_message.appendChild(tr1_2); |
---|
[2] | 2382 | //////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2383 | var tr1 = document.createElement("TR"); |
---|
| 2384 | var td1 = document.createElement("TD"); |
---|
| 2385 | td1.innerHTML = get_lang("To")+":"; |
---|
| 2386 | td1.setAttribute("noWrap","true"); |
---|
| 2387 | td1.style.width = "1%"; |
---|
[3035] | 2388 | |
---|
[2] | 2389 | var td_to = document.createElement("TD"); |
---|
| 2390 | td_to.setAttribute("noWrap","true"); |
---|
| 2391 | td_to.style.width = "100%"; |
---|
[3035] | 2392 | |
---|
[2] | 2393 | var input_to = document.createElement('TEXTAREA'); |
---|
| 2394 | input_to.id = "to_"+ID; |
---|
| 2395 | input_to.name = "input_to"; |
---|
[3035] | 2396 | input_to.setAttribute("tabIndex","1"); |
---|
[2] | 2397 | input_to.style.width = "100%"; |
---|
| 2398 | input_to.setAttribute("wrap","soft"); |
---|
| 2399 | input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);}; |
---|
| 2400 | input_to.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; |
---|
| 2401 | if (!is_ie) |
---|
| 2402 | { |
---|
| 2403 | input_to.rows = 2; |
---|
[3712] | 2404 | input_to.onkeydown = function (e) |
---|
[3035] | 2405 | { |
---|
| 2406 | if ((e.keyCode) == 120) //F9 |
---|
| 2407 | { |
---|
| 2408 | emQuickSearch(input_to.value, 'to', ID); |
---|
| 2409 | } |
---|
| 2410 | else |
---|
| 2411 | { |
---|
| 2412 | if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) |
---|
| 2413 | { |
---|
| 2414 | e.preventDefault(); |
---|
| 2415 | search_contacts(e.keyCode,this.id); |
---|
| 2416 | } |
---|
| 2417 | } |
---|
| 2418 | } |
---|
| 2419 | input_to.onkeyup = function (e) |
---|
| 2420 | { |
---|
| 2421 | if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) |
---|
| 2422 | { |
---|
| 2423 | search_contacts(e.keyCode,this.id); |
---|
| 2424 | } |
---|
| 2425 | } |
---|
[2] | 2426 | } |
---|
| 2427 | else |
---|
| 2428 | { |
---|
| 2429 | input_to.rows = 3; |
---|
| 2430 | input_to.onkeyup = function (e) |
---|
[3035] | 2431 | { |
---|
| 2432 | if ((window.event.keyCode) == 120) //F9 |
---|
| 2433 | { |
---|
| 2434 | emQuickSearch(input_to.value, 'to', ID); |
---|
| 2435 | } |
---|
| 2436 | else |
---|
| 2437 | { |
---|
| 2438 | search_contacts(window.event.keyCode,this.id); |
---|
| 2439 | } |
---|
| 2440 | } |
---|
[2] | 2441 | } |
---|
| 2442 | td_to.appendChild(input_to); |
---|
[3035] | 2443 | |
---|
[689] | 2444 | var forwarded_local_message = document.createElement("INPUT"); //Hidden para indicar se é um forward de uma mensagem local |
---|
| 2445 | forwarded_local_message.id = "is_local_forward"+ID; |
---|
| 2446 | forwarded_local_message.name = "is_local_forward"; |
---|
| 2447 | forwarded_local_message.type = "HIDDEN"; |
---|
| 2448 | forwarded_local_message.value = "0"; |
---|
| 2449 | td_to.appendChild(forwarded_local_message); |
---|
[3035] | 2450 | |
---|
[1121] | 2451 | if (!expresso_offline) { |
---|
| 2452 | var img_search = document.createElement("IMG"); |
---|
| 2453 | img_search.src = "./templates/"+template+"/images/search.gif"; |
---|
| 2454 | img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.'); |
---|
| 2455 | img_search.onclick = function () {emQuickSearch(document.getElementById('to_'+ID).value, 'to', ID);}; |
---|
| 2456 | } |
---|
| 2457 | else { |
---|
| 2458 | var img_search = document.createElement("SPAN"); |
---|
| 2459 | } |
---|
[3035] | 2460 | |
---|
[2] | 2461 | var span_search = document.createElement("SPAN"); |
---|
| 2462 | span_search.innerHTML = get_lang('Search'); |
---|
[3035] | 2463 | |
---|
[2] | 2464 | var td1_img_search = document.createElement("TD"); |
---|
| 2465 | td1_img_search.setAttribute("noWrap","true"); |
---|
| 2466 | var td1_span_search = document.createElement("TD"); |
---|
[3035] | 2467 | td1_span_search.setAttribute("noWrap","true"); |
---|
| 2468 | |
---|
[2] | 2469 | td1_img_search.appendChild(img_search); |
---|
| 2470 | td1_span_search.appendChild(span_search); |
---|
[3035] | 2471 | |
---|
[2] | 2472 | tr1.appendChild(td1); |
---|
| 2473 | tr1.appendChild(td_to); |
---|
| 2474 | tr1.appendChild(td1_img_search); |
---|
| 2475 | |
---|
| 2476 | tbody_message.appendChild(tr1); |
---|
| 2477 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2478 | var tr2 = document.createElement("TR"); |
---|
| 2479 | tr2.id = "tr_cc_"+ID; |
---|
| 2480 | tr2.style.display = 'none'; |
---|
| 2481 | var td2 = document.createElement("TD"); |
---|
| 2482 | td2.innerHTML = "Cc:"; |
---|
[3035] | 2483 | td2.setAttribute("noWrap","true"); |
---|
[2] | 2484 | td2.style.width = "1%"; |
---|
[3035] | 2485 | |
---|
[2] | 2486 | var td_cc = document.createElement("TD"); |
---|
| 2487 | td_cc.setAttribute("noWrap","true"); |
---|
| 2488 | td_cc.style.width = "100%"; |
---|
[3035] | 2489 | |
---|
[2] | 2490 | var input_cc = document.createElement('TEXTAREA'); |
---|
| 2491 | input_cc.id = "cc_"+ID; |
---|
| 2492 | input_cc.name = "input_cc"; |
---|
| 2493 | input_cc.setAttribute("tabIndex","1"); |
---|
| 2494 | input_cc.style.width = "100%"; |
---|
| 2495 | input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus',this.id);}; |
---|
| 2496 | input_cc.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; |
---|
[3035] | 2497 | if (!is_ie) |
---|
| 2498 | { |
---|
| 2499 | input_cc.rows = 2; |
---|
[3967] | 2500 | input_cc.onkeydown = function (e) |
---|
[3035] | 2501 | { |
---|
| 2502 | if ((e.keyCode) == 120) //F9 |
---|
| 2503 | { |
---|
| 2504 | emQuickSearch(input_cc.value, 'cc', ID); |
---|
| 2505 | } |
---|
| 2506 | else |
---|
| 2507 | { |
---|
| 2508 | if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) |
---|
| 2509 | { |
---|
| 2510 | e.preventDefault(); |
---|
| 2511 | search_contacts(e.keyCode,this.id); |
---|
| 2512 | } |
---|
| 2513 | } |
---|
| 2514 | } |
---|
| 2515 | input_cc.onkeyup = function (e) |
---|
| 2516 | { |
---|
| 2517 | if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) |
---|
| 2518 | { |
---|
| 2519 | search_contacts(e.keyCode,this.id); |
---|
| 2520 | } |
---|
| 2521 | } |
---|
| 2522 | } |
---|
| 2523 | else if (is_ie) |
---|
| 2524 | { |
---|
| 2525 | input_cc.rows = 3; |
---|
| 2526 | input_cc.onkeyup = function (e) |
---|
| 2527 | { |
---|
| 2528 | if ((window.event.keyCode) == 120) //F9 |
---|
| 2529 | { |
---|
| 2530 | emQuickSearch(input_cc.value, 'cc', ID); |
---|
| 2531 | } |
---|
| 2532 | else |
---|
| 2533 | { |
---|
| 2534 | search_contacts(window.event.keyCode,this.id); |
---|
| 2535 | } |
---|
| 2536 | } |
---|
| 2537 | } |
---|
| 2538 | |
---|
[2] | 2539 | td_cc.appendChild(input_cc); |
---|
| 2540 | var img_search = document.createElement("IMG"); |
---|
[790] | 2541 | img_search.src = "./templates/"+template+"/images/search.gif"; |
---|
[2] | 2542 | img_search.onclick = function () {emQuickSearch(document.getElementById('cc_'+ID).value, 'cc', ID)} |
---|
[53] | 2543 | img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.'); |
---|
[2] | 2544 | var span_search = document.createElement("SPAN"); |
---|
| 2545 | span_search.innerHTML = get_lang('Search'); |
---|
[3035] | 2546 | |
---|
[2] | 2547 | var td2_img_search = document.createElement("TD"); |
---|
| 2548 | td2_img_search.setAttribute("noWrap","true"); |
---|
| 2549 | var td2_span_search = document.createElement("TD"); |
---|
[3035] | 2550 | td2_span_search.setAttribute("noWrap","true"); |
---|
| 2551 | |
---|
[2] | 2552 | td2_img_search.appendChild(img_search); |
---|
| 2553 | td2_span_search.appendChild(span_search); |
---|
[3035] | 2554 | |
---|
[2] | 2555 | tr2.appendChild(td2); |
---|
| 2556 | tr2.appendChild(td_cc); |
---|
| 2557 | tr2.appendChild(td2_img_search); |
---|
| 2558 | tbody_message.appendChild(tr2); |
---|
| 2559 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2560 | var tr3 = document.createElement("TR"); |
---|
| 2561 | tr3.id = "tr_cco_"+ID; |
---|
| 2562 | tr3.style.display = 'none'; |
---|
| 2563 | var td3 = document.createElement("TD"); |
---|
| 2564 | td3.setAttribute("noWrap","true"); |
---|
| 2565 | td3.innerHTML = get_lang("CCo")+":"; |
---|
| 2566 | td3.style.width = "1%"; |
---|
[3035] | 2567 | |
---|
[2] | 2568 | var td_cco = document.createElement("TD"); |
---|
| 2569 | td_cco.setAttribute("noWrap","true"); |
---|
| 2570 | td_cco.style.width = "100%"; |
---|
[3035] | 2571 | |
---|
[2] | 2572 | var input_cco = document.createElement('TEXTAREA'); |
---|
| 2573 | input_cco.id = "cco_"+ID; |
---|
| 2574 | input_cco.name = "input_cco"; |
---|
| 2575 | input_cco.setAttribute("tabIndex","1"); |
---|
| 2576 | input_cco.style.width = "100%"; |
---|
| 2577 | input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus',this.id);}; |
---|
| 2578 | input_cco.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; |
---|
[3035] | 2579 | |
---|
[2] | 2580 | if (!is_ie) |
---|
[3035] | 2581 | { |
---|
| 2582 | input_cco.rows = 2; |
---|
[3967] | 2583 | input_cco.onkeydown = function (e) |
---|
[3035] | 2584 | { |
---|
| 2585 | if ((e.keyCode) == 120) //F9 |
---|
| 2586 | { |
---|
| 2587 | emQuickSearch(input_cco.value, 'cco', ID); |
---|
| 2588 | } |
---|
| 2589 | else |
---|
| 2590 | { |
---|
| 2591 | if (((e.keyCode == 13) || ((e.keyCode == 38)||(e.keyCode == 40))) && (document.getElementById('tipDiv').style.visibility!='hidden')) |
---|
| 2592 | { |
---|
| 2593 | e.preventDefault(); |
---|
| 2594 | search_contacts(e.keyCode,this.id); |
---|
| 2595 | } |
---|
| 2596 | } |
---|
| 2597 | } |
---|
| 2598 | input_cco.onkeyup = function (e) |
---|
| 2599 | { |
---|
| 2600 | if ((e.keyCode != 13) && (e.keyCode != 38) && (e.keyCode != 40)) |
---|
| 2601 | { |
---|
| 2602 | search_contacts(e.keyCode,this.id); |
---|
| 2603 | } |
---|
| 2604 | } |
---|
| 2605 | } |
---|
| 2606 | else if (is_ie) |
---|
| 2607 | { |
---|
| 2608 | input_cco.rows = 3; |
---|
| 2609 | input_cco.onkeyup = function (e) |
---|
| 2610 | { |
---|
| 2611 | if ((window.event.keyCode) == 120) //F9 |
---|
| 2612 | { |
---|
| 2613 | emQuickSearch(input_cco.value, 'cco', ID); |
---|
| 2614 | } |
---|
| 2615 | else |
---|
| 2616 | { |
---|
| 2617 | search_contacts(window.event.keyCode,this.id); |
---|
| 2618 | } |
---|
| 2619 | } |
---|
| 2620 | } |
---|
| 2621 | |
---|
[2] | 2622 | td_cco.appendChild(input_cco); |
---|
| 2623 | var img_search = document.createElement("IMG"); |
---|
[790] | 2624 | img_search.src = "./templates/"+template+"/images/search.gif"; |
---|
[3035] | 2625 | img_search.title = get_lang('Search') + " | " + get_lang('Use F9 Key as shortcut.'); |
---|
[2] | 2626 | img_search.onclick = function () {emQuickSearch(document.getElementById('cco_'+ID).value, 'cco', ID);}; |
---|
| 2627 | var span_search = document.createElement("SPAN"); |
---|
| 2628 | span_search.innerHTML = get_lang('Search'); |
---|
| 2629 | |
---|
| 2630 | var td3_img_search = document.createElement("TD"); |
---|
| 2631 | td3_img_search.setAttribute("noWrap","true"); |
---|
| 2632 | var td3_span_search = document.createElement("TD"); |
---|
[3035] | 2633 | td3_span_search.setAttribute("noWrap","true"); |
---|
| 2634 | |
---|
[2] | 2635 | td3_img_search.appendChild(img_search); |
---|
| 2636 | td3_span_search.appendChild(span_search); |
---|
[3035] | 2637 | |
---|
[2] | 2638 | tr3.appendChild(td3); |
---|
| 2639 | tr3.appendChild(td_cco); |
---|
[3035] | 2640 | tr3.appendChild(td3_img_search); |
---|
[2] | 2641 | tbody_message.appendChild(tr3); |
---|
| 2642 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2643 | var tr_link = document.createElement("TR"); |
---|
[3035] | 2644 | tr_link.id = "tr_link_"+ID; |
---|
[2] | 2645 | var td1_link = document.createElement("TD"); |
---|
| 2646 | var td2_link = document.createElement("TD"); |
---|
| 2647 | td1_link.innerHTML = " "; |
---|
| 2648 | var a_cc_link = document.createElement('A'); |
---|
| 2649 | a_cc_link.innerHTML = get_lang('Add CC'); |
---|
| 2650 | a_cc_link.id = "a_cc_link_"+ID; |
---|
| 2651 | a_cc_link.setAttribute("href","javascript:void(0)"); |
---|
| 2652 | a_cc_link.setAttribute("tabIndex","-1"); |
---|
[320] | 2653 | 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;} |
---|
[3035] | 2654 | td2_link.appendChild(a_cc_link); |
---|
[2] | 2655 | var space = document.createElement("span"); |
---|
| 2656 | space.id ="space_link_"+ID; |
---|
| 2657 | space.innerHTML=" | "; |
---|
| 2658 | td2_link.appendChild(space); |
---|
| 2659 | var a_cco_link = document.createElement('A'); |
---|
| 2660 | a_cco_link.innerHTML = get_lang('Add BCC'); |
---|
| 2661 | a_cco_link.id = "a_cco_link_"+ID; |
---|
| 2662 | a_cco_link.setAttribute("href","javascript:void(0)"); |
---|
| 2663 | a_cco_link.setAttribute("tabIndex","-1"); |
---|
[320] | 2664 | 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;} |
---|
[3035] | 2665 | td2_link.appendChild(a_cco_link); |
---|
[3527] | 2666 | var space = document.createElement("span"); |
---|
| 2667 | space.id ="space_link_2_"+ID; |
---|
| 2668 | space.innerHTML=" | "; |
---|
| 2669 | td2_link.appendChild(space); |
---|
| 2670 | var a_replyto_link = document.createElement('A'); |
---|
| 2671 | a_replyto_link.innerHTML = get_lang('Reply to'); |
---|
| 2672 | a_replyto_link.id = "a_replyto_link_"+ID; |
---|
| 2673 | a_replyto_link.setAttribute("href","javascript:void(0)"); |
---|
| 2674 | a_replyto_link.setAttribute("tabIndex","-1"); |
---|
| 2675 | 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;} |
---|
| 2676 | td2_link.appendChild(a_replyto_link); |
---|
[2] | 2677 | tr_link.appendChild(td1_link); |
---|
| 2678 | tr_link.appendChild(td2_link); |
---|
| 2679 | tbody_message.appendChild(tr_link); |
---|
| 2680 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
| 2681 | var tr4 = document.createElement("TR"); |
---|
| 2682 | var td4 = document.createElement("TD"); |
---|
[3035] | 2683 | //td4.setAttribute("noWrap","true"); |
---|
[2] | 2684 | td4.innerHTML = get_lang("Subject")+":"; |
---|
| 2685 | var td_subject = document.createElement("TD"); |
---|
| 2686 | var input_subject = document.createElement('input'); |
---|
| 2687 | input_subject.id = "subject_"+ID; |
---|
| 2688 | input_subject.name = "input_subject"; |
---|
| 2689 | input_subject.setAttribute("tabIndex","1"); |
---|
| 2690 | input_subject.style.width = "90%"; |
---|
| 2691 | input_subject.setAttribute("autocomplete","off"); |
---|
| 2692 | td_subject.appendChild(input_subject); |
---|
| 2693 | tr4.appendChild(td4); |
---|
| 2694 | tr4.appendChild(td_subject); |
---|
| 2695 | tbody_message.appendChild(tr4); |
---|
[3035] | 2696 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[2] | 2697 | var tr5 = document.createElement("TR"); |
---|
| 2698 | var td5 = document.createElement("TD"); |
---|
| 2699 | td5.innerHTML = " "; |
---|
| 2700 | var td_return_receipt = document.createElement("TD"); |
---|
| 2701 | td_return_receipt.setAttribute("noWrap","true"); |
---|
| 2702 | td_return_receipt.innerHTML = get_lang("Return receipt")+":"; |
---|
[3035] | 2703 | if (is_ie) |
---|
| 2704 | { |
---|
| 2705 | var input_return_receipt = document.createElement('input name=input_return_receipt'); |
---|
| 2706 | } |
---|
| 2707 | else |
---|
| 2708 | { |
---|
| 2709 | var input_return_receipt = document.createElement('input'); |
---|
| 2710 | input_return_receipt.name = "input_return_receipt"; |
---|
| 2711 | } |
---|
[2] | 2712 | input_return_receipt.type = "checkbox"; |
---|
| 2713 | input_return_receipt.className = "checkbox"; |
---|
| 2714 | input_return_receipt.id = "return_receipt_"+ID; |
---|
| 2715 | input_return_receipt.setAttribute("tabIndex","-1"); |
---|
[1035] | 2716 | td_return_receipt.appendChild(input_return_receipt); |
---|
| 2717 | |
---|
[3035] | 2718 | // Workaround para resolver problema ao enviar e-mails |
---|
| 2719 | if((preferences.use_assinar_criptografar != '0')) |
---|
[1701] | 2720 | { |
---|
[3035] | 2721 | if(parseInt(preferences.use_signature_digital_cripto)==1) |
---|
[1701] | 2722 | { |
---|
| 2723 | td_return_receipt.innerHTML += " " + get_lang("Digitally sign message?")+""; |
---|
[1035] | 2724 | |
---|
[3035] | 2725 | if (is_ie) |
---|
| 2726 | { |
---|
| 2727 | var input_return_digital = document.createElement('input name=input_return_digital'); |
---|
| 2728 | } |
---|
| 2729 | else |
---|
| 2730 | { |
---|
[1701] | 2731 | var input_return_digital = document.createElement('input'); |
---|
[3035] | 2732 | input_return_digital.name = "input_return_digital"; |
---|
| 2733 | } |
---|
[1035] | 2734 | |
---|
[1701] | 2735 | input_return_digital.type = "checkbox"; |
---|
| 2736 | input_return_digital.className = "checkbox"; |
---|
| 2737 | input_return_digital.id = "return_digital_"+ID; |
---|
| 2738 | input_return_digital.setAttribute("tabIndex","-1"); |
---|
[3035] | 2739 | if(parseInt(preferences.use_signature_digital)==1) |
---|
[1701] | 2740 | { |
---|
[3253] | 2741 | if (is_ie) |
---|
| 2742 | { |
---|
| 2743 | input_return_digital.checked=true; |
---|
| 2744 | } |
---|
| 2745 | else |
---|
| 2746 | { |
---|
| 2747 | input_return_digital.defaultChecked=true; |
---|
| 2748 | } |
---|
[1701] | 2749 | } |
---|
| 2750 | td_return_receipt.appendChild(input_return_digital); |
---|
| 2751 | td_return_receipt.innerHTML += " " + get_lang("Digitally crypt message?")+""; |
---|
[1035] | 2752 | |
---|
[3035] | 2753 | if (is_ie) |
---|
| 2754 | { |
---|
| 2755 | var input_return_cripto = document.createElement('input name=input_return_cripto'); |
---|
| 2756 | } |
---|
| 2757 | else |
---|
| 2758 | { |
---|
[1701] | 2759 | var input_return_cripto = document.createElement('input'); |
---|
[3035] | 2760 | input_return_cripto.name = "input_return_cripto"; |
---|
| 2761 | } |
---|
[1035] | 2762 | |
---|
[1701] | 2763 | input_return_cripto.type = "checkbox"; |
---|
| 2764 | input_return_cripto.className = "checkbox"; |
---|
| 2765 | input_return_cripto.id = "return_cripto_"+ID; |
---|
| 2766 | input_return_cripto.setAttribute("tabIndex","-1"); |
---|
| 2767 | input_return_cripto.defaultChecked=false; |
---|
[1035] | 2768 | |
---|
[3035] | 2769 | if(parseInt(preferences.use_signature_cripto)==1) |
---|
[1701] | 2770 | { |
---|
[3253] | 2771 | if (is_ie) |
---|
| 2772 | { |
---|
| 2773 | input_return_cripto.checked=true; |
---|
| 2774 | } |
---|
| 2775 | else |
---|
| 2776 | { |
---|
[1701] | 2777 | input_return_cripto.defaultChecked=true; |
---|
[3253] | 2778 | } |
---|
[1701] | 2779 | } |
---|
[1035] | 2780 | |
---|
[1701] | 2781 | td_return_receipt.appendChild(input_return_cripto); |
---|
| 2782 | } |
---|
| 2783 | } |
---|
[3705] | 2784 | td_return_receipt.innerHTML += ""; |
---|
[1701] | 2785 | tr5.appendChild(td5); |
---|
| 2786 | tr5.appendChild(td_return_receipt); |
---|
[4218] | 2787 | |
---|
| 2788 | if ( ! expresso_offline ) |
---|
| 2789 | { |
---|
| 2790 | var text_plain = td_return_receipt.appendChild( |
---|
| 2791 | document.createElement( 'span' ) |
---|
| 2792 | ).appendChild( |
---|
| 2793 | document.createTextNode( ' | ' ) |
---|
| 2794 | ).parentNode.appendChild( |
---|
[4248] | 2795 | document.createTextNode( get_lang('Send this mail as text plain') + ':') |
---|
[4218] | 2796 | ); |
---|
[4229] | 2797 | // changed to work in ie |
---|
| 2798 | input_checkbox = document.createElement('input'); |
---|
| 2799 | input_checkbox.setAttribute('class', 'checkbox'); |
---|
| 2800 | input_checkbox.setAttribute('type', 'checkbox'); |
---|
| 2801 | input_checkbox.setAttribute('tabIndex', '-1'); |
---|
| 2802 | input_checkbox.setAttribute('id', 'textplain_rt_checkbox_' + ID); |
---|
| 2803 | |
---|
| 2804 | input_checkbox.onclick = function () |
---|
[4218] | 2805 | { |
---|
| 2806 | RichTextEditor.plain( this.checked ); |
---|
| 2807 | document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : ''; |
---|
| 2808 | }; |
---|
[4229] | 2809 | |
---|
[4331] | 2810 | text_plain.parentNode.appendChild(input_checkbox); |
---|
[4218] | 2811 | } |
---|
| 2812 | |
---|
[1701] | 2813 | tbody_message.appendChild(tr5); |
---|
| 2814 | if (parseInt(preferences.use_important_flag)) |
---|
| 2815 | { |
---|
| 2816 | var trn = document.createElement("TR"); |
---|
| 2817 | var tdn = document.createElement("TD"); |
---|
| 2818 | tdn.innerHTML = " "; |
---|
| 2819 | var td_important_msg = document.createElement("TD"); |
---|
| 2820 | td_important_msg.setAttribute("noWrap","true"); |
---|
| 2821 | td_important_msg.innerHTML = get_lang("Important message")+":"; |
---|
| 2822 | var input_important_message = document.createElement('input'); |
---|
| 2823 | input_important_message.type = "checkbox"; |
---|
| 2824 | input_important_message.className = "checkbox"; |
---|
| 2825 | input_important_message.id = "important_message_"+ID; |
---|
| 2826 | input_important_message.name = "input_important_message"; |
---|
| 2827 | input_important_message.setAttribute("tabIndex","-1"); |
---|
[3035] | 2828 | td_important_msg.appendChild(input_important_message); |
---|
[1701] | 2829 | trn.appendChild(tdn); |
---|
| 2830 | trn.appendChild(td_important_msg); |
---|
| 2831 | tbody_message.appendChild(trn); |
---|
| 2832 | } |
---|
[1653] | 2833 | |
---|
[1701] | 2834 | var add_files = document.createElement("A"); |
---|
| 2835 | add_files.setAttribute("href", "javascript:void(0)"); |
---|
| 2836 | add_files.onclick = function () { addFile(ID); return false;}; |
---|
| 2837 | add_files.innerHTML = get_lang("Attachments: add+"); |
---|
| 2838 | add_files.setAttribute("tabIndex","-1"); |
---|
| 2839 | var divfiles = document.createElement("DIV"); |
---|
| 2840 | divfiles.id = "divFiles_"+ID; |
---|
| 2841 | var tr5 = document.createElement("TR"); |
---|
| 2842 | var td5_link = document.createElement("TD"); |
---|
[3035] | 2843 | var td5_input = document.createElement("TD"); |
---|
[1701] | 2844 | td5_input.innerHTML = " " |
---|
| 2845 | td5_link.setAttribute("valign","top"); |
---|
| 2846 | td5_link.setAttribute("colSpan","2"); |
---|
| 2847 | td5_link.appendChild(add_files); |
---|
| 2848 | tr5.appendChild(td5_input); |
---|
| 2849 | tr5.appendChild(td5_link); |
---|
| 2850 | tbody_message.appendChild(tr5); |
---|
| 2851 | var tr6 = document.createElement("TR"); |
---|
| 2852 | var td6_link = document.createElement("TD"); |
---|
| 2853 | var td6_input = document.createElement("TD"); |
---|
| 2854 | tr6.appendChild(td6_link); |
---|
| 2855 | td6_input.appendChild(divfiles); |
---|
[3035] | 2856 | tr6.appendChild(td6_input); |
---|
[1701] | 2857 | tbody_message.appendChild(tr6); |
---|
[2] | 2858 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[1701] | 2859 | var tr5 = document.createElement("TR"); |
---|
[3035] | 2860 | var td5 = document.createElement("TD"); |
---|
[1701] | 2861 | td5.innerHTML = " "; |
---|
| 2862 | var td_body = document.createElement("TD"); |
---|
| 2863 | td_body.setAttribute("colSpan","2"); |
---|
| 2864 | var div_body_position = document.createElement("DIV"); |
---|
| 2865 | div_body_position.id = "body_position_" + ID; |
---|
| 2866 | td_body.appendChild(div_body_position); |
---|
| 2867 | tr5.appendChild(td5); |
---|
| 2868 | tr5.appendChild(td_body); |
---|
| 2869 | tbody_message.appendChild(tr5); |
---|
[3018] | 2870 | var _div = document.createElement("DIV"); |
---|
[1701] | 2871 | _div.id = "div_message_scroll_"+ID; |
---|
| 2872 | _div.style.overflow = "auto"; |
---|
[3035] | 2873 | _div.style.width = "100%"; |
---|
[2] | 2874 | |
---|
[1701] | 2875 | // Hide the contac tips and re-position the pallete color. |
---|
| 2876 | _div.onscroll = function() { |
---|
| 2877 | var intElemScrollTop = Element("div_message_scroll_"+ID).scrollTop; |
---|
| 2878 | if (!is_ie) |
---|
| 2879 | ColorPalette.repos(intElemScrollTop); |
---|
| 2880 | Tooltip.scrollChanged(); |
---|
| 2881 | }; |
---|
[2] | 2882 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[1701] | 2883 | _div.appendChild(form); |
---|
| 2884 | content.appendChild(_div); |
---|
| 2885 | table_message.appendChild(tbody_message); |
---|
| 2886 | form.appendChild(table_message); |
---|
| 2887 | RichTextEditor.loadEditor(ID); |
---|
[2] | 2888 | ////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
[1701] | 2889 | if(!expresso_offline) |
---|
| 2890 | draw_from_field(sel_from,tr1_1); |
---|
[3035] | 2891 | resizeWindow(); |
---|
[4202] | 2892 | |
---|
[1701] | 2893 | return ID; |
---|
[2] | 2894 | } |
---|
| 2895 | |
---|
| 2896 | // Verify if any user is sharing his name/email address |
---|
| 2897 | // for use in the new messages's "From " field. |
---|
| 2898 | function draw_from_field(sel_from,tr1_1){ |
---|
| 2899 | |
---|
| 2900 | var el_shared_users = Element("el_shared_users"); |
---|
| 2901 | // The element was loaded and populated...so return. |
---|
[3035] | 2902 | if(el_shared_users){ |
---|
[371] | 2903 | // Nothing to work...so return. |
---|
| 2904 | if(el_shared_users.options.length == 0) |
---|
| 2905 | return; |
---|
[2] | 2906 | tr1_1.style.display = ''; |
---|
| 2907 | for (var x = 0; x < el_shared_users.options.length; x++) { |
---|
| 2908 | var _option = document.createElement("OPTION"); |
---|
| 2909 | _option.text = el_shared_users.options[x].text; |
---|
| 2910 | _option.value = el_shared_users.options[x].value; |
---|
| 2911 | sel_from.options[sel_from.options.length] = _option ; |
---|
| 2912 | } |
---|
| 2913 | return; |
---|
| 2914 | } |
---|
| 2915 | // Get the shared folders..... |
---|
| 2916 | var sharedFolders = new Array(); |
---|
| 2917 | for(var i = 0; i < folders.length; i++) { |
---|
| 2918 | var x = folders[i].folder_id; |
---|
[3035] | 2919 | if (folders[i].folder_parent == 'user'){ |
---|
| 2920 | sharedFolders[sharedFolders.length] = x; |
---|
| 2921 | } |
---|
| 2922 | } |
---|
[2] | 2923 | |
---|
[3035] | 2924 | var matchUser = '#'; |
---|
| 2925 | var sharedUsers = new Array(); |
---|
[2] | 2926 | // Filter the shared folders (only root folders) ..... |
---|
| 2927 | for(var i = 0; i < sharedFolders.length; i++) { |
---|
| 2928 | matchUser = sharedFolders[i]; |
---|
| 2929 | sharedUsers[sharedUsers.length] = matchUser.substring(("user"+cyrus_delimiter).length,matchUser.length); |
---|
[3035] | 2930 | } |
---|
[2] | 2931 | |
---|
| 2932 | // Handler function for cExecute |
---|
| 2933 | var h_user = function(data) { |
---|
[371] | 2934 | if(data.length > 0) { |
---|
| 2935 | tr1_1.style.display = ''; |
---|
[2] | 2936 | var _option = document.createElement("OPTION"); |
---|
[371] | 2937 | _option.text = '"'+data.myname+'" <'+Element("user_email").value+'>'; |
---|
| 2938 | _option.value = data.myname+";"+Element("user_email").value; |
---|
| 2939 | sel_from.options[sel_from.options.length] = _option; |
---|
[3035] | 2940 | |
---|
[371] | 2941 | var options = ''; |
---|
| 2942 | for (var x = 0; x < data.length; x++) { |
---|
| 2943 | var _option = document.createElement("OPTION"); |
---|
| 2944 | _option.text = '"'+data[x].cn[0] + '" <'+data[x].mail[0]+'>'; |
---|
[1912] | 2945 | _option.value = data[x].cn[0] + ';'+data[x].mail[0]+';'+data[x].save_shared[0]+';'+data[x].uid[0]; |
---|
[371] | 2946 | sel_from.options[sel_from.options.length] = _option ; |
---|
| 2947 | } |
---|
[2] | 2948 | } |
---|
| 2949 | var shared_users_from = Element("el_shared_users"); |
---|
| 2950 | if(!shared_users_from) { |
---|
| 2951 | shared_users_from = sel_from.cloneNode(true); |
---|
| 2952 | shared_users_from.id = "el_shared_users"; |
---|
| 2953 | shared_users_from.style.display = 'none'; |
---|
| 2954 | document.body.appendChild(shared_users_from); |
---|
| 2955 | } |
---|
| 2956 | } |
---|
| 2957 | // First time, so execute..... |
---|
| 2958 | cExecute ("$this.ldap_functions.getSharedUsersFrom&uids="+sharedUsers.join(';'), h_user); |
---|
| 2959 | } |
---|
| 2960 | |
---|
| 2961 | function changeBgColorToON(all_messages, begin, end){ |
---|
[163] | 2962 | for (begin; begin<=end; begin++) |
---|
| 2963 | { |
---|
| 2964 | add_className(all_messages[begin], 'selected_msg'); |
---|
[2] | 2965 | Element("check_box_message_" + all_messages[begin].id).checked = true; |
---|
| 2966 | } |
---|
| 2967 | } |
---|
[976] | 2968 | function updateBoxBgColor(box){ |
---|
| 2969 | // Set first TR Class |
---|
| 2970 | var _className = 'tr_msg_read2'; |
---|
[3035] | 2971 | for(var i = 0; i < box.length;i++){ |
---|
[976] | 2972 | if(exist_className(box[i],_className)) |
---|
| 2973 | remove_className(box[i], _className); |
---|
| 2974 | _className = (_className == 'tr_msg_read2' ? 'tr_msg_read' : 'tr_msg_read2'); |
---|
| 2975 | if(!exist_className(box[i],_className)) |
---|
| 2976 | add_className( box[i], _className); |
---|
| 2977 | } |
---|
| 2978 | } |
---|
[2] | 2979 | |
---|
| 2980 | function changeBgColor(event, msg_number){ |
---|
[163] | 2981 | actual_tr = Element(msg_number); |
---|
[2] | 2982 | |
---|
[163] | 2983 | if (event.shiftKey) |
---|
| 2984 | { |
---|
| 2985 | last_tr = Element(last_message_selected); |
---|
[2] | 2986 | if(!last_tr) |
---|
| 2987 | last_tr = actual_tr; |
---|
| 2988 | |
---|
| 2989 | all_messages = actual_tr.parentNode.childNodes; |
---|
[3035] | 2990 | |
---|
[163] | 2991 | for (var i=0; i < all_messages.length; i++) |
---|
| 2992 | { |
---|
| 2993 | if (actual_tr.id == all_messages[i].id) |
---|
[2] | 2994 | first_order = i; |
---|
[163] | 2995 | if (last_tr.id == all_messages[i].id) |
---|
[2] | 2996 | last_order = i; |
---|
| 2997 | } |
---|
[3035] | 2998 | |
---|
[163] | 2999 | if (parseInt(first_order) > parseInt(last_order)) |
---|
| 3000 | changeBgColorToON(all_messages, last_order, first_order); |
---|
| 3001 | else |
---|
| 3002 | changeBgColorToON(all_messages, first_order, last_order); |
---|
[2] | 3003 | } |
---|
| 3004 | else{ |
---|
[163] | 3005 | //if ( exist_className(actual_tr, 'selected_msg') ) |
---|
| 3006 | if ( Element('check_box_message_' + msg_number).checked ) |
---|
| 3007 | add_className(actual_tr, 'selected_msg'); |
---|
| 3008 | else |
---|
| 3009 | remove_className(actual_tr, 'selected_msg'); |
---|
[2] | 3010 | } |
---|
| 3011 | last_message_selected = msg_number; |
---|
| 3012 | } |
---|
| 3013 | |
---|
| 3014 | function build_quota(data){ |
---|
| 3015 | id = "content_quota"; |
---|
| 3016 | q_limit = data['quota_limit']; |
---|
| 3017 | var div = document.getElementById(id); |
---|
| 3018 | if(!q_limit){ |
---|
[3035] | 3019 | div.innerHTML = '<span><font size="2" style="color:red"><strong>'+get_lang("Without Quota")+'</strong></font></span>'; |
---|
[2] | 3020 | } |
---|
| 3021 | else{ |
---|
[345] | 3022 | if(div) |
---|
[356] | 3023 | div.innerHTML = ''; |
---|
[2] | 3024 | value = data['quota_percent']; |
---|
| 3025 | q_used = data['quota_used']; |
---|
| 3026 | table = document.getElementById("table_quota"); |
---|
| 3027 | if(table) |
---|
| 3028 | table.parentNode.removeChild(table); |
---|
[3035] | 3029 | table = document.createElement("TABLE"); |
---|
| 3030 | tbody = document.createElement("TBODY"); |
---|
[2] | 3031 | table.appendChild(tbody); |
---|
| 3032 | table.id = "table_quota"; |
---|
| 3033 | table.width="102"; |
---|
| 3034 | table.border="0"; |
---|
| 3035 | table.cellSpacing = 0; |
---|
| 3036 | table.cellPadding = 0; |
---|
[3035] | 3037 | |
---|
[2] | 3038 | //tr1 = document.createElement("TR"); |
---|
| 3039 | td11 = document.createElement("TD"); |
---|
| 3040 | td11.align="center"; |
---|
| 3041 | td11.setAttribute("noWrap","true"); |
---|
[3064] | 3042 | td11.innerHTML += ' <span class="boxHeaderText">' + value+"% ("+borkb(q_used*1024)+"/"+borkb(q_limit*1024)+")</span>"; |
---|
[2] | 3043 | //tr1.appendChild(td11); |
---|
[3035] | 3044 | |
---|
[2] | 3045 | tr2 = document.createElement("TR"); |
---|
| 3046 | td21 = document.createElement("TD"); |
---|
| 3047 | td21.setAttribute("noWrap","true"); |
---|
| 3048 | td21.height="15"; |
---|
[3035] | 3049 | td22 = document.createElement("TD"); |
---|
[1564] | 3050 | td21.setAttribute("background","../phpgwapi/templates/"+template+"/images/dsunused.gif"); |
---|
[2] | 3051 | table221 = document.createElement("TABLE"); |
---|
| 3052 | tbody221 = document.createElement("TBODY"); |
---|
| 3053 | table221.appendChild(tbody221); |
---|
[3035] | 3054 | table221.style.width=value+"%"; |
---|
[2] | 3055 | td21.width="102"; |
---|
| 3056 | table221.border="0"; |
---|
| 3057 | table221.cellSpacing = 0; |
---|
| 3058 | table221.cellPadding = 0; |
---|
| 3059 | tr221 = document.createElement("TR"); |
---|
| 3060 | td221 = document.createElement("TD"); |
---|
| 3061 | td221.height="15"; |
---|
| 3062 | if(value > 90) { |
---|
| 3063 | if(value >= 100) |
---|
[53] | 3064 | write_msg(get_lang("Your Mailbox is 100% full! You must free more space or will not receive messages.")); |
---|
[2] | 3065 | else |
---|
| 3066 | write_msg(get_lang("Warning: Your Mailbox is almost full!")); |
---|
[790] | 3067 | td221.setAttribute("background","templates/"+template+"/images/dsalert.gif"); |
---|
[2] | 3068 | } |
---|
| 3069 | else if(value > 80) |
---|
[790] | 3070 | td221.setAttribute("background","templates/"+template+"/images/dswarn.gif"); |
---|
[2] | 3071 | else |
---|
[1172] | 3072 | td221.className = 'dsused'; |
---|
[4448] | 3073 | |
---|
| 3074 | td221.setAttribute("style","width: 100%"); |
---|
[3035] | 3075 | |
---|
[2] | 3076 | tr221.appendChild(td221); |
---|
| 3077 | tbody221.appendChild(tr221); |
---|
[3035] | 3078 | td21.appendChild(table221); |
---|
[2] | 3079 | tr2.appendChild(td21); |
---|
| 3080 | tr2.appendChild(td11); |
---|
| 3081 | |
---|
| 3082 | //tr2.appendChild(td1); |
---|
| 3083 | |
---|
| 3084 | tbody.appendChild(tr2); //Desenho |
---|
| 3085 | //tbody.appendChild(tr1); //Letras |
---|
| 3086 | div.appendChild(table); |
---|
| 3087 | } |
---|
| 3088 | } |
---|
| 3089 | |
---|
| 3090 | function draw_quota(data){ |
---|
| 3091 | build_quota(data); |
---|
| 3092 | } |
---|
| 3093 | |
---|
[345] | 3094 | function update_quota(folder_id){ |
---|
[325] | 3095 | cExecute ("$this.imap_functions.get_quota&folder_id="+folder_id,build_quota); |
---|
[2] | 3096 | } |
---|
| 3097 | |
---|
| 3098 | function draw_search(headers_msgs){ |
---|
| 3099 | Element("border_id_0").innerHTML = " " + get_lang('Search Result') + " "; |
---|
| 3100 | |
---|
| 3101 | var tbody = Element('tbody_box'); |
---|
| 3102 | for (var i=0; i<(headers_msgs.length); i++){ |
---|
[3493] | 3103 | // passa parâmetro offset |
---|
[2] | 3104 | var tr = this.make_tr_message(headers_msgs[i], headers_msgs[i].msg_folder); |
---|
[790] | 3105 | if (tr) |
---|
| 3106 | tbody.appendChild(tr); |
---|
[2] | 3107 | } |
---|
| 3108 | } |
---|
| 3109 | |
---|
| 3110 | function draw_search_header_box(){ |
---|
| 3111 | var table_message_header_box = Element("table_message_header_box"); |
---|
| 3112 | table_message_header_box.parentNode.removeChild(table_message_header_box); |
---|
| 3113 | |
---|
| 3114 | var content_id_0 = Element("content_id_0"); |
---|
| 3115 | var table_element = document.createElement("TABLE"); |
---|
| 3116 | var tbody_element = document.createElement("TBODY"); |
---|
| 3117 | table_element.setAttribute("id", "table_message_header_box"); |
---|
| 3118 | table_element.className = "table_message_header_box"; |
---|
| 3119 | tr_element = document.createElement("TR"); |
---|
| 3120 | tr_element.className = "message_header"; |
---|
| 3121 | td_element1 = document.createElement("TD"); |
---|
| 3122 | td_element1.setAttribute("width", "1%"); |
---|
| 3123 | chk_box_element = document.createElement("INPUT"); |
---|
| 3124 | chk_box_element.id = "chk_box_select_all_messages"; |
---|
| 3125 | chk_box_element.setAttribute("type", "checkbox"); |
---|
| 3126 | chk_box_element.className = "checkbox"; |
---|
| 3127 | chk_box_element.onclick = function(){select_all_messages(this.checked);}; |
---|
| 3128 | chk_box_element.onmouseover = function () {this.title=get_lang('Select all messages.')}; |
---|
| 3129 | chk_box_element.onkeydown = function (e){ |
---|
| 3130 | if (is_ie) |
---|
| 3131 | { |
---|
| 3132 | if ((window.event.keyCode) == 46) |
---|
| 3133 | { |
---|
| 3134 | //delete_all_selected_msgs_imap(); |
---|
[689] | 3135 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 3136 | } |
---|
| 3137 | } |
---|
| 3138 | else |
---|
| 3139 | { |
---|
| 3140 | if ((e.keyCode) == 46) |
---|
| 3141 | { |
---|
| 3142 | //delete_all_selected_msgs_imap(); |
---|
[689] | 3143 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 3144 | } |
---|
| 3145 | } |
---|
| 3146 | }; |
---|
[3035] | 3147 | |
---|
[2] | 3148 | td_element1.appendChild(chk_box_element); |
---|
| 3149 | td_element2 = document.createElement("TD"); |
---|
| 3150 | td_element2.setAttribute("width", "3%"); |
---|
| 3151 | td_element3 = document.createElement("TD"); |
---|
| 3152 | td_element3.setAttribute("width", "30%"); |
---|
| 3153 | td_element3.id = "message_header_SORTFROM"; |
---|
| 3154 | td_element3.align = "left"; |
---|
| 3155 | td_element3.innerHTML = get_lang("From"); |
---|
| 3156 | td_element4 = document.createElement("TD"); |
---|
| 3157 | td_element4.setAttribute("width", "49%"); |
---|
| 3158 | td_element4.id = "message_header_SORTSUBJECT"; |
---|
| 3159 | td_element4.align = "left"; |
---|
[3035] | 3160 | td_element4.innerHTML = get_lang("Subject"); |
---|
[2] | 3161 | td_element5 = document.createElement("TD"); |
---|
| 3162 | td_element5.setAttribute("width", "10%"); |
---|
| 3163 | td_element5.id = "message_header_SORTARRIVAL"; |
---|
| 3164 | td_element5.align = "center"; |
---|
[3035] | 3165 | td_element5.innerHTML = "<B>"+get_lang("Date")+"</B>"; |
---|
[790] | 3166 | td_element5.innerHTML += "<img src ='templates/"+template+"/images/arrow_descendant.gif'>"; |
---|
[2] | 3167 | td_element6 = document.createElement("TD"); |
---|
| 3168 | td_element6.setAttribute("width", "10%"); |
---|
| 3169 | td_element6.id = "message_header_SORTSIZE"; |
---|
| 3170 | td_element6.align = "right"; |
---|
| 3171 | td_element6.innerHTML = get_lang("Size"); |
---|
| 3172 | tr_element.appendChild(td_element1); |
---|
| 3173 | tr_element.appendChild(td_element2); |
---|
| 3174 | tr_element.appendChild(td_element3); |
---|
| 3175 | tr_element.appendChild(td_element4); |
---|
| 3176 | tr_element.appendChild(td_element5); |
---|
| 3177 | tr_element.appendChild(td_element6); |
---|
[3035] | 3178 | |
---|
[2] | 3179 | tbody_element.appendChild(tr_element); |
---|
| 3180 | table_element.appendChild(tbody_element); |
---|
| 3181 | content_id_0.appendChild(table_element); |
---|
| 3182 | } |
---|
| 3183 | |
---|
| 3184 | function draw_search_division(msg){ |
---|
| 3185 | var tbody = Element('tbody_box'); |
---|
| 3186 | var tr = document.createElement("TR"); |
---|
| 3187 | var td = document.createElement("TD"); |
---|
| 3188 | td.colSpan = '7'; |
---|
| 3189 | td.width = '100%'; |
---|
| 3190 | |
---|
| 3191 | var action_info_table = document.createElement("TABLE"); |
---|
| 3192 | var action_info_tbody = document.createElement("TBODY"); |
---|
[3035] | 3193 | |
---|
[2] | 3194 | action_info_table.className = "action_info_table"; |
---|
| 3195 | action_info_table.width = "100%"; |
---|
[3035] | 3196 | |
---|
[2] | 3197 | var action_info_tr = document.createElement("TR"); |
---|
[3035] | 3198 | |
---|
[2] | 3199 | var action_info_th1 = document.createElement("TH"); |
---|
| 3200 | action_info_th1.width = "40%"; |
---|
| 3201 | action_info_th1.innerHTML = " "; |
---|
| 3202 | |
---|
| 3203 | var action_info_th2 = document.createElement("TH"); |
---|
[3035] | 3204 | |
---|
[2] | 3205 | action_info_th2.innerHTML = msg; |
---|
| 3206 | action_info_th2.className = "action_info_th"; |
---|
| 3207 | action_info_th2.setAttribute("noWrap", "true"); |
---|
[3035] | 3208 | |
---|
[2] | 3209 | var action_info_th3 = document.createElement("TH"); |
---|
| 3210 | action_info_th3.width = "40%"; |
---|
| 3211 | action_info_th3.innerHTML = " "; |
---|
[3035] | 3212 | |
---|
[2] | 3213 | action_info_tr.appendChild(action_info_th1); |
---|
| 3214 | action_info_tr.appendChild(action_info_th2); |
---|
| 3215 | action_info_tr.appendChild(action_info_th3); |
---|
| 3216 | action_info_tbody.appendChild(action_info_tr); |
---|
| 3217 | action_info_table.appendChild(action_info_tbody); |
---|
| 3218 | |
---|
| 3219 | td.appendChild(action_info_table); |
---|
| 3220 | tr.appendChild(td); |
---|
| 3221 | tbody.appendChild(tr); |
---|
| 3222 | } |
---|
| 3223 | |
---|
| 3224 | function draw_search_box(){ |
---|
| 3225 | var content_id_0 = Element("content_id_0"); |
---|
| 3226 | var table = document.createElement("TABLE"); |
---|
| 3227 | table.id = "table_box"; |
---|
| 3228 | table.width = 'auto'; |
---|
| 3229 | var tbody = document.createElement("TBODY"); |
---|
| 3230 | tbody.id = "tbody_box"; |
---|
| 3231 | |
---|
| 3232 | table.className = "table_box"; |
---|
| 3233 | table.setAttribute("frame", "below"); |
---|
| 3234 | table.setAttribute("rules", "none"); |
---|
| 3235 | table.setAttribute("cellpadding", "0"); |
---|
| 3236 | table.onkeydown = function (e){ |
---|
| 3237 | if (is_ie) |
---|
| 3238 | { |
---|
| 3239 | if ((window.event.keyCode) == 46) |
---|
| 3240 | { |
---|
| 3241 | //delete_all_selected_msgs_imap(); |
---|
[689] | 3242 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 3243 | } |
---|
| 3244 | } |
---|
| 3245 | else |
---|
| 3246 | { |
---|
| 3247 | if ((e.keyCode) == 46) |
---|
| 3248 | { |
---|
| 3249 | //delete_all_selected_msgs_imap(); |
---|
[689] | 3250 | proxy_mensagens.delete_msgs(get_current_folder(),'selected','null'); |
---|
[2] | 3251 | } |
---|
| 3252 | } |
---|
| 3253 | }; |
---|
| 3254 | if (is_ie) |
---|
| 3255 | table.style.cursor = "hand"; |
---|
[3035] | 3256 | |
---|
[2] | 3257 | table.appendChild(tbody); |
---|
| 3258 | content_id_0.appendChild(table); |
---|
| 3259 | } |
---|
| 3260 | var idx_cc = 0; |
---|
[790] | 3261 | function draw_plugin_cc(ID, addrs) |
---|
| 3262 | { |
---|
[2] | 3263 | connector.loadScript("ccQuickAdd"); |
---|
| 3264 | |
---|
| 3265 | var array_addrs = ''; |
---|
[3035] | 3266 | var array_name = ''; |
---|
[2] | 3267 | var cc_data = new Array(); |
---|
[3035] | 3268 | if(typeof(addrs.name) != 'undefined') { |
---|
[2] | 3269 | array_name = LTrim(addrs.name).split(" "); |
---|
[3035] | 3270 | array_addrs = new Array(addrs.email); |
---|
[2] | 3271 | } |
---|
| 3272 | else { |
---|
| 3273 | array_addrs = (typeof addrs == 'object' ? addrs.toString().split("\" ") : addrs.split("\" ")); |
---|
[3035] | 3274 | array_name = LTrim(array_addrs[0]).replace('"','').split(" "); |
---|
[2] | 3275 | } |
---|
| 3276 | |
---|
| 3277 | var _split = array_name[0].split('@'); |
---|
| 3278 | cc_data[0] = _split[0]; |
---|
| 3279 | cc_data[1] = _split[0]; |
---|
| 3280 | cc_data[2] = ''; |
---|
| 3281 | |
---|
| 3282 | for (i=1; i < array_name.length; i++) |
---|
[3035] | 3283 | cc_data[2] += array_name[i] + " "; |
---|
[2] | 3284 | |
---|
[3035] | 3285 | |
---|
| 3286 | if(array_addrs.length > 1) |
---|
| 3287 | cc_data[3] = array_addrs[1] ? array_addrs[1].replace("<",'').replace(">",'') : ''; |
---|
[2] | 3288 | else |
---|
| 3289 | cc_data[3] = array_addrs[0]; |
---|
[3035] | 3290 | |
---|
[106] | 3291 | var sm_envelope_img1 = '<img style="cursor:'+ (is_ie ? 'hand' : 'pointer') +'" title="' + get_lang("Add Contact") + |
---|
[790] | 3292 | '" onclick="ccQuickAddOne.showList(\''+cc_data+'\')" src="./templates/'+template+'/images/user_card.png">'; |
---|
[2] | 3293 | var to_addybook_add = "<SPAN id='insert_plugin_"+idx_cc+"_"+ID+"'>"; |
---|
| 3294 | to_addybook_add += addrs; |
---|
| 3295 | to_addybook_add += sm_envelope_img1; |
---|
| 3296 | idx_cc++; |
---|
| 3297 | to_addybook_add += "</SPAN>"; |
---|
| 3298 | return to_addybook_add; |
---|
| 3299 | } |
---|
| 3300 | function deny_email(email){ |
---|
| 3301 | connector.loadScript("filter"); |
---|
[375] | 3302 | connector.loadScript("filters"); |
---|
[2] | 3303 | var dn_em = document.createElement("SPAN"); |
---|
| 3304 | dn_em.id = "tt_d"; |
---|
[3809] | 3305 | dn_em.onclick = function(){filter.new_rule(email);}; |
---|
[106] | 3306 | dn_em.setAttribute("title",get_lang("Block Sender")); |
---|
[3035] | 3307 | dn_em.style.cursor = "pointer"; |
---|
[3809] | 3308 | dn_em.innerHTML = "<img align='top' src='./templates/"+template+"/images/deny.gif'>"; |
---|
[2] | 3309 | return dn_em; |
---|
[3035] | 3310 | |
---|
[2] | 3311 | } |
---|
[13] | 3312 | function show_div_address_full(id, type) { |
---|
| 3313 | var div_address_full = Element("div_"+type+"address_full_"+id); |
---|
| 3314 | if(!div_address_full) { |
---|
| 3315 | div_address_full = document.createElement("SPAN"); |
---|
[3035] | 3316 | div_address_full.id = "div_"+type+"address_full_"+id; |
---|
| 3317 | div_address_full.style.display="none"; |
---|
[13] | 3318 | var _address = eval(type+"address_array['"+id+"']"); |
---|
| 3319 | var isOverLimit = (_address.length > 100); |
---|
[3035] | 3320 | |
---|
[2] | 3321 | if(isOverLimit) { |
---|
[446] | 3322 | alert("Esse campo possui muitos endereços ("+_address.length+" destinatários).\r\n"+ |
---|
| 3323 | "Para evitar o travamento do navegador, o botão 'Adicionar Contato' foi desabilitado!"); |
---|
[2] | 3324 | } |
---|
[13] | 3325 | |
---|
| 3326 | for(var idx = 1 ; idx < _address.length;idx++) { |
---|
| 3327 | div_address_full.innerHTML += isOverLimit ? '<br>'+_address[idx] : ','+draw_plugin_cc(id,_address[idx]); |
---|
[3035] | 3328 | } |
---|
[13] | 3329 | div_address_full.innerHTML += " (<a STYLE='color: RED;' onclick=document.getElementById('div_"+type+"address_full_"+id+"').style.display='none';document.getElementById('div_"+type+"address_"+id+"').style.display='';>"+get_lang('less')+"</a>)"; |
---|
| 3330 | Element(type+"_"+id).appendChild(div_address_full); |
---|
[2] | 3331 | } |
---|
[13] | 3332 | Element('div_'+type+'address_'+id).style.display='none'; |
---|
| 3333 | div_address_full.style.display=''; |
---|
[46] | 3334 | } |
---|
| 3335 | function draw_footer_box(num_msgs){ |
---|
[689] | 3336 | folder = get_current_folder(); |
---|
[3287] | 3337 | connector.loadScript('wfolders'); |
---|
[3035] | 3338 | var span_R = Element("table_message"); |
---|
| 3339 | var span_options = Element("span_options"); |
---|
[58] | 3340 | if(!span_options) { |
---|
[3035] | 3341 | span_options = document.createElement("TD"); |
---|
[58] | 3342 | span_options.style.fontSize = "12"; |
---|
| 3343 | span_options.id = "span_options"; |
---|
[59] | 3344 | span_R.appendChild(span_options); |
---|
| 3345 | } |
---|
[69] | 3346 | |
---|
[790] | 3347 | var change_font_color = 'onmouseover="var last_class = this.className;'+ |
---|
[848] | 3348 | 'if (this.className != \'message_options_over\')'+ |
---|
| 3349 | 'this.className=\'message_options_active\'; '+ |
---|
[790] | 3350 | 'this.onmouseout=function(){this.className=last_class;}"'; |
---|
| 3351 | |
---|
| 3352 | span_options.innerHTML = |
---|
| 3353 | '<span class="message_options_trash"><span ' + change_font_color + ' title="'+get_lang("Delete")+'" class="message_options" onclick=proxy_mensagens.delete_msgs(\'null\',\'selected\',\'null\')>'+get_lang("Delete")+'</span></span>'+ |
---|
| 3354 | '<span class="message_options_move"><span ' + change_font_color + ' title="'+get_lang("Move")+'" class="message_options" onclick=wfolders.makeWindow(\"\",\"move_to\")>'+get_lang("Move")+'</span></span>'+ |
---|
[1141] | 3355 | ((expresso_offline)?" ":'<span class="message_options_print"><span ' + change_font_color + ' title="'+get_lang("Print")+'" class="message_options" onclick=print_all()>'+get_lang("Print")+'</span></span>')+ |
---|
[1121] | 3356 | // '<span class="message_options_print"><span ' + change_font_color + ' title="'+get_lang("Print")+'" class="message_options" onclick=print_all()>'+get_lang("Print")+'</span></span>'+ |
---|
[3035] | 3357 | ((expresso_offline)?" ":'<span class="message_options_export"><span ' + change_font_color + ' title="'+get_lang("Export")+'" class="message_options" onclick="proxy_mensagens.export_all_messages()">'+get_lang("Export")+'</span></span>') + |
---|
[1141] | 3358 | ((expresso_offline)?" ":'<span class="message_options_import"><span ' + change_font_color + ' title="'+get_lang("Import")+'" class="message_options" onclick="import_window()">'+get_lang("Import")+'</span></span>'); |
---|
[3035] | 3359 | if(preferences.use_local_messages==1 && !expresso_offline) |
---|
[1000] | 3360 | if(proxy_mensagens.is_local_folder(current_folder)) |
---|
| 3361 | span_options.innerHTML += ' <span title="'+get_lang("Unarchive")+'" class="message_options" onclick="expresso_local_messages.unarchive_msgs(\''+folder+'\',null)">'+get_lang("Unarchive")+'</span>'; |
---|
| 3362 | else |
---|
| 3363 | span_options.innerHTML += ' <span title="'+get_lang("Archive")+'" class="message_options" onclick="archive_msgs(\''+folder+'\',null)">'+get_lang("Archive")+'</span>'; |
---|
[69] | 3364 | if (use_spam_filter) { |
---|
[790] | 3365 | if ( current_folder == 'INBOX'+cyrus_delimiter+'Spam' ) { |
---|
| 3366 | span_options.innerHTML += ' | <span ' + change_font_color + ' title="'+get_lang("Not Spam")+'" class="message_options" onclick="nospam(\'selected\',\'null\',\'null\')">'+get_lang("Not Spam")+'</span>'; |
---|
[69] | 3367 | } |
---|
| 3368 | else { |
---|
[790] | 3369 | span_options.innerHTML += ' | <span ' + change_font_color + ' title="'+get_lang("Mark as Spam")+'" class="message_options" onclick="spam(\'null\', \'selected\',\'null\')">'+get_lang("Mark as Spam")+'</span>'; |
---|
[69] | 3370 | } |
---|
| 3371 | } |
---|
[3035] | 3372 | var span_D = Element("span_D"); |
---|
[58] | 3373 | if(!span_D){ |
---|
[3035] | 3374 | span_D = document.createElement("TD"); |
---|
[58] | 3375 | span_D.align = "right"; |
---|
| 3376 | span_D.style.fontSize = "12"; |
---|
| 3377 | span_D.id = "span_D"; |
---|
| 3378 | span_R.appendChild(span_D); |
---|
| 3379 | } |
---|
[3035] | 3380 | span_D.innerHTML = |
---|
[58] | 3381 | get_lang("List")+': '+ |
---|
[790] | 3382 | '<span ' + change_font_color + ' id="span_flag_SORTARRIVAL" class="'+(search_box_type == 'ALL' ? 'message_options_over' : 'message_options')+'" title="'+get_lang("All")+'" onclick="if(\'ALL\' == \''+search_box_type+'\') return false;sort_box(\'ALL\',\''+sort_box_type+'\')">'+get_lang("All")+'</span>, '+ |
---|
| 3383 | '<span ' + change_font_color + ' id="span_flag_UNSEEN" class="'+(search_box_type == 'UNSEEN' ? 'message_options_over' : 'message_options')+'" title="'+get_lang("l_unseen")+'" onclick="if(\'UNSEEN\' == \''+search_box_type+'\') return false;sort_box(\'UNSEEN\',\''+sort_box_type+'\')">'+get_lang("l_unseen")+'</span>, '+ |
---|
| 3384 | '<span ' + change_font_color + ' id="span_flag_SEEN" class="'+(search_box_type == 'SEEN' ? 'message_options_over' : 'message_options')+'" title="'+get_lang("l_seen")+'" onclick="if(\'SEEN\' == \''+search_box_type+'\') return false;sort_box(\'SEEN\',\''+sort_box_type+'\')">'+get_lang("l_seen")+'</span>, '+ |
---|
[3819] | 3385 | '<span ' + change_font_color + ' id="span_flag_ANSWERED" class="'+(search_box_type == 'ANSWERED' ? 'message_options_over' : 'message_options')+'" title="'+get_lang("title_answered")+'" onclick="if(\'ANSWERED\' == \''+search_box_type+'\') return false;sort_box(\'ANSWERED\',\''+sort_box_type+'\')">'+get_lang("l_answered")+'</span>, '+ |
---|
[790] | 3386 | '<span ' + change_font_color + ' id="span_flag_FLAGGED" class="'+(search_box_type == 'FLAGGED' ? 'message_options_over' : 'message_options')+'" title="'+get_lang("l_important")+'" onclick="if(\'FLAGGED\' == \''+search_box_type+'\') return false;sort_box(\'FLAGGED\',\''+sort_box_type+'\')">'+get_lang("l_important")+'</span> '; |
---|
[46] | 3387 | draw_paging(num_msgs); |
---|
[3035] | 3388 | Element("tot_m").innerHTML = num_msgs; |
---|
[1247] | 3389 | } |
---|