Ignore:
Timestamp:
05/12/11 15:40:14 (13 years ago)
Author:
niltonneto
Message:

Ticket #1824 - Permitindo o envio de mail em texto puro.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/main.js

    r4151 r4366  
    7979 
    8080        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        } ); 
    8185        setTimeout('auto_refresh()', time_refresh); 
    8286 
     
    16451649        } 
    16461650 
    1647         if ( document.getElementById('viewsource_rt_checkbox').checked == true ) 
    1648                 document.getElementById('viewsource_rt_checkbox').click(); 
     1651        if ( document.getElementById('viewsource_rt_checkbox_' + ID).checked == true ) 
     1652                document.getElementById('viewsource_rt_checkbox_' + ID).click(); 
    16491653 
    16501654        var save_link = Element("save_message_options_"+ID); 
     
    16571661                send_message_return(data, this.ID_tmp); // this is a hack to escape quotation form connector bug 
    16581662        }; 
     1663 
     1664        var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + ID ); 
     1665        mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 
    16591666 
    16601667        var textArea = document.createElement("TEXTAREA"); 
     
    16621669        textArea.name = "body"; 
    16631670        body = document.getElementById("body_"+ID); 
    1664         textArea.value += '<body>\r\n'; 
    1665         textArea.value += body.contentWindow.document.body.innerHTML; 
    1666         textArea.value += '\r\n</body>'; 
     1671        textArea.value += ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 
    16671672        var input_folder = document.createElement("INPUT"); 
    16681673        input_folder.style.display='none'; 
     
    16981703        form.appendChild(input_folder); 
    16991704        form.appendChild(msg_id); 
     1705 
     1706        var mail_type = form.appendChild( document.createElement( 'input' ) ); 
     1707        mail_type.name = 'type'; 
     1708        mail_type.type = 'hidden'; 
     1709        mail_type.value = ( mail_as_plain ) ? 'plain' : 'html'; 
    17001710 
    17011711        var _subject = trim(Element("subject_"+ID).value); 
     
    19031913                withImage = false; 
    19041914 
    1905         var rt_checkbox = Element('viewsource_rt_checkbox'); 
     1915        var rt_checkbox = Element('viewsource_rt_checkbox_' + ID); 
    19061916        if (rt_checkbox == null) 
    19071917                return false; 
Note: See TracChangeset for help on using the changeset viewer.