Mercurial > hg > cmmr2012-drupal-site
annotate core/misc/entity-form.js @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
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); |