annotate core/misc/entity-form.js @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 /**
Chris@0 2 * DO NOT EDIT THIS FILE.
Chris@0 3 * See the following change record for more information,
Chris@0 4 * https://www.drupal.org/node/2815083
Chris@0 5 * @preserve
Chris@0 6 **/
Chris@0 7
Chris@0 8 (function ($, Drupal) {
Chris@0 9 Drupal.behaviors.entityContentDetailsSummaries = {
Chris@0 10 attach: function attach(context) {
Chris@0 11 var $context = $(context);
Chris@0 12 $context.find('.entity-content-form-revision-information').drupalSetSummary(function (context) {
Chris@0 13 var $revisionContext = $(context);
Chris@0 14 var revisionCheckbox = $revisionContext.find('.js-form-item-revision input');
Chris@0 15
Chris@0 16 if (revisionCheckbox.is(':checked') || !revisionCheckbox.length && $revisionContext.find('.js-form-item-revision-log textarea').length) {
Chris@0 17 return Drupal.t('New revision');
Chris@0 18 }
Chris@0 19
Chris@0 20 return Drupal.t('No revision');
Chris@0 21 });
Chris@0 22
Chris@0 23 $context.find('details.entity-translation-options').drupalSetSummary(function (context) {
Chris@0 24 var $translationContext = $(context);
Chris@0 25 var translate = void 0;
Chris@0 26 var $checkbox = $translationContext.find('.js-form-item-translation-translate input');
Chris@0 27
Chris@0 28 if ($checkbox.length) {
Chris@0 29 translate = $checkbox.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated');
Chris@0 30 } else {
Chris@0 31 $checkbox = $translationContext.find('.js-form-item-translation-retranslate input');
Chris@0 32 translate = $checkbox.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated');
Chris@0 33 }
Chris@0 34
Chris@0 35 return translate;
Chris@0 36 });
Chris@0 37 }
Chris@0 38 };
Chris@0 39 })(jQuery, Drupal);