| 1 |
// $Id: comment-node-form.js,v 1.2 2009/04/27 20:19:36 webchick Exp $
|
| 2 |
|
| 3 |
(function ($) {
|
| 4 |
|
| 5 |
Drupal.behaviors.commentFieldsetSummaries = {
|
| 6 |
attach: function (context) {
|
| 7 |
$('fieldset#edit-comment-settings', context).setSummary(function (context) {
|
| 8 |
return Drupal.checkPlain($('input:checked', context).parent().text());
|
| 9 |
});
|
| 10 |
// Provide the summary for the node type form.
|
| 11 |
$('fieldset#edit-comment', context).setSummary(function(context) {
|
| 12 |
var vals = [];
|
| 13 |
|
| 14 |
// Default comment setting.
|
| 15 |
vals.push($("select[name='comment'] option:selected", context).text());
|
| 16 |
|
| 17 |
// Threading.
|
| 18 |
var threading = $("input[name='comment_default_mode']:checked", context).parent().text();
|
| 19 |
if (threading) {
|
| 20 |
vals.push(threading);
|
| 21 |
}
|
| 22 |
|
| 23 |
// Comments per page.
|
| 24 |
var number = $("select[name='comment_default_per_page'] option:selected", context).val();
|
| 25 |
vals.push(Drupal.t('@number comments per page', {'@number': number}));
|
| 26 |
|
| 27 |
return Drupal.checkPlain(vals.join(', '));
|
| 28 |
});
|
| 29 |
}
|
| 30 |
};
|
| 31 |
|
| 32 |
})(jQuery);
|