From dcbb5fa3f4434be266793f6a610071a14c777414 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 9 Apr 2007 13:58:03 +0000 Subject: - Patch #107061 by Steven et al: add jQuery teaser splitter. --- includes/form.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'includes') diff --git a/includes/form.inc b/includes/form.inc index 0ce8b3d3a..1845f4d9a 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1452,6 +1452,18 @@ function theme_form($element) { */ function theme_textarea($element) { $class = array('form-textarea'); + + // Add teaser behaviour (must come before resizable) + if (!empty($element['#teaser'])) { + drupal_add_js('misc/teaser.js'); + // Note: arrays are merged in drupal_get_js(). + drupal_add_js(array('teaserButton' => array(t('Join summary'), t('Split summary at cursor'))), 'setting'); + drupal_add_js(array('teaserCheckbox' => array($element['#id'] => $element['#teaser_checkbox'])), 'setting'); + drupal_add_js(array('teaser' => array($element['#id'] => $element['#teaser'])), 'setting'); + $class[] = 'teaser'; + } + + // Add resizable behaviour if ($element['#resizable'] !== FALSE) { drupal_add_js('misc/textarea.js'); $class[] = 'resizable'; -- cgit v1.2.3