diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d494b61762bcdb96825dda98a2516fa653d0c6cf..24a3b0c76ce14998574f21fdaa8c5993143ae4c0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx Wysiwyg 6.x-x.x, xxxx-xx-xx --------------------------- +#319363 by sun: Changed JS settings namespace 'wysiwygEditor' to 'wysiwyg'. #319363 by sun: Code clean-up; fixed missing namespace change in tinymce-3.js. #273408 by quicksketch: Added blockquote button for TinyMCE 3. #319363 by sun: Changed JavaScript namespaces and centralized namespace diff --git a/editors/fckeditor.inc b/editors/fckeditor.inc index 214d1cddc46661f234a8dcebb72f448341a28493..dc03ce6388f9e4f7c95432552d83cfc939aa73fa 100644 --- a/editors/fckeditor.inc +++ b/editors/fckeditor.inc @@ -77,7 +77,7 @@ function wysiwyg_fckeditor_version($editor) { * * @return * A settings array to be populated in - * Drupal.settings.wysiwygEditor.configs.{editor} + * Drupal.settings.wysiwyg.configs.{editor} */ function wysiwyg_fckeditor_settings($editor, $config, $theme) { $init = array( diff --git a/editors/js/fckeditor-2.6.js b/editors/js/fckeditor-2.6.js index 8f243b340e2ebb70b629357cd1eb2e8eb6962725..156e5ba2026244bff84e8ef95135ede45b7893e2 100644 --- a/editors/js/fckeditor-2.6.js +++ b/editors/js/fckeditor-2.6.js @@ -15,7 +15,7 @@ Drupal.wysiwyg.editor.attach.fckeditor = function(context, params, settings) { FCKinstance.Config[setting] = settings[params.theme][setting]; } // Attach editor control if default is on. - if (Drupal.settings.wysiwygEditor.status) { + if (Drupal.settings.wysiwyg.status) { FCKinstance.ReplaceTextarea(); } }; diff --git a/editors/js/tinymce-2.js b/editors/js/tinymce-2.js index c04ea3a8c7de37099b14f89a3255404792f0f9d9..56a8bfc4da4bf94d96a36f4000da8323ef9bea69 100644 --- a/editors/js/tinymce-2.js +++ b/editors/js/tinymce-2.js @@ -13,19 +13,19 @@ Drupal.wysiwyg.editor.init.tinymce = function(editorSettings) { // 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.wysiwygEditor.editorBasePath; - tinyMCE.srcMode = (Drupal.settings.wysiwygEditor.execMode == 'src' ? '_src' : ''); - tinyMCE.gzipMode = (Drupal.settings.wysiwygEditor.execMode == 'gzip'); + tinyMCE.baseURL = Drupal.settings.wysiwyg.editorBasePath; + tinyMCE.srcMode = (Drupal.settings.wysiwyg.execMode == 'src' ? '_src' : ''); + tinyMCE.gzipMode = (Drupal.settings.wysiwyg.execMode == 'gzip'); for (var theme in editorSettings) { - // @todo Remove; moved into wysiwygEditor.js. + // @todo Remove; moved into wysiwyg_editor.js. // Clone, so original settings are not overwritten. var config = Drupal.wysiwyg.clone(editorSettings[theme]); tinyMCE.init(config); } // @todo Move into global library settings. - for (var plugin in Drupal.settings.wysiwygEditor.plugins.tinymce) { - tinyMCE.loadPlugin(plugin, Drupal.settings.wysiwygEditor.plugins.tinymce[plugin]); + for (var plugin in Drupal.settings.wysiwyg.plugins.tinymce) { + tinyMCE.loadPlugin(plugin, Drupal.settings.wysiwyg.plugins.tinymce[plugin]); } }; @@ -40,7 +40,7 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, editorSettings) tinyMCE.settings[setting] = editorSettings[params.theme][setting]; } // Attach editor control if default is on. - if (Drupal.settings.wysiwygEditor.status) { + if (Drupal.settings.wysiwyg.status) { tinyMCE.execCommand('mceAddControl', true, params.field); } }; diff --git a/editors/js/tinymce-3.js b/editors/js/tinymce-3.js index f86ea85b040894f9c64e6cf0d32152cfd1601fc7..7767c758926501b102f67bba7191244a7b8f4085 100644 --- a/editors/js/tinymce-3.js +++ b/editors/js/tinymce-3.js @@ -14,9 +14,9 @@ Drupal.wysiwyg.editor.init.tinymce = function(editorSettings) { // 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.wysiwygEditor.editorBasePath; - tinyMCE.srcMode = (Drupal.settings.wysiwygEditor.execMode == 'src' ? '_src' : ''); - tinyMCE.gzipMode = (Drupal.settings.wysiwygEditor.execMode == 'gzip'); + tinyMCE.baseURL = Drupal.settings.wysiwyg.editorBasePath; + tinyMCE.srcMode = (Drupal.settings.wysiwyg.execMode == 'src' ? '_src' : ''); + tinyMCE.gzipMode = (Drupal.settings.wysiwyg.execMode == 'gzip'); for (var theme in editorSettings) { // Clone, so original settings are not overwritten. @@ -24,8 +24,8 @@ Drupal.wysiwyg.editor.init.tinymce = function(editorSettings) { tinyMCE.init(config); } // @todo Move into global library settings. - for (var plugin in Drupal.settings.wysiwygEditor.plugins.tinymce) { - tinymce.PluginManager.load(plugin, Drupal.settings.wysiwygEditor.plugins.tinymce[plugin] + '/editor_plugin.js'); + for (var plugin in Drupal.settings.wysiwyg.plugins.tinymce) { + tinymce.PluginManager.load(plugin, Drupal.settings.wysiwyg.plugins.tinymce[plugin] + '/editor_plugin.js'); } }; @@ -40,7 +40,7 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, editorSettings) tinyMCE.settings[setting] = editorSettings[params.theme][setting]; } // Attach editor control if default is on. - if (Drupal.settings.wysiwygEditor.status) { + if (Drupal.settings.wysiwyg.status) { tinyMCE.execCommand('mceAddControl', true, params.field); } }; diff --git a/editors/tinymce.inc b/editors/tinymce.inc index 9564667b7fe3e35bfe2cc53db3ef8f8a0983fdff..9a8f82fad71318910fd87b3ad1a07c3dbdb1a1b4 100644 --- a/editors/tinymce.inc +++ b/editors/tinymce.inc @@ -103,7 +103,7 @@ function wysiwyg_tinymce_version($editor) { * * @return * A settings array to be populated in - * Drupal.settings.wysiwygEditor.configs.{editor} + * Drupal.settings.wysiwyg.configs.{editor} */ function wysiwyg_tinymce_settings($editor, $config, $theme) { $init = array( diff --git a/wysiwyg_editor.js b/wysiwyg_editor.js index f5530e1f5b2893982bcf4d36dc461dce436ca420..50bea6b7269898e90bdebdfe2e11a71e237e24c3 100644 --- a/wysiwyg_editor.js +++ b/wysiwyg_editor.js @@ -8,7 +8,7 @@ */ Drupal.wysiwygInit = function() { jQuery.each(Drupal.wysiwyg.editor.init, function(editor) { - this(Drupal.settings.wysiwygEditor.configs[editor]); + this(Drupal.settings.wysiwyg.configs[editor]); }); } @@ -48,7 +48,7 @@ Drupal.behaviors.attachWysiwyg = function(context) { // Directly attach this editor, if the input format is enabled or there is // only one input format at all. if (($this.is(':input') && $this.is(':checked')) || $this.is('div')) { - Drupal.wysiwygEditorAttachToggleLink(context, params); + Drupal.wysiwygAttachToggleLink(context, params); Drupal.wysiwygAttach(context, params); } // Attach onChange handlers to input format selector elements. @@ -80,7 +80,7 @@ Drupal.behaviors.attachWysiwyg = function(context) { Drupal.wysiwygAttach = function(context, params) { if (typeof Drupal.wysiwyg.editor.attach[params.editor] == 'function') { // Attach editor. - Drupal.wysiwyg.editor.attach[params.editor](context, params, Drupal.wysiwyg.clone(Drupal.settings.wysiwygEditor.configs[params.editor])); + Drupal.wysiwyg.editor.attach[params.editor](context, params, Drupal.wysiwyg.clone(Drupal.settings.wysiwyg.configs[params.editor])); // Display toggle link. $('#wysiwyg-toggle-' + params.field).show(); } @@ -116,13 +116,13 @@ Drupal.wysiwygDetach = function(context, params) { * @param params * An object containing input format parameters. */ -Drupal.wysiwygEditorAttachToggleLink = function(context, params) { - var text = document.createTextNode(Drupal.settings.wysiwygEditor.status ? Drupal.settings.wysiwygEditor.disable : Drupal.settings.wysiwygEditor.enable); +Drupal.wysiwygAttachToggleLink = function(context, params) { + var text = document.createTextNode(Drupal.settings.wysiwyg.status ? Drupal.settings.wysiwyg.disable : Drupal.settings.wysiwyg.enable); var a = document.createElement('a'); $(a).toggle( function() { Drupal.wysiwygDetach(context, params); - $('#wysiwyg-toggle-' + params.field).html(Drupal.settings.wysiwygEditor.enable).blur(); + $('#wysiwyg-toggle-' + params.field).html(Drupal.settings.wysiwyg.enable).blur(); // After disabling the editor, re-attach default behaviors. Drupal.wysiwyg.editor.attach.none(context, params); }, @@ -130,7 +130,7 @@ Drupal.wysiwygEditorAttachToggleLink = function(context, params) { // Before enabling the editor, detach default behaviors. Drupal.wysiwyg.editor.detach.none(context, params); Drupal.wysiwygAttach(context, params); - $('#wysiwyg-toggle-' + params.field).html(Drupal.settings.wysiwygEditor.disable).blur(); + $('#wysiwyg-toggle-' + params.field).html(Drupal.settings.wysiwyg.disable).blur(); }) .attr('id', 'wysiwyg-toggle-' + params.field) .attr('href', 'javascript:void(0);') diff --git a/wysiwyg_editor.module b/wysiwyg_editor.module index 79d184d269f31ae9b1bf1e7a6e8087ff574dece3..f4a24855fd614cc97005eef43139c1146536bf1e 100644 --- a/wysiwyg_editor.module +++ b/wysiwyg_editor.module @@ -264,7 +264,7 @@ function wysiwyg_editor_load_editor($profile) { } $status = wysiwyg_editor_user_get_status($profile); - drupal_add_js(array('wysiwygEditor' => array( + drupal_add_js(array('wysiwyg' => array( 'configs' => array($editor['name'] => array()), 'showToggle' => $profile->settings['show_toggle'], 'status' => $status, @@ -283,7 +283,7 @@ function wysiwyg_editor_load_editor($profile) { // Add basic Wysiwyg settings if any editor has been added. if (!isset($settings_added) && $loaded[$name]) { - drupal_add_js(array('wysiwygEditor' => array( + drupal_add_js(array('wysiwyg' => array( 'configs' => array(), 'disable' => t('Disable rich-text'), 'enable' => t('Enable rich-text'), @@ -300,7 +300,7 @@ function wysiwyg_editor_load_editor($profile) { // Add wysiwyg_editor.js to the footer to ensure it's executed after the // Drupal.settings array has been rendered and populated. Also, since editor // library initialization functions must be loaded first by the browser, - // Drupal.wysiwygEditorInit() must be executed AFTER editors registered + // Drupal.wysiwygInit() must be executed AFTER editors registered // their callbacks, and BEFORE Drupal.behaviors are applied, this must come // last. drupal_add_js(wysiwyg_get_path('wysiwyg_editor.js'), 'module', 'footer'); @@ -333,7 +333,7 @@ function wysiwyg_editor_add_settings($profile, $theme) { $config[$key] = implode(',', $config[$key]); } } - drupal_add_js(array('wysiwygEditor' => array('configs' => array($profile->settings['editor'] => array($theme => $config)))), 'setting'); + drupal_add_js(array('wysiwyg' => array('configs' => array($profile->settings['editor'] => array($theme => $config)))), 'setting'); $themes[$theme] = TRUE; } } @@ -363,7 +363,7 @@ function wysiwyg_editor_add_plugin_settings($profile) { $plugins = $editor['plugin settings callback']($editor, $profile, $info); } - drupal_add_js(array('wysiwygEditor' => array('plugins' => array($profile->settings['editor'] => $plugins))), 'setting'); + drupal_add_js(array('wysiwyg' => array('plugins' => array($profile->settings['editor'] => $plugins))), 'setting'); $plugins_added[$profile->settings['editor']] = TRUE; }