mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-11 02:49:04 +01:00
Autosave periodical executor from masquerade. fixes #3195
git-svn-id: http://svn.automattic.com/wordpress/trunk@4433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b6a531917e
commit
5e605dfa5b
@ -2,15 +2,11 @@
|
|||||||
cache_javascript_headers();
|
cache_javascript_headers();
|
||||||
?>
|
?>
|
||||||
var autosaveLast = '';
|
var autosaveLast = '';
|
||||||
function autosave_timer() {
|
var autosavePeriodical;
|
||||||
autosave();
|
|
||||||
setTimeout("autosave_timer()", <?php echo apply_filters('autosave_interval', '60000') ?>);
|
|
||||||
}
|
|
||||||
|
|
||||||
function autosave_start_timer() {
|
function autosave_start_timer() {
|
||||||
var form = $('post');
|
var form = $('post');
|
||||||
autosaveLast = form.post_title.value+form.content.value;
|
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)
|
addLoadEvent(autosave_start_timer)
|
||||||
|
|
||||||
@ -80,6 +76,7 @@ function autosave() {
|
|||||||
if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
|
if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 || rich == false ) {
|
||||||
autosaveAjax.setVar("content", form.content.value);
|
autosaveAjax.setVar("content", form.content.value);
|
||||||
} else {
|
} else {
|
||||||
|
// Don't run while the TinyMCE spellcheck is on.
|
||||||
if(tinyMCE.selectedInstance.spellcheckerOn) return;
|
if(tinyMCE.selectedInstance.spellcheckerOn) return;
|
||||||
tinyMCE.wpTriggerSave();
|
tinyMCE.wpTriggerSave();
|
||||||
autosaveAjax.setVar("content", form.content.value);
|
autosaveAjax.setVar("content", form.content.value);
|
||||||
|
Loading…
Reference in New Issue
Block a user