Changeset 4493 for sandbox/2.2.0.2/expressoMail1_2/js/draw_api.js
- Timestamp:
- 05/24/11 13:54:20 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/expressoMail1_2/js/draw_api.js
r4461 r4493 668 668 } 669 669 670 function getStyle(el,styleProp) 671 { 670 function getStyle(el,styleProp) { 672 671 var x = document.getElementById(el); 673 672 if (x.currentStyle) … … 919 918 } 920 919 } 920 921 921 function setColSizesCookie() { 922 922 var str = "maillist_colsizes=" + colSizes[0].join() + ":" + colSizes[1].join(); … … 926 926 document.cookie = str; 927 927 } 928 928 929 function getColSizesCookie() { 929 930 var search = "maillist_colsizes="; … … 943 944 // Draw the inbox and another folders 944 945 function draw_box(headers_msgs, msg_folder, alternate){ 945 946 /* 946 /* 947 947 * When the paging response is not in the correct folder you need to change folder 948 948 * This occurs when the Ajax response is not fast enough and the user click in outher … … 1244 1244 // Passar o parâmetro offset para esta função 1245 1245 function make_tr_message(headers_msgs, msg_folder, offsetToGMT){ 1246 1247 1248 1249 1250 1246 if (typeof offsetToGMT == 'undefined') 1247 { 1248 // In older local messages headers_msgs.offsetToGMT is undefined. 1249 offsetToGMT = typeof headers_msgs.offsetToGMT != 'undefined'?headers_msgs.offsetToGMT:0; 1250 } 1251 1251 var tr_element = document.createElement('tr'); 1252 1252 if(typeof(preferences.line_height) != 'undefined') … … 1547 1547 //update_menu(); 1548 1548 } 1549 1549 1550 function draw_header_box(){ 1550 1551 switch(sort_box_type){ … … 1571 1572 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'>"; 1572 1573 } 1574 1573 1575 function draw_message(info_msg, ID){ 1574 1576 var content = document.getElementById('content_id_' + ID); … … 1588 1590 img_next_msg.style.cursor = 'pointer'; 1589 1591 1590 var folder_id = ID.match(/\d+/)[0]; 1591 var folder; 1592 1593 //Correção para fazer funcionar e-mails assinados no formato encapsulado. 1594 // folder_id = info_msg.original_ID ? info_msg.original_ID: info_msg.msg_number; 1595 if ((folder = document.getElementById(info_msg.original_ID)) == null) 1596 //if ((folder = document.getElementById(info_msg.msg_number)) == null) 1597 folder = document.getElementById(info_msg.msg_number); 1592 var folder_id = ID.match(/\d+/)[0]; 1593 var folder; 1594 1595 //Correção para fazer funcionar e-mails assinados no formato encapsulado. 1596 // folder_id = info_msg.original_ID ? info_msg.original_ID: info_msg.msg_number; 1597 //if ((folder = document.getElementById(info_msg.msg_number)) == null) 1598 if ((folder = Element(info_msg.original_ID)) == null) 1599 folder = Element(info_msg.msg_number); 1600 1598 1601 if (!folder){ 1599 1602 delete_border(ID); 1600 1603 return; 1601 1604 } 1602 1605 if (folder){ // mensagem local criptografada nao tem ID da pasta local 1603 1606 if (folder.nextSibling){ … … 1687 1690 var tbody_message = document.createElement("TBODY"); 1688 1691 table_message.border = "0"; 1689 table_message.width = "100%"; 1690 1692 //table_message.width = "100%"; 1693 //k! 1694 table_message.setAttribute("class", "expressomail-message-body"); 1695 table_message.setAttribute("className", "expressomail-message-body"); 1691 1696 ////////////////////////////////////////////////////////////////////////////////////////////////////// 1692 1697 //Make the options message. … … 1716 1721 1717 1722 td.innerHTML = _name.bold() + ', ' + info_msg.smalldate; 1723 //k! 1718 1724 if (info_msg.attachments && info_msg.attachments.length > 0) 1719 1725 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+"'>"; … … 1816 1822 option_forward.onclick = function(){new_message('forward', ID);}; 1817 1823 option_forward.onmouseover=function () { this.className='message_options_active'; }; 1818 1824 option_forward.onmouseout=function () { this.className='message_options' }; 1819 1825 option_forward.innerHTML = get_lang('Forward'); 1820 1826 options.appendChild(space1); … … 1964 1970 } 1965 1971 else{ 1966 //this.innerHTML += "Mais Informaᅵᅵes";1967 1972 this.value = 'more_cert'; 1968 1973 Element("div_message_scroll_"+ID).style.height = (_height - _offset)+"px"; … … 2281 2286 tr5.appendChild(subject); 2282 2287 tbody_message_others_options.appendChild(tr5); 2283 if ( info_msg.attachments && info_msg.attachments.length > 0 ){ 2284 var tr6 = document.createElement("TR"); 2285 tr6.className = "tr_message_header"; 2286 var td6 = document.createElement("TD"); 2287 td6.innerHTML = get_lang("Attachments: "); 2288 2289 var attachments = document.createElement("TD"); 2290 td6.vAlign = "top"; 2291 attachments.align='left'; 2292 if(info_msg.attachments.length >= 1) { 2293 if(info_msg.attachments.length > 1) { 2294 var link_attachment = document.createElement("A"); 2295 if(proxy_mensagens.is_local_folder(current_folder)) 2296 link_attachment.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2297 else 2298 link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2299 link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments'); 2300 attachments.appendChild(link_attachment); 2301 } 2302 if(parseInt(preferences.remove_attachments_function)) 2303 { 2304 attachments.appendChild(document.createTextNode(' ')); 2305 var del_attachments = document.createElement("A"); 2306 del_attachments.setAttribute("href", "javascript:remove_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2307 del_attachments.innerHTML = get_lang('remove all attachments'); 2308 attachments.appendChild(del_attachments); 2309 } 2310 attachments.appendChild(document.createElement('BR')); 2311 } 2312 2313 attachments.id = "attachments_" + ID; 2314 for (var i=0; i<info_msg.attachments.length; i++){ 2288 //k! 2289 if ( info_msg.attachments && info_msg.attachments.length > 0 ) 2290 { 2291 var div_attach = document.createElement("DIV"); 2292 div_attach.setAttribute("class", "expressomail-attachments"); 2293 div_attach.setAttribute("className", "expressomail-attachments"); //for IE 2294 2295 var div_attach_lbl = document.createElement("span"); 2296 div_attach_lbl.setAttribute("class", "expressomail-attachments-label"); 2297 div_attach_lbl.setAttribute("className", "expressomail-attachments-label"); //for IE 2298 div_attach_lbl.innerHTML = get_lang("Attachments: "); 2299 2300 var div_attach_list = document.createElement("UL"); 2301 div_attach_list.setAttribute("id", "attachments_" + ID); 2302 div_attach_list.setAttribute("class", "expressomail-attachments-list"); 2303 div_attach_list.setAttribute("className", "expressomail-attachments-list"); //for IE 2304 2305 if(info_msg.attachments.length > 1) { 2306 var li_link_attachment = document.createElement("LI"); 2307 var link_attachment = document.createElement("A"); 2308 link_attachment.setAttribute("class", "expressomail-attachments-link"); 2309 link_attachment.setAttribute("className", "expressomail-attachments-link"); //for IE 2310 2311 if(proxy_mensagens.is_local_folder(current_folder)) 2312 link_attachment.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2313 else 2314 link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2315 link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments'); 2316 li_link_attachment.appendChild(link_attachment); 2317 div_attach_list.appendChild(li_link_attachment); 2318 } 2319 2320 if(parseInt(preferences.remove_attachments_function)) 2321 { 2322 var li_link_attachment = document.createElement("LI"); 2323 var link_attachment = document.createElement("A"); 2324 link_attachment.setAttribute("class", "expressomail-attachments-link"); 2325 link_attachment.setAttribute("className", "expressomail-attachments-link"); //for IE 2326 link_attachment.setAttribute("href", "javascript:remove_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2327 link_attachment.innerHTML = get_lang('remove all attachments'); 2328 2329 li_link_attachment.appendChild(link_attachment); 2330 div_attach_list.appendChild(li_link_attachment); 2331 } 2332 2333 for (var i=0; i<info_msg.attachments.length; i++) 2334 { 2335 var li_link_attachment = document.createElement("LI"); 2315 2336 var link_attachment = document.createElement("A"); 2316 2337 link_attachment.setAttribute("href", proxy_mensagens.link_anexo(info_msg,i)); 2317 link_attachment.innerHTML = url_decode(info_msg.attachments[i].name) ;2318 link_attachment. innerHTML += " ("+borkb(info_msg.attachments[i].fsize)+")";2319 2320 if((url_decode(info_msg.attachments[i].name).indexOf(".ics")!=-1) ||2321 2338 link_attachment.innerHTML = url_decode(info_msg.attachments[i].name) + " ("+borkb(info_msg.attachments[i].fsize)+")"; 2339 link_attachment.setAttribute("name", url_decode(info_msg.attachments[i].name)); 2340 2341 //k trocar por match??? 2342 if((url_decode(info_msg.attachments[i].name).indexOf(".ics")!=-1) || (url_decode(info_msg.attachments[i].name).indexOf(".vcard")!=-1)) 2322 2343 { 2323 2344 //Link para importar calendário … … 2331 2352 link_attachment.appendChild(link_import_attachment); 2332 2353 } 2333 2334 link_attachment.innerHTML += '<br/>'; 2335 attachments.appendChild(link_attachment); 2336 } 2354 2355 li_link_attachment.appendChild(link_attachment); 2356 div_attach_list.appendChild(li_link_attachment); 2357 } 2358 div_attach.appendChild(div_attach_lbl); 2359 div_attach.appendChild(div_attach_list); 2360 2361 var tr6 = document.createElement("TR"); 2362 tr6.className = "tr_message_header"; 2363 var td6 = document.createElement("TD"); 2364 td6.setAttribute("colspan", "2"); 2365 td6.vAlign = "top"; 2366 td6.appendChild(div_attach); 2337 2367 tr6.appendChild(td6); 2338 tr6.appendChild(attachments);2339 2368 tbody_message_others_options.appendChild(tr6); 2340 } 2341 2342 2369 } 2370 //k!! 2343 2371 var div = document.createElement("DIV"); 2344 2372 div.id = "div_message_scroll_"+ID; 2345 div.style.background = 'WHITE'; 2346 div.style.overflow = "auto"; 2347 div.style.width = "100%"; 2373 div.setAttribute('class', 'div_message_scroll'); 2374 div.setAttribute('className', 'div_message_scroll'); //for IE 2348 2375 table_message_others_options.appendChild(tbody_message_others_options); 2349 2376 var tr = document.createElement("TR"); … … 2449 2476 //Make the thumbs of the message. 2450 2477 ////////////////////////////////////////////////////////////////////////////////////////////////////// 2451 if ((info_msg.thumbs)&&(info_msg.thumbs.length > 0)){ 2452 var table_message_thumbs = document.createElement("TABLE"); 2453 table_message_thumbs.width = "80%"; 2454 table_message_thumbs.style.borderTop = "2px solid rgb(170, 170, 170)"; 2455 var tbody_message_thumbs = document.createElement("TBODY"); 2456 var tr = document.createElement("TR"); 2457 tr.className = "tr_message_body"; 2458 var td = document.createElement("TD"); 2459 td.setAttribute("colSpan","2"); 2460 td.id = "body_thumbs_"+ID; 2461 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>"; 2462 var _link_attachments = ''; 2463 if(info_msg.thumbs.length > 1){ 2464 _link_attachments = document.createElement("A"); 2465 _link_attachments.className = "message_options"; 2466 if(proxy_mensagens.is_local_folder(current_folder)) 2467 _link_attachments.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2478 //k 2479 2480 if ( (info_msg.thumbs) && (info_msg.thumbs.length > 0) ){ 2481 var div_thumbs = document.createElement("DIV"); 2482 div_thumbs.setAttribute("class", "expressomail-thumbs"); 2483 div_thumbs.setAttribute("className", "expressomail-thumbs"); //for IE 2484 2485 var div_thumbs_lbl = document.createElement("DIV"); 2486 div_thumbs_lbl.setAttribute("class", "expressomail-thumbs-label"); 2487 div_thumbs_lbl.setAttribute("className", "expressomail-thumbs-label"); //for IE 2488 2489 var div_thumbs_lbl_sp = document.createElement("SPAN"); 2490 div_thumbs_lbl_sp.setAttribute("class", "message_options"); 2491 div_thumbs_lbl_sp.setAttribute("className", "message_options"); //for IE 2492 var div_thumbs_lbl_st = document.createElement("STRONG"); 2493 div_thumbs_lbl_st.innerHTML = info_msg.attachments.length+" "+get_lang("attachment")+(info_msg.attachments.length > 1 ? "s" : "")+" "+get_lang("in this message"); 2494 var div_thumbs_lbl_a = document.createElement("A"); 2495 2496 if(info_msg.thumbs.length > 1){ 2497 if(proxy_mensagens.is_local_folder(current_folder)) 2498 div_thumbs_lbl_a.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2468 2499 else 2469 _link_attachments.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2470 _link_attachments.innerHTML = get_lang('Download all atachments'); 2471 } 2472 2473 if(_link_attachments){ 2474 td.innerHTML += " :: "; 2475 td.appendChild(_link_attachments); 2476 } 2477 2478 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>."); 2479 td.innerHTML += "<BR>"; 2500 div_thumbs_lbl_a.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2501 div_thumbs_lbl_a.innerHTML = get_lang('Download all atachments'); 2502 } else { 2503 div_thumbs_lbl_a.setAttribute("style", "display:none; visibility:hidden;"); 2504 } 2505 2506 div_thumbs_lbl_sp.appendChild(div_thumbs_lbl_st); 2507 div_thumbs_lbl_sp.appendChild(document.createTextNode(' :: ')); 2508 div_thumbs_lbl_sp.appendChild(div_thumbs_lbl_a); 2509 div_thumbs_lbl.appendChild(div_thumbs_lbl_sp); 2510 2511 var div_thumbs_lbl_sp2 = document.createElement("SPAN"); 2512 div_thumbs_lbl_sp2.setAttribute("class", "message_tips"); 2513 div_thumbs_lbl_sp2.setAttribute("className", "message_tips"); //for IE 2514 div_thumbs_lbl_sp2.innerHTML = get_lang("<strong>Tip:</strong> <span>For faster save, click over the image with <em>right button</em>.</span>"); 2515 2516 var ul_thumbs_list = document.createElement("UL"); 2517 ul_thumbs_list.setAttribute("class", "expressomail-thumbs-list"); 2518 ul_thumbs_list.setAttribute("className", "expressomail-thumbs-list"); //for IE 2480 2519 2481 2520 for (var i=0; i<info_msg.thumbs.length; i++){ 2482 if ((i % 4) == 0) 2483 td.innerHTML += "<BR>"; 2484 td.innerHTML += info_msg.thumbs[i]; 2485 td.innerHTML += " "; 2486 } 2487 tr.appendChild(td); 2488 tbody_message_thumbs.appendChild(tr); 2489 table_message_thumbs.appendChild(tbody_message_thumbs); 2490 div.appendChild(table_message_thumbs); 2491 } 2521 var li = document.createElement("LI"); 2522 li.innerHTML += info_msg.thumbs[i]; 2523 ul_thumbs_list.appendChild(li); 2524 } 2525 2526 div_thumbs.appendChild(div_thumbs_lbl); 2527 div_thumbs.appendChild(div_thumbs_lbl_sp2); 2528 div_thumbs.appendChild(ul_thumbs_list); 2529 2530 div.appendChild(div_thumbs); 2531 } 2532 //k!! 2492 2533 ////////////////////////////////////////////////////////////////////////////////////////////////////// 2493 2534 table_message.appendChild(tbody_message); … … 2510 2551 show_div_address_full(ID,'cc'); 2511 2552 } 2512 2513 } 2553 2554 //k! 2555 /* 2556 * TODO: implementar o controle como preferência do usuário 2557 * 2558 */ 2559 var jcarousel = false; 2560 2561 if (jcarousel) { 2562 jQuery(document).ready(function() { 2563 jQuery('.expressomail-thumbs-list').attr('id', 'expressomail-thumbs-list'+ID); 2564 jQuery('.expressomail-thumbs-list').addClass('jcarousel-skin-default'); 2565 jQuery('#expressomail-thumbs-list'+ID).jcarousel({ 2566 // Configuration 2567 }); 2568 }); 2569 2570 //fancybox 2571 jQuery(document).ready(function() { 2572 jQuery(".expressomail-thumbs-list li a").attr('onclick', 'return true;'); 2573 jQuery(".expressomail-thumbs-list li a").fancybox({ 2574 'hideOnContentClick': true, 2575 'type': 'image' 2576 }); 2577 }); 2578 } 2579 //k!! 2580 } 2581 2514 2582 function changeLinkState(el,state){ 2515 2583 el.innerHTML = get_lang(state); … … 2551 2619 } 2552 2620 } 2621 2553 2622 function draw_new_message(border_ID){ 2554 2623 connector.loadScript("color_palette"); … … 2646 2715 sel_from.id = "from_"+ID; 2647 2716 sel_from.name = "input_from"; 2648 sel_from.style.width = " 70%";2717 sel_from.style.width = "100%"; 2649 2718 sel_from.setAttribute("wrap","soft"); 2650 2719 td_from.appendChild(sel_from); … … 2657 2726 var td1_2 = document.createElement("TD"); 2658 2727 tr1_2.style.display = 'none'; 2659 2728 td1_2.innerHTML = get_lang("Reply to")+":"; 2660 2729 td1_2.setAttribute("noWrap","true"); 2661 2730 td1_2.style.width = "1%"; 2662 2731 2663 2732 var td_replyto = document.createElement("TD"); 2664 2733 td_replyto.setAttribute("noWrap","true"); 2665 2734 td_replyto.style.width = "100%"; 2666 2735 2667 2736 var input_replyto = document.createElement('INPUT'); 2668 2737 input_replyto.id = "replyto_"+ID; 2669 2738 input_replyto.name = "input_replyto"; 2670 2739 input_replyto.setAttribute("tabIndex","1"); 2671 2740 input_replyto.style.width = "100%"; 2672 2741 input_replyto.setAttribute("wrap","soft"); 2673 2742 input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);}; 2674 2743 input_replyto.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 2675 2744 … … 3045 3114 input_subject.name = "input_subject"; 3046 3115 input_subject.setAttribute("tabIndex","1"); 3047 input_subject.style.width = " 90%";3116 input_subject.style.width = "100%"; 3048 3117 input_subject.setAttribute("autocomplete","off"); 3049 3118 td_subject.appendChild(input_subject); … … 3351 3420 } 3352 3421 } 3422 3353 3423 function updateBoxBgColor(box){ 3354 3424 // Set first TR Class … … 3641 3711 content_id_0.appendChild(table); 3642 3712 } 3643 3644 function draw_plugin_cc(ID, addrs) 3645 {3713 var idx_cc = 0; 3714 3715 function draw_plugin_cc(ID, addrs){ 3646 3716 connector.loadScript("ccQuickAdd"); 3647 3717 … … 3681 3751 return to_addybook_add; 3682 3752 } 3753 3683 3754 function deny_email(email){ 3684 3755 connector.loadScript("filter"); … … 3693 3764 3694 3765 } 3766 3695 3767 function show_div_address_full(id, type) { 3696 3768 var div_address_full = Element("div_"+type+"address_full_"+id); … … 3716 3788 div_address_full.style.display=''; 3717 3789 } 3790 3718 3791 function draw_footer_box(num_msgs){ 3719 3792 folder = get_current_folder();
Note: See TracChangeset
for help on using the changeset viewer.