Commit 325352d7 authored by sun's avatar sun

#316507 by sun: Code clean-up; editor settings should be cloned for init, too.

parent 92da632d
......@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
Wysiwyg 6.x-x.x, xxxx-xx-xx
---------------------------
#316507 by sun: Code clean-up; editor settings should be cloned for init, too.
#282717 by sun: Fixed FCKeditor default settings while FCKeditor maintainers get
up and running.
#319363 by sun: Changed JS settings namespace 'wysiwygEditor' to 'wysiwyg'.
......
......@@ -17,13 +17,10 @@ Drupal.wysiwyg.editor.init.tinymce = function(editorSettings) {
tinyMCE.srcMode = (Drupal.settings.wysiwyg.execMode == 'src' ? '_src' : '');
tinyMCE.gzipMode = (Drupal.settings.wysiwyg.execMode == 'gzip');
// Initialize editor configurations.
for (var theme in editorSettings) {
// @todo Remove; moved into wysiwyg_editor.js.
// Clone, so original settings are not overwritten.
var config = Drupal.wysiwyg.clone(editorSettings[theme]);
tinyMCE.init(config);
tinyMCE.init(editorSettings[theme]);
}
// @todo Move into global library settings.
for (var plugin in Drupal.settings.wysiwyg.plugins.tinymce) {
tinyMCE.loadPlugin(plugin, Drupal.settings.wysiwyg.plugins.tinymce[plugin]);
}
......
......@@ -18,14 +18,12 @@ Drupal.wysiwyg.editor.init.tinymce = function(editorSettings) {
tinyMCE.srcMode = (Drupal.settings.wysiwyg.execMode == 'src' ? '_src' : '');
tinyMCE.gzipMode = (Drupal.settings.wysiwyg.execMode == 'gzip');
// Initialize editor configurations.
for (var theme in editorSettings) {
// Clone, so original settings are not overwritten.
var config = Drupal.wysiwyg.clone(editorSettings[theme]);
tinyMCE.init(config);
tinyMCE.init(editorSettings[theme]);
}
// @todo Move into global library settings.
for (var plugin in Drupal.settings.wysiwyg.plugins.tinymce) {
tinymce.PluginManager.load(plugin, Drupal.settings.wysiwyg.plugins.tinymce[plugin] + '/editor_plugin.js');
tinymce.PluginManager.load(plugin, Drupal.settings.wysiwyg.plugins.tinymce[plugin]);
}
};
......
......@@ -263,14 +263,14 @@ function wysiwyg_tinymce_themes($editor, $profile) {
* TinyMCE requires that external plugins (i.e. not residing in the editor's
* directory) are loaded (once) after the editor has been initialized.
*/
function wysiwyg_tinymce_plugin_settings($editor, $profile, $info) {
$plugins = array();
foreach ($info as $name => $plugin) {
function wysiwyg_tinymce_plugin_settings($editor, $profile, $plugins) {
$settings = array();
foreach ($plugins as $name => $plugin) {
if (!isset($plugin['internal'])) {
$plugins[$name] = base_path() . $plugin['path'];
$settings[$name] = base_path() . $plugin['path'];
}
}
return $plugins;
return $settings;
}
/**
......
......@@ -8,7 +8,8 @@
*/
Drupal.wysiwygInit = function() {
jQuery.each(Drupal.wysiwyg.editor.init, function(editor) {
this(Drupal.settings.wysiwyg.configs[editor]);
// Clone, so original settings are not overwritten.
this(Drupal.wysiwyg.clone(Drupal.settings.wysiwyg.configs[editor]));
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment