content_types.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. **/
  7. (function ($, Drupal) {
  8. Drupal.behaviors.contentTypes = {
  9. attach: function attach(context) {
  10. var $context = $(context);
  11. $context.find('#edit-submission').drupalSetSummary(function (context) {
  12. var vals = [];
  13. vals.push(Drupal.checkPlain($(context).find('#edit-title-label').val()) || Drupal.t('Requires a title'));
  14. return vals.join(', ');
  15. });
  16. $context.find('#edit-workflow').drupalSetSummary(function (context) {
  17. var vals = [];
  18. $(context).find('input[name^="options"]:checked').next('label').each(function () {
  19. vals.push(Drupal.checkPlain($(this).text()));
  20. });
  21. if (!$(context).find('#edit-options-status').is(':checked')) {
  22. vals.unshift(Drupal.t('Not published'));
  23. }
  24. return vals.join(', ');
  25. });
  26. $('#edit-language', context).drupalSetSummary(function (context) {
  27. var vals = [];
  28. vals.push($('.js-form-item-language-configuration-langcode select option:selected', context).text());
  29. $('input:checked', context).next('label').each(function () {
  30. vals.push(Drupal.checkPlain($(this).text()));
  31. });
  32. return vals.join(', ');
  33. });
  34. $context.find('#edit-display').drupalSetSummary(function (context) {
  35. var vals = [];
  36. var $editContext = $(context);
  37. $editContext.find('input:checked').next('label').each(function () {
  38. vals.push(Drupal.checkPlain($(this).text()));
  39. });
  40. if (!$editContext.find('#edit-display-submitted').is(':checked')) {
  41. vals.unshift(Drupal.t("Don't display post information"));
  42. }
  43. return vals.join(', ');
  44. });
  45. }
  46. };
  47. })(jQuery, Drupal);