summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsun2008-10-13 20:52:44 (GMT)
committer sun2008-10-13 20:52:44 (GMT)
commitf178028cce7f1acc9e31373374060fc866f932a6 (patch)
treeed6c4a083f21202e3838a5d62182628bd2a68b38
parent9eb0a9ec0333be769b02d7a4644b1ed1dd892703 (diff)
#319363 by sun: Changed JS settings namespace 'wysiwygEditor' to 'wysiwyg'.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--editors/fckeditor.inc2
-rw-r--r--editors/js/fckeditor-2.6.js2
-rw-r--r--editors/js/tinymce-2.js14
-rw-r--r--editors/js/tinymce-3.js12
-rw-r--r--editors/tinymce.inc2
-rw-r--r--wysiwyg_editor.js14
-rw-r--r--wysiwyg_editor.module10
8 files changed, 29 insertions, 28 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index d494b61..24a3b0c 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 214d1cd..dc03ce6 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 8f243b3..156e5ba 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 c04ea3a..56a8bfc 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 f86ea85..7767c75 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 9564667..9a8f82f 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 f5530e1..50bea6b 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 79d184d..f4a2485 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;
}