diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index cff6143..31fd9e6 100755 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -17,11 +17,11 @@ When [reporting bugs][reporting-bugs] or [issue tracker on GitHub][issue-tracker] is the recommended channel to use. The issue tracker **is not** a place for support requests. Refer the -[extension documentation and demos](http://demos.krajee.com/editable) and/or refer to the +[widget documentation and demos](http://demos.krajee.com/editable) and/or refer to the [webtips Q & A forum](http://webtips.krajee.com/questions) which are the better places to get help. Reporting bugs with yii2-editable ---------------------------------- +-------------------------------- We really appreciate clear bug reports that _consistently_ show an issue _within yii2-editable_. @@ -31,8 +31,9 @@ The ideal bug report follows these guidelines: has already been reported. 2. **Check if the issue has been fixed** — Try to reproduce the problem using the code in the `master` branch. -3. **Isolate the problem** — Try to share a demo or a test case that - consistently reproduces the problem. +3. **Isolate the problem** — Try to create an + [isolated js fiddle][isolated-case] that consistently reproduces the problem + in case of javascript/client level code issues. Please try to be as detailed as possible in your bug report, especially if an isolated test case cannot be made. Some useful questions to include the answer @@ -48,7 +49,7 @@ to are: All of these questions will help others fix and identify any potential bugs. Requesting features in yii2-editable ------------------------------------- +-------------------------------------------- Before starting work on a major feature for yii2-editable, **read the [documentation](http://demos.krajee.com/editable) first** or you may risk spending a considerable amount of time on something which the project developers are not interested in bringing into the project. @@ -119,6 +120,7 @@ It should also be made clear that **all code contributed to yii2-editable** must licensable under the [BSD-3 license][licensing]. Code that cannot be released under this license **cannot be accepted** into the project. +[isolated-case]: https://jsfiddle.net/ [issue-search]: https://github.com/kartik-v/yii2-editable/search?q=&type=Issues [issue-tracker]: https://github.com/kartik-v/yii2-editable/issues [licensing]: https://github.com/kartik-v/yii2-editable/blob/master/LICENSE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 2ec1170..b4a1715 100755 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -2,8 +2,9 @@ - [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate. - [ ] The issue still exists against the latest `master` branch of yii2-editable. -- [ ] This is not an usage question. I confirm having gone through and read the [documentation and demos](http://demos.krajee.com/editable). +- [ ] This is not an usage question. I confirm having read the [widget documentation and demos](http://demos.krajee.com/editable). - [ ] This is not a general programming / coding question. (Those should be directed to the [webtips Q & A forum](http://webtips.krajee.com/questions)). +- [ ] This is not a source plugin (summernote) issue. (Those should be directed to the [plugin issues repo](https://github.com/summernote/summernote/search?q=&type=Issues)). - [ ] I have attempted to find the simplest possible steps to reproduce the issue. - [ ] I have included a failing test as a pull request (Optional). @@ -21,27 +22,28 @@ I was expecting... ## Environment -#### Browsers +Browsers - [ ] Google Chrome - [ ] Mozilla Firefox - [ ] Internet Explorer - [ ] Safari -#### Operating System +Operating System - [ ] Windows - [ ] Mac OS X - [ ] Linux - [ ] Mobile -#### Libraries +Libraries - jQuery version: - yii2-editable version: ## Isolating the problem -- [ ] This bug happens [on the demos page](https://demos.krajee.com/editable) +- [ ] This bug happens [on the widget demos page](http://demos.krajee.com/editable) - [ ] The bug happens consistently across all tested browsers -- [ ] This bug happens when using yii2-editable without other plugins. \ No newline at end of file +- [ ] This bug happens when using yii2-editable without other plugins +- [ ] I can reproduce this bug in [a jsbin](https://jsbin.com/) \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3283d29..bc0df70 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,7 +6,7 @@ This pull request includes a - [ ] Translation ## Changes -The following changes were made (this change is also documented in the [change log](https://github.com/kartik-v/yii2-editable/blob/master/CHANGE.md)): +The following changes were made - - diff --git a/CHANGE.md b/CHANGE.md index c5a5f4c..8487c7c 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -3,8 +3,9 @@ Change Log: `yii2-editable` ## Version 1.7.9 -**Date:** 27-Nov-2020 +**Date:** 06-Sep-2021 +- (enh #212): Enhancements to support Bootstrap v5.x. - (enh #206): Validate undefined data returned to ajax call. - (enh #198): Initialize value for model. - (enh #184): Add gitattributes. diff --git a/LICENSE.md b/LICENSE.md index eecaac3..26c7ba9 100755 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2015 - 2018, Kartik Visweswaran +Copyright (c) 2015 - 2021, Kartik Visweswaran Krajee.com All rights reserved. diff --git a/composer.json b/composer.json index 19bba19..0224c4c 100755 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } ], "require": { - "kartik-v/yii2-widget-activeform": ">=1.5.7", + "kartik-v/yii2-widget-activeform": ">=1.6.0", "kartik-v/yii2-popover-x": "~1.3" }, "autoload": { diff --git a/src/Editable.php b/src/Editable.php index d7bc69e..ae303eb 100755 --- a/src/Editable.php +++ b/src/Editable.php @@ -2,13 +2,14 @@ /** * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 */ namespace kartik\editable; use Closure; +use Exception; use kartik\base\Config; use kartik\base\InputWidget; use kartik\popover\PopoverX; @@ -17,6 +18,7 @@ use yii\helpers\ArrayHelper; use yii\helpers\Html; use yii\web\View; +use yii\widgets\ActiveField; use yii\widgets\ActiveForm; /** @@ -624,15 +626,15 @@ public function getForm() /** * Initialize default icons - * @throws InvalidConfigException + * @throws InvalidConfigException|Exception */ protected function initIcons() { - $isBs4 = $this->isBs4(); + $notBs3 = !$this->isBs(3); $prefix = $this->getDefaultIconPrefix(); foreach (static::$_icons as $icon => $setting) { if (!isset($this->$icon)) { - $css = $isBs4 ? $setting[1] : $setting[0]; + $css = $notBs3 ? $setting[1] : $setting[0]; $this->$icon = Html::tag('i', '', ['class' => $prefix . $css]); } } @@ -664,7 +666,7 @@ protected function initEditable() $this->initOptions(); $this->_popoverOptions['options']['id'] = $this->options['id'] . '-popover'; $this->_popoverOptions['toggleButton']['id'] = $this->options['id'] . '-targ'; - if ($this->isBs4()) { + if (!$this->isBs(3)) { $this->_popoverOptions['bsVersion'] = $this->bsVersion; } $this->registerAssets(); @@ -679,7 +681,7 @@ protected function initEditable() } echo Html::beginTag('div', $this->contentOptions); /** - * @var ActiveForm $class + * @var string|ActiveForm $class */ $class = $this->formClass; if (!class_exists($class)) { @@ -699,7 +701,7 @@ protected function runEditable() if (!$this->asPopover) { echo Html::beginTag('div', $this->inlineSettings['options']); } - echo $this->renderFormFields(); + $this->renderFormFields(); if (!$this->asPopover) { echo "\n"; // inline options } @@ -966,7 +968,7 @@ protected function renderFormFields() * * @param boolean|string $label the label for the field * - * @return \yii\widgets\ActiveField + * @return ActiveField */ protected function getField($label = false) { @@ -1009,7 +1011,7 @@ protected function renderHtml5Input() * @param string $class the input widget class name * * @return string - * @throws \Exception + * @throws Exception */ protected function renderWidget($class) { diff --git a/src/EditableAsset.php b/src/EditableAsset.php index afabfda..8753e10 100755 --- a/src/EditableAsset.php +++ b/src/EditableAsset.php @@ -2,13 +2,12 @@ /** * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 */ namespace kartik\editable; -use Yii; use kartik\base\AssetBundle; /** diff --git a/src/EditablePjaxAsset.php b/src/EditablePjaxAsset.php index f8acba9..1786c16 100755 --- a/src/EditablePjaxAsset.php +++ b/src/EditablePjaxAsset.php @@ -2,7 +2,7 @@ /** * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 */ diff --git a/src/assets/css/editable.css b/src/assets/css/editable.css index 453d2fc..df0e581 100755 --- a/src/assets/css/editable.css +++ b/src/assets/css/editable.css @@ -1,7 +1,7 @@ /*! * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 * * Styling for the Editable widget diff --git a/src/assets/css/editable.min.css b/src/assets/css/editable.min.css index 34f5187..cb46fbc 100755 --- a/src/assets/css/editable.min.css +++ b/src/assets/css/editable.min.css @@ -1,7 +1,7 @@ /*! * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 * * Styling for the Editable widget diff --git a/src/assets/js/editable-pjax.js b/src/assets/js/editable-pjax.js index af2749d..9d9c195 100755 --- a/src/assets/js/editable-pjax.js +++ b/src/assets/js/editable-pjax.js @@ -1,7 +1,7 @@ /*! * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 * * Editable Extension - PJAX processing script for popover-x diff --git a/src/assets/js/editable-pjax.min.js b/src/assets/js/editable-pjax.min.js index cf7165a..f7ff13f 100755 --- a/src/assets/js/editable-pjax.min.js +++ b/src/assets/js/editable-pjax.min.js @@ -1,7 +1,7 @@ /*! * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 * * Editable Extension - PJAX processing script for popover-x diff --git a/src/assets/js/editable.js b/src/assets/js/editable.js index b3c762f..653b064 100755 --- a/src/assets/js/editable.js +++ b/src/assets/js/editable.js @@ -1,7 +1,7 @@ /*! * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 * * Editable Extension jQuery plugin diff --git a/src/assets/js/editable.min.js b/src/assets/js/editable.min.js index 4a5b59b..ba6c727 100755 --- a/src/assets/js/editable.min.js +++ b/src/assets/js/editable.min.js @@ -1,7 +1,7 @@ /*! * @package yii2-editable * @author Kartik Visweswaran - * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2020 + * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015 - 2021 * @version 1.7.9 * * Editable Extension jQuery plugin