3 * Javascript for the node content editing form.
6 (function ($, Drupal) {
11 * Behaviors for setting summaries on content type form.
13 * @type {Drupal~behavior}
15 * @prop {Drupal~behaviorAttach} attach
16 * Attaches summary behaviors on content type edit forms.
18 Drupal.behaviors.contentTypes = {
19 attach: function (context) {
20 var $context = $(context);
21 // Provide the vertical tab summaries.
22 $context.find('#edit-submission').drupalSetSummary(function (context) {
24 vals.push(Drupal.checkPlain($(context).find('#edit-title-label').val()) || Drupal.t('Requires a title'));
25 return vals.join(', ');
27 $context.find('#edit-workflow').drupalSetSummary(function (context) {
29 $(context).find('input[name^="options"]:checked').parent().each(function () {
30 vals.push(Drupal.checkPlain($(this).text()));
32 if (!$(context).find('#edit-options-status').is(':checked')) {
33 vals.unshift(Drupal.t('Not published'));
35 return vals.join(', ');
37 $('#edit-language', context).drupalSetSummary(function (context) {
40 vals.push($('.js-form-item-language-configuration-langcode select option:selected', context).text());
42 $('input:checked', context).next('label').each(function () {
43 vals.push(Drupal.checkPlain($(this).text()));
46 return vals.join(', ');
48 $context.find('#edit-display').drupalSetSummary(function (context) {
50 var $editContext = $(context);
51 $editContext.find('input:checked').next('label').each(function () {
52 vals.push(Drupal.checkPlain($(this).text()));
54 if (!$editContext.find('#edit-display-submitted').is(':checked')) {
55 vals.unshift(Drupal.t("Don't display post information"));
57 return vals.join(', ');