3 * Defines JavaScript behaviors for the media type form.
6 (function ($, Drupal) {
8 * Behaviors for setting summaries on media type form.
10 * @type {Drupal~behavior}
12 * @prop {Drupal~behaviorAttach} attach
13 * Attaches summary behaviors on media type edit forms.
15 Drupal.behaviors.mediaTypeFormSummaries = {
17 const $context = $(context);
18 // Provide the vertical tab summaries.
19 $context.find('#edit-workflow').drupalSetSummary((context) => {
21 $(context).find('input[name^="options"]:checked').parent().each(function () {
22 vals.push(Drupal.checkPlain($(this).find('label').text()));
24 if (!$(context).find('#edit-options-status').is(':checked')) {
25 vals.unshift(Drupal.t('Not published'));
27 return vals.join(', ');
29 $(context).find('#edit-language').drupalSetSummary((context) => {
32 vals.push($(context).find('.js-form-item-language-configuration-langcode select option:selected').text());
34 $(context).find('input:checked').next('label').each(function () {
35 vals.push(Drupal.checkPlain($(this).text()));
38 return vals.join(', ');