Index: widgeditor.module =================================================================== --- widgeditor.module (revision 994) +++ widgeditor.module (working copy) @@ -54,7 +54,6 @@ } function widgeditor_add_javascript($textareas = array(), $def_enabled) { - $query = ''; foreach ($textareas as $i => $ta) { $pattern = '/(\d+)-(\w+)/i'; @@ -65,33 +64,38 @@ drupal_add_js(drupal_get_path('module', 'widgeditor') . '/' . 'scripts/widgEditor.js'); drupal_add_css(drupal_get_path('module', 'widgeditor') . '/' . 'scripts/css/widgEditor.css'); if ($def_enabled) { - drupal_add_js('if (Drupal.jsEnabled) { - $(document).ready(function() { - var textareas = new Array(); -' . $query . ' - for (i=0;iEnable WYSIWYG\'); - } - $("a#widgEditor-id").click(function(){ - var string1= $(this).attr("class"); - var pattern=/(widgEditor)-(\w+)-(\w+)/i; - if (pattern.test(string1) == true) { - $("textarea#"+string1.replace(/widgEditor-/, "")).attr("class","widgEditor"); - widgInit(); - $(this).hide("slow"); - } - }); - }); -}', 'inline'); + drupal_add_js(' + if (Drupal.jsEnabled) { + $(document).ready(function() { + var textareas = new Array(); + ' . $query . ' + for (i=0;iEnable WYSIWYG\'); + } + $("a#widgEditor-id").click(function(){ + var string1= $(this).attr("class"); + var pattern=/(widgEditor)-(\w+)-(\w+)/i; + if (pattern.test(string1) == true) { + $("textarea#"+string1.replace(/widgEditor-/, "")).attr("class","widgEditor"); + widgInit(); + $(this).hide("slow"); + } + }); + }); + }', + 'inline'); } -} +} \ No newline at end of file