annotate 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
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@0 19 return Drupal.t('By @name on @date', { '@name': name, '@date': date });
Chris@0 20 } else if (name) {
Chris@0 21 return Drupal.t('By @name', { '@name': name });
Chris@0 22 } else if (date) {
Chris@0 23 return Drupal.t('Authored on @date', { '@date': date });
Chris@0 24 }
Chris@0 25 });
Chris@0 26 }
Chris@0 27 };
Chris@0 28 })(jQuery, Drupal);