-
Notifications
You must be signed in to change notification settings - Fork 99
/
Asset.php
executable file
·70 lines (62 loc) · 1.37 KB
/
Asset.php
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* This file is part of yii2-imperavi-widget.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/vova07/yii2-imperavi-widget
*/
namespace vova07\imperavi;
use yii\web\AssetBundle;
/**
* Widget asset bundle.
*
* @author Vasile Crudu <bazillio07@yandex.ru>
*
* @link https://github.com/vova07/yii2-imperavi-widget
*/
class Asset extends AssetBundle
{
/**
* @inheritdoc
*/
public $sourcePath = '@vova07/imperavi/assets';
/**
* @inheritdoc
*/
public $css = [
'redactor.css',
];
/**
* @inheritdoc
*/
public $js = [
'redactor.min.js',
];
/**
* @inheritdoc
*/
public $depends = [
'yii\web\JqueryAsset',
];
/**
* @param array $plugins The plugins array to register.
*/
public function addPlugins($plugins)
{
foreach ($plugins as $plugin) {
if ($plugin === 'clips') {
$this->css[] = 'plugins/' . $plugin . '/' . $plugin . '.css';
}
$this->js[] = 'plugins/' . $plugin . '/' . $plugin . '.js';
}
}
/**
* @param string $language The language to register.
*/
public function addLanguage($language)
{
$this->js[] = 'lang/' . $language . '.js';
}
}