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