? LICENSE.txt
? current.patch
? wysiwyg-DRUPAL-6--1.fckeditor.toolbar.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-4.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-5-alternative.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-5-dataprocessor.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-5.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-6-dataprocessor.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-alternative.patch
? wysiwyg-HEAD.fckeditor-drupal-plugins-dataprocessor.patch
Index: editors/js/fckeditor-2.6.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/js/fckeditor-2.6.js,v
retrieving revision 1.14
diff -u -p -r1.14 fckeditor-2.6.js
--- editors/js/fckeditor-2.6.js	21 Mar 2009 23:16:15 -0000	1.14
+++ editors/js/fckeditor-2.6.js	25 Mar 2009 22:12:35 -0000
@@ -36,17 +36,50 @@ Drupal.wysiwyg.editor.detach.fckeditor =
   }
 
   for (var instanceName in instances) {
-    // Shut down the instance and give plugins a chance to detach by changing status first.
-    instances[instanceName].SetStatus(FCK_STATUS_NOTLOADED);
-    instances[instanceName].UpdateLinkedField();
-    $('#' + instanceName).show();
+    instances[instanceName].UpdateLinkedField(); 
     $('#' + instanceName + '___Config').remove();
     $('#' + instanceName + '___Frame').remove();
-    delete FCKeditorAPI.__Instances[instanceName];
+    $('#' + instanceName).show();
+    delete instances[instanceName];
   }
 };
 
 Drupal.wysiwyg.editor.instance.fckeditor = {
+  init: function(instance) {
+    /**
+    * Create a custom Data Processor to wrap the default one and let the plugins modify the editor contents.
+    */
+    var pluginsDataProcessor = function() {};
+    pluginsDataProcessor.prototype = new instance.FCKDataProcessor();
+    pluginsDataProcessor.prototype.ConvertToDataFormat = function(rootNode, excludeRoot) {
+      // This is called from GetData() and given the editor area DOM in Wysiwyg Mode.
+      // Use the original Data Processor to convert the DOM into an XHTML string
+      var data = instance.FCKDataProcessor.prototype.ConvertToDataFormat.call(this, rootNode, excludeRoot);
+      for (var plugin in Drupal.settings.wysiwyg.plugins[instance.wysiwygFormat].drupal) {
+        if (typeof Drupal.wysiwyg.plugins[plugin].detach == 'function') {
+          data = Drupal.wysiwyg.plugins[plugin].detach(data, Drupal.settings.wysiwyg.plugins.drupal[plugin], instance.FCK.Name);
+        }
+      }
+      return data;
+    };
+
+    pluginsDataProcessor.prototype.ConvertToHtml = function(data) {
+      // This is called from SetData(), but the data has had comments, scripts etc stripped.
+      // Revert the protection and let our plugins process it.
+      var data = instance.FCKConfig.ProtectedSource.Revert(data);
+      for (var plugin in Drupal.settings.wysiwyg.plugins[instance.wysiwygFormat].drupal) {
+        if (typeof Drupal.wysiwyg.plugins[plugin].attach == 'function') {
+          data = Drupal.wysiwyg.plugins[plugin].attach(data, Drupal.settings.wysiwyg.plugins.drupal[plugin], instance.FCK.Name);
+          data = Drupal.wysiwyg.editor.instance.fckeditor.prepareContent(data);
+        }
+      }
+      // Protect the source once again and send it off to the original Data Processor for conversion to XHTML.
+      data = instance.FCKConfig.ProtectedSource.Protect(data);
+      return instance.FCKDataProcessor.prototype.ConvertToHtml.call(this, data);
+    };
+    instance.FCK.DataProcessor = new pluginsDataProcessor();
+  },
+
   addPlugin: function(plugin, settings, pluginSettings, instance) {
     if (typeof Drupal.wysiwyg.plugins[plugin] != 'object') {
       return;
Index: editors/js/fckeditor.config.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/js/fckeditor.config.js,v
retrieving revision 1.3
diff -u -p -r1.3 fckeditor.config.js
--- editors/js/fckeditor.config.js	21 Mar 2009 23:16:15 -0000	1.3
+++ editors/js/fckeditor.config.js	25 Mar 2009 22:12:35 -0000
@@ -26,6 +26,12 @@ for (var setting in wysiwygSettings) {
 }
 
 /**
+ * Do things needed to be done once for each editor instance.
+ */
+Drupal.wysiwyg.editor.instance.fckeditor.init(window);
+
+
+/**
  * Register Drupal plugins for this input format.
  *
  * Parameters to addPlugin() are:
