- Timestamp:
- 07/21/11 16:56:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/js/main.js
r4831 r4848 1835 1835 if (data == null || data.append != true ) 1836 1836 { 1837 RichTextEditor.saveFlag = -1;1837 RichTextEditor.saveFlag = 0; 1838 1838 if (! data.append) 1839 write_msg('ERROR saving your message.'); 1839 if(data == 'Post-Content-Length') 1840 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)); 1841 else 1842 write_msg(get_lang('ERROR saving your message.')); 1840 1843 else 1841 1844 { … … 1859 1862 1860 1863 var newTitle = document.getElementById('subject_'+border_id).value; 1861 if (newTitle.length > 18) 1862 newTitle = newTitle.substr(18) + '...'; 1863 else if (newTitle == '') 1864 if (newTitle == '') 1864 1865 newTitle = get_lang("No subject"); 1865 document.getElementById('font_border_id_'+border_id).innerHTML = newTitle;1866 set_border_caption('border_id_'+border_id, newTitle); 1866 1867 1867 1868 // Replace the embedded images for new uids 1868 var mainField = document.getElementById('body_'+border_id).contentWindow; 1869 var content_body = mainField.document.getElementsByTagName('body').item(0).innerHTML; 1870 var body_images = content_body.match(/msg_num=\d*/g); 1871 var folder_images = content_body.match(/msg_folder=[^&]*&/g); 1872 1873 if (body_images != null) 1869 var mainField = document.getElementById('body_'+border_id).contentWindow; 1870 var content_body = mainField.document.getElementsByTagName('body').item(0).innerHTML; 1871 var body_images = content_body.match(/msg_num=\d*/g); 1872 var images_part = content_body.match(/msg_part=\d*/g); 1873 if (body_images) 1874 1874 { 1875 for (var i=0; i<body_images.length; i++) 1876 { 1877 if( folder_images != null) 1878 content_body = content_body.replace(folder_images[i], "msg_folder=INBOX" + cyrus_delimiter + draftsfolder +"&"); 1879 1875 for (var i=0; i<body_images.length; i++){ 1880 1876 content_body = content_body.replace(body_images[i],"msg_num="+openTab.imapUid[border_id]); 1881 1877 } 1882 1878 1883 var images_part = content_body.match(/msg_part=[0-9.]*/g); 1884 1885 if(images_part != null) 1886 { 1887 for (var x = 0; x < images_part.length; x++) 1879 var allImgs = new Array (images_part.length); 1880 var j=-1; 1881 for (var i in images_part){ 1882 1883 if (is_ie) 1884 if (i == 0) 1885 var image_number = parseInt(images_part[i].substr(9)); 1886 else 1887 image_number = "null"; 1888 else 1889 var image_number = parseInt(images_part[i].substr(9)); 1890 1891 if (! isNaN(image_number)) 1888 1892 { 1889 var position = images_part[x].substr(9,images_part[x].length); 1890 content_body = content_body.replace(images_part[x],'msg_part(||.|||.||)='+data.imagesParts[position]); 1893 if (! allImgs[image_number]) 1894 { 1895 allImgs[image_number] = true; 1896 j--; 1897 } 1898 content_body = content_body.replace(images_part[i],'msg_part='+j); 1891 1899 } 1892 1900 content_body = content_body.replace(/msg_part=-/g,'msg_part='); 1893 1901 } 1894 content_body = content_body.replace(/msg_part\(\|\|\.\|\|\|\.\|\|\)=/g,'msg_part=');1895 1896 1902 mainField.document.getElementsByTagName('body').item(0).innerHTML = content_body; 1897 1903 } … … 1899 1905 //Replace all files to new files 1900 1906 var divFiles = Element("divFiles_"+border_id); 1901 divFiles.innerHTML = ''; 1907 elFiles = divFiles.getElementsByTagName("input"); 1908 var countCheck =0; 1909 for (var i=0; i<elFiles.length; i++) { 1910 if(elFiles[i].value !=""){ 1911 if (elFiles[i].type == "checkbox") { 1912 countCheck++; 1913 } 1914 else { 1915 elFiles[i].value =""; 1916 parantNodeFile = elFiles[i].parentNode.parentNode; 1917 parantNodeFile.removeChild(elFiles[i].parentNode); 1918 i--; 1919 } 1920 } 1921 } 1902 1922 1903 1923 var attach_files = connector.unserialize(data.files); 1904 1924 if (attach_files != null) { 1905 1925 openTab.countFile[border_id] = attach_files.length; 1906 for (att_index = 0; att_index < attach_files.length; att_index++){ 1926 att_index = countCheck; 1927 for (att_index; att_index < attach_files.length; att_index++) 1928 { 1907 1929 1908 1930 var link_attachment = document.createElement("a"); 1909 var fileName = attach_files[att_index].substr(0, attach_files[att_index].lastIndexOf('_SIZE_'));1910 var fileSize = parseInt(attach_files[att_index].substr(attach_files[att_index].lastIndexOf('_SIZE_')+6))/10241911 link_attachment.innerHTML = fileName + " ("+parseInt(fileSize)+" kb)";1912 1913 var href = "'"+folder_id+"','"+data.msg_no+"','"+(att_index)+"',' 0."+(att_index+1)+"','base64'";1931 var fileName = attach_files[att_index].substr(0,attach_files[att_index].indexOf('_SIZE_')); 1932 var fileSize = parseInt(attach_files[att_index].substr(attach_files[att_index].indexOf('_SIZE_')+6))/1024 1933 link_attachment.innerHTML = fileName + " ("+borkb((parseInt(fileSize)*1024))+")"; 1934 1935 var href = "'"+folder_id+"','"+data.msg_no+"','"+(att_index)+"','"+(att_index+2)+"','base64'"; 1914 1936 1915 1937 link_attachment.setAttribute("href", "javascript:download_attachments("+href+")"); … … 1919 1941 s_tmp = escape(connector.serialize(a_tmp)); 1920 1942 1921 var check_attachment = document.createElement("input"); 1922 check_attachment.type = 'checkbox'; 1923 check_attachment.name = 'forwarding_attachments[]'; 1924 check_attachment.value = s_tmp; 1943 var check_attachment = document.createElement("INPUT"); 1944 check_attachment.type = 'CHECKBOX'; 1945 check_attachment.name = 'forwarding_attachments[]'; 1946 check_attachment.value = trim(s_tmp); 1947 1948 if (!divFiles.childNodes[0]) 1949 { 1950 divFiles.appendChild(document.createElement("BR")); 1951 } 1952 else 1953 { 1954 divFiles.insertBefore(document.createElement("BR"),divFiles.childNodes[0]); 1955 } 1956 1957 divFiles.insertBefore(link_attachment,divFiles.childNodes[0]); 1958 divFiles.insertBefore(check_attachment,divFiles.childNodes[0]); 1925 1959 1926 1960 check_attachment.checked = true; … … 1942 1976 change_tr_properties(tr_msg, data.msg_no, data.subject); 1943 1977 } 1944 1978 } else { 1979 refresh(); 1945 1980 } 1946 1981
Note: See TracChangeset
for help on using the changeset viewer.