Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
61
web/core/modules/ckeditor/js/ckeditor.js
vendored
61
web/core/modules/ckeditor/js/ckeditor.js
vendored
|
@ -3,7 +3,7 @@
|
|||
* CKEditor implementation of {@link Drupal.editors} API.
|
||||
*/
|
||||
|
||||
(function (Drupal, debounce, CKEDITOR, $) {
|
||||
(function (Drupal, debounce, CKEDITOR, $, displace, AjaxCommands) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -85,6 +85,26 @@
|
|||
editor.on('change', debounce(function () {
|
||||
callback(editor.getData());
|
||||
}, 400));
|
||||
|
||||
// A temporary workaround to control scrollbar appearance when using
|
||||
// autoGrow event to control editor's height.
|
||||
// @todo Remove when http://dev.ckeditor.com/ticket/12120 is fixed.
|
||||
editor.on('mode', function () {
|
||||
var editable = editor.editable();
|
||||
if (!editable.isInline()) {
|
||||
editor.on('autoGrow', function (evt) {
|
||||
var doc = evt.editor.document;
|
||||
var scrollable = CKEDITOR.env.quirks ? doc.getBody() : doc.getDocumentElement();
|
||||
|
||||
if (scrollable.$.scrollHeight < scrollable.$.clientHeight) {
|
||||
scrollable.setStyle('overflow-y', 'hidden');
|
||||
}
|
||||
else {
|
||||
scrollable.removeStyle('overflow-y');
|
||||
}
|
||||
}, null, null, 10000);
|
||||
}
|
||||
});
|
||||
}
|
||||
return !!editor;
|
||||
},
|
||||
|
@ -273,6 +293,11 @@
|
|||
}
|
||||
});
|
||||
|
||||
// Formulate a default formula for the maximum autoGrow height.
|
||||
$(document).on('drupalViewportOffsetChange', function () {
|
||||
CKEDITOR.config.autoGrow_maxHeight = 0.7 * (window.innerHeight - displace.offsets.top - displace.offsets.bottom);
|
||||
});
|
||||
|
||||
// Redirect on hash change when the original hash has an associated CKEditor.
|
||||
function redirectTextareaFragmentToCKEditorInstance() {
|
||||
var hash = location.hash.substr(1);
|
||||
|
@ -287,7 +312,39 @@
|
|||
}
|
||||
$(window).on('hashchange.ckeditor', redirectTextareaFragmentToCKEditorInstance);
|
||||
|
||||
// Set autoGrow to make the editor grow the moment it is created.
|
||||
CKEDITOR.config.autoGrow_onStartup = true;
|
||||
|
||||
// Set the CKEditor cache-busting string to the same value as Drupal.
|
||||
CKEDITOR.timestamp = drupalSettings.ckeditor.timestamp;
|
||||
|
||||
})(Drupal, Drupal.debounce, CKEDITOR, jQuery);
|
||||
if (AjaxCommands) {
|
||||
|
||||
/**
|
||||
* Command to add style sheets to a CKEditor instance.
|
||||
*
|
||||
* Works for both iframe and inline CKEditor instances.
|
||||
*
|
||||
* @param {Drupal.Ajax} [ajax]
|
||||
* {@link Drupal.Ajax} object created by {@link Drupal.ajax}.
|
||||
* @param {object} response
|
||||
* The response from the Ajax request.
|
||||
* @param {string} response.editor_id
|
||||
* The CKEditor instance ID.
|
||||
* @param {number} [status]
|
||||
* The XMLHttpRequest status.
|
||||
*
|
||||
* @see http://docs.ckeditor.com/#!/api/CKEDITOR.dom.document
|
||||
*/
|
||||
AjaxCommands.prototype.ckeditor_add_stylesheet = function (ajax, response, status) {
|
||||
var editor = CKEDITOR.instances[response.editor_id];
|
||||
|
||||
if (editor) {
|
||||
response.stylesheets.forEach(function (url) {
|
||||
editor.document.appendStyleSheet(url);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
})(Drupal, Drupal.debounce, CKEDITOR, jQuery, Drupal.displace, Drupal.AjaxCommands);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
var parsedAttributes = {};
|
||||
|
||||
var domElement = element.$;
|
||||
var attribute = null;
|
||||
var attribute;
|
||||
var attributeName;
|
||||
for (var attrIndex = 0; attrIndex < domElement.attributes.length; attrIndex++) {
|
||||
attribute = domElement.attributes.item(attrIndex);
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
};
|
||||
|
||||
// Create hidden CKEditor with all features enabled, retrieve metadata.
|
||||
// @see \Drupal\ckeditor\Plugin\Editor\CKEditor::settingsForm.
|
||||
// @see \Drupal\ckeditor\Plugin\Editor\CKEditor::buildConfigurationForm().
|
||||
var hiddenCKEditorID = 'ckeditor-hidden';
|
||||
if (CKEDITOR.instances[hiddenCKEditorID]) {
|
||||
CKEDITOR.instances[hiddenCKEditorID].destroy(true);
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
var $button = $target.parent();
|
||||
var $container = $button.parent();
|
||||
var $group = $button.closest('.ckeditor-toolbar-group');
|
||||
var $row = $button.closest('.ckeditor-row');
|
||||
var $row;
|
||||
var containerType = $container.data('drupal-ckeditor-button-sorting');
|
||||
var $availableButtons = this.$el.find('[data-drupal-ckeditor-button-sorting="source"]');
|
||||
var $activeButtons = this.$el.find('.ckeditor-toolbar-active');
|
||||
|
|
Reference in a new issue