Asset   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 51
ccs 0
cts 13
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerAssetFiles() 0 14 1
1
<?php
2
3
/*
4
 * TwentyFifteen Theme for hiqdev/yii2-thememanager
5
 *
6
 * @link      https://github.com/hiqdev/yii2-theme-twentyfifteen
7
 * @package   yii2-theme-twentyfifteen
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\themes\twentyfifteen;
13
14
use yii\bootstrap\BootstrapAsset;
15
use yii\web\JqueryAsset;
16
use yii\web\View;
17
18
/**
19
 * Theme main asset bundle.
20
 */
21
class Asset extends \yii\web\AssetBundle
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public $sourcePath = '@wp-content/themes/twentyfifteen';
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public $css = [
32
        '//fonts.googleapis.com/css?family=Noto+Sans%3A400italic%2C700italic%2C400%2C700%7CNoto+Serif%3A400italic%2C700italic%2C400%2C700%7CInconsolata%3A400%2C700&subset=latin%2Clatin-ext',
33
        'genericons/genericons.css',
34
        'style.css',
35
    ];
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public $js = [
41
        'js/skip-link-focus-fix.js',
42
        'js/keyboard-image-navigation.js',
43
        'js/functions.js',
44
    ];
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public $depends = [
50
        JqueryAsset::class,
51
        BootstrapAsset::class,
52
    ];
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function registerAssetFiles($view)
58
    {
59
        parent::registerAssetFiles($view);
60
61
        $manager = $view->getAssetManager();
62
        $view->registerJs('
63
        /* <![CDATA[ */
64
        var screenReaderText = {"expand":"<span class=\"screen-reader-text\">expand child menu<\/span>","collapse":"<span class=\"screen-reader-text\">collapse child menu<\/span>"};
65
        /* ]]> */
66
        ', View::POS_HEAD);
67
        $view->registerJsFile($manager->getAssetUrl($this, 'js/html5.js'), ['condition' => 'lt IE 9', 'position' => View::POS_HEAD]);
68
        $view->registerCssFile($manager->getAssetUrl($this, 'css/ie.css'), ['condition' => 'lt IE 9']);
69
        $view->registerCssFile($manager->getAssetUrl($this, 'css/ie7.css'), ['condition' => 'lt IE 8']);
70
    }
71
}
72