entity-form.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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.entityContentDetailsSummaries = {
  9. attach: function attach(context) {
  10. var $context = $(context);
  11. $context.find('.entity-content-form-revision-information').drupalSetSummary(function (context) {
  12. var $revisionContext = $(context);
  13. var revisionCheckbox = $revisionContext.find('.js-form-item-revision input');
  14. if (revisionCheckbox.is(':checked') || !revisionCheckbox.length && $revisionContext.find('.js-form-item-revision-log textarea').length) {
  15. return Drupal.t('New revision');
  16. }
  17. return Drupal.t('No revision');
  18. });
  19. $context.find('details.entity-translation-options').drupalSetSummary(function (context) {
  20. var $translationContext = $(context);
  21. var translate = void 0;
  22. var $checkbox = $translationContext.find('.js-form-item-translation-translate input');
  23. if ($checkbox.length) {
  24. translate = $checkbox.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated');
  25. } else {
  26. $checkbox = $translationContext.find('.js-form-item-translation-retranslate input');
  27. translate = $checkbox.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated');
  28. }
  29. return translate;
  30. });
  31. }
  32. };
  33. })(jQuery, Drupal);