summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsun2009-01-07 09:02:53 (GMT)
committer sun2009-01-07 09:02:53 (GMT)
commite7b3eaf677677cfd032e25ab161e800313760346 (patch)
tree5456df5b5326ae3747a18807a6ccb7cfa26b75ca
parent09061e6e0a1036d0eb9d9726d205eda130640cba (diff)
#342376 by sun: Extended API to allow "preprocess" JavaScript option for some editors.
-rw-r--r--CHANGELOG.txt2
-rw-r--r--editors/tinymce.inc4
-rw-r--r--wysiwyg.module10
3 files changed, 13 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index b409bda..1792237 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 4db8d8e..c18cae7 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 7b378af..6e3fddc 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?