Ignore:
Timestamp:
05/10/11 10:31:11 (13 years ago)
Author:
airton
Message:

Ticket #1820 - Corrige local do opcao do envio de email em texto puro - r4258

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.2.0.2/expressoMail1_2/js/rich_text_editor.js

    r4291 r4301  
    2525                parentDiv.appendChild(this.table); 
    2626 
    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';  
     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';  
    2929        if(!Element(this.editor)) 
    3030        { 
     
    168168                } 
    169169                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"; 
    172179                        editor.contentWindow.document.body.innerHTML = ''; 
    173180 
     
    176183                        textarea.style.height = '300px'; 
    177184                        textarea.style.fontSize = '12pt'; 
    178                         textarea.innerHTML = html.nodeValue.replace( /<br\s*\/?>/mg, "\n" ).replace( /(<([^>]+)>)/ig, '' ); 
     185                        textarea.innerHTML = html; 
    179186 
    180187                        editor.style.width = '0px'; 
     
    201208                        editor.style.visibility = 'visible'; 
    202209                                                this.loadEditor( this.id ); 
     210                                                 
     211                                                setTimeout( function( ) { editor.contentWindow.focus( ); }, 100 ); 
    203212                                        } 
    204213                                } 
Note: See TracChangeset for help on using the changeset viewer.