Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
19
web/core/misc/drupal.init.js
Normal file
19
web/core/misc/drupal.init.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Allow other JavaScript libraries to use $.
|
||||
if (window.jQuery) {
|
||||
jQuery.noConflict();
|
||||
}
|
||||
|
||||
// Class indicating that JS is enabled; used for styling purpose.
|
||||
document.documentElement.className += ' js';
|
||||
|
||||
// JavaScript should be made compatible with libraries other than jQuery by
|
||||
// wrapping it in an anonymous closure.
|
||||
|
||||
(function (domready, Drupal, drupalSettings) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// Attach all behaviors.
|
||||
domready(function () { Drupal.attachBehaviors(document, drupalSettings); });
|
||||
|
||||
})(domready, Drupal, window.drupalSettings);
|
|
@ -40,17 +40,9 @@
|
|||
*/
|
||||
window.Drupal = {behaviors: {}, locale: {}};
|
||||
|
||||
// Class indicating that JavaScript is enabled; used for styling purpose.
|
||||
document.documentElement.className += ' js';
|
||||
|
||||
// Allow other JavaScript libraries to use $.
|
||||
if (window.jQuery) {
|
||||
jQuery.noConflict();
|
||||
}
|
||||
|
||||
// JavaScript should be made compatible with libraries other than jQuery by
|
||||
// wrapping it in an anonymous closure.
|
||||
(function (domready, Drupal, drupalSettings, drupalTranslations) {
|
||||
(function (Drupal, drupalSettings, drupalTranslations) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -174,9 +166,6 @@ if (window.jQuery) {
|
|||
}
|
||||
};
|
||||
|
||||
// Attach all behaviors.
|
||||
domready(function () { Drupal.attachBehaviors(document, drupalSettings); });
|
||||
|
||||
/**
|
||||
* Detaches registered behaviors from a page element.
|
||||
*
|
||||
|
@ -591,4 +580,4 @@ if (window.jQuery) {
|
|||
return '<em class="placeholder">' + Drupal.checkPlain(str) + '</em>';
|
||||
};
|
||||
|
||||
})(domready, Drupal, window.drupalSettings, window.drupalTranslations);
|
||||
})(Drupal, window.drupalSettings, window.drupalTranslations);
|
||||
|
|
57
web/core/misc/entity-form.js
Normal file
57
web/core/misc/entity-form.js
Normal file
|
@ -0,0 +1,57 @@
|
|||
/**
|
||||
* @file
|
||||
* Defines Javascript behaviors for the block_content module.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Sets summaries about revision and translation of entities.
|
||||
*
|
||||
* @type {Drupal~behavior}
|
||||
*
|
||||
* @prop {Drupal~behaviorAttach} attach
|
||||
* Attaches summary behaviour entity form tabs.
|
||||
*
|
||||
* Specifically, it updates summaries to the revision information and the
|
||||
* translation options.
|
||||
*/
|
||||
Drupal.behaviors.entityContentDetailsSummaries = {
|
||||
attach: function (context) {
|
||||
var $context = $(context);
|
||||
$context.find('.entity-content-form-revision-information').drupalSetSummary(function (context) {
|
||||
var $revisionContext = $(context);
|
||||
var revisionCheckbox = $revisionContext.find('.js-form-item-revision input');
|
||||
|
||||
// Return 'New revision' if the 'Create new revision' checkbox is checked,
|
||||
// or if the checkbox doesn't exist, but the revision log does. For users
|
||||
// without the "Administer content" permission the checkbox won't appear,
|
||||
// but the revision log will if the content type is set to auto-revision.
|
||||
if (revisionCheckbox.is(':checked') || (!revisionCheckbox.length && $revisionContext.find('.js-form-item-revision-log textarea').length)) {
|
||||
return Drupal.t('New revision');
|
||||
}
|
||||
|
||||
return Drupal.t('No revision');
|
||||
});
|
||||
|
||||
$context.find('details.entity-translation-options').drupalSetSummary(function (context) {
|
||||
var $translationContext = $(context);
|
||||
var translate;
|
||||
var $checkbox = $translationContext.find('.js-form-item-translation-translate input');
|
||||
|
||||
if ($checkbox.length) {
|
||||
translate = $checkbox.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated');
|
||||
}
|
||||
else {
|
||||
$checkbox = $translationContext.find('.js-form-item-translation-retranslate input');
|
||||
translate = $checkbox.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated');
|
||||
}
|
||||
|
||||
return translate;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, Drupal);
|
|
@ -71,22 +71,22 @@
|
|||
xhr = null;
|
||||
}
|
||||
|
||||
// Wait 300 milliseconds since the last event to update the machine name
|
||||
// i.e., after the user has stopped typing.
|
||||
// Wait 300 milliseconds for Ajax request since the last event to update
|
||||
// the machine name i.e., after the user has stopped typing.
|
||||
if (timeout) {
|
||||
clearTimeout(timeout);
|
||||
timeout = null;
|
||||
}
|
||||
timeout = setTimeout(function () {
|
||||
if (baseValue.toLowerCase() !== expected) {
|
||||
if (baseValue.toLowerCase() !== expected) {
|
||||
timeout = setTimeout(function () {
|
||||
xhr = self.transliterate(baseValue, options).done(function (machine) {
|
||||
self.showMachineName(machine.substr(0, options.maxlength), data);
|
||||
});
|
||||
}
|
||||
else {
|
||||
self.showMachineName(expected, data);
|
||||
}
|
||||
}, 300);
|
||||
}, 300);
|
||||
}
|
||||
else {
|
||||
self.showMachineName(expected, data);
|
||||
}
|
||||
}
|
||||
|
||||
Object.keys(settings.machineName).forEach(function (source_id) {
|
||||
|
|
Reference in a new issue