X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fmedia%2Fjs%2Ftype_form.js;fp=web%2Fcore%2Fmodules%2Fmedia%2Fjs%2Ftype_form.js;h=79c24f957d9c7c6d2ca2d367ac5494cce24e9ec0;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/modules/media/js/type_form.js b/web/core/modules/media/js/type_form.js new file mode 100644 index 000000000..79c24f957 --- /dev/null +++ b/web/core/modules/media/js/type_form.js @@ -0,0 +1,36 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.mediaTypeFormSummaries = { + attach: function attach(context) { + var $context = $(context); + + $context.find('#edit-workflow').drupalSetSummary(function (context) { + var vals = []; + $(context).find('input[name^="options"]:checked').parent().each(function () { + vals.push(Drupal.checkPlain($(this).find('label').text())); + }); + if (!$(context).find('#edit-options-status').is(':checked')) { + vals.unshift(Drupal.t('Not published')); + } + return vals.join(', '); + }); + $(context).find('#edit-language').drupalSetSummary(function (context) { + var vals = []; + + vals.push($(context).find('.js-form-item-language-configuration-langcode select option:selected').text()); + + $(context).find('input:checked').next('label').each(function () { + vals.push(Drupal.checkPlain($(this).text())); + }); + + return vals.join(', '); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file