Index: wysiwyg_editor.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/wysiwyg_editor.js,v
retrieving revision 1.1.2.6
diff -u -p -r1.1.2.6 wysiwyg_editor.js
--- wysiwyg_editor.js	8 Jul 2008 02:54:34 -0000	1.1.2.6
+++ wysiwyg_editor.js	6 Aug 2008 17:18:05 -0000
@@ -20,7 +20,11 @@ Drupal.wysiwygEditorInit = function () {
     tinyMCE.init(config);
   }
   for (var plugin in Drupal.settings.wysiwygEditor.plugins) {
-    tinyMCE.loadPlugin(plugin, Drupal.settings.wysiwygEditor.plugins[plugin]);
+    if (tinyMCE.addI18n) {
+      //tinymce.PluginManager.load(plugin, Drupal.settings.wysiwygEditor.plugins[plugin] + '/editor_plugin.js');
+    } else {
+      tinyMCE.loadPlugin(plugin, Drupal.settings.wysiwygEditor.plugins[plugin]);
+    }
   }
 }
 
@@ -50,21 +54,38 @@ Drupal.wysiwygEditorAttach = function ()
   }
 }
 
+Drupal.tinyMCERemoveControl = function(id) {
+  if (tinyMCE.activeEditor) {
+    tinyMCE.execCommand('mceRemoveControl', false, id);
+  } else {
+    tinyMCE.removeMCEControl(tinyMCE.getEditorId(id));
+  }
+}
+
+Drupal.tinyMCEAddControl = function(id) {
+  if (tinyMCE.activeEditor) {
+    tinyMCE.execCommand('mceAddControl', true, id);
+  } else {
+    tinyMCE.addMCEControl($('#' + id).get(0), id);
+  }
+}
+
 /**
  * Toggle the Wysiwyg Editor control and related link text for a textarea.
  */
 Drupal.wysiwygEditorToggle = function (id, theme) {
-  if (tinyMCE.getEditorId(id) == null) {
+  var state = tinyMCE.activeEditor ? tinyMCE.get(id) : tinyMCE.getEditorId(id);
+  if (state == null) {
     var config = Drupal.wysiwygEditorCloneObject(Drupal.settings.wysiwygEditor.configs[theme]);
     // Set configuration options for this theme.
     for (var setting in config) {
       tinyMCE.settings[setting] = config[setting];
     }
-    tinyMCE.addMCEControl($('#' + id).get(0), id);
+    Drupal.tinyMCEAddControl(id);
     $('#wysiwyg4' + id).html(Drupal.settings.wysiwygEditor.disable).blur();
   }
   else {
-    tinyMCE.removeMCEControl(tinyMCE.getEditorId(id));
+    Drupal.tinyMCERemoveControl(id);
     $('#wysiwyg4' + id).html(Drupal.settings.wysiwygEditor.enable).blur();
   }
 }
