diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-11-05 19:47:20 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-11-05 19:47:20 +0000 |
commit | ae85abb9833e0600afa0595a912be8065f8bccab (patch) | |
tree | 93940d8f28f7f5c63c07ecab9d94bdf20544fbbe /modules/node | |
parent | e920fe34ef16d30af0f4fb8e33b565e572ab30c8 (diff) | |
download | brdo-ae85abb9833e0600afa0595a912be8065f8bccab.tar.gz brdo-ae85abb9833e0600afa0595a912be8065f8bccab.tar.bz2 |
- Patch #955610 by casey: impossible to have multiple node forms on one page due to fixed IDs.
Diffstat (limited to 'modules/node')
-rw-r--r-- | modules/node/node.js | 14 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 9 |
2 files changed, 16 insertions, 7 deletions
diff --git a/modules/node/node.js b/modules/node/node.js index 9b2876baf..146d91a58 100644 --- a/modules/node/node.js +++ b/modules/node/node.js @@ -4,28 +4,28 @@ Drupal.behaviors.nodeFieldsetSummaries = { attach: function (context) { - $('fieldset#edit-revision-information', context).drupalSetSummary(function (context) { - return $('#edit-revision', context).is(':checked') ? + $('fieldset.node-form-revision-information', context).drupalSetSummary(function (context) { + return $('.form-item-revision input', context).is(':checked') ? Drupal.t('New revision') : Drupal.t('No revision'); }); - $('fieldset#edit-author', context).drupalSetSummary(function (context) { - var name = $('#edit-name').val() || Drupal.settings.anonymous, - date = $('#edit-date').val(); + $('fieldset.node-form-author', context).drupalSetSummary(function (context) { + var name = $('.form-item-name input', context).val() || Drupal.settings.anonymous, + date = $('.form-item-date input', context).val(); return date ? Drupal.t('By @name on @date', { '@name': name, '@date': date }) : Drupal.t('By @name', { '@name': name }); }); - $('fieldset#edit-options', context).drupalSetSummary(function (context) { + $('fieldset.node-form-options', context).drupalSetSummary(function (context) { var vals = []; $('input:checked', context).parent().each(function () { vals.push(Drupal.checkPlain($.trim($(this).text()))); }); - if (!$('#edit-status', context).is(':checked')) { + if (!$('.form-item-status input', context).is(':checked')) { vals.unshift(Drupal.t('Not published')); } return vals.join(', '); diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index a85b2afcf..166a510c7 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -166,6 +166,9 @@ function node_form($form, &$form_state, $node) { // Collapsed by default when "Create new revision" is unchecked '#collapsed' => !$node->revision, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('node-form-revision-information'), + ), '#attached' => array( 'js' => array(drupal_get_path('module', 'node') . '/node.js'), ), @@ -204,6 +207,9 @@ function node_form($form, &$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('node-form-author'), + ), '#attached' => array( 'js' => array( drupal_get_path('module', 'node') . '/node.js', @@ -240,6 +246,9 @@ function node_form($form, &$form_state, $node) { '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', + '#attributes' => array( + 'class' => array('node-form-options'), + ), '#attached' => array( 'js' => array(drupal_get_path('module', 'node') . '/node.js'), ), |