diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6193ba2ec786dc14c0cef45fdc471019b0c52ce0..75f1bb20a3668291a9b6e17e69597304769f65cc 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 e2f4cc46c9331c6fd5f2c9bd9940f58ffd1100d6..43c9c78177eeac3d9a95dec9ea15f8acc54d0376 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 1879ef9dd3396a1afa8456edf5c6f3bd18c0ca49..898855c97284fba6b7bdd3253c2e673cc81f3a04 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 e80f7b8468e76ee78eafc8913323a008e6c72917..0136aaed3a458ffc212d1e19f8d6d0a290167fbf 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 = $('