From de808bca2512c05ed633acbe74dfffe54b1e880f Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:14:54 +0700 Subject: [PATCH 1/8] fix Asset for prod mode --- src/Lightbox2Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lightbox2Asset.php b/src/Lightbox2Asset.php index 3b83b5a..de88c5b 100644 --- a/src/Lightbox2Asset.php +++ b/src/Lightbox2Asset.php @@ -32,8 +32,8 @@ 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' : 'js/lightbox.min.css'; } } From 9b936f6d88f02b8958d0aabadf92acf0d56b7af7 Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:27:11 +0700 Subject: [PATCH 2/8] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 67084d8..5990850 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 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") +![alt text](https://github.com/crestoff/github-images/blob/master/pic1.png "Description goes here") Installation ------------ @@ -12,13 +12,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 +28,9 @@ Usage * In view: ```php -use coderius\lightbox2\Lightbox2; +use crestoff\lightbox2\Lightbox2; - [ 'resizeDuration' => 200, 'wrapAround' => true, @@ -61,4 +61,4 @@ to set group images, then put identic names to data-lightbox attribute for each -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. From a6421b51bd85de4c9fe832c2639bed39b484ed55 Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:40:53 +0700 Subject: [PATCH 3/8] Update composer.json --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 +} From 72fc3567de37edb767decd0b51d54b2e193374e4 Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:47:10 +0700 Subject: [PATCH 4/8] Update Lightbox2.php --- src/Lightbox2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lightbox2.php b/src/Lightbox2.php index e914b81..676d4be 100644 --- a/src/Lightbox2.php +++ b/src/Lightbox2.php @@ -7,7 +7,7 @@ * @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; @@ -68,4 +68,4 @@ protected function registerAssets($plugin){ -} \ No newline at end of file +} From ec3f269e6d9536cb0964d483097e8c38d02aff21 Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:48:02 +0700 Subject: [PATCH 5/8] Update Lightbox2Asset.php --- src/Lightbox2Asset.php | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/Lightbox2Asset.php b/src/Lightbox2Asset.php index de88c5b..0c6582e 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,17 +9,13 @@ 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(); @@ -35,6 +23,4 @@ public function init() $this->js[] = YII_DEBUG ? 'js/lightbox.js' : 'js/lightbox.min.js'; $this->css[] = YII_DEBUG ? 'css/lightbox.css' : 'js/lightbox.min.css'; } - } - From afd0e0d1c1acf002d5f15430515894616353b63c Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:48:56 +0700 Subject: [PATCH 6/8] Update Lightbox2.php --- src/Lightbox2.php | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/src/Lightbox2.php b/src/Lightbox2.php index 676d4be..88c01d4 100644 --- a/src/Lightbox2.php +++ b/src/Lightbox2.php @@ -1,12 +1,5 @@ - * @contacts sunrise4fun@gmail.com - Have suggestions, contact me :) - * @link https://github.com/coderius - My github - */ namespace crestoff\lightbox2; use yii\base\Widget; @@ -14,35 +7,19 @@ 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); } - - - - } From f3ab0953c8a229016d639b338740a9390f2b357c Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:49:39 +0700 Subject: [PATCH 7/8] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 5990850..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/crestoff/github-images/blob/master/pic1.png "Description goes here") - Installation ------------ The preferred way to install this extension is through [composer](http://getcomposer.org/download/). @@ -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. From 51d230f883cd234c0df8ea74f8a2b6ed81684911 Mon Sep 17 00:00:00 2001 From: Dmitry Crestoff Date: Thu, 11 May 2023 14:54:27 +0700 Subject: [PATCH 8/8] Update Lightbox2Asset.php --- src/Lightbox2Asset.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lightbox2Asset.php b/src/Lightbox2Asset.php index 0c6582e..63d353b 100644 --- a/src/Lightbox2Asset.php +++ b/src/Lightbox2Asset.php @@ -21,6 +21,6 @@ public function init() parent::init(); $this->js[] = YII_DEBUG ? 'js/lightbox.js' : 'js/lightbox.min.js'; - $this->css[] = YII_DEBUG ? 'css/lightbox.css' : 'js/lightbox.min.css'; + $this->css[] = YII_DEBUG ? 'css/lightbox.css' : 'css/lightbox.min.css'; } }