Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / core / modules / node / node.js
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
8 (function ($, Drupal, drupalSettings) {
9   Drupal.behaviors.nodeDetailsSummaries = {
10     attach: function attach(context) {
11       var $context = $(context);
12
13       $context.find('.node-form-author').drupalSetSummary(function (context) {
14         var $authorContext = $(context);
15         var name = $authorContext.find('.field--name-uid input').val();
16         var date = $authorContext.find('.field--name-created input').val();
17
18         if (name && date) {
19           return Drupal.t('By @name on @date', {
20             '@name': name,
21             '@date': date
22           });
23         }
24         if (name) {
25           return Drupal.t('By @name', { '@name': name });
26         }
27         if (date) {
28           return Drupal.t('Authored on @date', { '@date': date });
29         }
30       });
31
32       $context.find('.node-form-options').drupalSetSummary(function (context) {
33         var $optionsContext = $(context);
34         var vals = [];
35
36         if ($optionsContext.find('input').is(':checked')) {
37           $optionsContext.find('input:checked').next('label').each(function () {
38             vals.push(Drupal.checkPlain($.trim($(this).text())));
39           });
40           return vals.join(', ');
41         }
42
43         return Drupal.t('Not promoted');
44       });
45     }
46   };
47 })(jQuery, Drupal, drupalSettings);