Skip to content
Snippets Groups Projects
Commit b7c9f69c authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4210 Add mathjax plugin

parent 1a4ea2b6
No related branches found
No related tags found
1 merge request!39Feature/istwcms 4210 l26yan add mathjax
<?php
namespace Drupal\uw_cfg_common\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\editor\Entity\Editor;
/**
* Defines the "mathjax" plugin.
*
* @CKEditorPlugin(
* id = "mathjax",
* label = @Translation("Mathjax")
* )
*/
class MathJaxPlugin extends CKEditorPluginBase {
/**
* {@inheritdoc}
*/
public function getDependencies(Editor $editor) {
return [
'clipboard',
'dialog',
'lineutils',
'widget',
];
}
/**
* {@inheritdoc}
*/
public function getLibraries(Editor $editor) {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfig(Editor $editor) {
return [
'mathJaxLib' => '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS_HTML',
];
}
/**
* {@inheritdoc}
*/
public function getButtons() {
return [
'Mathjax' => [
'label' => $this->t('Math'),
'image' => drupal_get_path('profile', 'uw_base_profile') . '/libraries/ckeditor-mathjax/icons/mathjax.png',
],
];
}
/**
* {@inheritdoc}
*/
public function getFile() {
return drupal_get_path('profile', 'uw_base_profile') . '/libraries/ckeditor-mathjax/plugin.js';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment