Ignore:
Timestamp:
04/11/12 11:35:15 (12 years ago)
Author:
gustavo
Message:

Ticket #2611 - Refatorar interface de criação de nova mensagem

File:
1 edited

Legend:

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

    r5745 r5911  
    5555cRichTextEditor.prototype.fromJSON = function( value ) 
    5656{ 
    57     return (new Function( "return " + this.decode64( value )))(); 
     57        if(!value) 
     58                return ''; 
     59        return (new Function( "return " + this.decode64( value )))(); 
    5860} 
    5961 
     
    111113                        RichTextEditor.active(pObj); 
    112114} 
     115 
     116cRichTextEditor.prototype.loadEditor2 = function(ID) {       
     117                var pObj = "body_" + ID; 
     118        RichTextEditor.plain[ID] = false;  
     119         
     120        if(preferences.plain_text_editor == 1) 
     121                { 
     122                        RichTextEditor.plain[ID] = true;   
     123                        RichTextEditor.editorReady = true; 
     124                } 
     125        else  
     126                        RichTextEditor.active(pObj); 
     127} 
     128 
    113129 
    114130cRichTextEditor.prototype.getSignaturesOptions = function() { 
     
    152168        var editor =  CKEDITOR.instances[inst];  
    153169        var id = inst.replace('body_',''); 
     170        var content = $("#content_id_"+id) 
    154171        editor.document.on('keydown', function(event) 
    155172        { 
    156173                away = false; 
    157                 var save_link = Element("save_message_options_"+id); 
    158                 save_link.onclick = function onclick() {openTab.toPreserve[id] = true;save_msg(id);} ; 
    159                 $("#save_message_options_"+id).button({ disabled: false }); 
     174                var save_link = content.find(".save"); 
     175                save_link.click(function(){ 
     176                        openTab.toPreserve[id] = true;save_msg(id); 
     177                }); 
     178                save_link.button({ disabled: false }); 
    160179        }); 
    161180         
     
    186205cRichTextEditor.prototype.setPlain = function (active,id){ 
    187206      RichTextEditor.plain[id] = active; 
     207          var content = $("#content_id_"+id); 
    188208      if(active === true) 
    189209      { 
     
    194214            $('#body_'+id).keydown(function(event) { 
    195215                away = false; 
    196                 var save_link = Element("save_message_options_"+id); 
     216                save_link = content.find(".save")[0]; 
    197217                save_link.onclick = function onclick() {openTab.toPreserve[id] = true;save_msg(id);} ; 
    198218                                $("#save_message_options_"+id).button({ disabled: false }); 
     
    305325     height -= 375; 
    306326     $('#'+id).ckeditor(  
    307           function() {RichTextEditor.execPosInstance(id)}, 
    308           { 
    309               toolbar:'mail', 
    310               height: height 
    311           });  
    312         $("[name=textplain_rt_checkbox_"+just_id+"]").button({ disabled: false }); 
     327                function() { 
     328                        RichTextEditor.execPosInstance(id) 
     329                }, 
     330                { 
     331                        toolbar:'mail', 
     332                        height: height 
     333                } 
     334        );  
     335        //$("[name=textplain_rt_checkbox_"+just_id+"]").button({ disabled: false }); 
    313336} 
    314337cRichTextEditor.prototype.focus = function(id) 
Note: See TracChangeset for help on using the changeset viewer.