From 02a2d051bea60b130975391d969593f602a73fb4 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 30 Oct 2006 20:18:59 +0000 Subject: [PATCH] Autosave periodical executor from masquerade. fixes #3195 git-svn-id: https://develop.svn.wordpress.org/trunk@4433 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/autosave.js.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index a8648f0118..155408a606 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -2,15 +2,11 @@ cache_javascript_headers(); ?> var autosaveLast = ''; -function autosave_timer() { - autosave(); - setTimeout("autosave_timer()", ); -} - +var autosavePeriodical; function autosave_start_timer() { var form = $('post'); autosaveLast = form.post_title.value+form.content.value; - setTimeout("autosave_timer()", ); + autosavePerodical = new PeriodicalExecutor(autosave, ); } addLoadEvent(autosave_start_timer) @@ -80,6 +76,7 @@ function autosave() { if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) { autosaveAjax.setVar("content", form.content.value); } else { + // Don't run while the TinyMCE spellcheck is on. if(tinyMCE.selectedInstance.spellcheckerOn) return; tinyMCE.wpTriggerSave(); autosaveAjax.setVar("content", form.content.value);