diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php
index bc4af483f5..2898199cc2 100644
--- a/wp-admin/admin-header.php
+++ b/wp-admin/admin-header.php
@@ -40,7 +40,7 @@ var pagenow = '';
'none',
- 'onpageload' => 'switchEditors.edInit',
+ 'mode' => 'specific_textareas',
+ 'editor_selector' => 'theEditor',
'width' => '100%',
'theme' => 'advanced',
'skin' => 'wp_theme',
@@ -1334,7 +1334,7 @@ function wp_tiny_mce( $teeny = false ) {
$language = $initArray['language'];
$zip = $compress_scripts ? 1 : 0;
- $ver = apply_filters('tiny_mce_version', '3211');
+ $ver = apply_filters('tiny_mce_version', '323');
if ( 'en' != $language )
include_once(ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php');
diff --git a/wp-admin/js/editor.dev.js b/wp-admin/js/editor.dev.js
index 2fd9157209..17c01928e7 100644
--- a/wp-admin/js/editor.dev.js
+++ b/wp-admin/js/editor.dev.js
@@ -1,4 +1,16 @@
+jQuery(document).ready(function($){
+ var h = wpCookies.getHash('TinyMCE_content_size');
+
+ if ( getUserSetting( 'editor' ) == 'html' ) {
+ if ( h )
+ $('#content').css('height', h.ch - 15 + 'px');
+ } else {
+ $('#content').css('color', 'white');
+ $('#quicktags').hide();
+ }
+});
+
var switchEditors = {
mode : '',
@@ -8,18 +20,6 @@ var switchEditors = {
},
edInit : function() {
- var h = tinymce.util.Cookie.getHash("TinyMCE_content_size");
-
- // Activate TinyMCE if it's the user's default editor
- if ( getUserSetting( 'editor' ) == 'html' ) {
- if ( h )
- try { this.I('content').style.height = h.ch - 30 + 'px'; } catch(e){};
- } else {
- try {
- this.I("quicktags").style.display = "none";
- } catch(e){};
- tinyMCE.execCommand("mceAddControl", false, "content");
- }
},
saveCallback : function(el, content, body) {
@@ -94,43 +94,44 @@ var switchEditors = {
id = id || 'content';
mode = mode || this.mode || '';
- var ed = tinyMCE.get(id) || false, qt = this.I('quicktags'), H = this.I('edButtonHTML'), P = this.I('edButtonPreview'), ta = this.I(id);
+ var ed, qt = this.I('quicktags'), H = this.I('edButtonHTML'), P = this.I('edButtonPreview'), ta = this.I(id);
+
+ try { ed = tinyMCE.get(id); }
+ catch(e) { ed = false; }
if ( 'tinymce' == mode ) {
-
if ( ed && ! ed.isHidden() )
return false;
+ setUserSetting( 'editor', 'tinymce' );
this.mode = 'html';
- ta.style.color = '#fff';
P.className = 'active';
H.className = '';
edCloseAllTags(); // :-(
-
qt.style.display = 'none';
ta.value = this.wpautop(ta.value);
- if ( ed ) ed.show();
- else tinyMCE.execCommand("mceAddControl", false, id);
-
- setUserSetting( 'editor', 'tinymce' );
+ if ( ed ) {
+ ed.show();
+ } else {
+ try{tinyMCE.execCommand("mceAddControl", false, id);}
+ catch(e){}
+ }
} else {
- if ( ! ed || ed.isHidden() )
- return false;
-
+ setUserSetting( 'editor', 'html' );
+ ta.style.color = '#000';
this.mode = 'tinymce';
H.className = 'active';
P.className = '';
- ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px';
+ if ( ed && !ed.isHidden() ) {
+ ta.style.height = ed.getContentAreaContainer().offsetHeight + 24 + 'px';
+ ed.hide();
+ }
- ed.hide();
qt.style.display = 'block';
-
- ta.style.color = '';
- setUserSetting( 'editor', 'html' );
}
return false;
},
diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js
index 15279f0795..f3e5415450 100644
--- a/wp-admin/js/editor.js
+++ b/wp-admin/js/editor.js
@@ -1 +1 @@
-var switchEditors={mode:"",I:function(a){return document.getElementById(a)},edInit:function(){var a=tinymce.util.Cookie.getHash("TinyMCE_content_size");if(getUserSetting("editor")=="html"){if(a){try{this.I("content").style.height=a.ch-30+"px"}catch(b){}}}else{try{this.I("quicktags").style.display="none"}catch(b){}tinyMCE.execCommand("mceAddControl",false,"content")}},saveCallback:function(b,c,a){if(tinyMCE.activeEditor.isHidden()){c=this.I(b).value}else{c=this.pre_wpautop(c)}return c},pre_wpautop:function(b){var c,a;b=b.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(d){d=d.replace(/
[\r\n]*/g,"");return d.replace(/<\/?p( [^>]*)?>[\r\n]*/g,"")});c="blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p";b=b.replace(new RegExp("\\s*("+c+")>\\s*","mg"),"$1>\n");b=b.replace(new RegExp("\\s*<(("+c+")[^>]*)>","mg"),"\n<$1>");b=b.replace(new RegExp("(]+>.*?)
","mg"),"$1
");b=b.replace(new RegExp("]*)>\\s*
","mgi"),"
\n\n");b=b.replace(new RegExp("\\s*
","mgi"),"");b=b.replace(new RegExp("\\s*
\\s*","mgi"),"\n\n");b=b.replace(new RegExp("\\n\\s*\\n","mgi"),"\n\n");b=b.replace(new RegExp("\\s*
\\s*","gi"),"\n");b=b.replace(new RegExp("\\s*
\\s*","mg"),"
\n");b=b.replace(new RegExp("\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*","gi"),"\n\n[caption$1[/caption]\n\n");b=b.replace(new RegExp("caption\\]\\n\\n+\\[caption","g"),"caption]\n\n[caption");a="blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre";b=b.replace(new RegExp("\\s*<(("+a+") ?[^>]*)\\s*>","mg"),"\n<$1>");b=b.replace(new RegExp("\\s*("+a+")>\\s*","mg"),"$1>\n");b=b.replace(new RegExp("
]*)>","g"),"\t");if(b.indexOf("