comment-node-form.js 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. (function ($) {
  2. Drupal.behaviors.commentFieldsetSummaries = {
  3. attach: function (context) {
  4. $('fieldset.comment-node-settings-form', context).drupalSetSummary(function (context) {
  5. return Drupal.checkPlain($('.form-item-comment input:checked', context).next('label').text());
  6. });
  7. // Provide the summary for the node type form.
  8. $('fieldset.comment-node-type-settings-form', context).drupalSetSummary(function(context) {
  9. var vals = [];
  10. // Default comment setting.
  11. vals.push($(".form-item-comment select option:selected", context).text());
  12. // Threading.
  13. var threading = $(".form-item-comment-default-mode input:checked", context).next('label').text();
  14. if (threading) {
  15. vals.push(threading);
  16. }
  17. // Comments per page.
  18. var number = $(".form-item-comment-default-per-page select option:selected", context).val();
  19. vals.push(Drupal.t('@number comments per page', {'@number': number}));
  20. return Drupal.checkPlain(vals.join(', '));
  21. });
  22. }
  23. };
  24. })(jQuery);