summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/comment/comment-node-form.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/comment/comment-node-form.js')
-rw-r--r--core/modules/comment/comment-node-form.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/core/modules/comment/comment-node-form.js b/core/modules/comment/comment-node-form.js
new file mode 100644
index 00000000000..76db2404ea1
--- /dev/null
+++ b/core/modules/comment/comment-node-form.js
@@ -0,0 +1,32 @@
+
+(function ($) {
+
+Drupal.behaviors.commentFieldsetSummaries = {
+ attach: function (context) {
+ $('fieldset.comment-node-settings-form', context).drupalSetSummary(function (context) {
+ return Drupal.checkPlain($('.form-item-comment input:checked', context).next('label').text());
+ });
+
+ // Provide the summary for the node type form.
+ $('fieldset.comment-node-type-settings-form', context).drupalSetSummary(function(context) {
+ var vals = [];
+
+ // Default comment setting.
+ vals.push($(".form-item-comment select option:selected", context).text());
+
+ // Threading.
+ var threading = $(".form-item-comment-default-mode input:checked", context).next('label').text();
+ if (threading) {
+ vals.push(threading);
+ }
+
+ // Comments per page.
+ var number = $(".form-item-comment-default-per-page select option:selected", context).val();
+ vals.push(Drupal.t('@number comments per page', {'@number': number}));
+
+ return Drupal.checkPlain(vals.join(', '));
+ });
+ }
+};
+
+})(jQuery);