diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b409bda7b913db82b096c4f17db6cb116c79704e..1792237e38fb6b5a07b8c36d5816ce206408d7a2 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -6,6 +6,8 @@ Wysiwyg x.x-x.x, xxxx-xx-xx Wysiwyg 5.x-x.x, xxxx-xx-xx --------------------------- +#342376 by sun: Extended API to allow "preprocess" JavaScript option for some + editors. #352295 by sun: Added markItUp editor support. #352703 by sun: Fixed wrong default configuration options for TinyMCE 3.2.1+. #348317 by sun: Fixed TinyMCE's extended_valid_elements for advlink/advimage diff --git a/editors/tinymce.inc b/editors/tinymce.inc index 4db8d8e87ec269c53ec2134fd5ae8fe980c905fe..c18cae71aebb1be1c2ea1269cf5157cb01ada176 100644 --- a/editors/tinymce.inc +++ b/editors/tinymce.inc @@ -48,7 +48,9 @@ function wysiwyg_tinymce_editor() { 'libraries' => array( '' => array( 'title' => 'Minified', - 'files' => array('tiny_mce.js'), + 'files' => array( + 'tiny_mce.js' => array('preprocess' => FALSE), + ), ), 'jquery' => array( 'title' => 'jQuery', diff --git a/wysiwyg.module b/wysiwyg.module index 7b378af22c66d5d59b9031a87ae47075dd7efadd..6e3fddcdad11163b1c2215018d93aeb5d81d7c33 100644 --- a/wysiwyg.module +++ b/wysiwyg.module @@ -218,8 +218,14 @@ function wysiwyg_load_editor($profile) { $files = array_shift($editor['libraries']); $files = $files['files']; } - foreach ($files as $file) { - drupal_add_js($editor['library path'] . '/' . $file); + foreach ($files as $file => $options) { + if (is_array($options)) { + $options += array('type' => 'module', 'scope' => 'header', 'defer' => FALSE, 'cache' => TRUE, 'preprocess' => TRUE); + drupal_add_js($editor['library path'] . '/' . $file, $options['type'], $options['scope'], $options['defer'], $options['cache'], $options['preprocess']); + } + else { + drupal_add_js($editor['library path'] . '/' . $options); + } } // If editor defines an additional load callback, invoke it. // @todo Isn't the settings callback sufficient?