From 5e605dfa5bb9f95f20b00810f2aa4593621e0614 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 30 Oct 2006 20:18:59 +0000 Subject: [PATCH] Autosave periodical executor from masquerade. fixes #3195 git-svn-id: http://svn.automattic.com/wordpress/trunk@4433 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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);