Ignore:
Timestamp:
07/03/12 08:47:47 (12 years ago)
Author:
marcosw
Message:

Ticket #2927 - Confirmação e remoção de tags no texto simples

File:
1 edited

Legend:

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

    r6483 r6698  
    213213      RichTextEditor.plain[id] = active; 
    214214          var content = $("#content_id_"+id); 
     215          var div = $("<div>").attr("display", "none"); 
    215216      if(active === true) 
    216217      { 
     
    219220            height -= 330; 
    220221            $('#body_'+id).height(height); 
     222            div.html($('#body_'+id).val()); 
     223            /*Remove as tags html, tabulações e quebras de linha quando for utilizado o editor de texto simples*/ 
     224            div.html($.trim(div.text().replace(/[\t]+/g, '').replace(/[\n]+/g, '\n'))); 
     225            /*Insere o texto sem formatação no textarea*/ 
     226            $('#body_'+id).val(div.text()); 
     227             
    221228            $('#body_'+id).keydown(function(event) { 
    222229                away = false; 
     
    228235                        $("[name=textplain_rt_checkbox_"+id+"]").button({ disabled: false }); 
    229236      }    
    230       else 
     237      else{ 
    231238          RichTextEditor.active('body_'+id, id); 
     239          /*Insere somente quebras de linha para que o texto convertido não fique todo em uma linha só*/ 
     240          div.html($('#body_'+id).val().replace(/[\n]+/g, '<br>')); 
     241          $('#body_'+id).val(div.html()); 
     242      } 
    232243} 
    233244 
Note: See TracChangeset for help on using the changeset viewer.