Autosave periodical executor from masquerade. fixes #3195

git-svn-id: https://develop.svn.wordpress.org/trunk@4433 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-10-30 20:18:59 +00:00
parent d3eee351ce
commit 02a2d051be
1 changed files with 3 additions and 6 deletions

View File

@ -2,15 +2,11 @@
cache_javascript_headers();
?>
var autosaveLast = '';
function autosave_timer() {
autosave();
setTimeout("autosave_timer()", <?php echo apply_filters('autosave_interval', '60000') ?>);
}
var autosavePeriodical;
function autosave_start_timer() {
var form = $('post');
autosaveLast = form.post_title.value+form.content.value;
setTimeout("autosave_timer()", <?php echo apply_filters('autosave_start_delay', '60000') ?>);
autosavePerodical = new PeriodicalExecutor(autosave, <?php echo apply_filters('autosave_interval', '60000'); ?>);
}
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);