4 Drupal
.behaviors
.nodeFieldsetSummaries
= {
5 attach: function (context
) {
6 $('fieldset.node-form-revision-information', context
).drupalSetSummary(function (context
) {
7 var revisionCheckbox
= $('.form-item-revision input', context
);
9 // Return 'New revision' if the 'Create new revision' checkbox is checked,
10 // or if the checkbox doesn't exist, but the revision log does. For users
11 // without the "Administer content" permission the checkbox won't appear,
12 // but the revision log will if the content type is set to auto-revision.
13 if (revisionCheckbox
.is(':checked') || (!revisionCheckbox
.length
&& $('.form-item-log textarea', context
).length
)) {
14 return Drupal
.t('New revision');
17 return Drupal
.t('No revision');
20 $('fieldset.node-form-author', context
).drupalSetSummary(function (context
) {
21 var name
= $('.form-item-name input', context
).val() || Drupal
.settings
.anonymous
,
22 date
= $('.form-item-date input', context
).val();
24 Drupal
.t('By @name on @date', { '@name': name
, '@date': date
}) :
25 Drupal
.t('By @name', { '@name': name
});
28 $('fieldset.node-form-options', context
).drupalSetSummary(function (context
) {
31 $('input:checked', context
).parent().each(function () {
32 vals
.push(Drupal
.checkPlain($.trim($(this).text())));
35 if (!$('.form-item-status input', context
).is(':checked')) {
36 vals
.unshift(Drupal
.t('Not published'));
38 return vals
.join(', ');