
| Current Path : /var/www/html/rocksensor1/web/modules/contrib/ckeditor/js/plugins/drupalmedialibrary/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/modules/contrib/ckeditor/js/plugins/drupalmedialibrary/plugin.js |
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
(function (Drupal, CKEDITOR) {
CKEDITOR.plugins.add('drupalmedialibrary', {
requires: 'drupalmedia',
icons: 'drupalmedialibrary',
hidpi: true,
beforeInit: function beforeInit(editor) {
editor.addCommand('drupalmedialibrary', {
allowedContent: {
'drupal-media': {
attributes: {
'!data-entity-type': true,
'!data-entity-uuid': true,
'!data-view-mode': true,
'!data-align': true,
'!data-caption': true,
'!alt': true,
'!title': true
},
classes: {}
}
},
requiredContent: new CKEDITOR.style({
element: 'drupal-media',
attributes: {
'data-entity-type': '',
'data-entity-uuid': ''
}
}),
modes: {
wysiwyg: 1
},
canUndo: true,
exec: function exec(editor) {
var saveCallback = function saveCallback(values) {
editor.fire('saveSnapshot');
var mediaElement = editor.document.createElement('drupal-media');
var attributes = values.attributes;
Object.keys(attributes).forEach(function (key) {
mediaElement.setAttribute(key, attributes[key]);
});
editor.insertHtml(mediaElement.getOuterHtml());
editor.fire('saveSnapshot');
};
Drupal.ckeditor.openDialog(editor, editor.config.DrupalMediaLibrary_url, {}, saveCallback, editor.config.DrupalMediaLibrary_dialogOptions);
}
});
if (editor.ui.addButton) {
editor.ui.addButton('DrupalMediaLibrary', {
label: Drupal.t('Insert from Media Library'),
command: 'drupalmedialibrary'
});
}
}
});
})(Drupal, CKEDITOR);