summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsun2011-01-06 00:11:48 (GMT)
committer sun2011-01-06 00:11:48 (GMT)
commita271ac7accdd08f9b5dc2ba5448ab16e99bc8510 (patch)
tree68ea5abbdea9a52437416ae5fa36546d06979316
parent78bc24563fa27e7c7d3253128e0008f4b154d5de (diff)
#950216 by TwoD, sun: Fixed missing editor for a single text format.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--wysiwyg.js2
-rw-r--r--wysiwyg.module36
3 files changed, 28 insertions, 11 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 182deee..1c2dc2d 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -2,6 +2,7 @@
Wysiwyg 7.x-2.x, xxxx-xx-xx
---------------------------
+#950216 by TwoD, sun: Fixed missing editor for a single text format.
#1007630 by aspilicious: Removed files[] declarations from .info file.
#612954 by sun: Reverted 'buttons' change in profile configuration form.
#975546 by TwoD, sun: Fixed markItUp CSS loaded with wrong weight.
diff --git a/wysiwyg.js b/wysiwyg.js
index 9a2b3b0..4225f09 100644
--- a/wysiwyg.js
+++ b/wysiwyg.js
@@ -46,7 +46,7 @@ Drupal.behaviors.attachWysiwyg = {
}
$('.wysiwyg', context).once('wysiwyg', function() {
- if (!this.id || !this.value || typeof Drupal.settings.wysiwyg.triggers[this.id] === 'undefined') {
+ if (!this.id || typeof Drupal.settings.wysiwyg.triggers[this.id] === 'undefined') {
return;
}
var $this = $(this);
diff --git a/wysiwyg.module b/wysiwyg.module
index 7b30d29..c8ac362 100644
--- a/wysiwyg.module
+++ b/wysiwyg.module
@@ -137,10 +137,12 @@ function wysiwyg_pre_render_text_format($element) {
foreach ($format_field['format']['#options'] as $format_id => $format_name) {
$format = 'format' . $format_id;
// Initialize default settings, defaulting to 'none' editor.
- $settings[$format]['editor'] = 'none';
- $settings[$format]['status'] = 1;
- $settings[$format]['toggle'] = 1;
- $settings[$format]['resizable'] = $resizable;
+ $settings[$format] = array(
+ 'editor' => 'none',
+ 'status' => 1,
+ 'toggle' => 1,
+ 'resizable' => $resizable,
+ );
// Fetch the profile associated to this text format.
$profile = wysiwyg_get_profile($format_id);
@@ -162,15 +164,23 @@ function wysiwyg_pre_render_text_format($element) {
}
// Use a hidden element for a single text format.
if (!$format_field['format']['#access']) {
- $format_field['guidelines']['format'] = array(
+ $format_field['wysiwyg'] = array(
'#type' => 'hidden',
'#name' => $format_field['format']['#name'],
- '#id' => $format_field['format']['#id'],
'#value' => $format_id,
- '#attributes' => array('class' => array('wysiwyg')),
+ '#attributes' => array(
+ 'id' => $format_field['format']['#id'],
+ 'class' => array('wysiwyg'),
+ ),
);
- $format_field['guidelines']['format']['#attached']['js'][] = array(
- 'data' => array('wysiwyg' => array('triggers' => array($format_field['format']['#id'] => $settings))),
+ $format_field['wysiwyg']['#attached']['js'][] = array(
+ 'data' => array(
+ 'wysiwyg' => array(
+ 'triggers' => array(
+ $format_field['format']['#id'] => $settings,
+ ),
+ ),
+ ),
'type' => 'setting',
);
}
@@ -178,7 +188,13 @@ function wysiwyg_pre_render_text_format($element) {
else {
$format_field['format']['#attributes']['class'][] = 'wysiwyg';
$format_field['format']['#attached']['js'][] = array(
- 'data' => array('wysiwyg' => array('triggers' => array($format_field['format']['#id'] => $settings))),
+ 'data' => array(
+ 'wysiwyg' => array(
+ 'triggers' => array(
+ $format_field['format']['#id'] => $settings,
+ ),
+ ),
+ ),
'type' => 'setting',
);
}