Ignore:
Timestamp:
05/06/11 16:17:48 (13 years ago)
Author:
rafaelraymundo
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.0.1/expressoMail1_2/js/main.js

    r4197 r4252  
    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 
     
    886890                } 
    887891        var new_border_ID = draw_new_message(parseInt(border_ID)); 
    888  
    889892        if(typeof(openTab.type[new_border_ID]) != "undefined") { 
    890893                if(tabTypes[type] == openTab.type[new_border_ID]) { 
     
    907910                } 
    908911        } 
    909  
    910912        if (new_border_ID == false) 
    911913        { 
     
    16371639        } 
    16381640 
    1639         if ( document.getElementById('viewsource_rt_checkbox').checked == true ) 
    1640                 document.getElementById('viewsource_rt_checkbox').click(); 
     1641        if ( document.getElementById('viewsource_rt_checkbox_' + ID).checked == true ) 
     1642                document.getElementById('viewsource_rt_checkbox_' + ID).click(); 
    16411643 
    16421644        var save_link = Element("save_message_options_"+ID); 
     
    16491651                send_message_return(data, this.ID_tmp); // this is a hack to escape quotation form connector bug 
    16501652        }; 
     1653 
     1654        var mail_as_plain = document.getElementById( 'textplain_rt_checkbox_' + ID ); 
     1655        mail_as_plain = ( mail_as_plain ) ? mail_as_plain.checked : false; 
    16511656 
    16521657        var textArea = document.createElement("TEXTAREA"); 
     
    16541659        textArea.name = "body"; 
    16551660        body = document.getElementById("body_"+ID); 
    1656         textArea.value += '<body>\r\n'; 
    1657         textArea.value += body.contentWindow.document.body.innerHTML; 
    1658         textArea.value += '\r\n</body>'; 
     1661        textArea.value += ( ( mail_as_plain ) ? body.previousSibling.value : ( '<body>\r\n' + body.contentWindow.document.body.innerHTML + '\r\n</body>' ) ); 
    16591662        var input_folder = document.createElement("INPUT"); 
    16601663        input_folder.style.display='none'; 
     
    16901693        form.appendChild(input_folder); 
    16911694        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'; 
    16921700 
    16931701        var _subject = trim(Element("subject_"+ID).value); 
     
    18951903                withImage = false; 
    18961904 
    1897         var rt_checkbox = Element('viewsource_rt_checkbox'); 
     1905        var rt_checkbox = Element('viewsource_rt_checkbox_' + ID); 
    18981906        if (rt_checkbox == null) 
    18991907                return false; 
     
    22282236        } else{ 
    22292237                show_attachs = ""; 
    2230         } 
    2231          
     2238        }        
    22322239        var current_path = window.location.href.substr(0,window.location.href.lastIndexOf("/")); 
    22332240        var window_print_head  = window_print.document.getElementsByTagName("head")[0]; 
Note: See TracChangeset for help on using the changeset viewer.