commit 02cab48e36abb13e6ec6b23a61cb6a59fdb318da
Author: Landry Breuil <breuil@craig.fr>
Date:   Mon Feb 1 15:29:25 2010 +0100

    Backport patch from http://drupal.org/node/695398
    
    Now wysiwyg module correctly detects tinymce 3.3.x versions

diff --git a/sites/all/modules/wysiwyg/editors/js/tinymce-3.js b/sites/all/modules/wysiwyg/editors/js/tinymce-3.js
index 9482dcf..681fe98 100644
--- a/sites/all/modules/wysiwyg/editors/js/tinymce-3.js
+++ b/sites/all/modules/wysiwyg/editors/js/tinymce-3.js
@@ -17,10 +17,9 @@ Drupal.wysiwyg.editor.init.tinymce = function(settings) {
   }
   // If JS compression is enabled, TinyMCE is unable to find its own base path
   // and exec mode, hence we need to define it manually.
-  // @todo Move global library settings somewhere else.
-  tinyMCE.baseURL = Drupal.settings.wysiwyg.editorBasePath;
-  tinyMCE.srcMode = (Drupal.settings.wysiwyg.execMode == 'src' ? '_src' : '');
-  tinyMCE.gzipMode = (Drupal.settings.wysiwyg.execMode == 'gzip');
+  tinyMCE.baseURL = Drupal.settings.wysiwyg.configs.tinymce.editorBasePath;
+  tinyMCE.srcMode = (Drupal.settings.wysiwyg.configs.tinymce.execMode == 'src' ? '_src' : '');
+  tinyMCE.gzipMode = (Drupal.settings.wysiwyg.configs.tinymce.execMode == 'gzip');
 
   // Initialize editor configurations.
   for (var format in settings) {
diff --git a/sites/all/modules/wysiwyg/editors/tinymce.inc b/sites/all/modules/wysiwyg/editors/tinymce.inc
index 18cd329..19b9912 100644
--- a/sites/all/modules/wysiwyg/editors/tinymce.inc
+++ b/sites/all/modules/wysiwyg/editors/tinymce.inc
@@ -65,6 +65,24 @@ function wysiwyg_tinymce_editor() {
           ),
         ),
       ),
+      '3.3' => array(
+        'js files' => array('tinymce-3.js'),
+        'css files' => array('tinymce-3.css'),
+        'libraries' => array(
+          '' => array(
+            'title' => 'Minified',
+            'files' => array('tiny_mce.js'),
+          ),
+          'jquery' => array(
+            'title' => 'jQuery',
+            'files' => array('tiny_mce_jquery.js'),
+          ),
+          'src' => array(
+            'title' => 'Source',
+            'files' => array('tiny_mce_src.js'),
+          ),
+        ),
+      ),
     ),
   );
   return $editor;
@@ -82,8 +100,8 @@ function wysiwyg_tinymce_editor() {
 function wysiwyg_tinymce_version($editor) {
   $script = $editor['library path'] . '/tiny_mce.js';
   $script = fopen($script, 'r');
-  // Version is contained in the first 80 chars.
-  $line = fgets($script, 80);
+  // Version is contained in the first 80 chars before 3.3, then 100 chars.
+  $line = fgets($script, 100);
   // 2.x: this.majorVersion="2";this.minorVersion="1.3"
   // 3.x: majorVersion:'3',minorVersion:'2.0.1'
   if (preg_match('@majorVersion[=:]["\'](\d).+?minorVersion[=:]["\']([\d\.]+)@', $line, $version)) {
@@ -574,6 +592,16 @@ function wysiwyg_tinymce_plugins($editor) {
       'load' => TRUE,
     );
   }
+  if (version_compare($editor['installed version'], '3.3', '>=')) {
+    unset($plugins['safari']);
+    $plugins['advlist'] = array(
+      'path' => $editor['library path'] . '/plugins/advlist',
+      'extensions' => array('advlist' => t('Advanced lists')),
+      'url' => 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist',
+      'internal' => TRUE,
+      'load' => TRUE,
+    );
+  }
   return $plugins;
 }
 
diff --git a/sites/all/modules/wysiwyg/wysiwyg.module b/sites/all/modules/wysiwyg/wysiwyg.module
index dd56833..a2c05b9 100644
--- a/sites/all/modules/wysiwyg/wysiwyg.module
+++ b/sites/all/modules/wysiwyg/wysiwyg.module
@@ -282,14 +282,14 @@ function wysiwyg_load_editor($profile) {
       }
 
       drupal_add_js(array('wysiwyg' => array(
-        'configs' => array($editor['name'] => array()),
-        // @todo Move into profile settings.
+        'configs' => array($editor['name'] => array(
         'showToggle' => isset($profile->settings['show_toggle']) ? $profile->settings['show_toggle'] : TRUE,
         // @todo Move into (global) editor settings.
         // If JS compression is enabled, at least TinyMCE is unable to determine
         // its own base path and exec mode since it can't find the script name.
         'editorBasePath' => base_path() . $editor['library path'],
         'execMode' => $library,
+        )),
       )), 'setting');
 
       $loaded[$name] = TRUE;
