1 ckeditor5.module ckeditor5_library_info()

Implements hook_library_info().

File

core/modules/ckeditor5/ckeditor5.module, line 64
Provides integration with the CKEditor WYSIWYG editor.

Code

function ckeditor5_library_info() {
  $module_path = backdrop_get_path('module', 'ckeditor5');
  $info = system_get_info('module', 'ckeditor5');

  $libraries['backdrop.ckeditor5.admin'] = array(
    'title' => 'Administrative library for configuring CKEditor.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/ckeditor5.admin.js' => array(),
    ),
    'css' => array(
      $module_path . '/css/ckeditor5.admin.css' => array(),
    ),
    'dependencies' => array(
      array('system', 'ui.sortable'),
      array('system', 'ui.draggable'),
    ),
  );
  $libraries['backdrop.ckeditor5'] = array(
    'title' => 'Backdrop behavior to enable CKEditor on textareas.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/ckeditor5.js' => array(),
      $module_path . '/js/ckeditor5.formatter.js' => array(),
    ),
    'css' => array(
      $module_path . '/css/ckeditor5.css' => array(),
    ),
    'dependencies' => array(
      array('filter', 'filter'),
      array('system', 'backdrop.ajax'),
      array('ckeditor5', 'ckeditor5'),
    ),
  );

  // CKEditor 5 does not have a built-in script loader. Any needed dependencies
  // should be present on the page when CKEditor loads. Add in library
  // dependencies to the overall CKEditor 5 library.
  $libraries['backdrop.ckeditor5']['dependencies'] = array_merge(
  $libraries['backdrop.ckeditor5']['dependencies'], 
  _ckeditor5_get_plugin_libraries()
  );

  // Collect a list of CSS files from the default theme to be added to the page
  // along with CKEditor 5 instances.
  $css = _ckeditor5_theme_css();
  backdrop_alter('ckeditor5_css', $css);
  foreach ($css as $file) {
    $libraries['backdrop.ckeditor5']['css'][$file] = array(
      'group' => CSS_THEME,
    );
  }

  $libraries['backdrop.ckeditor5.backdrop-basic-styles'] = array(
    'title' => 'CKEditor plugin to convert basic HTML tags to preferred tags.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/plugins/backdrop-basic-styles/backdrop-basic-styles.js' => array(),
    ),
  );
  $libraries['backdrop.ckeditor5.backdrop-html-engine'] = array(
    'title' => 'CKEditor plugin that writes the HTML source from the editor.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/plugins/backdrop-html-engine/backdrop-html-engine.js' => array(),
    ),
  );
  $libraries['backdrop.ckeditor5.backdrop-image'] = array(
    'title' => 'Integrates uploading images with CKEditor 5.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/plugins/backdrop-image/backdrop-image.js' => array(),
    ),
  );
  $libraries['backdrop.ckeditor5.backdrop-link'] = array(
    'title' => 'Provides a CKEditor 5 plugin for linking with a dialog.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/plugins/backdrop-link/backdrop-link.js' => array(),
    ),
  );
  $libraries['backdrop.ckeditor5.maximize'] = array(
    'title' => 'Provides a CKEditor 5 plugin to maximize the editor.',
    'version' => $info['version'],
    'js' => array(
      $module_path . '/js/plugins/backdrop-maximize/backdrop-maximize.js' => array(),
    ),
    'css' => array(
      $module_path . '/css/ckeditor5-maximize.css' => array(),
    ),
  );

  $libraries['ckeditor5'] = array(
    'title' => 'Loads the main CKEditor library.',
    'version' => $info['version'],
    'js' => array(
      // CKEditor is a large library but already compressed. Do not aggregate.
      $module_path . '/lib/ckeditor5/build/ckeditor5-dll.js' => array(
        'preprocess' => FALSE,
        'group' => JS_LIBRARY,
      ),
    ),
  );

  return $libraries;
}