Changeset 4820
- Timestamp:
- 07/19/11 15:55:40 (13 years ago)
- Location:
- trunk/expressoMail1_2/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/common_functions.js
r4749 r4820 224 224 div_attachment = document.getElementById("id_div_attachment"); 225 225 var params = ''; 226 226 227 227 if (div_attachment == null){ 228 228 var div_attachment = document.createElement("DIV"); … … 343 343 344 344 divFile = document.createElement('div'); 345 var inputFile = document.createElement("input"); 346 inputFile.id = "inputFile_"+id_border+"_"+countDivFiles; 347 348 inputFile.name = "file_"+countDivFiles; 349 inputFile.type = "file"; 350 inputFile.size = 50; 351 inputFile.maxlength = 255; 352 353 inputFile.onchange = function () { 354 validateFileExtension(this.value, this.id.replace('input','div'), this.getAttribute('id_border')); 355 356 openTab.autosave_timer[id_border] = setTimeout("save_msg("+id_border+")", autosave_time); 357 }; 358 359 360 inputFile.onfocus = function () { 361 if (openTab.autosave_timer[id_border]) 362 clearTimeout(openTab.autosave_timer[id_border]); 363 }; 364 365 divFile.appendChild(inputFile); 366 var linkFile = document.createElement("a"); 367 linkFile.id = "linkFile_"+id_border+"_"+countDivFiles; 368 linkFile.href = 'javascript:void(0)'; 369 linkFile.onclick = function () { 370 removeFile("divFile_"+id_border+"_"+countDivFiles); return false; 371 }; 372 373 linkFile.innerHTML = get_lang("Remove"); 374 375 divFile.appendChild(linkFile); 376 divFile.id = "divFile_"+id_border+"_"+countDivFiles; 377 divFiles.appendChild(divFile); 345 346 var inputFile = document.createElement("input"); 347 inputFile.id = "inputFile_"+id_border+"_"+countDivFiles; 348 inputFile.name = "file_"+countDivFiles; 349 inputFile.type = "file"; 350 inputFile.size = 50; 351 inputFile.maxlength = 255; 352 inputFile.onchange = function () { 353 validateFileExtension(this.value, this.id.replace('input','div'), this.getAttribute('id_border')); 354 openTab.autosave_timer[id_border] = setTimeout("save_msg("+id_border+")", autosave_time); 355 }; 356 357 inputFile.onfocus = function () { 358 if (openTab.autosave_timer[id_border]) 359 clearTimeout(openTab.autosave_timer[id_border]); 360 }; 361 362 divFile.appendChild(inputFile); 363 364 var linkFile = document.createElement("a"); 365 linkFile.id = "linkFile_"+id_border+"_"+countDivFiles; 366 linkFile.href = 'javascript:void(0)'; 367 linkFile.onclick = function () {removeFile("divFile_"+id_border+"_"+countDivFiles); return false;}; 368 linkFile.innerHTML = get_lang("Remove"); 369 370 divFile.appendChild(linkFile); 371 divFile.id = "divFile_"+id_border+"_"+countDivFiles; 372 divFiles.appendChild(divFile); 378 373 379 374 return inputFile; -
trunk/expressoMail1_2/js/draw_api.js
r4814 r4820 923 923 // Draw the inbox and another folders 924 924 function draw_box(headers_msgs, msg_folder, alternate){ 925 925 /* 926 926 * When the paging response is not in the correct folder you need to change folder 927 927 * This occurs when the Ajax response is not fast enough and the user click in outher … … 1221 1221 // Passar o parâmetro offset para esta função 1222 1222 function make_tr_message(headers_msgs, msg_folder, offsetToGMT){ 1223 1224 1225 1226 1227 1223 if (typeof offsetToGMT == 'undefined') 1224 { 1225 // In older local messages headers_msgs.offsetToGMT is undefined. 1226 offsetToGMT = typeof headers_msgs.offsetToGMT != 'undefined'?headers_msgs.offsetToGMT:0; 1227 } 1228 1228 var tr_element = document.createElement('tr'); 1229 1229 if(typeof(preferences.line_height) != 'undefined') … … 1235 1235 if(headers_msgs.msg_sample && preferences.preview_msg_subject == "1") 1236 1236 { 1237 if (cssForResizing) //Colunas redimensionaveis - nao trunca 1238 tr_element.msg_sample = headers_msgs.msg_sample.body.substr(0,180) + "..."; //trecho do body que sera exibido com o assunto; 1239 else 1240 tr_element.msg_sample = headers_msgs.msg_sample.body.substr(0,120) + "..."; //trecho do body que sera exibido com o assunto; 1237 if (cssForResizing) //Colunas redimensionaveis - nao trunca 1238 tr_element.msg_sample = headers_msgs.msg_sample.body.substr(0,180) + "..."; //trecho do body que sera exibido com o assunto; 1239 else 1240 tr_element.msg_sample = headers_msgs.msg_sample.body.substr(0,120) + "..."; //trecho do body que sera exibido com o assunto; 1241 1241 } 1242 1242 … … 1406 1406 if ((headers_msgs.subject)&&(headers_msgs.subject.length > 50)) 1407 1407 { 1408 if (cssForResizing) 1409 //Colunas redimensionaveis - nao trunca 1410 td_element4.innerHTML += headers_msgs.subject + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample +"</span>"; 1411 else { 1412 //Modificacao para evitar que o truncamento do assunto quebre uma NCR - #11891413 pos = headers_msgs.subject.indexOf("&",45); 1414 if ((pos > 0) && (pos <= 50) && ((headers_msgs.subject.charAt(pos+5) == ";") || (headers_msgs.subject.charAt(pos+6) == ";"))) 1415 td_element4.innerHTML += headers_msgs.subject.substring(0,pos+6) + "..." + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample +"</span>"; 1416 else 1417 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; 1418 }1408 if (cssForResizing) 1409 //Colunas redimensionaveis - nao trunca 1410 td_element4.innerHTML += headers_msgs.subject + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample +"</span>"; 1411 else { 1412 //Modificacao para evitar que o truncamento do assunto quebre uma NCR - #1189 1413 pos = headers_msgs.subject.indexOf("&",45); 1414 if ((pos > 0) && (pos <= 50) && ((headers_msgs.subject.charAt(pos+5) == ";") || (headers_msgs.subject.charAt(pos+6) == ";"))) 1415 td_element4.innerHTML += headers_msgs.subject.substring(0,pos+6) + "..." + "<span style=\"color:#b3b3b3;\"> " + tr_element.msg_sample +"</span>"; 1416 else 1417 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; 1418 } 1419 1419 } 1420 1420 else … … 1567 1567 img_next_msg.style.cursor = 'pointer'; 1568 1568 1569 1570 1571 1572 1573 // folder_id = info_msg.original_ID ? info_msg.original_ID: info_msg.msg_number;1574 1569 var folder_id = ID.match(/\d+/)[0]; 1570 var folder; 1571 1572 //Correção para fazer funcionar e-mails assinados no formato encapsulado. 1573 // folder_id = info_msg.original_ID ? info_msg.original_ID: info_msg.msg_number; 1574 //if ((folder = document.getElementById(info_msg.msg_number)) == null) 1575 1575 if ((folder = Element(info_msg.original_ID)) == null) 1576 1576 folder = Element(info_msg.msg_number); … … 1579 1579 delete_border(ID); 1580 1580 return; 1581 }1581 } 1582 1582 if (folder){ // mensagem local criptografada nao tem ID da pasta local 1583 1583 if (folder.nextSibling){ … … 1801 1801 option_forward.onclick = function(){new_message('forward', ID);}; 1802 1802 option_forward.onmouseover=function () { this.className='message_options_active'; }; 1803 1803 option_forward.onmouseout=function () { this.className='message_options' }; 1804 1804 option_forward.innerHTML = get_lang('Forward'); 1805 1805 options.appendChild(space1); … … 2271 2271 div_attach.setAttribute("class", "expressomail-attachments"); 2272 2272 div_attach.setAttribute("className", "expressomail-attachments"); //for IE 2273 2273 2274 2274 var div_attach_lbl = document.createElement("span"); 2275 2275 div_attach_lbl.setAttribute("class", "expressomail-attachments-label"); … … 2282 2282 div_attach_list.setAttribute("className", "expressomail-attachments-list"); //for IE 2283 2283 2284 if(info_msg.attachments.length > 1) {2284 if(info_msg.attachments.length > 1) { 2285 2285 var li_link_attachment = document.createElement("LI"); 2286 var link_attachment= document.createElement("A");2286 var link_attachment = document.createElement("A"); 2287 2287 link_attachment.setAttribute("class", "expressomail-attachments-link"); 2288 2288 link_attachment.setAttribute("className", "expressomail-attachments-link"); //for IE 2289 2289 2290 if(proxy_mensagens.is_local_folder(current_folder))2291 link_attachment.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");2292 else2293 link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");2294 link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments');2290 if(proxy_mensagens.is_local_folder(current_folder)) 2291 link_attachment.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2292 else 2293 link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2294 link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments'); 2295 2295 li_link_attachment.appendChild(link_attachment); 2296 2296 div_attach_list.appendChild(li_link_attachment); 2297 }2297 } 2298 2298 2299 if(parseInt(preferences.remove_attachments_function))2300 {2299 if(parseInt(preferences.remove_attachments_function)) 2300 { 2301 2301 var li_link_attachment = document.createElement("LI"); 2302 2302 var link_attachment = document.createElement("A"); … … 2308 2308 li_link_attachment.appendChild(link_attachment); 2309 2309 div_attach_list.appendChild(li_link_attachment); 2310 }2311 2310 } 2311 2312 2312 for (var i=0; i<info_msg.attachments.length; i++) 2313 2313 { … … 2331 2331 link_attachment.appendChild(link_import_attachment); 2332 2332 } 2333 2333 2334 2334 li_link_attachment.appendChild(link_attachment); 2335 2335 div_attach_list.appendChild(li_link_attachment); … … 2346 2346 tr6.appendChild(td6); 2347 2347 tbody_message_others_options.appendChild(tr6); 2348 } 2348 } 2349 2349 //k!! 2350 2350 var div = document.createElement("DIV"); … … 2457 2457 //k 2458 2458 2459 if ( (info_msg.thumbs) && (info_msg.thumbs.length > 0)){2459 if ((info_msg.thumbs)&&(info_msg.thumbs.length > 0)){ 2460 2460 var div_thumbs = document.createElement("DIV"); 2461 2461 div_thumbs.setAttribute("class", "expressomail-thumbs"); … … 2473 2473 var div_thumbs_lbl_a = document.createElement("A"); 2474 2474 2475 if(info_msg.thumbs.length > 1){ 2476 if(proxy_mensagens.is_local_folder(current_folder))2475 if(info_msg.thumbs.length > 1){ 2476 if(proxy_mensagens.is_local_folder(current_folder)) 2477 2477 div_thumbs_lbl_a.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')"); 2478 2478 else … … 2487 2487 div_thumbs_lbl_sp.appendChild(div_thumbs_lbl_a); 2488 2488 div_thumbs_lbl.appendChild(div_thumbs_lbl_sp); 2489 2489 2490 2490 var div_thumbs_lbl_sp2 = document.createElement("SPAN"); 2491 2491 div_thumbs_lbl_sp2.setAttribute("class", "message_tips"); 2492 2492 div_thumbs_lbl_sp2.setAttribute("className", "message_tips"); //for IE 2493 2493 div_thumbs_lbl_sp2.innerHTML = get_lang("<strong>Tip:</strong> <span>For faster save, click over the image with <em>right button</em>.</span>"); 2494 2494 2495 2495 var ul_thumbs_list = document.createElement("UL"); 2496 2496 ul_thumbs_list.setAttribute("class", "expressomail-thumbs-list"); … … 2530 2530 show_div_address_full(ID,'cc'); 2531 2531 } 2532 2532 2533 2533 //k! 2534 2534 /* … … 2555 2555 }); 2556 2556 }); 2557 2557 } 2558 2558 //k!! 2559 2559 } … … 2650 2650 if(!expresso_offline) 2651 2651 var option_send_and_file= '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","send_and_file");>'+get_lang("Send and file")+'</span> | '; 2652 else 2652 else 2653 2653 var option_send_and_file=''; 2654 2654 } … … 2671 2671 2672 2672 tr_menu_new_message.appendChild(td_menu_new_message); 2673 2673 2674 2674 2675 2675 tbody_menu_new_message.appendChild(tr_menu_new_message); … … 2705 2705 var td1_2 = document.createElement("TD"); 2706 2706 tr1_2.style.display = 'none'; 2707 2707 td1_2.innerHTML = get_lang("Reply to")+":"; 2708 2708 td1_2.setAttribute("noWrap","true"); 2709 2709 td1_2.style.width = "1%"; 2710 2710 2711 2711 var td_replyto = document.createElement("TD"); 2712 2712 td_replyto.setAttribute("noWrap","true"); 2713 2713 td_replyto.style.width = "100%"; 2714 2714 2715 2715 var input_replyto = document.createElement('INPUT'); 2716 2716 input_replyto.id = "replyto_"+ID; 2717 2717 input_replyto.name = "input_replyto"; 2718 2718 input_replyto.setAttribute("tabIndex","1"); 2719 2719 input_replyto.style.width = "100%"; 2720 2720 input_replyto.setAttribute("wrap","soft"); 2721 2721 input_replyto.onfocus = function(){clearTimeout(parseInt(setTimeOutLayer)); search_contacts('onfocus', this.id);}; 2722 2722 input_replyto.onblur = function(){setTimeOutLayer=setTimeout('search_contacts("lostfocus","'+this.id+'")',100);}; 2723 2723 … … 3200 3200 tr5.appendChild(td5); 3201 3201 tr5.appendChild(td_return_receipt); 3202 3203 3204 3205 3206 3207 3208 3209 3210 document.createTextNode( get_lang('Send this mail as text plain') + '.') 3202 3203 if ( ! expresso_offline ) 3204 { 3205 var text_plain = td_return_receipt.appendChild( 3206 document.createElement( 'span' ) 3207 ).appendChild( 3208 document.createTextNode( ' | ' ) 3209 ).parentNode.appendChild( 3210 document.createTextNode( get_lang('Send this mail as text plain') + '.') 3211 3211 ).parentNode.appendChild( 3212 3212 document.createElement( 'input' ) 3213 3213 ); 3214 3214 text_plain.setAttribute( 'tabIndex', '-1' ); 3215 3215 text_plain.id = 'textplain_rt_checkbox_' + ID ; 3216 3216 text_plain.type = "checkbox"; 3217 3217 text_plain.onclick = function () 3218 3219 3220 3221 3218 { 3219 RichTextEditor.plain( this.checked ); 3220 document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : ''; 3221 }; 3222 3222 //text_plain = text_plain.parentNode.appendChild(input_checkbox); 3223 3224 3223 } 3224 3225 3225 3226 3226 tbody_message.appendChild(tr5); … … 3245 3245 } 3246 3246 3247 3247 /** 3248 * event to enable autosave_draft on file attachment 3249 */ 3250 function save_onchange_attachment_handler () { 3251 away = false; 3252 var save_link = Element("save_message_options_"+ID); 3253 save_link.onclick = function onclick(event) { 3254 openTab.toPreserve[ID] = true; 3255 save_msg(ID); 3256 }; 3257 save_link.className = 'message_options'; 3258 }; 3259 3248 3260 var add_files = document.createElement("A"); 3249 3261 add_files.setAttribute("href", "javascript:void(0)"); 3250 3251 add_files.onclick = function () { 3252 var obj = addFile(ID); 3253 if (preferences.auto_save_draft == 1 && obj) { 3254 if ( obj.addEventListener ) 3255 obj.addEventListener('click', save_onchange_attachment_handler, false); 3256 } 3257 return false; 3258 }; 3259 3262 add_files.onclick = function () { 3263 var obj = addFile(ID); 3264 if (preferences.auto_save_draft == 1 && obj) { 3265 if ( obj.addEventListener ) 3266 obj.addEventListener('click', save_onchange_attachment_handler, false); 3267 } 3268 return false; 3269 }; 3260 3270 add_files.innerHTML = get_lang("Attachments: add+"); 3261 3271 add_files.setAttribute("tabIndex","-1"); … … 3313 3323 draw_from_field(sel_from,tr1_1); 3314 3324 resizeWindow(); 3315 3325 3316 3326 if ( ! expresso_offline ) 3317 3327 { … … 3514 3524 td221.className = 'dsused'; 3515 3525 3516 td221.setAttribute("style","width: 100%"); 3517 3526 td221.setAttribute("style","width: 100%"); 3527 3518 3528 tr221.appendChild(td221); 3519 3529 tbody221.appendChild(tr221); … … 3700 3710 content_id_0.appendChild(table); 3701 3711 } 3702 var idx_cc = 0;3712 var idx_cc = 0; 3703 3713 3704 3714 function draw_plugin_cc(ID, addrs){ -
trunk/expressoMail1_2/js/main.js
r4818 r4820 1786 1786 var handler_delete_msg = function(data){refresh(preferences.alert_new_msg);}; 1787 1787 1788 if (data.append != true || !data)1788 if (data == null || data.append != true ) 1789 1789 { 1790 RichTextEditor.saveFlag = 0;1790 RichTextEditor.saveFlag = -1; 1791 1791 if (! data.append) 1792 if(data == 'Post-Content-Length') 1793 write_msg(get_lang('The size of this message has exceeded the limit (%1B).', preferences.max_attachment_size ? preferences.max_attachment_size : Element('upload_max_filesize').value)); 1794 else 1795 write_msg(get_lang('ERROR saving your message.')); 1792 write_msg('ERROR saving your message.'); 1796 1793 else 1797 1794 { … … 1815 1812 1816 1813 var newTitle = document.getElementById('subject_'+border_id).value; 1817 if (newTitle == '') 1818 newTitle = get_lang("No subject"); 1819 set_border_caption('border_id_'+border_id, newTitle); 1814 if (newTitle.length > 18) 1815 newTitle = newTitle.substr(18) + '...'; 1816 else if (newTitle == '') 1817 newTitle = get_lang("No subject"); 1818 document.getElementById('font_border_id_'+border_id).innerHTML = newTitle; 1820 1819 1821 1820 // Replace the embedded images for new uids 1822 var mainField = document.getElementById('body_'+border_id).contentWindow; 1823 var content_body = mainField.document.getElementsByTagName('body').item(0).innerHTML; 1824 var body_images = content_body.match(/msg_num=\d*/g); 1825 var images_part = content_body.match(/msg_part=\d*/g); 1826 if (body_images) 1821 var mainField = document.getElementById('body_'+border_id).contentWindow; 1822 var content_body = mainField.document.getElementsByTagName('body').item(0).innerHTML; 1823 var body_images = content_body.match(/msg_num=\d*/g); 1824 var folder_images = content_body.match(/msg_folder=[^&]*&/g); 1825 1826 if (body_images != null) 1827 1827 { 1828 for (var i=0; i<body_images.length; i++){ 1829 content_body = content_body.replace(body_images[i],"msg_num="+openTab.imapUid[border_id]); 1830 } 1831 var allImgs = new Array (images_part.length); 1832 var j=-1; 1833 for (var i in images_part){ 1834 1835 if (is_ie) 1836 if (i == 0) 1837 var image_number = parseInt(images_part[i].substr(9)); 1838 else 1839 image_number = "null"; 1840 else 1841 var image_number = parseInt(images_part[i].substr(9)); 1842 1843 if (! isNaN(image_number)) 1844 { 1845 if (! allImgs[image_number]) 1846 { 1847 allImgs[image_number] = true; 1848 j--; 1849 } 1850 content_body = content_body.replace(images_part[i],'msg_part='+j); 1851 } 1852 } 1853 content_body = content_body.replace(/msg_part=-/g,'msg_part='); 1854 1855 mainField.document.getElementsByTagName('body').item(0).innerHTML = content_body; 1856 } 1828 for (var i=0; i<body_images.length; i++) 1829 { 1830 if( folder_images != null) 1831 content_body = content_body.replace(folder_images[i], "msg_folder=INBOX" + cyrus_delimiter + draftsfolder +"&"); 1832 1833 content_body = content_body.replace(body_images[i],"msg_num="+openTab.imapUid[border_id]); 1834 } 1835 1836 var images_part = content_body.match(/msg_part=[0-9.]*/g); 1837 1838 if(images_part != null) 1839 { 1840 for (var x = 0; x < images_part.length; x++) 1841 { 1842 var position = images_part[x].substr(9,images_part[x].length); 1843 content_body = content_body.replace(images_part[x],'msg_part(||.|||.||)='+data.imagesParts[position]); 1844 } 1845 1846 } 1847 content_body = content_body.replace(/msg_part\(\|\|\.\|\|\|\.\|\|\)=/g,'msg_part='); 1848 1849 mainField.document.getElementsByTagName('body').item(0).innerHTML = content_body; 1850 } 1857 1851 1858 1852 //Replace all files to new files 1859 1853 var divFiles = Element("divFiles_"+border_id); 1860 elFiles = divFiles.getElementsByTagName("input"); 1861 var countCheck =0; 1862 for (var i=0; i<elFiles.length; i++) { 1863 if(elFiles[i].value !=""){ 1864 if (elFiles[i].type == "checkbox") { 1865 countCheck++; 1866 } 1867 else { 1868 elFiles[i].value =""; 1869 parantNodeFile = elFiles[i].parentNode.parentNode; 1870 parantNodeFile.removeChild(elFiles[i].parentNode); 1871 i--; 1872 } 1873 1874 } 1875 }; 1854 divFiles.innerHTML = ''; 1876 1855 1877 1856 var attach_files = connector.unserialize(data.files); 1878 1857 if (attach_files != null) { 1879 openTab.countFile[border_id] = attach_files.length; 1880 att_index = countCheck; 1881 for (att_index; att_index < attach_files.length; att_index++){ 1882 1883 var link_attachment = document.createElement("A"); 1884 var fileName = attach_files[att_index].substr(0,attach_files[att_index].indexOf('_SIZE_')); 1885 var fileSize = parseInt(attach_files[att_index].substr(attach_files[att_index].indexOf('_SIZE_')+6))/1024 1886 link_attachment.innerHTML = fileName + " ("+borkb((parseInt(fileSize)*1024))+")"; 1887 1888 var href = "'"+folder_id+"','"+data.msg_no+"','"+(att_index)+"','"+(att_index+2)+"','base64'"; 1889 1890 link_attachment.setAttribute("href", "javascript:download_attachments("+href+")"); 1891 1892 var a_tmp = href.split(','); 1893 a_tmp[2] = fileName; 1894 s_tmp = escape(connector.serialize(a_tmp)); 1895 1896 var check_attachment = document.createElement("INPUT"); 1897 check_attachment.type = 'CHECKBOX'; 1898 check_attachment.name = 'forwarding_attachments[]'; 1899 check_attachment.value = trim(s_tmp); 1900 1901 if (!divFiles.childNodes[0]) 1902 { 1903 divFiles.appendChild(document.createElement("BR")); 1904 } 1905 else 1906 { 1907 divFiles.insertBefore(document.createElement("BR"),divFiles.childNodes[0]); 1908 } 1909 1910 divFiles.insertBefore(link_attachment,divFiles.childNodes[0]); 1911 divFiles.insertBefore(check_attachment,divFiles.childNodes[0]); 1912 1913 check_attachment.checked = true; 1914 } 1915 } 1858 openTab.countFile[border_id] = attach_files.length; 1859 for (att_index = 0; att_index < attach_files.length; att_index++){ 1860 1861 var link_attachment = document.createElement("a"); 1862 var fileName = attach_files[att_index].substr(0, attach_files[att_index].lastIndexOf('_SIZE_')); 1863 var fileSize = parseInt(attach_files[att_index].substr(attach_files[att_index].lastIndexOf('_SIZE_')+6))/1024 1864 link_attachment.innerHTML = fileName + " ("+parseInt(fileSize)+" kb)"; 1865 1866 var href = "'"+folder_id+"','"+data.msg_no+"','"+(att_index)+"','0."+(att_index+1)+"','base64'"; 1867 1868 link_attachment.setAttribute("href", "javascript:download_attachments("+href+")"); 1869 1870 var a_tmp = href.split(','); 1871 a_tmp[2] = fileName; 1872 s_tmp = escape(connector.serialize(a_tmp)); 1873 1874 var check_attachment = document.createElement("input"); 1875 check_attachment.type = 'checkbox'; 1876 check_attachment.name = 'forwarding_attachments[]'; 1877 check_attachment.value = s_tmp; 1878 1879 check_attachment.checked = true; 1880 check_attachment.setAttribute("checked", "checked"); 1881 1882 divFiles.appendChild(check_attachment); 1883 divFiles.appendChild(link_attachment); 1884 divFiles.appendChild(document.createElement("br")); 1885 } 1886 } 1887 1916 1888 if (message_id) 1917 1889 { 1918 cExecute ("$this.imap_functions.delete_msgs&folder="+openTab.imapBox[border_id]+"&msgs_number="+message_id,handler_delete_msg); 1919 if (openTab.imapBox[0] == "INBOX/"+draftsfolder) 1920 { 1921 //Update mailbox 1922 var tr_msg = document.getElementById(message_id); 1923 change_tr_properties(tr_msg, data.msg_no, data.subject); 1924 } 1925 } else { 1926 refresh(); 1890 cExecute ("$this.imap_functions.delete_msgs&folder="+openTab.imapBox[border_id]+"&msgs_number="+message_id,handler_delete_msg); 1891 if (openTab.imapBox[0] == "INBOX" + cyrus_delimiter + draftsfolder) 1892 { 1893 //Update mailbox 1894 var tr_msg = document.getElementById(message_id); 1895 change_tr_properties(tr_msg, data.msg_no, data.subject); 1896 } 1897 1927 1898 } 1928 1899
Note: See TracChangeset
for help on using the changeset viewer.