Changeset 4281 for sandbox/2.2.0.2/expressoMail1_2/js/main.js
- Timestamp:
- 05/09/11 14:10:14 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/expressoMail1_2/js/main.js
r4231 r4281 5 5 var autosave_time = 20000; 6 6 7 var cabecalho = '<h4>ExpressoLivre - ExpressoMail</h4>';8 9 7 function init(){ 10 8 if (!is_ie) … … 22 20 23 21 preferences = data; 24 25 if(preferences.show_name_print_messages == "1") {26 var getUserName = document.getElementById("user_info");27 var userName = getUserName.innerHTML;28 var position = userName.indexOf("-");29 var userName = userName.substring(3, position);30 cabecalho = '<h4>' + userName;31 }32 33 22 current_folder="INBOX"; 34 23 … … 90 79 91 80 cExecute ("$this.functions.get_preferences", save_preferences); 81 cExecute ("phpgwapi.browser.isMobile", function( data ) 82 { 83 mobile_device = ( ( data.constructor == Boolean ) ? data : ( data === 'true' ) ); 84 } ); 92 85 setTimeout('auto_refresh()', time_refresh); 93 86 … … 897 890 } 898 891 var new_border_ID = draw_new_message(parseInt(border_ID)); 899 900 892 if(typeof(openTab.type[new_border_ID]) != "undefined") { 901 893 if(tabTypes[type] == openTab.type[new_border_ID]) { … … 918 910 } 919 911 } 920 921 912 if (new_border_ID == false) 922 913 { … … 1648 1639 } 1649 1640 1650 if ( document.getElementById('viewsource_rt_checkbox ').checked == true )1651 document.getElementById('viewsource_rt_checkbox ').click();1641 if ( document.getElementById('viewsource_rt_checkbox_' + ID).checked == true ) 1642 document.getElementById('viewsource_rt_checkbox_' + ID).click(); 1652 1643 1653 1644 var save_link = Element("save_message_options_"+ID); … … 1660 1651 send_message_return(data, this.ID_tmp); // this is a hack to escape quotation form connector bug 1661 1652 }; 1653 1654 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + ID ); 1655 mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 1662 1656 1663 1657 var textArea = document.createElement("TEXTAREA"); … … 1665 1659 textArea.name = "body"; 1666 1660 body = document.getElementById("body_"+ID); 1667 textArea.value += '<body>\r\n'; 1668 textArea.value += body.contentWindow.document.body.innerHTML; 1669 textArea.value += '\r\n</body>'; 1661 textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 1670 1662 var input_folder = document.createElement("INPUT"); 1671 1663 input_folder.style.display='none'; … … 1701 1693 form.appendChild(input_folder); 1702 1694 form.appendChild(msg_id); 1695 1696 var mail_type = form.appendChild( document.createElement( 'input' ) ); 1697 mail_type.name = 'type'; 1698 mail_type.type = 'hidden'; 1699 mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 1703 1700 1704 1701 var _subject = trim(Element("subject_"+ID).value); … … 1906 1903 withImage = false; 1907 1904 1908 var rt_checkbox = Element('viewsource_rt_checkbox ');1905 var rt_checkbox = Element('viewsource_rt_checkbox_' + border_id); 1909 1906 if (rt_checkbox == null) 1910 1907 return false; … … 1933 1930 var handler_save_msg = function(data){ return_save(data,this.tmp_border_id,this.tmp_folder_name,this.tmp_folder_id,this.message_id); } 1934 1931 1932 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + border_id ); 1933 mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 1934 1935 1935 var textArea = document.createElement("TEXTAREA"); 1936 1936 textArea.style.display='none'; … … 1939 1939 if (! body) 1940 1940 return; 1941 textArea.value += '<body>\r\n'; 1942 textArea.value += body.contentWindow.document.body.innerHTML; 1943 textArea.value += '\r\n</body>'; 1941 textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 1944 1942 var input_folder = document.createElement("INPUT"); 1945 1943 input_folder.style.display='none'; … … 1967 1965 form.appendChild(input_msgid); 1968 1966 form.appendChild(input_insertImg); 1967 1968 var mail_type = form.appendChild( document.createElement( 'input' ) ); 1969 mail_type.name = 'type'; 1970 mail_type.type = 'hidden'; 1971 mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 1969 1972 1970 1973 cExecuteForm ("$this.imap_functions.save_msg", form, handler_save_msg,border_id); … … 2161 2164 try{ 2162 2165 var html = '<br>'; 2163 html += cabecalho + "</h4><hr>";2166 html += "<h4>ExpressoLivre - ExpressoMail</h4>"; 2164 2167 html += folder+"<hr>"; 2165 2168 … … 2239 2242 } else{ 2240 2243 show_attachs = ""; 2241 } 2242 2244 } 2243 2245 var current_path = window.location.href.substr(0,window.location.href.lastIndexOf("/")); 2244 2245 var head = '<head><title></title><link href="'+current_path+'/templates/default/main.css" type="text/css" rel="stylesheet"></head>'; 2246 window_print.document.write(head); 2247 2246 var window_print_head = window_print.document.getElementsByTagName("head")[0]; 2247 // For IE 2248 if(typeof(window_print_head) == 'undefined'){ 2249 window_print_head = window_print.document.createElement("head"); 2250 window_print.document.appendChild(window_print_head); 2251 } 2252 var window_print_style = window_print.document.createElement("LINK"); 2253 window_print_style.href = current_path+'/templates/default/main.css'; 2254 window_print_style.type = "text/css"; 2255 window_print_style.rel = "stylesheet"; 2256 window_print_head.appendChild(window_print_style); 2257 2248 2258 while (1){ 2249 2259 try{ 2250 2260 var html ='<body>'; 2251 html += cabecalho + "</h4><hr>";2261 html += "<h4>ExpressoLivre - ExpressoMail</h4><hr>"; 2252 2262 html += '<table><tbody>'; 2253 2263 if(sender) … … 2275 2285 html += show_attachs; //to show the names of the attachments 2276 2286 html += "</tbody></table><hr>"; 2277 window_print.document. write(html + body.innerHTML);2287 window_print.document.body.innerHTML = html + body.innerHTML; 2278 2288 if(!is_ie){ 2279 2289 var tab_tags = window_print.document.getElementsByTagName("IMG"); … … 2503 2513 } 2504 2514 form_upload.innerHTML = '<form method="POST" name="form_import" enctype="multipart/form-data">'+get_lang('zip mails to import')+':<br>'+ 2505 '<input name="file_1" maxlength="255" size=" 40" id="file_1" type="file"><br>' +2515 '<input name="file_1" maxlength="255" size="50" id="file_1" type="file"><br>' + 2506 2516 '<input title="'+get_lang('Select a folder')+'" value="' + get_lang('Select a folder') + '"' + 'type="button" onclick="javascript:select_import_folder()"> ' + 2507 2517 '<input title="' + get_lang('Close') + '" value="' + get_lang('Close') + '"' +
Note: See TracChangeset
for help on using the changeset viewer.