Changeset 4258 for branches/2.2.0.1
- Timestamp:
- 05/06/11 17:01:31 (13 years ago)
- Location:
- branches/2.2.0.1/expressoMail1_2/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.0.1/expressoMail1_2/js/draw_api.js
r4253 r4258 2616 2616 2617 2617 tr_menu_new_message.appendChild(td_menu_new_message); 2618 2619 if ( ! expresso_offline )2620 {2621 var text_plain = td_menu_new_message.appendChild(2622 document.createElement( 'span' )2623 ).appendChild(2624 document.createTextNode( ' | ' )2625 ).parentNode.appendChild(2626 document.createElement( 'input' )2627 ).parentNode.appendChild(2628 document.createTextNode( get_lang('Send this mail as text plain') + '.')2629 ).previousSibling;2630 text_plain.setAttribute( 'tabIndex', '-1' );2631 text_plain.id = 'textplain_rt_checkbox_' + ID ;2632 text_plain.type = "checkbox";2633 text_plain.onclick = function ()2634 {2635 RichTextEditor.plain( ( ! this.checked ) ? this.checked : mobile_device || ( this.checked = confirm( 'The text format will be lost.' ) ) );2636 document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : '';2637 };2638 }2639 2618 2640 2619 tbody_menu_new_message.appendChild(tr_menu_new_message); … … 3165 3144 tr5.appendChild(td5); 3166 3145 tr5.appendChild(td_return_receipt); 3146 3147 if ( ! expresso_offline ) 3148 { 3149 var text_plain = td_return_receipt.appendChild( 3150 document.createElement( 'span' ) 3151 ).appendChild( 3152 document.createTextNode( ' | ' ) 3153 ).parentNode.appendChild( 3154 document.createTextNode( get_lang('Send this mail as text plain') + '.') 3155 ).parentNode.appendChild( 3156 document.createElement( 'input' ) 3157 ); 3158 text_plain.setAttribute( 'tabIndex', '-1' ); 3159 text_plain.id = 'textplain_rt_checkbox_' + ID ; 3160 text_plain.type = "checkbox"; 3161 text_plain.onclick = function () 3162 { 3163 RichTextEditor.plain( this.checked ); 3164 document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : ''; 3165 }; 3166 } 3167 3167 3168 tbody_message.appendChild(tr5); 3168 3169 if (parseInt(preferences.use_important_flag)) -
branches/2.2.0.1/expressoMail1_2/js/main.js
r4252 r4258 1659 1659 textArea.name = "body"; 1660 1660 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>' ) );1661 textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 1662 1662 var input_folder = document.createElement("INPUT"); 1663 1663 input_folder.style.display='none'; … … 1903 1903 withImage = false; 1904 1904 1905 var rt_checkbox = Element('viewsource_rt_checkbox_' + ID);1905 var rt_checkbox = Element('viewsource_rt_checkbox_' + border_id); 1906 1906 if (rt_checkbox == null) 1907 1907 return false; … … 1930 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); } 1931 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 1932 1935 var textArea = document.createElement("TEXTAREA"); 1933 1936 textArea.style.display='none'; … … 1936 1939 if (! body) 1937 1940 return; 1938 textArea.value += '<body>\r\n'; 1939 textArea.value += body.contentWindow.document.body.innerHTML; 1940 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>' ) ); 1941 1942 var input_folder = document.createElement("INPUT"); 1942 1943 input_folder.style.display='none'; … … 1964 1965 form.appendChild(input_msgid); 1965 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'; 1966 1972 1967 1973 cExecuteForm ("$this.imap_functions.save_msg", form, handler_save_msg,border_id); -
branches/2.2.0.1/expressoMail1_2/js/rich_text_editor.js
r4252 r4258 166 166 } 167 167 else{ 168 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + this.id ); 169 168 170 html = document.createTextNode( editor.contentWindow.document.body.innerHTML ); 171 html = html.nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' ).replace( /^[\n ]+|[\n ]+$/g, '' ); 172 173 if ( ! mobile_device && html != '' && ! ( mail_as_plain.checked = confirm( 'The text format will be lost.' ) ) ) 174 return false; 175 169 176 this.table.style.visibility="hidden"; 170 177 editor.contentWindow.document.body.innerHTML = ''; … … 174 181 textarea.style.height = '300px'; 175 182 textarea.style.fontSize = '12pt'; 176 textarea.innerHTML = html .nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' );183 textarea.innerHTML = html; 177 184 178 185 editor.style.width = '0px';
Note: See TracChangeset
for help on using the changeset viewer.