Make WordPress Core

Ticket #3195: autosave-prototype-periodicalexecutor.diff

File autosave-prototype-periodicalexecutor.diff, 1.2 KB (added by masquerade, 18 years ago)
  • wp-includes/js/autosave.js.php

     
    22cache_javascript_headers();
    33?>
    44var autosaveLast = '';
    5 function autosave_timer() {
    6         autosave();
    7         setTimeout("autosave_timer()", <?php echo apply_filters('autosave_interval', '60000') ?>);
    8 }
    9 
     5var autosavePeriodical;
    106function autosave_start_timer() {
    117        var form = $('post');
    128        autosaveLast = form.post_title.value+form.content.value;
    13         setTimeout("autosave_timer()", <?php echo apply_filters('autosave_start_delay', '60000') ?>);
     9        autosavePerodical = new PeriodicalExecutor(autosave, <?php echo apply_filters('autosave_interval', '60000'); ?>);
    1410}
    1511addLoadEvent(autosave_start_timer)
    1612
     
    8076        if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
    8177                autosaveAjax.setVar("content", form.content.value);
    8278        } else {
     79                // Don't run while the TinyMCE spellcheck is on.
    8380                if(tinyMCE.selectedInstance.spellcheckerOn) return;
    8481                tinyMCE.wpTriggerSave();
    8582                autosaveAjax.setVar("content", form.content.value);