From 27d3c39739daa1489bf73d567a7db5129b630f41 Mon Sep 17 00:00:00 2001 From: Tim Steiner <tsteiner2@unl.edu> Date: Wed, 29 Sep 2010 15:50:22 +0000 Subject: [PATCH] Updating WYSIWYG to latest dev version. git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@197 20a16fea-79d4-4915-8869-1ea9d5ebf173 --- sites/all/modules/wysiwyg/CHANGELOG.txt | 12 +++++++-- .../all/modules/wysiwyg/editors/ckeditor.inc | 3 ++- .../wysiwyg/editors/js/fckeditor-2.6.js | 14 +++++++--- .../modules/wysiwyg/editors/js/tinymce-2.js | 7 ++++- .../modules/wysiwyg/editors/js/tinymce-3.js | 27 ++++++++++++++----- .../wysiwyg/editors/js/whizzywig-56.js | 8 +++++- .../modules/wysiwyg/editors/js/whizzywig.js | 10 ++++++- sites/all/modules/wysiwyg/editors/tinymce.inc | 6 ++--- sites/all/modules/wysiwyg/wysiwyg.info | 4 +-- sites/all/modules/wysiwyg/wysiwyg.install | 3 ++- sites/all/modules/wysiwyg/wysiwyg.js | 4 +-- 11 files changed, 75 insertions(+), 23 deletions(-) diff --git a/sites/all/modules/wysiwyg/CHANGELOG.txt b/sites/all/modules/wysiwyg/CHANGELOG.txt index ce8b5471..4c029e14 100644 --- a/sites/all/modules/wysiwyg/CHANGELOG.txt +++ b/sites/all/modules/wysiwyg/CHANGELOG.txt @@ -1,4 +1,4 @@ -// $Id: CHANGELOG.txt,v 1.194 2010/04/07 21:18:20 sun Exp $ +// $Id: CHANGELOG.txt,v 1.202 2010/09/25 11:53:19 twod Exp $ Wysiwyg x.x-x.x, xxxx-xx-xx --------------------------- @@ -6,7 +6,6 @@ Wysiwyg x.x-x.x, xxxx-xx-xx Wysiwyg 7.x-3.x, xxxx-xx-xx --------------------------- -#752516 by nquocbao, sun: Fixed openwysiwyg version callback. #739558 by sun, TwoD: Updated for new #type text_format. #612954 by TwoD: Fixed broken editor settings. #585932 by sun: Ported to Drupal 7. @@ -14,6 +13,15 @@ Wysiwyg 7.x-3.x, xxxx-xx-xx Wysiwyg 6.x-3.x, xxxx-xx-xx --------------------------- +#651490 by TwoD: Fixed Whizzywig width. +#715228 by TwoD: Fixed TinyMCE image popups not launching for existing images. +#606952 by TwoD: Fixed inserting content in fullscreen TinyMCE. +#593008 by TwoD: Fixed third-party scripts breaking Wysiwyg. +#695398 by RichieB, Cl1mh4224rd, mcpuddin: Fixed TinyMCE 3.3.9.1 detection. +#737318 by dboune: Fixed CKEditor default skin depends on filesystem order. +#775608 by TwoD: Fixed FCKEditor crashes IE on save. +#824710 by TwoD: CKEditor not disabled upon enabling. +#752516 by nquocbao, sun: Fixed openwysiwyg version callback. #753536 by TwoD: Fixed version detection for Whizzywig. #752516 by nquocbao, sun: Fixed file stream warnings in version callbacks. #628110 by quicksketch, sun, markus_petrux: Added editor settings alter hook. diff --git a/sites/all/modules/wysiwyg/editors/ckeditor.inc b/sites/all/modules/wysiwyg/editors/ckeditor.inc index db13e18e..cf314d0b 100644 --- a/sites/all/modules/wysiwyg/editors/ckeditor.inc +++ b/sites/all/modules/wysiwyg/editors/ckeditor.inc @@ -1,5 +1,5 @@ <?php -// $Id: ckeditor.inc,v 1.7 2010/04/02 14:05:36 sun Exp $ +// $Id: ckeditor.inc,v 1.8 2010/09/10 02:13:59 sun Exp $ /** * @file @@ -103,6 +103,7 @@ function wysiwyg_ckeditor_themes($editor, $profile) { } } closedir($dir_handle); + natcasesort($themes); return !empty($themes) ? $themes : array('default'); } else { diff --git a/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js b/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js index 1dac6fda..5c22c14d 100644 --- a/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js +++ b/sites/all/modules/wysiwyg/editors/js/fckeditor-2.6.js @@ -1,4 +1,4 @@ -// $Id: fckeditor-2.6.js,v 1.20 2010/02/06 15:27:32 sun Exp $ +// $Id: fckeditor-2.6.js,v 1.21 2010/09/10 02:06:48 sun Exp $ (function($) { /** @@ -43,11 +43,19 @@ Drupal.wysiwyg.editor.detach.fckeditor = function(context, params) { // deepest. Its parent is the iFrame containing the editor. var instanceScope = instance.EditingArea.Window.parent; instanceScope.FCKTools.RemoveEventListener(instance.GetParentForm(), 'submit', instance.UpdateLinkedField); - // Remove the editor instance. + // Run cleanups before forcing an unload of the iFrames or IE crashes. + // This also deletes the instance from the FCKeditorAPI.__Instances array. + instanceScope.FCKTools.RemoveEventListener(instanceScope, 'unload', instanceScope.FCKeditorAPI_Cleanup); + instanceScope.FCKTools.RemoveEventListener(instanceScope, 'beforeunload', instanceScope.FCKeditorAPI_ConfirmCleanup); + if (jQuery.isFunction(instanceScope.FCKIECleanup_Cleanup)) { + instanceScope.FCKIECleanup_Cleanup(); + } + instanceScope.FCKeditorAPI_ConfirmCleanup(); + instanceScope.FCKeditorAPI_Cleanup(); + // Remove the editor elements. $('#' + instanceName + '___Config').remove(); $('#' + instanceName + '___Frame').remove(); $('#' + instanceName).show(); - delete instance; } }; diff --git a/sites/all/modules/wysiwyg/editors/js/tinymce-2.js b/sites/all/modules/wysiwyg/editors/js/tinymce-2.js index 43902cab..79095cb2 100644 --- a/sites/all/modules/wysiwyg/editors/js/tinymce-2.js +++ b/sites/all/modules/wysiwyg/editors/js/tinymce-2.js @@ -1,4 +1,4 @@ -// $Id: tinymce-2.js,v 1.12 2010/02/10 21:18:10 twod Exp $ +// $Id: tinymce-2.js,v 1.13 2010/09/25 03:00:16 twod Exp $ (function($) { /** @@ -48,6 +48,11 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, settings) { for (var setting in settings) { tinyMCE.settings[setting] = settings[setting]; } + + // #715228: Remove extra mceItem class added by Wysiwyg < v2.1. + $field = $('#' + params.field); + $field.val($field.val().replace(/class=(['"].*?)\bmceItem\b(.*?['"])/ig, 'class=$1$2')); + // Attach editor. tinyMCE.execCommand('mceAddControl', true, params.field); }; diff --git a/sites/all/modules/wysiwyg/editors/js/tinymce-3.js b/sites/all/modules/wysiwyg/editors/js/tinymce-3.js index b1d528a2..a406e48a 100644 --- a/sites/all/modules/wysiwyg/editors/js/tinymce-3.js +++ b/sites/all/modules/wysiwyg/editors/js/tinymce-3.js @@ -1,4 +1,4 @@ -// $Id: tinymce-3.js,v 1.19 2010/02/10 21:18:10 twod Exp $ +// $Id: tinymce-3.js,v 1.21 2010/09/25 03:00:16 twod Exp $ (function($) { /** @@ -60,6 +60,11 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, settings) { $('#' + ed.editorContainer + ' table.mceLayout td.mceToolbar').append($toolbar); $('#' + ed.editorContainer + ' table.mceToolbar').remove(); }); + + // #715228: Remove extra mceItem class added by Wysiwyg < v2.1. + $field = $('#' + params.field); + $field.val($field.val().replace(/class=(['"].*?)\bmceItem\b(.*?['"])/ig, 'class=$1$2')); + // Attach editor. ed.render(); }; @@ -106,7 +111,9 @@ Drupal.wysiwyg.editor.instance.tinymce = { ed.addCommand(plugin, function() { if (typeof Drupal.wysiwyg.plugins[plugin].invoke == 'function') { var data = { format: 'html', node: ed.selection.getNode(), content: ed.selection.getContent() }; - Drupal.wysiwyg.plugins[plugin].invoke(data, pluginSettings, ed.id); + // TinyMCE creates a completely new instance for fullscreen mode. + var instanceId = ed.id == 'mce_fullscreen' ? ed.getParam('fullscreen_editor_id') : ed.id; + Drupal.wysiwyg.plugins[plugin].invoke(data, pluginSettings, instanceId); } }); @@ -163,9 +170,10 @@ Drupal.wysiwyg.editor.instance.tinymce = { }, openDialog: function(dialog, params) { - var editor = tinyMCE.get(this.field); + var instanceId = this.isFullscreen() ? 'mce_fullscreen' : this.field; + var editor = tinyMCE.get(instanceId); editor.windowManager.open({ - file: dialog.url + '/' + this.field, + file: dialog.url + '/' + instanceId, width: dialog.width, height: dialog.height, inline: 1 @@ -173,7 +181,8 @@ Drupal.wysiwyg.editor.instance.tinymce = { }, closeDialog: function(dialog) { - var editor = tinyMCE.get(this.field); + var instanceId = this.isFullscreen() ? 'mce_fullscreen' : this.field; + var editor = tinyMCE.get(instanceId); editor.windowManager.close(dialog); }, @@ -208,7 +217,13 @@ Drupal.wysiwyg.editor.instance.tinymce = { insert: function(content) { content = this.prepareContent(content); - tinyMCE.execInstanceCommand(this.field, 'mceInsertContent', false, content); + var instanceId = this.isFullscreen() ? 'mce_fullscreen' : this.field; + tinyMCE.execInstanceCommand(instanceId, 'mceInsertContent', false, content); + }, + + isFullscreen: function() { + // TinyMCE creates a completely new instance for fullscreen mode. + return tinyMCE.activeEditor.id == 'mce_fullscreen' && tinyMCE.activeEditor.getParam('fullscreen_editor_id') == this.field; } }; diff --git a/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js b/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js index 2b462060..50fb2c00 100644 --- a/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js +++ b/sites/all/modules/wysiwyg/editors/js/whizzywig-56.js @@ -1,4 +1,4 @@ -// $Id: whizzywig-56.js,v 1.1 2010/02/06 17:33:34 sun Exp $ +// $Id: whizzywig-56.js,v 1.2 2010/09/25 11:53:19 twod Exp $ var wysiwygWhizzywig = { currentField: null, fields: {} }; var buttonPath = null; @@ -70,6 +70,11 @@ Drupal.wysiwyg.editor.attach.whizzywig = function(context, params, settings) { // Create Whizzywig container. wysiwygWhizzywig.currentField = params.field; wysiwygWhizzywig.fields[wysiwygWhizzywig.currentField] = ''; + // Whizzywig needs to have the width set 'inline'. + $field = $('#' + params.field); + Drupal.wysiwyg.instances[params.field].originalWidth = $field.css('width'); + $field.css('width', $field.width() + 'px'); + // Attach editor. makeWhizzyWig(params.field, (settings.buttons ? settings.buttons : 'all')); // Whizzywig fails to detect and set initial textarea contents. @@ -98,6 +103,7 @@ Drupal.wysiwyg.editor.detach.whizzywig = function(context, params) { // Remove editor instance. $('#' + whizzies[id] + '-whizzywig').remove(); whizzies.splice(id, 1); + $field.css('width', Drupal.wysiwyg.instances[$field.attr('id')].originalWidth); }; if (typeof params != 'undefined') { diff --git a/sites/all/modules/wysiwyg/editors/js/whizzywig.js b/sites/all/modules/wysiwyg/editors/js/whizzywig.js index c3bf7c6d..ef42e468 100644 --- a/sites/all/modules/wysiwyg/editors/js/whizzywig.js +++ b/sites/all/modules/wysiwyg/editors/js/whizzywig.js @@ -1,4 +1,4 @@ -// $Id: whizzywig.js,v 1.6 2009/09/29 01:48:23 sun Exp $ +// $Id: whizzywig.js,v 1.7 2010/09/25 11:53:19 twod Exp $ var wysiwygWhizzywig = { currentField: null, fields: {} }; var buttonPath = null; @@ -61,6 +61,13 @@ Drupal.wysiwyg.editor.attach.whizzywig = function(context, params, settings) { // Create Whizzywig container. wysiwygWhizzywig.currentField = params.field; wysiwygWhizzywig.fields[wysiwygWhizzywig.currentField] = ''; + // Whizzywig needs to have the width set 'inline'. + $field = $('#' + params.field); + this.instances = this.instances || {}; + this.instances[params.field] = this.instances[params.field] || {}; + this.instances[params.field].originalWidth = $field.css('width'); + $field.css('width', $field.width() + 'px'); + // Attach editor. makeWhizzyWig(params.field, (settings.buttons ? settings.buttons : 'all')); // Whizzywig fails to detect and set initial textarea contents. @@ -89,6 +96,7 @@ Drupal.wysiwyg.editor.detach.whizzywig = function(context, params) { // Remove editor instance. $('#' + whizzies[id] + '-whizzywig').remove(); whizzies.splice(id, 1); + $field.css('width', Drupal.wysiwyg.instances[$field.attr('id')].originalWidth); }; if (typeof params != 'undefined') { diff --git a/sites/all/modules/wysiwyg/editors/tinymce.inc b/sites/all/modules/wysiwyg/editors/tinymce.inc index 17fdc77d..9c05ad1f 100644 --- a/sites/all/modules/wysiwyg/editors/tinymce.inc +++ b/sites/all/modules/wysiwyg/editors/tinymce.inc @@ -1,5 +1,5 @@ <?php -// $Id: tinymce.inc,v 1.39 2010/04/02 14:05:36 sun Exp $ +// $Id: tinymce.inc,v 1.40 2010/09/25 00:12:34 twod Exp $ /** * @file @@ -86,8 +86,8 @@ function wysiwyg_tinymce_version($editor) { return; } $script = fopen($script, 'r'); - // Version is contained in the first 100 chars. - $line = fgets($script, 100); + // Version is contained in the first 200 chars. + $line = fgets($script, 200); // 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)) { diff --git a/sites/all/modules/wysiwyg/wysiwyg.info b/sites/all/modules/wysiwyg/wysiwyg.info index be2c727d..57946c9b 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.info +++ b/sites/all/modules/wysiwyg/wysiwyg.info @@ -12,9 +12,9 @@ files[] = wysiwyg.install files[] = wysiwyg.admin.inc files[] = wysiwyg.dialog.inc -; Information added by drupal.org packaging script on 2010-04-08 +; Information added by drupal.org packaging script on 2010-09-25 version = "7.x-2.x-dev" core = "7.x" project = "wysiwyg" -datestamp = "1270685982" +datestamp = "1285417346" diff --git a/sites/all/modules/wysiwyg/wysiwyg.install b/sites/all/modules/wysiwyg/wysiwyg.install index fdbab738..24508f19 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.install +++ b/sites/all/modules/wysiwyg/wysiwyg.install @@ -1,5 +1,5 @@ <?php -// $Id: wysiwyg.install,v 1.6 2009/09/26 05:37:56 sun Exp $ +// $Id: wysiwyg.install,v 1.7 2010/09/10 00:39:16 sun Exp $ /** * Implementation of hook_schema(). @@ -24,6 +24,7 @@ function wysiwyg_enable() { // Disable conflicting, obsolete editor integration modules whenever this // module is enabled. This is crude, but the only way to ensure no conflicts. module_disable(array( + 'ckeditor', 'editarea', 'editonpro', 'editor', diff --git a/sites/all/modules/wysiwyg/wysiwyg.js b/sites/all/modules/wysiwyg/wysiwyg.js index e3ae9b4c..14b49195 100644 --- a/sites/all/modules/wysiwyg/wysiwyg.js +++ b/sites/all/modules/wysiwyg/wysiwyg.js @@ -1,4 +1,4 @@ -// $Id: wysiwyg.js,v 1.18 2009/11/14 03:35:29 twod Exp $ +// $Id: wysiwyg.js,v 1.19 2010/09/25 00:46:33 twod Exp $ (function($) { /** @@ -201,7 +201,7 @@ Drupal.wysiwygAttachToggleLink = function(context, params) { Drupal.wysiwyg.getParams = function(element, params) { var classes = element.className.split(' '); var params = params || {}; - for (var i in classes) { + for (var i = 0; i < classes.length; i++) { if (classes[i].substr(0, 8) == 'wysiwyg-') { var parts = classes[i].split('-'); var value = parts.slice(2).join('-'); -- GitLab