Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/media/js/form.js @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | a9cd425dd02b |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
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) { | |
9 Drupal.behaviors.mediaFormSummaries = { | |
10 attach: function attach(context) { | |
11 var $context = $(context); | |
12 | |
13 $context.find('.media-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', { '@name': name, '@date': date }); | |
20 } else if (name) { | |
21 return Drupal.t('By @name', { '@name': name }); | |
22 } else if (date) { | |
23 return Drupal.t('Authored on @date', { '@date': date }); | |
24 } | |
25 }); | |
26 } | |
27 }; | |
28 })(jQuery, Drupal); |