Mercurial > hg > cmmr2012-drupal-site
annotate core/modules/media/js/form.js @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
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.mediaFormSummaries = { |
Chris@0 | 10 attach: function attach(context) { |
Chris@0 | 11 var $context = $(context); |
Chris@0 | 12 |
Chris@0 | 13 $context.find('.media-form-author').drupalSetSummary(function (context) { |
Chris@0 | 14 var $authorContext = $(context); |
Chris@0 | 15 var name = $authorContext.find('.field--name-uid input').val(); |
Chris@0 | 16 var date = $authorContext.find('.field--name-created input').val(); |
Chris@0 | 17 |
Chris@0 | 18 if (name && date) { |
Chris@4 | 19 return Drupal.t('By @name on @date', { |
Chris@4 | 20 '@name': name, |
Chris@4 | 21 '@date': date |
Chris@4 | 22 }); |
Chris@4 | 23 } |
Chris@4 | 24 if (name) { |
Chris@0 | 25 return Drupal.t('By @name', { '@name': name }); |
Chris@4 | 26 } |
Chris@4 | 27 if (date) { |
Chris@0 | 28 return Drupal.t('Authored on @date', { '@date': date }); |
Chris@0 | 29 } |
Chris@0 | 30 }); |
Chris@0 | 31 } |
Chris@0 | 32 }; |
Chris@0 | 33 })(jQuery, Drupal); |