summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.js35
-rw-r--r--modules/node/node.pages.inc14
2 files changed, 47 insertions, 2 deletions
diff --git a/modules/node/node.js b/modules/node/node.js
new file mode 100644
index 000000000..59647b34e
--- /dev/null
+++ b/modules/node/node.js
@@ -0,0 +1,35 @@
+// $Id$
+
+(function($) {
+
+Drupal.behaviors.nodeFieldsetSummaries = {
+ attach: function(context) {
+ $('fieldset#edit-revision-information', context).setSummary(function(context) {
+ return $('#edit-revision', context).is(':checked') ?
+ Drupal.t('New revision') :
+ Drupal.t('No revision');
+ });
+
+ $('fieldset#edit-author', context).setSummary(function(context) {
+ var name = $('#edit-name').val(), date = $('#edit-date').val();
+ return date ?
+ Drupal.t('By @name on @date', { '@name': name, '@date': date }) :
+ Drupal.t('By @name', { '@name': name });
+ });
+
+ $('fieldset#edit-options', context).setSummary(function(context) {
+ var vals = [];
+
+ $('input:checked', context).parent().each(function() {
+ vals.push(Drupal.checkPlain($.trim($(this).text())));
+ });
+
+ if (!$('#edit-status', context).is(':checked')) {
+ vals.unshift(Drupal.t('Not published'));
+ }
+ return vals.join(', ');
+ });
+ }
+};
+
+})(jQuery);
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index b77c3801c..c02d70fe5 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -152,6 +152,10 @@ function node_form(&$form_state, $node) {
$form['#node'] = $node;
+ $form['additional_settings'] = array(
+ '#type' => 'vertical_tabs',
+ );
+
// Add a log field if the "Create new revision" option is checked, or if the
// current user has the ability to check that option.
if (!empty($node->revision) || user_access('administer nodes')) {
@@ -161,6 +165,8 @@ function node_form(&$form_state, $node) {
'#collapsible' => TRUE,
// Collapsed by default when "Create new revision" is unchecked
'#collapsed' => !$node->revision,
+ '#group' => 'additional_settings',
+ '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'),
'#weight' => 20,
);
$form['revision_information']['revision'] = array(
@@ -172,7 +178,7 @@ function node_form(&$form_state, $node) {
$form['revision_information']['log'] = array(
'#type' => 'textarea',
'#title' => t('Revision log message'),
- '#rows' => 2,
+ '#rows' => 4,
'#description' => t('Provide an explanation of the changes you are making. This will help other authors understand your motivations.'),
);
}
@@ -184,6 +190,8 @@ function node_form(&$form_state, $node) {
'#title' => t('Authoring information'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
+ '#group' => 'additional_settings',
+ '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'),
'#weight' => 90,
);
$form['author']['name'] = array(
@@ -213,6 +221,8 @@ function node_form(&$form_state, $node) {
'#title' => t('Publishing options'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
+ '#group' => 'additional_settings',
+ '#attached_js' => array(drupal_get_path('module', 'node') . '/node.js'),
'#weight' => 95,
);
$form['options']['status'] = array(
@@ -283,7 +293,7 @@ function node_body_field(&$node, $label, $word_count) {
$form = array(
'#after_build' => array('node_teaser_js', 'node_teaser_include_verify'));
- $form['#prefix'] = '<div class="body-field-wrapper">';
+ $form['#prefix'] = '<div class="body-field-wrapper clearfix">';
$form['#suffix'] = '</div>';
$form['teaser_js'] = array(