Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/CHANGELOG.txt,v
retrieving revision 1.1.2.32
diff -u -p -r1.1.2.32 CHANGELOG.txt
--- CHANGELOG.txt	5 Oct 2008 21:01:47 -0000	1.1.2.32
+++ CHANGELOG.txt	5 Oct 2008 22:07:42 -0000
@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
 
 Wysiwyg 5.x-x.x, xxxx-xx-xx
 ---------------------------
+#282717 by sun: Added (basic) FCKeditor support.
 #316507 by sun: Added Drupal.wysiwyg function stacks to execute editor library
   specific actions upon initializing, attaching, detaching, and toggling an
   editor. Editor specific JavaScript resides in separate files now, as specified
Index: editors/fckeditor.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/fckeditor.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 fckeditor.inc
--- editors/fckeditor.inc	5 Oct 2008 04:05:04 -0000	1.1.2.1
+++ editors/fckeditor.inc	5 Oct 2008 22:01:59 -0000
@@ -17,7 +17,6 @@ function wysiwyg_fckeditor_editor() {
     'title' => 'FCKeditor',
     'vendor url' => 'http://www.fckeditor.net',
     'download url' => 'http://www.fckeditor.net/download',
-    'editor path' => wysiwyg_get_path('fckeditor'),
     'library path' => wysiwyg_get_path('fckeditor'),
     'libraries' => array( // We cannot assume that all editors need just one js library.
       '' => array( // Key may be used in wysiwyg_fckeditor_settings() for exec mode.
@@ -25,7 +24,6 @@ function wysiwyg_fckeditor_editor() {
         'files' => array('fckeditor.js'),
       ),
     ),
-    'js path' => wysiwyg_get_path('js'),
     'version callback' => 'wysiwyg_fckeditor_version',
     'themes callback' => 'wysiwyg_fckeditor_themes',
     'settings callback' => 'wysiwyg_fckeditor_settings',
@@ -33,13 +31,16 @@ function wysiwyg_fckeditor_editor() {
     'plugin settings callback' => 'wysiwyg_fckeditor_plugin_settings',
     'versions' => array( // Each version can override global editor properties.
       2.6 => array(
-        'include files' => array('fckeditor-2.inc'),
-        'js files' => array('fckeditor-2.js'),
+        // 'include files' => array('fckeditor-2.inc'),
+        'js files' => array('fckeditor-2.6.js'),
       ),
     ),
     // Optional properties
-    'css path' => wysiwyg_get_path('css'),
-    'css files' => array('fckeditor.css'),
+    // 'editor path' => wysiwyg_get_path('fckeditor'),
+    // 'js path' => wysiwyg_get_path('js'),
+    // 'css path' => wysiwyg_get_path('css'),
+    // @todo Not yet implemented.
+    // 'css files' => array('fckeditor.css'),
   );
   return $editor;
 }
@@ -79,6 +80,38 @@ function wysiwyg_fckeditor_version($edit
  *   Drupal.settings.wysiwygEditor.configs.{editor}
  */
 function wysiwyg_fckeditor_settings($editor, $config, $theme) {
+  $init = array(
+    'BasePath' => base_path() . $editor['editor path'] .'/',
+    'SkinPath' => base_path() . $editor['editor path'] .'/editor/skins/default/',
+    'DefaultLanguage' => 'en',
+    'AutoDetectLanguage' => TRUE,
+    'Height' => 420,
+    'ToolbarStartExpanded' => TRUE,
+    'Width' => '100%',
+    'EnterMode' => 'p',
+    'ShiftEnterMode' => 'br',
+    'FontFormats' => strtr($config['block_formats'], array(',' => ';')),
+    'FormatSource' => $config['apply_source_formatting'],
+    'FormatOutput' => $config['preformatted'],
+    'LinkBrowser' => FALSE,
+    'ImageBrowser' => FALSE,
+    'FlashBrowser' => FALSE,
+    'LinkUpload' => FALSE,
+    'ImageUpload' => FALSE,
+    'FlashUpload' => FALSE,
+  );
+
+  if ($config['css_setting'] == 'theme') {
+    $css = path_to_theme() .'/style.css';
+    if (file_exists($css)) {
+      $init['EditorAreaCSS'] = base_path() . $css;
+    }
+  }
+  else if ($config['css_setting'] == 'self') {
+    $init['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+  }
+
+  return $init;
 }
 
 /**
Index: editors/js/fckeditor-2.6.js
===================================================================
RCS file: editors/js/fckeditor-2.6.js
diff -N editors/js/fckeditor-2.6.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ editors/js/fckeditor-2.6.js	5 Oct 2008 22:06:49 -0000
@@ -0,0 +1,69 @@
+// $Id: tinymce-3.js,v 1.1.2.2 2008/10/05 21:01:48 sun Exp $
+
+Drupal.wysiwyg = Drupal.wysiwyg || { 'init': {}, 'attach': {}, 'detach': {}, 'toggle': {} };
+
+/**
+ * Attach FCKeditor to textareas, using the theme specified in CSS class names.
+ *
+ * @param editorSettings
+ *   An object containing editor settings for each enabled editor theme.
+ */
+Drupal.wysiwyg.attach.fckeditor = function(context, editorSettings) {
+  for (var theme in editorSettings) {
+    $('textarea.wysiwyg-' + theme + ':not(.wysiwyg-processed)', context).each(function() {
+      // @todo Convert string into variable name w/o overwriting string?
+      //   workaround: build object via editors[this.id] = new ...
+      var oFCK_1 = new FCKeditor(this.id);
+      // Clone, so original settings are not overwritten.
+      var config = Drupal.wysiwyg.clone(editorSettings[theme]);
+      // Configure settings for this theme.
+      oFCK_1.BasePath = config.BasePath;
+      for (var setting in config) {
+        oFCK_1.Config[setting] = config[setting];
+      }
+      // Attach Wysiwyg Editor control if default is on.
+      if (Drupal.settings.wysiwygEditor.status) {
+        oFCK_1.ReplaceTextarea();
+      }
+      $(this).addClass('wysiwyg-processed');
+    });
+  }
+}
+
+/**
+ * Detach all FCKeditor editors.
+ *
+ * @todo Context support required to remove only certain editors (think AHAH/AJAX).
+ */
+Drupal.wysiwyg.detach.fckeditor = function(context) {
+  if (tinyMCE.activeEditor) {
+    tinyMCE.triggerSave();
+    tinyMCE.activeEditor.remove();
+  }
+}
+
+/**
+ * Toggle editor and return new state.
+ *
+ * @param element
+ *   The DOM element to toggle the editor for.
+ * @param theme
+ *   The editor theme assigned to the element.
+ *
+ * @return
+ *   A boolean value indicating whether the editor has been enabled.
+ */
+Drupal.wysiwyg.toggle.fckeditor = function(element, theme) {
+  var instance = FCKeditorAPI.GetInstance(element.id);
+  if ($(element).css('display') != 'none' || instance == null) {
+    instance.SetHTML($(element).hide().val());
+    $('#' + element.id + '___Frame').show();
+    return true;
+  }
+  else {
+    $('#' + element.id).val(instance.GetXHTML()).show();
+    $('#' + element.id + '___Frame').hide();
+    return false;
+  }
+}
+
