summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsun2009-02-04 02:54:55 (GMT)
committer sun2009-02-04 02:54:55 (GMT)
commit7b623a49820525ac6f78b61bc6ffb0c4d2758204 (patch)
tree96dca21596f72f04a231437f9533d9a60c3ba717
parent328444ecbcb3e55c131ebb626161dea7266f6745 (diff)
#367632 by sun: Fixed invalid JavaScript syntax.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--editors/js/fckeditor-2.6.js10
-rw-r--r--editors/js/none.js2
-rw-r--r--editors/js/tinymce-3.js14
-rw-r--r--plugins/break/break.js2
-rw-r--r--wysiwyg.js14
6 files changed, 22 insertions, 21 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6193ba2..75f1bb2 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
Wysiwyg 6.x-2.x, xxxx-xx-xx
---------------------------
+#367632 by sun: Fixed invalid JavaScript syntax.
#319363 by sun: Follow-up: Synced 1.x with 2.x where possible.
#319363 by sun, quicksketch: Rewrote editor plugin API. The new plugin API
allows Drupal modules to expose editor plugins for ANY editor without
diff --git a/editors/js/fckeditor-2.6.js b/editors/js/fckeditor-2.6.js
index e2f4cc4..43c9c78 100644
--- a/editors/js/fckeditor-2.6.js
+++ b/editors/js/fckeditor-2.6.js
@@ -27,17 +27,17 @@ Drupal.wysiwyg.editor.attach.fckeditor = function(context, params, settings) {
*/
Drupal.wysiwyg.editor.detach.fckeditor = function(context, params) {
if (typeof params != 'undefined' && typeof FCKeditorAPI != 'undefined') {
- var editor = FCKeditorAPI.GetInstance(params.field);
- if (editor) {
- $('#' + params.field).val(editor.GetXHTML()).show();
+ var instance = FCKeditorAPI.GetInstance(params.field);
+ if (instance) {
+ $('#' + params.field).val(instance.GetXHTML()).show();
$('#' + params.field + '___Config').remove();
$('#' + params.field + '___Frame').remove();
delete FCKeditorAPI.__Instances[params.field];
}
}
else {
- for (instance in FCKeditorAPI.__Instances) {
- $('#' + instance).val(editor.GetXHTML()).show();
+ for (var instance in FCKeditorAPI.__Instances) {
+ $('#' + instance).val(instance.GetXHTML()).show();
$('#' + instance + '___Config').remove();
$('#' + instance + '___Frame').remove();
delete FCKeditorAPI.__Instances[instance];
diff --git a/editors/js/none.js b/editors/js/none.js
index 1879ef9..898855c 100644
--- a/editors/js/none.js
+++ b/editors/js/none.js
@@ -53,7 +53,7 @@ Drupal.wysiwyg.editor.instance.none = {
// IE support.
if (document.selection) {
editor.focus();
- sel = document.selection.createRange();
+ var sel = document.selection.createRange();
sel.text = content;
}
// Mozilla/Firefox/Netscape 7+ support.
diff --git a/editors/js/tinymce-3.js b/editors/js/tinymce-3.js
index e80f7b8..0136aae 100644
--- a/editors/js/tinymce-3.js
+++ b/editors/js/tinymce-3.js
@@ -55,18 +55,18 @@ Drupal.wysiwyg.editor.attach.tinymce = function(context, params, settings) {
*/
Drupal.wysiwyg.editor.detach.tinymce = function(context, params) {
if (typeof params != 'undefined') {
- var editor = tinyMCE.get(params.field);
- if (editor) {
- editor.save();
- editor.remove();
+ var instance = tinyMCE.get(params.field);
+ if (instance) {
+ instance.save();
+ instance.remove();
}
}
else {
// Save contents of all editors back into textareas.
tinyMCE.triggerSave();
// Remove all editor instances.
- for (var instanceId in tinyMCE.editors) {
- tinyMCE.editors[instanceId].remove();
+ for (var instance in tinyMCE.editors) {
+ tinyMCE.editors[instance].remove();
}
}
};
@@ -168,7 +168,7 @@ Drupal.wysiwyg.editor.instance.tinymce = {
var specialProperties = {
img: { class: 'mceItem' }
};
- $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
+ var $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
jQuery.each(specialProperties, function(element, properties) {
$content.find(element).each(function() {
for (var property in properties) {
diff --git a/plugins/break/break.js b/plugins/break/break.js
index 7e34b8c..a0cca26 100644
--- a/plugins/break/break.js
+++ b/plugins/break/break.js
@@ -45,7 +45,7 @@ Drupal.wysiwyg.plugins.break = {
* Replace images with <!--break--> tags in content upon detaching editor.
*/
detach: function(content, settings, instanceId) {
- $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
+ var $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :(
$('img.wysiwyg-break', $content).replaceWith('<!--break-->');
return $content.html();
},
diff --git a/wysiwyg.js b/wysiwyg.js
index 7aa7517..209a6e9 100644
--- a/wysiwyg.js
+++ b/wysiwyg.js
@@ -11,7 +11,7 @@ Drupal.wysiwygInit = function() {
// Clone, so original settings are not overwritten.
this(Drupal.wysiwyg.clone(Drupal.settings.wysiwyg.configs[editor]));
});
-}
+};
/**
* Attach editors to input formats and target elements (f.e. textareas).
@@ -57,7 +57,7 @@ Drupal.behaviors.attachWysiwyg = function(context) {
}
$this.addClass('wysiwyg-processed');
});
-}
+};
/**
* Attach an editor to a target element.
@@ -98,7 +98,7 @@ Drupal.wysiwygAttach = function(context, params) {
Drupal.wysiwyg.instances[params.field].editor = 'none';
}
}
-}
+};
/**
* Detach all editors from a target element.
@@ -113,7 +113,7 @@ Drupal.wysiwygDetach = function(context, params) {
if (jQuery.isFunction(Drupal.wysiwyg.editor.detach[editor])) {
Drupal.wysiwyg.editor.detach[editor](context, params);
}
-}
+};
/**
* Append or update an editor toggle link to a target element.
@@ -158,7 +158,7 @@ Drupal.wysiwygAttachToggleLink = function(context, params) {
if (params.editor == 'none') {
$('#wysiwyg-toggle-' + params.field).hide();
}
-}
+};
/**
* Parse the CSS classes of an input format DOM element into parameters.
@@ -186,7 +186,7 @@ Drupal.wysiwyg.getParams = function(element, params) {
params.status = parseInt(params.status);
params.resizable = parseInt(params.resizable);
return params;
-}
+};
/**
* Clone a configuration object recursively.
@@ -208,7 +208,7 @@ Drupal.wysiwyg.clone = function(obj) {
}
}
return clone;
-}
+};
/**
* Allow certain editor libraries to initialize before the DOM is loaded.