diff options
Diffstat (limited to 'modules/node/node.js')
-rw-r--r-- | modules/node/node.js | 35 |
1 files changed, 35 insertions, 0 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); |