| 1 |
// $Id: node.js,v 1.3 2009/04/11 22:19:45 webchick Exp $
|
| 2 |
|
| 3 |
(function ($) {
|
| 4 |
|
| 5 |
Drupal.behaviors.nodeFieldsetSummaries = {
|
| 6 |
attach: function (context) {
|
| 7 |
$('fieldset#edit-revision-information', context).setSummary(function (context) {
|
| 8 |
return $('#edit-revision', context).is(':checked') ?
|
| 9 |
Drupal.t('New revision') :
|
| 10 |
Drupal.t('No revision');
|
| 11 |
});
|
| 12 |
|
| 13 |
$('fieldset#edit-author', context).setSummary(function (context) {
|
| 14 |
var name = $('#edit-name').val(), date = $('#edit-date').val();
|
| 15 |
return date ?
|
| 16 |
Drupal.t('By @name on @date', { '@name': name, '@date': date }) :
|
| 17 |
Drupal.t('By @name', { '@name': name });
|
| 18 |
});
|
| 19 |
|
| 20 |
$('fieldset#edit-options', context).setSummary(function (context) {
|
| 21 |
var vals = [];
|
| 22 |
|
| 23 |
$('input:checked', context).parent().each(function () {
|
| 24 |
vals.push(Drupal.checkPlain($.trim($(this).text())));
|
| 25 |
});
|
| 26 |
|
| 27 |
if (!$('#edit-status', context).is(':checked')) {
|
| 28 |
vals.unshift(Drupal.t('Not published'));
|
| 29 |
}
|
| 30 |
return vals.join(', ');
|
| 31 |
});
|
| 32 |
}
|
| 33 |
};
|
| 34 |
|
| 35 |
})(jQuery);
|