Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Nov 12, 2021
1 parent 9209bba commit 0404f0e
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions src/assets/Custom.php
Expand Up @@ -8,7 +8,10 @@
* @date 06.11.2014
* @since 1.0.0
*/

namespace skeeks\sx\assets;

use yii\helpers\Json;
/**
* Class Custom
* @package skeeks\sx\assets
Expand All @@ -21,7 +24,25 @@ public function init()
$this->_implodeFiles();
}

public $css = [
//JqueryJgrowl
'libs/jquery-plugins/jquery-jgrowl/jquery.jgrowl.min.css',
];

public $js = [

//ComponentNotify
'js/components/notify/Notify.js',

//JqueryJgrowl
'libs/jquery-plugins/jquery-jgrowl/jquery.jgrowl.js',

//'skeeks\sx\assets\ComponentNotifyJgrowl',
'js/components/notify/NotifyJgrowl.js',

//'skeeks\sx\assets\JqueryBlockUi',
'libs/jquery-plugins/block-ui/jquery.blockUI.min.js',

'js/Widget.js',
'js/helpers/Helpers.js',
'js/components/window/Window.js',
Expand All @@ -32,8 +53,40 @@ public function init()
];

public $depends = [
'yii\web\YiiAsset',
'skeeks\sx\assets\Core',
'skeeks\sx\assets\ComponentNotifyJgrowl',
'skeeks\sx\assets\JqueryBlockUi',
//'skeeks\sx\assets\ComponentNotifyJgrowl',
//'skeeks\sx\assets\JqueryBlockUi',
];


/**
* Registers this asset bundle with a view.
* @param View $view the view to be registered with
* @return static the registered asset bundle instance
*/
public function registerAssetFiles($view)
{
parent::registerAssetFiles($view);

$options = [
'notify' => [
'imageError' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/error.png'),
'imageFail' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/fail.gif'),
'imageInfo' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/info.png'),
'imageSuccess' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/success.png'),
'imageWarning' => \Yii::$app->getAssetManager()->getAssetUrl($this, 'js/components/notify/images/warning.png'),
],
];

$options = Json::encode($options);

$view->registerJs(<<<JS
(function(sx, $, _)
{
sx.Config.merge({$options});
})(sx, sx.$, sx._);
JS
);
}
}

0 comments on commit 0404f0e

Please sign in to comment.