-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPlugin.php
More file actions
50 lines (44 loc) · 1.27 KB
/
Plugin.php
File metadata and controls
50 lines (44 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php namespace Mossadal\MathJax;
use Backend;
use Controller;
use System\Classes\PluginBase;
use October\Rain\Support\MarkdownData;
use Mossadal\ExtendMarkdown\Models\Rule;
use Mossadal\ExtendMarkdown\Classes\Hooks;
use System\Classes\SettingsManager;
use Event;
use Rainlab\Blog\Controllers\Posts as PostsController;
/**
* MathJax Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* @var array Require the RainLab.Blog plugin
*/
public $require = ['RainLab.Blog'];
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'MathJax',
'description' => 'Allows MathJax preview on blog posts',
'author' => 'Frank Wikström, Mossadal konsult och design AB',
'icon' => 'icon-superscript'
];
}
/**
* Add Mathjax dependencies to the PostsController
*/
public function boot()
{
PostsController::extend(function ($controller) {
$controller->addJs("//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML");
$controller->addJs("/plugins/mossadal/mathjax/assets/js/mathjax.js");
});
}
}