diff --git a/core/.eslintignore b/core/.eslintignore index 44777b9fe3..d06be16821 100644 --- a/core/.eslintignore +++ b/core/.eslintignore @@ -3,6 +3,7 @@ node_modules/**/* **/js_test_files/**/* *.js !*.es6.js +modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.es6.js modules/locale/tests/locale_test.es6.js !tests/Drupal/Nightwatch/**/*.js misc/polyfills/array.find.es6.js diff --git a/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.es6.js b/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.es6.js new file mode 100644 index 0000000000..d131cf0f62 --- /dev/null +++ b/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.es6.js @@ -0,0 +1,34 @@ +(function (Drupal, once) { + Drupal.behaviors.CKEditor5Inspector = { + /** + * Facilitates adding and removing inspectors. + */ + attach() { + // This is added in a Drupal behavior so it can be applied after the + // Drupal.CKEditor5Instances Map() is initialized without having to change + // loading weights. + once('ckeditor5-inspector', 'body').forEach(() => { + // Get the current set and delete functions from + // Drupal.CKEditor5Instances so they can be called in their overrides. + const oldSet = Drupal.CKEditor5Instances.set; + const oldDelete = Drupal.CKEditor5Instances.delete; + + // Override set() so an inspector is added when it is called, then the + // default functionality is invoked. + Drupal.CKEditor5Instances.set = function (...args) { + const [id, editor] = args; + CKEditorInspector.attach({ [id]: editor }); + return oldSet.apply(Drupal.CKEditor5Instances, args); + }; + + // Override delete() so an inspector is detached when it is called, + // then the default functionality is invoked. + Drupal.CKEditor5Instances.delete = function (...args) { + const [id] = args; + CKEditorInspector.detach(id); + return oldDelete.apply(Drupal.CKEditor5Instances, args); + }; + }); + }, + }; +})(Drupal, once); diff --git a/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.js b/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.js index 02fdad4fe9..d86baa3251 100644 --- a/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.js +++ b/core/modules/ckeditor5/modules/ckeditor5_dev/js/ckeditor5_dev.js @@ -1,34 +1,40 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + (function (Drupal, once) { Drupal.behaviors.CKEditor5Inspector = { - /** - * Facilitates adding and removing inspectors. - */ - attach() { - // This is added in a Drupal behavior so it can be applied after the - // Drupal.CKEditor5Instances Map() is initialized without having to change - // loading weights. - once('ckeditor5-inspector', 'body').forEach(() => { - // Get the current set and delete functions from - // Drupal.CKEditor5Instances so they can be called in their overrides. - const oldSet = Drupal.CKEditor5Instances.set; - const oldDelete = Drupal.CKEditor5Instances.delete; + attach: function attach() { + once('ckeditor5-inspector', 'body').forEach(function () { + var oldSet = Drupal.CKEditor5Instances.set; + var oldDelete = Drupal.CKEditor5Instances.delete; + + Drupal.CKEditor5Instances.set = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - // Override set() so an inspector is added when it is called, then the - // default functionality is invoked. - Drupal.CKEditor5Instances.set = function (...args) { - const [id, editor] = args; - CKEditorInspector.attach( { [id]: editor } ); + var id = args[0], + editor = args[1]; + CKEditorInspector.attach(_defineProperty({}, id, editor)); return oldSet.apply(Drupal.CKEditor5Instances, args); }; - // Override delete() so an inspector is detached when it is called, - // then the default functionality is invoked. - Drupal.CKEditor5Instances.delete = function (...args) { - const [id] = args; + Drupal.CKEditor5Instances.delete = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var id = args[0]; CKEditorInspector.detach(id); return oldDelete.apply(Drupal.CKEditor5Instances, args); - } + }; }); } - } -})(Drupal, once); + }; +})(Drupal, once); \ No newline at end of file