Ignore:
Timestamp:
02/01/12 13:20:05 (12 years ago)
Author:
cristiano
Message:

Ticket #2475 - Problema no registro da função autosave

File:
1 edited

Legend:

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

    r5417 r5459  
    146146 
    147147cRichTextEditor.prototype.createImage = function(){ 
    148         if (preferences.auto_save_draft == 1) 
    149         { 
    150                         autosave_time = 200000; 
    151                         clearTimeout(openTab.autosave_timer[currentTab]); 
    152         } 
    153148                 
    154149        var form = document.getElementById("attachment_window"); 
     
    264259 
    265260cRichTextEditor.prototype.execPosInstance = function(inst) { 
     261     if(RichTextEditor.editorReady === false) 
     262     { 
    266263        var editor =  CKEDITOR.instances[inst];  
    267264        var id = inst.replace('body_',''); 
     
    274271        }); 
    275272         
    276 //Adicionando atalhos de preferencias   
    277 //TODO: Não esta pegando o numero (keycode) 
    278 //        if (preferences.use_shortcuts == '1') 
    279 //        { 
    280 //            CKEDITOR.instances[inst].document.on('keyup', function(event){ 
    281 //                    if(event.keyCode == 27){                          
    282 //                            delete_border(id,'false');}  //Tecla delete fechar aba           
    283 //            }); 
    284 //        }   
    285273        
    286274        // IM Module Enabled 
     
    291279                });              
    292280        } 
    293          
     281 
    294282        if (preferences.auto_save_draft == 1) 
    295283        { 
    296                 openTab.autosave_timer[id] = false; 
    297                 var save_link = document.getElementById("save_message_options"+id); 
    298                 CKEDITOR.instances[inst].document.on('keydown', function(event){ 
    299                    if (openTab.autosave_timer[id]) 
    300                                 clearTimeout(openTab.autosave_timer[id]); 
    301                    openTab.autosave_timer[id] = setTimeout("save_msg("+id+")", autosave_time); 
    302                                          
    303                 });   
    304         } 
    305          
    306         /*var rich_button = document.createElement("a"); 
    307         //rich_button.className = "button small"; 
    308         rich_button.name = "textplain_rt_checkbox_"+id; 
    309         rich_button.innerHTML = get_lang('Simple text mode')+" >>"; 
    310         rich_button.href = "#"; 
    311         rich_button.onclick = function (){ 
    312                 var check = $("#"+$(this).attr("name")).attr("checked"); 
    313                 $("#"+$(this).attr("name")).attr("checked", (!check ? true : false)); 
    314                 $("#"+$(this).attr("name")).trigger('click'); 
    315                 //RichTextEditor.setPlain($("#"+$(this).attr("name")).attr("checked"), id); 
    316         }; 
    317         if($("#cke_top_body_"+id).find(".cke_toolbar:last")) 
    318         $("#cke_top_body_"+id).find(".cke_toolbar:last").append("<span class='button small'></span>"); 
    319         $("#cke_top_body_"+id).find("span:last").append(rich_button); 
    320         $("#cke_top_body_"+id).attr("colSpan", "2"); 
    321         $("#cke_contents_body_"+id).attr("colSpan", "2"); 
    322         $("#cke_bottom_body_"+id).attr("colSpan", "2");*/ 
     284            autoSaveControl.status[id] = true; 
     285            autoSaveControl.timer[id] = window.setInterval( "autoSave("+id+")" ,autosave_time);   
     286 
     287            CKEDITOR.instances[inst].document.on('keydown', function(event){    
     288                autoSaveControl.status[id] = false; 
     289            }) 
     290        } 
     291         
    323292        $(".cke_editor").css("white-space", "normal"); 
    324          
    325         RichTextEditor.editorReady = true; 
    326 } 
     293        RichTextEditor.editorReady = true; 
     294     }   
     295} 
     296 
    327297cRichTextEditor.prototype.setPlain = function (active,id){ 
    328298      RichTextEditor.plain[id] = active; 
Note: See TracChangeset for help on using the changeset viewer.