From 5c2a838d90a0406e789197d42d9ae58b57d0a68a Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 16 Aug 2006 02:50:03 +0000 Subject: [PATCH] Autosave focus grab fix from masquerade. fixes #3040 git-svn-id: https://develop.svn.wordpress.org/trunk@4101 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/autosave.js.php | 1 + wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js | 5 ++++- wp-includes/script-loader.php | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-includes/js/autosave.js.php b/wp-includes/js/autosave.js.php index 2c78f4e31f..7d2fe4e635 100644 --- a/wp-includes/js/autosave.js.php +++ b/wp-includes/js/autosave.js.php @@ -83,6 +83,7 @@ function autosave() { if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) { autosaveAjax.setVar("content", form.content.value); } else { + if(tinyMCE.selectedInstance.spellcheckerOn) return; tinyMCE.wpTriggerSave(); autosaveAjax.setVar("content", form.content.value); } diff --git a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js index ef5df27665..9a118f9080 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js +++ b/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js @@ -424,7 +424,10 @@ wpInstTriggerSave = function (skip_cleanup, skip_callback) { } tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body); - var htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true); + tinyMCE.selectedInstance.getWin().oldfocus=tinyMCE.selectedInstance.getWin().focus; + tinyMCE.selectedInstance.getWin().focus=function() {}; + var htm = tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true); + tinyMCE.selectedInstance.getWin().focus=tinyMCE.selectedInstance.getWin().oldfocus; htm = tinyMCE._customCleanup(this, "submit_content", htm); if (!skip_callback && tinyMCE.settings['save_callback'] != "") diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 56c44cbc01..27e2bd3681 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -15,10 +15,10 @@ class WP_Scripts { $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' ); $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); - $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '08112006' ); + $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '08152006' ); $this->add( 'wp_tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('tiny_mce'), '04162006' ); $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0'); - $this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4096'); + $this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4101'); if ( is_admin() ) { $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' ); $this->add( 'listman', '/wp-admin/list-manipulation-js.php', array('sack', 'fat'), '4042' ); // Make changeset # the correct one