function DrupalMedia::getLibraries

Same name and namespace in other branches
  1. 8.9.x core/modules/media/src/Plugin/CKEditorPlugin/DrupalMedia.php \Drupal\media\Plugin\CKEditorPlugin\DrupalMedia::getLibraries()

Returns a list of libraries this plugin requires.

These libraries will be attached to the text_format element on which the editor is being loaded.

Parameters

\Drupal\editor\Entity\Editor $editor: A configured text editor object.

Return value

array An array of libraries suitable for usage in a render API #attached property.

Overrides CKEditorPluginInterface::getLibraries

File

core/modules/ckeditor/src/Plugin/CKEditorPlugin/DrupalMedia.php, line 82

Class

DrupalMedia
Defines the "drupalmedia" plugin.

Namespace

Drupal\ckeditor\Plugin\CKEditorPlugin

Code

public function getLibraries(Editor $editor) {
    return [
        'core/jquery',
        'core/drupal',
        'core/drupal.ajax',
        // @see Drupal.theme.mediaEmbedPreviewError()
'media/media_embed_ckeditor_theme',
        // @see Drupal.theme.mediaEmbedEditButton()
'ckeditor/drupal.ckeditor.plugins.drupalmedia',
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.