Skip to content

Commit 510c3a3

Browse files
committed
Fix #45: Enhancements to support Bootstrap v5.x
1 parent bb0f6a1 commit 510c3a3

18 files changed

+114
-112
lines changed

CHANGE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Change Log: `yii2-dialog`
22
=========================
33

4+
## Version 1.0.6
5+
6+
**Date:** 02-Sep-2021
7+
8+
- (enh #45): Enhancements to support Bootstrap v5.x.
9+
- (enh #44): Add Latvian Translations.
10+
- (enh #43): Add Uzbek Translations.
11+
412
## Version 1.0.5
513

614
**Date:** 09-Oct-2018

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014 - 2018, Kartik Visweswaran
1+
Copyright (c) 2014 - 2021, Kartik Visweswaran
22
Krajee.com
33
All rights reserved.
44

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
[![Monthly Downloads](https://poser.pugx.org/kartik-v/yii2-dialog/d/monthly)](https://packagist.org/packages/kartik-v/yii2-dialog)
1919
[![Daily Downloads](https://poser.pugx.org/kartik-v/yii2-dialog/d/daily)](https://packagist.org/packages/kartik-v/yii2-dialog)
2020

21-
A widget component for Yii Framework 2.0 to easily configure and initialize popup notification dialog boxes. It provides a polyfill for the native javascript alert, confirm, and prompt dialog boxes. It includes inbuilt support for rendering rich dialog boxes via [bootstrap3-dialog](http://nakupanda.github.io/bootstrap3-dialog/) which makes using Bootstrap's modal more monkey-friendly. The key features provided by the library are:
21+
A widget component for Yii Framework 2.0 to easily configure and initialize popup notification dialog boxes. It provides a polyfill for
22+
the native javascript alert, confirm, and prompt dialog boxes. It includes inbuilt support for rendering rich dialog boxes via a customized
23+
plugin by Krajee based on and enhanced from [bootstrap3-dialog](http://nakupanda.github.io/bootstrap3-dialog/). This plugin makes using Bootstrap's
24+
modal more monkey-friendly. The Krajee enhancements also includes enhanced support for Bootstrap 5.x, 4.x and 3.x. The key features provided by
25+
the library are:
2226

2327
- Control how you want to render JAVASCRIPT dialogs. Inbuilt quick support for following dialog types:
2428
- ALERT dialog
@@ -38,7 +42,7 @@ Refer this [git workflow for contributors](.github/GIT-WORKFLOW.md).
3842
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
3943

4044
### Pre-requisites
41-
> Note: Check the [composer.json](https://github.com/kartik-v/yii2-dropdown-x/blob/master/composer.json) for this extension's requirements and dependencies.
45+
> Note: Check the [composer.json](https://github.com/kartik-v/yii2-dialog/blob/master/composer.json) for this extension's requirements and dependencies.
4246
You must set the `minimum-stability` to `dev` in the **composer.json** file in your application root folder before installation of this extension OR
4347
if your `minimum-stability` is set to any other value other than `dev`, then set the following in the require section of your composer.json file
4448

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"kartik-v/yii2-krajee-base": ">=2.0.0"
23+
"kartik-v/yii2-krajee-base": ">=3.0.0"
2424
},
2525
"autoload": {
2626
"psr-4": {

src/Dialog.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
/**
44
* @package yii2-dialog
55
* @author Kartik Visweswaran <[email protected]>
6-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
7-
* @version 1.0.5
6+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
7+
* @version 1.0.6
88
*/
99

1010
namespace kartik\dialog;
1111

12+
use Exception;
13+
use ReflectionException;
1214
use Yii;
1315
use kartik\base\Widget;
16+
use yii\base\InvalidConfigException;
1417
use yii\helpers\Json;
1518
use yii\web\View;
1619

@@ -169,7 +172,7 @@ class Dialog extends Widget
169172
* @var boolean (DEPRECATED) applicable only for versions v1.0.3 and below, where if set to `true`
170173
* will enable a draggable cursor for draggable dialog boxes when dragging.
171174
*
172-
* for v1.0.5 and above the cursor will always be displayed irrespective of this setting
175+
* for v1.0.6 and above the cursor will always be displayed irrespective of this setting
173176
* (which can be controlled via CSS).
174177
*/
175178
public $showDraggable = true;
@@ -197,8 +200,8 @@ class Dialog extends Widget
197200

198201
/**
199202
* @inheritdoc
200-
* @throws \ReflectionException
201-
* @throws \yii\base\InvalidConfigException
203+
* @throws ReflectionException
204+
* @throws InvalidConfigException
202205
*/
203206
public function run()
204207
{
@@ -209,15 +212,15 @@ public function run()
209212

210213
/**
211214
* Initialize the dialog buttons.
212-
* @throws \yii\base\InvalidConfigException
215+
* @throws InvalidConfigException|Exception
213216
*/
214217
public function initOptions()
215218
{
216-
$isBs4 = $this->isBs4();
217-
$defaultBtnCss = $isBs4 ? 'btn-outline-secondary' : 'btn-default';
218-
$this->iconOk = $isBs4 ? 'fas fa-check' : 'glyphicon glyphicon-ok';
219-
$this->iconCancel = $isBs4 ? 'fas fa-ban' : 'glyphicon glyphicon-ban-circle';
220-
$this->iconSpinner = $isBs4 ? 'fas fa-asterisk' : 'glyphicon glyphicon-asterisk';
219+
$notBs3 = !$this->isBs(3);
220+
$defaultBtnCss = $notBs3 ? 'btn-outline-secondary' : 'btn-default';
221+
$this->iconOk = $notBs3 ? 'fas fa-check' : 'glyphicon glyphicon-ok';
222+
$this->iconCancel = $notBs3 ? 'fas fa-ban' : 'glyphicon glyphicon-ban-circle';
223+
$this->iconSpinner = $notBs3 ? 'fas fa-asterisk' : 'glyphicon glyphicon-asterisk';
221224
$ok = Yii::t('kvdialog', 'Ok');
222225
$cancel = Yii::t('kvdialog', 'Cancel');
223226
$info = Yii::t('kvdialog', 'Information');

src/DialogAsset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* @package yii2-dialog
55
* @author Kartik Visweswaran <[email protected]>
6-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
7-
* @version 1.0.5
6+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
7+
* @version 1.0.6
88
*/
99

1010
namespace kartik\dialog;

src/DialogBootstrapAsset.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
/**
44
* @package yii2-dialog
55
* @author Kartik Visweswaran <[email protected]>
6-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
7-
* @version 1.0.5
6+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
7+
* @version 1.0.6
88
*/
99

1010
namespace kartik\dialog;
@@ -26,7 +26,7 @@ public function init()
2626
$this->depends = array_merge(['kartik\dialog\DialogAsset'], $this->depends);
2727
$this->setSourcePath(__DIR__ . '/assets');
2828
$this->setupAssets('js', ['js/bootstrap-dialog']);
29-
$this->setupAssets('css', ['css/bootstrap-dialog-bs' . ($this->isBs4() ? '4' : '3')]);
29+
$this->setupAssets('css', ['css/bootstrap-dialog-bs' . (!$this->isBs(3) ? '4' : '3')]);
3030
parent::init();
3131
}
3232
}

src/DialogYiiAsset.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
/**
44
* @package yii2-dialog
55
* @author Kartik Visweswaran <[email protected]>
6-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
7-
* @version 1.0.5
6+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
7+
* @version 1.0.6
88
*/
99

1010
namespace kartik\dialog;
1111

12-
use yii\web\View;
1312
use kartik\base\AssetBundle;
1413

1514
/**

src/assets/css/bootstrap-dialog-bs3.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
/*!
22
* @package yii2-dialog
33
* @author Kartik Visweswaran <[email protected]>
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
5-
* @version 1.0.5
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2021
5+
* @version 1.0.6
66
*
77
* Bootstrap 3.x styling for bootstrap-dialog plugin.
88
*
99
* For more JQuery plugins visit http://plugins.krajee.com
1010
* For more Yii related demos visit http://demos.krajee.com
11-
*/.bootstrap-dialog {
12-
}
11+
*/
1312
.bootstrap-dialog .modal-header {
1413
border-top-left-radius: 4px;
1514
border-top-right-radius: 4px;
1615
}
16+
.bootstrap-dialog .btn-modal-close {
17+
margin: -5px;
18+
background: none;
19+
border-radius: 50%;
20+
}
1721
.bootstrap-dialog .modal-header.bootstrap-dialog-draggable {
1822
cursor: move;
1923
}

src/assets/css/bootstrap-dialog-bs3.min.css

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)