diff --git a/README.md b/README.md index 67084d8..b3f910e 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ Lightbox2 widget for Yii2 The Lightbox2 widget is a customized lightbox script based on [Lightbox](https://lokeshdhakar.com/projects/lightbox2/). and This widget used to overlay images on top of the current page. -![alt text](https://github.com/coderius/github-images/blob/master/pic1.png "Description goes here") - Installation ------------ The preferred way to install this extension is through [composer](http://getcomposer.org/download/). @@ -12,13 +10,13 @@ The preferred way to install this extension is through [composer](http://getcomp Either run ``` -php composer.phar require coderius/yii2-lightbox2-widget "@dev" +php composer.phar require crestoff/yii2-lightbox2-widget "@dev" ``` or add ```json -"coderius/yii2-lightbox2-widget" : "@dev" +"crestoff/yii2-lightbox2-widget" : "@dev" ``` to the require section of your application's `composer.json` file. @@ -28,9 +26,9 @@ Usage * In view: ```php -use coderius\lightbox2\Lightbox2; +use crestoff\lightbox2\Lightbox2; - [ 'resizeDuration' => 200, 'wrapAround' => true, @@ -59,6 +57,4 @@ to set group images, then put identic names to data-lightbox attribute for each *Thumbnail picture, by clicking on which opens the widget is wrapped with a link - - -Reference to plugin [github](https://github.com/lokesh/lightbox2/) repository that is used in this widget. \ No newline at end of file +Reference to plugin [github](https://github.com/lokesh/lightbox2/) repository that is used in this widget. diff --git a/composer.json b/composer.json index bbcf601..6a5abae 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "coderius/yii2-lightbox2-widget", + "name": "crestoff/yii2-lightbox2-widget", "description": "Yii 2 lightbox2-widget", "keywords": ["lightbox", "widget", "lightbox2", "yii2"], "type": "yii2-extension", @@ -22,7 +22,7 @@ }, "autoload": { "psr-4": { - "coderius\\lightbox2\\": "src/" + "crestoff\\lightbox2\\": "src/" } }, "extra": { @@ -38,4 +38,4 @@ } ] -} \ No newline at end of file +} diff --git a/src/Lightbox2.php b/src/Lightbox2.php index e914b81..88c01d4 100644 --- a/src/Lightbox2.php +++ b/src/Lightbox2.php @@ -1,48 +1,25 @@ - * @contacts sunrise4fun@gmail.com - Have suggestions, contact me :) - * @link https://github.com/coderius - My github - */ -namespace coderius\lightbox2; +namespace crestoff\lightbox2; use yii\base\Widget; use yii\helpers\Json; class Lightbox2 extends Widget { - /** - * @var array the options for the lightbox2 JS plugin. - * @see https://lokeshdhakar.com/projects/lightbox2/ - */ public $clientOptions = []; - /** - * @inheritdoc - */ public function init() { - parent::init(); - + parent::init(); } - /** - * @inheritdoc - */ public function run() { $plugin = $this->makePlugin('lightbox'); - $this->registerAssets($plugin); - + $this->registerAssets($plugin); } - /** - * @param string $name - * @return string - */ protected function makePlugin($name) { $js = false; @@ -55,17 +32,10 @@ protected function makePlugin($name) return $js; } - - /** - * @param string $plugin - */ + protected function registerAssets($plugin){ $view = $this->getView(); $bundle = Lightbox2Asset::register($view); $view->registerJs($plugin); } - - - - -} \ No newline at end of file +} diff --git a/src/Lightbox2Asset.php b/src/Lightbox2Asset.php index 3b83b5a..63d353b 100644 --- a/src/Lightbox2Asset.php +++ b/src/Lightbox2Asset.php @@ -1,14 +1,6 @@ - * @contacts sunrise4fun@gmail.com - Have suggestions, contact me :) - * @link https://github.com/coderius - My github - */ - -namespace coderius\lightbox2; +namespace crestoff\lightbox2; use Yii; use yii\web\AssetBundle; @@ -17,24 +9,18 @@ class Lightbox2Asset extends AssetBundle { public $sourcePath = '@bower/lightbox2/dist'; - public $css = []; - public $js = []; - -// public $jsOptions = [ -// 'position' => \yii\web\View::POS_END, -// ]; + public $css = []; public $depends = [ 'yii\web\JqueryAsset', ]; + public function init() { parent::init(); - $this->js[] = YII_DEBUG ? 'js/lightbox.js' : 'lightbox.min.js'; - $this->css[] = YII_DEBUG ? 'css/lightbox.css' : 'lightbox.min.css'; + $this->js[] = YII_DEBUG ? 'js/lightbox.js' : 'js/lightbox.min.js'; + $this->css[] = YII_DEBUG ? 'css/lightbox.css' : 'css/lightbox.min.css'; } - } -