Don't do autosave while the TinyMCE spellchecker is active (it strips all the markup), fixes #10515
git-svn-id: https://develop.svn.wordpress.org/trunk@11790 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cbb9057c95
commit
ad9e217bf4
|
@ -196,12 +196,17 @@ autosave = function() {
|
|||
doAutoSave = false;
|
||||
|
||||
/* Gotta do this up here so we can check the length when tinyMCE is in use */
|
||||
if ( rich ) {
|
||||
if ( rich && doAutoSave ) {
|
||||
ed = tinyMCE.activeEditor;
|
||||
// Don't run while the TinyMCE spellcheck is on. It resets all found words.
|
||||
if ( ed.plugins.spellchecker && ed.plugins.spellchecker.active ) {
|
||||
doAutoSave = false;
|
||||
} else {
|
||||
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() )
|
||||
|
@ -216,7 +221,6 @@ autosave = function() {
|
|||
|
||||
origStatus = jQuery('#original_post_status').val();
|
||||
|
||||
autosaveLast = jQuery("#title").val()+jQuery("#content").val();
|
||||
goodcats = ([]);
|
||||
jQuery("[name='post_category[]']:checked").each( function(i) {
|
||||
goodcats.push(this.value);
|
||||
|
@ -233,9 +237,10 @@ autosave = function() {
|
|||
post_data["post_author"] = jQuery("#post_author").val();
|
||||
post_data["user_ID"] = jQuery("#user-id").val();
|
||||
|
||||
// Don't run while the TinyMCE spellcheck is on. It resets all found words.
|
||||
if ( rich && tinyMCE.activeEditor.plugins.spellchecker && tinyMCE.activeEditor.plugins.spellchecker.active ) {
|
||||
doAutoSave = false;
|
||||
if ( doAutoSave ) {
|
||||
autosaveLast = jQuery("#title").val()+jQuery("#content").val();
|
||||
} else {
|
||||
post_data['autosave'] = 0;
|
||||
}
|
||||
|
||||
if ( parseInt(post_data["post_ID"], 10) < 1 ) {
|
||||
|
@ -245,10 +250,6 @@ autosave = function() {
|
|||
successCallback = autosave_saved; // pre-existing post
|
||||
}
|
||||
|
||||
if ( !doAutoSave ) {
|
||||
post_data['autosave'] = 0;
|
||||
}
|
||||
|
||||
autosaveOldMessage = jQuery('#autosave').html();
|
||||
|
||||
jQuery.ajax({
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -98,7 +98,7 @@ function wp_default_scripts( &$scripts ) {
|
|||
'l10n_print_after' => 'try{convertEntities(wpAjax);}catch(e){};'
|
||||
) );
|
||||
|
||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090526' );
|
||||
$scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), '20090807' );
|
||||
$scripts->add_data( 'autosave', 'group', 1 );
|
||||
|
||||
$scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array('wp-ajax-response'), '20090504' );
|
||||
|
|
Loading…
Reference in New Issue