- Timestamp:
- 07/15/11 18:03:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/js/draw_api.js
r4716 r4778 168 168 tree_folders = new dFTree({name: 'tree_folders'}); 169 169 170 var n_root = new dNode({id:'root', caption: get_lang("My Folders")}); 171 tree_folders.add(n_root,'anything'); //Places the root; second argument can be anything. 172 173 var unseen_in_mailbox = 0; 174 var unseen_in_shared_folders = 0; 175 for (var i=0; i<folders.length; i++){ 176 if (folders[i].folder_unseen > 0) 177 { 178 unseen_in_mailbox = parseInt( unseen_in_mailbox + folders[ i ].folder_unseen ); 179 if ( folders[i].folder_id.indexOf( 'INBOX' ) !== 0 ) 180 unseen_in_shared_folders = parseInt( unseen_in_shared_folders + folders[ i ].folder_unseen ); 181 182 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}); 183 184 if( folders[i].folder_name.toLowerCase() == 'inbox' ) 185 Element('new_m').innerHTML = '<font style="color:red">' + folders[i].folder_unseen + '</font>'; 186 } 187 else 188 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}); 189 190 if (folders[i].folder_parent == '') 191 folders[i].folder_parent = 'root'; 192 else if (folders[i].folder_parent == 'user'){ 193 194 if (!tree_folders.getNodeById('user')){ 195 tmpFolderId = folders[i].folder_id.split(cyrus_delimiter).pop(); 196 if (tmpFolderId != folders[i].folder_name) 197 { 198 translatedFolders.add(tmpFolderId, folders[i].folder_name); 199 } 200 var n_root_shared_folders = new dNode({id:'user', caption:get_lang("Shared folders"), plusSign:true}); 201 tree_folders.add(n_root_shared_folders,'root'); 202 } 203 } 204 tree_folders.add(nn,folders[i].folder_parent); 205 } 170 var n_root = new dNode({id:'root', caption: get_lang("My Folders")}); 171 tree_folders.add(n_root,'anything'); //Places the root; second argument can be anything. 172 173 var unseen_in_mailbox = 0; 174 var unseen_in_shared_folders = 0; 175 for (var i=0; i<folders.length; i++) 176 { 177 if (folders[i].folder_unseen > 0) 178 { 179 unseen_in_mailbox = parseInt( unseen_in_mailbox + folders[ i ].folder_unseen ); 180 if ( folders[i].folder_id.indexOf( 'INBOX' ) !== 0 ) 181 unseen_in_shared_folders = parseInt( unseen_in_shared_folders + folders[ i ].folder_unseen ); 182 183 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}); 184 185 if( folders[i].folder_name.toLowerCase() == 'inbox' ) 186 Element('new_m').innerHTML = '<font style="color:red">' + folders[i].folder_unseen + '</font>'; 187 } 188 else 189 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}); 190 191 if (folders[i].folder_parent == '') 192 folders[i].folder_parent = 'root'; 193 else if (folders[i].folder_parent == 'user') 194 { 195 196 if (!tree_folders.getNodeById('user')) 197 { 198 tmpFolderId = folders[i].folder_id.split(cyrus_delimiter).pop(); 199 if (tmpFolderId != folders[i].folder_name) 200 { 201 translatedFolders.add(tmpFolderId, folders[i].folder_name); 202 } 203 var n_root_shared_folders = new dNode({id:'user', caption:get_lang("Shared folders"), plusSign:true}); 204 tree_folders.add(n_root_shared_folders,'root'); 205 } 206 } 207 tree_folders.add(nn,folders[i].folder_parent); 208 } 206 209 } 207 210 //MAILARCHIVER … … 230 233 } 231 234 232 233 234 var handlerChannel = function(data){ 235 if (data == null || typeof(data) == 'string') 236 return; 237 /* 238 * RSS NEWS 239 */ 240 var root_rss = new dNode({ 241 id: "news_root", 242 caption: get_lang('News') 243 }); 244 tree_folders.add(root_rss, "root"); 245 for(i=0; i < data.length; i++) 246 { 247 var nodeNews = new dNode({ 248 id: "NEWS/"+data[i].name, 249 caption: data[i].name, 250 onClick: "open_rss('"+data[i].rss_url+"')", 251 plusSign: 0 252 }); 253 tree_folders.add(nodeNews,"news_root"); 254 } 255 var noden=document.getElementById('lnews_roottree_folders'); 256 noden.style.backgroundImage="url(templates/"+template+"/images/menu/rss.png)"; 257 } 258 // cExecute('$this.rss.getChannels',handlerChannel); 259 260 235 var handlerChannel = function(data) 236 { 237 238 if ( data == null || typeof(data) == 'string') 239 { 240 return false; 241 } 242 243 var nodeParent = document.getElementById('content_folders'); 244 var treeRss = new dFTree({name: 'treeRss'}); 245 var root_rss = new dNode({id:'news_root', caption: get_lang("News")}); 246 247 treeRss.add(root_rss,'anything'); 248 249 for( i=0; i < data.length; i++ ) 250 { 251 var nodeNews = new dNode( 252 { 253 id: "NEWS/"+data[i].name, 254 caption: data[i].name, 255 onClick: "open_rss('"+data[i].rss_url+"')", 256 plusSign: 0 257 }); 258 treeRss.add(nodeNews,"news_root"); 259 } 260 261 treeRss.draw( nodeParent ); 262 263 with ( document.getElementById('lnews_roottreeRss') ) 264 { 265 style.backgroundImage = "url(templates/"+template+"/images/menu/rss.png)"; 266 style.marginLeft = "2px"; 267 } 268 269 if( nodeParent.firstChild.id != ("dftree_" + treeRss.name ) ) 270 { 271 var _folder = Element(nodeParent.firstChild.id); 272 var _rssNews = Element("dftree_" + treeRss.name ); 273 274 nodeParent.insertBefore( _rssNews, _folder ); 275 } 276 277 } 278 279 if( eval(enabledReadRSS ) == true ) 280 cExecute('$this.rss.getChannels',handlerChannel); 261 281 262 282 tree_folders.draw(Element('content_folders')); … … 1087 1107 var spanSender = document.createElement("SPAN"); 1088 1108 spanSender.onmouseover = function (event) {this.style.textDecoration = "underline";try {InfoContact.begin(this,headers_msgs.from.email)} catch(e){};}; 1089 spanSender.onmouseout = function (){ try {this.style.textDecoration = "none";clearTimeout(InfoContact.timeout);} catch(e){}};1109 spanSender.onmouseout = function (){try {this.style.textDecoration = "none";clearTimeout(InfoContact.timeout);} catch(e){}}; 1090 1110 spanSender.innerHTML = headers_msgs.from.name != null ? headers_msgs.from.name : headers_msgs.from.email; 1091 1111 if (spanSender.innerHTML.indexOf(" ") == '-1' && spanSender.innerHTML.length > 25){ … … 1422 1442 var option_hide_more = document.createElement("SPAN"); 1423 1443 option_hide_more.className = 'message_options'; 1424 option_hide_more.onmouseover=function () { this.className='message_options_active';};1425 option_hide_more.onmouseout=function () { this.className='message_options'};1444 option_hide_more.onmouseover=function () {this.className='message_options_active';}; 1445 option_hide_more.onmouseout=function () {this.className='message_options'}; 1426 1446 options.align = 'right'; 1427 1447 option_hide_more.value = 'more_options'; … … 1446 1466 var option_mark_as_unseen = document.createElement("SPAN"); 1447 1467 option_mark_as_unseen.className = "message_options"; 1448 option_mark_as_unseen.onclick = function () { 1468 option_mark_as_unseen.onclick = function () {changeLinkState(this,'seen'); 1449 1469 proxy_mensagens.proxy_set_message_flag(folder_id,'unseen'); 1450 1470 write_msg(get_lang('Message marked as ')+get_lang("Unseen")); 1451 1471 }; 1452 option_mark_as_unseen.onmouseover=function () { this.className='message_options_active';};1453 option_mark_as_unseen.onmouseout=function () { this.className='message_options'};1472 option_mark_as_unseen.onmouseover=function () {this.className='message_options_active';}; 1473 option_mark_as_unseen.onmouseout=function () {this.className='message_options'}; 1454 1474 option_mark_as_unseen.innerHTML = get_lang("Unseen"); 1455 1475 … … 1457 1477 option_mark_important.className = 'message_options'; 1458 1478 option_mark_important.style.paddingLeft = "10px"; 1459 option_mark_important.onmouseover=function () { this.className='message_options_active';};1460 option_mark_important.onmouseout=function () { this.className='message_options'};1479 option_mark_important.onmouseover=function () {this.className='message_options_active';}; 1480 option_mark_important.onmouseout=function () {this.className='message_options'}; 1461 1481 1462 1482 if (info_msg.Flagged == "F"){ … … 1474 1494 } 1475 1495 else{ 1476 option_mark_important.onclick = function() { 1496 option_mark_important.onclick = function() {changeLinkState(this,'normal'); 1477 1497 proxy_mensagens.proxy_set_message_flag(folder_id,'flagged'); 1478 1498 write_msg(get_lang('Message marked as ')+get_lang("Important")); … … 1497 1517 option_forward.className = 'message_options'; 1498 1518 option_forward.onclick = function(){new_message('forward', ID);}; 1499 option_forward.onmouseover=function () { this.className='message_options_active';};1500 option_forward.onmouseout=function () { this.className='message_options'};1519 option_forward.onmouseover=function () {this.className='message_options_active';}; 1520 option_forward.onmouseout=function () {this.className='message_options'}; 1501 1521 option_forward.innerHTML = get_lang('Forward'); 1502 1522 options.appendChild(space1); … … 1507 1527 option_reply.onclick = function(){new_message('reply_with_history', ID);}; 1508 1528 option_reply.innerHTML = get_lang('Reply'); 1509 option_reply.onmouseover=function () { this.className='message_options_active';};1510 option_reply.onmouseout=function () { this.className='message_options'};1529 option_reply.onmouseover=function () {this.className='message_options_active';}; 1530 option_reply.onmouseout=function () {this.className='message_options'}; 1511 1531 1512 1532 options.appendChild(space2); … … 2218 2238 case 'important': 2219 2239 { 2220 el.onclick = function(){changeLinkState(el,'normal');proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'flagged'); 2240 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"))} 2221 2241 break; 2222 2242 } … … 2236 2256 case 'unseen': 2237 2257 { 2238 el.onclick = function(){ 2258 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"))} 2239 2259 break; 2240 2260 … … 2242 2262 case 'seen': 2243 2263 { 2244 el.onclick = function(){ 2264 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"))} 2245 2265 break; 2246 2266 … … 2372 2392 input_replyto.style.width = "100%"; 2373 2393 input_replyto.setAttribute("wrap","soft"); 2374 input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); 2394 input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus', this.id);}; 2375 2395 input_replyto.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 2376 2396 … … 2455 2475 input_to.style.width = "100%"; 2456 2476 input_to.setAttribute("wrap","soft"); 2457 input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); 2477 input_to.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus', this.id);}; 2458 2478 input_to.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 2459 2479 if (!is_ie) … … 2551 2571 input_cc.setAttribute("tabIndex","1"); 2552 2572 input_cc.style.width = "100%"; 2553 input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); 2573 input_cc.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus',this.id);}; 2554 2574 input_cc.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 2555 2575 if (!is_ie) … … 2633 2653 input_cco.setAttribute("tabIndex","1"); 2634 2654 input_cco.style.width = "100%"; 2635 input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); 2655 input_cco.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer));search_contacts('onfocus',this.id);}; 2636 2656 input_cco.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 2637 2657 … … 2709 2729 a_cc_link.setAttribute("href","javascript:void(0)"); 2710 2730 a_cc_link.setAttribute("tabIndex","-1"); 2711 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(); 2731 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;} 2712 2732 td2_link.appendChild(a_cc_link); 2713 2733 var space = document.createElement("span"); … … 2720 2740 a_cco_link.setAttribute("href","javascript:void(0)"); 2721 2741 a_cco_link.setAttribute("tabIndex","-1"); 2722 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(); 2742 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;} 2723 2743 td2_link.appendChild(a_cco_link); 2724 2744 var space = document.createElement("span"); … … 2731 2751 a_replyto_link.setAttribute("href","javascript:void(0)"); 2732 2752 a_replyto_link.setAttribute("tabIndex","-1"); 2733 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(); 2753 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;} 2734 2754 td2_link.appendChild(a_replyto_link); 2735 2755 tr_link.appendChild(td1_link); … … 2892 2912 var add_files = document.createElement("A"); 2893 2913 add_files.setAttribute("href", "javascript:void(0)"); 2894 add_files.onclick = function () { addFile(ID);return false;};2914 add_files.onclick = function () {addFile(ID);return false;}; 2895 2915 add_files.innerHTML = get_lang("Attachments: add+"); 2896 2916 add_files.setAttribute("tabIndex","-1");
Note: See TracChangeset
for help on using the changeset viewer.