diff options
Diffstat (limited to 'wp-includes/js/autosave.js')
-rw-r--r-- | wp-includes/js/autosave.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/wp-includes/js/autosave.js b/wp-includes/js/autosave.js index b0a2fa5..2f77920 100644 --- a/wp-includes/js/autosave.js +++ b/wp-includes/js/autosave.js @@ -154,8 +154,13 @@ var autosave = function() { doAutoSave = false; /* Gotta do this up here so we can check the length when tinyMCE is in use */ - if ( rich ) { tinyMCE.triggerSave(); } - + if ( rich ) { + var ed = tinyMCE.activeEditor; + if ( 'mce_fullscreen' == ed.id ) + tinyMCE.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); + tinyMCE.get('content').save(); + } + post_data["content"] = jQuery("#content").val(); if ( jQuery('#post_name').val() ) post_data["post_name"] = jQuery('#post_name').val(); @@ -168,8 +173,6 @@ var autosave = function() { autosave_disable_buttons(); var origStatus = jQuery('#original_post_status').val(); - if ( 'draft' != origStatus ) // autosave currently only turned on for drafts - doAutoSave = false; autosaveLast = jQuery("#title").val()+jQuery("#content").val(); goodcats = ([]); @@ -182,9 +185,9 @@ var autosave = function() { post_data["comment_status"] = 'open'; if ( jQuery("#ping_status").attr("checked") ) post_data["ping_status"] = 'open'; - if ( jQuery("#excerpt") ) + if ( jQuery("#excerpt").size() ) post_data["excerpt"] = jQuery("#excerpt").val(); - if ( jQuery("#post_author") ) + if ( jQuery("#post_author").size() ) post_data["post_author"] = jQuery("#post_author").val(); // Don't run while the TinyMCE spellcheck is on. Why? Who knows. |