2012-11-10 15:25:19 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
2012-11-10 15:25:19 +00:00
|
|
|
|
2013-09-21 23:39:42 +00:00
|
|
|
(function ($, Drupal, drupalSettings) {
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.behaviors.nodeDetailsSummaries = {
|
2021-12-18 06:12:16 +00:00
|
|
|
attach(context) {
|
|
|
|
const $context = $(context);
|
|
|
|
$context.find('.node-form-author').drupalSetSummary(context => {
|
2022-01-17 16:08:33 +00:00
|
|
|
const nameElement = context.querySelector('.field--name-uid input');
|
|
|
|
const name = nameElement && nameElement.value;
|
|
|
|
const dateElement = context.querySelector('.field--name-created input');
|
|
|
|
const date = dateElement && dateElement.value;
|
2015-12-10 14:56:01 +00:00
|
|
|
|
|
|
|
if (name && date) {
|
2018-08-09 15:49:18 +00:00
|
|
|
return Drupal.t('By @name on @date', {
|
|
|
|
'@name': name,
|
|
|
|
'@date': date
|
|
|
|
});
|
2018-07-05 15:50:52 +00:00
|
|
|
}
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2018-07-05 15:50:52 +00:00
|
|
|
if (name) {
|
2020-01-30 09:08:38 +00:00
|
|
|
return Drupal.t('By @name', {
|
|
|
|
'@name': name
|
|
|
|
});
|
2018-07-05 15:50:52 +00:00
|
|
|
}
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2018-07-05 15:50:52 +00:00
|
|
|
if (date) {
|
2020-01-30 09:08:38 +00:00
|
|
|
return Drupal.t('Authored on @date', {
|
|
|
|
'@date': date
|
|
|
|
});
|
2015-12-10 14:56:01 +00:00
|
|
|
}
|
2014-01-27 21:41:32 +00:00
|
|
|
});
|
2021-12-18 06:12:16 +00:00
|
|
|
$context.find('.node-form-options').drupalSetSummary(context => {
|
|
|
|
const $optionsContext = $(context);
|
|
|
|
const vals = [];
|
2009-04-11 22:19:46 +00:00
|
|
|
|
2015-01-10 01:36:01 +00:00
|
|
|
if ($optionsContext.find('input').is(':checked')) {
|
|
|
|
$optionsContext.find('input:checked').next('label').each(function () {
|
2021-10-12 19:17:13 +00:00
|
|
|
vals.push(Drupal.checkPlain($(this).text().trim()));
|
2014-01-27 21:41:32 +00:00
|
|
|
});
|
|
|
|
return vals.join(', ');
|
|
|
|
}
|
2017-07-06 06:21:40 +00:00
|
|
|
|
|
|
|
return Drupal.t('Not promoted');
|
2014-01-27 21:41:32 +00:00
|
|
|
});
|
|
|
|
}
|
2021-12-18 06:12:16 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery, Drupal, drupalSettings);
|