Index: img_assist.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/img_assist/img_assist.module,v retrieving revision 1.102 diff -u -p -r1.102 img_assist.module --- img_assist.module 4 Jun 2009 01:18:12 -0000 1.102 +++ img_assist.module 9 Jun 2009 00:47:29 -0000 @@ -571,14 +571,18 @@ function img_assist_cache_clear() { */ function img_assist_loader() { $path = drupal_get_path('module', 'img_assist'); - $editor = arg(2) ? arg(2) : 'textarea'; + $caller = arg(2) ? arg(2) : 'textarea'; - drupal_add_js($path .'/img_assist_popup.js'); - if ($editor == 'tinymce') { - $tinymce_path = drupal_get_path('module', 'wysiwyg'); - drupal_add_js($tinymce_path .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js'); + drupal_add_js($path . '/img_assist_popup.js'); + if (module_exists('wysiwyg') && ($editor = wysiwyg_get_editor($caller))) { + if ($editor['name'] == 'tinymce') { + drupal_add_js($editor['library path'] . '/tiny_mce_popup.js'); + } + } + else { + $caller = 'textarea'; } - drupal_add_js($path .'/img_assist_'. $editor .'.js'); + drupal_add_js($path .'/img_assist_'. $caller .'.js'); $output = ''."\n"; $output .= "\n";