Changeset 4301 for sandbox/2.2.0.2/expressoMail1_2
- Timestamp:
- 05/10/11 10:31:11 (13 years ago)
- Location:
- sandbox/2.2.0.2/expressoMail1_2/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.2.0.2/expressoMail1_2/js/draw_api.js
r4298 r4301 2616 2616 tr_menu_new_message.appendChild(td_menu_new_message); 2617 2617 2618 if ( ! expresso_offline )2619 {2620 var text_plain = td_menu_new_message.appendChild(2621 document.createElement( 'span' )2622 ).appendChild(2623 document.createTextNode( ' | ' )2624 ).parentNode.appendChild(2625 document.createTextNode( get_lang('Send this mail as text plain') + '.')2626 );2627 // changed to work in ie2628 input_checkbox = document.createElement('input');2629 input_checkbox.setAttribute('class', 'checkbox');2630 input_checkbox.setAttribute('type', 'checkbox');2631 input_checkbox.setAttribute('tabIndex', '-1');2632 input_checkbox.setAttribute('id', 'textplain_rt_checkbox_' + ID);2633 2634 2635 input_checkbox.onclick = function ()2636 {2637 RichTextEditor.plain( ( ! this.checked ) ? this.checked : mobile_device || ( this.checked = confirm( 'The text format will be lost.' ) ) );2638 document.getElementById( 'viewsource_rt_checkbox_' + ID ).parentNode.style.display = ( this.checked ) ? 'none' : '';2639 };2640 text_plain.parentNode.appendChild(input_checkbox);2641 }2642 2618 2643 2619 tbody_menu_new_message.appendChild(tr_menu_new_message); … … 3168 3144 tr5.appendChild(td5); 3169 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 3168 3170 3169 tbody_message.appendChild(tr5); 3171 3170 if (parseInt(preferences.use_important_flag)) -
sandbox/2.2.0.2/expressoMail1_2/js/main.js
r4291 r4301 1674 1674 body = document.getElementById("body_"+ID); 1675 1675 1676 textArea.value += ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) );1676 textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 1677 1677 1678 1678 var input_folder = document.createElement("INPUT"); … … 1920 1920 withImage = false; 1921 1921 1922 var rt_checkbox = Element('viewsource_rt_checkbox_' + ID);1922 var rt_checkbox = Element('viewsource_rt_checkbox_' + border_id); 1923 1923 if (rt_checkbox == null) 1924 1924 return false; … … 1947 1947 var handler_save_msg = function(data){ return_save(data,this.tmp_border_id,this.tmp_folder_name,this.tmp_folder_id,this.message_id); } 1948 1948 1949 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + border_id ); 1950 mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 1951 1949 1952 var textArea = document.createElement("TEXTAREA"); 1950 1953 textArea.style.display='none'; … … 1953 1956 if (! body) 1954 1957 return; 1955 textArea.value += '<body>\r\n';1956 textArea.value += body.contentWindow.document.body.innerHTML;1957 textArea.value += '\r\n</body>';1958 1959 textArea.value = ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 1960 1958 1961 var input_folder = document.createElement("INPUT"); 1959 1962 input_folder.style.display='none'; … … 1982 1985 form.appendChild(input_insertImg); 1983 1986 1987 var mail_type = form.appendChild( document.createElement( 'input' ) ); 1988 mail_type.name = 'type'; 1989 mail_type.type = 'hidden'; 1990 mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 1991 1984 1992 cExecuteForm ("$this.imap_functions.save_msg", form, handler_save_msg,border_id); 1985 1993 } -
sandbox/2.2.0.2/expressoMail1_2/js/rich_text_editor.js
r4291 r4301 25 25 parentDiv.appendChild(this.table); 26 26 27 28 27 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + this.id ); 28 this.table.style.visibility = ( mail_as_plain && mail_as_plain.checked ) ? 'hidden' : 'visible'; 29 29 if(!Element(this.editor)) 30 30 { … … 168 168 } 169 169 else{ 170 html = document.createTextNode( editor.contentWindow.document.body.innerHTML ); 171 this.table.style.visibility="hidden"; 170 var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + this.id ); 171 html = document.createTextNode( editor.contentWindow.document.body.innerHTML ); 172 173 html = html.nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' ).replace( /^[\n ]+|[\n ]+$/g, '' ); 174 175 if ( ! mobile_device && html != '' && ! ( mail_as_plain.checked = confirm( 'The text format will be lost.' ) ) ) 176 return false; 177 178 this.table.style.visibility="hidden"; 172 179 editor.contentWindow.document.body.innerHTML = ''; 173 180 … … 176 183 textarea.style.height = '300px'; 177 184 textarea.style.fontSize = '12pt'; 178 textarea.innerHTML = html .nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' );185 textarea.innerHTML = html; 179 186 180 187 editor.style.width = '0px'; … … 201 208 editor.style.visibility = 'visible'; 202 209 this.loadEditor( this.id ); 210 211 setTimeout( function( ) { editor.contentWindow.focus( ); }, 100 ); 203 212 } 204 213 }
Note: See TracChangeset
for help on using the changeset viewer.