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