Completed
Push — master ( bd340d...f93ca8 )
by Henry
07:26
created

TextareaResizer   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A renderStart() 0 9 1
1
<?php
2
namespace Redaxscript\Modules\TextareaResizer;
3
4
use Redaxscript\Head;
5
use Redaxscript\Module;
6
7
/**
8
 * Adjust the textarea to fit content
9
 *
10
 * @since 4.0.0
11
 *
12
 * @package Redaxscript
13
 * @category Modules
14
 * @author Henry Ruhs
15
 */
16
17
class TextareaResizer extends Module\Module
18
{
19
	/**
20
	 * array of the module
21
	 *
22
	 * @var array
23
	 */
24
25
	protected static $_moduleArray =
26
	[
27
		'name' => 'Textarea Resizer',
28
		'alias' => 'TextareaResizer',
29
		'author' => 'Redaxmedia',
30
		'description' => 'Adjust the textarea to fit content',
31
		'version' => '4.0.0'
32
	];
33
34
	/**
35
	 * renderStart
36
	 *
37
	 * @since 4.0.0
38
	 */
39
40
	public function renderStart()
41
	{
42
		$script = Head\Script::getInstance();
43
		$script
44
			->init('foot')
45
			->appendFile('https://cdnjs.cloudflare.com/ajax/libs/autosize.js/4.0.2/autosize.min.js')
46
			->appendFile('modules/TextareaResizer/assets/scripts/init.js')
47
			->appendFile('modules/TextareaResizer/dist/scripts/textarea-resizer.min.js');
48
	}
49
}
50