Skip to content

Commit

Permalink
Upgrade to release v1.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jul 1, 2015
1 parent b8f3bbd commit 0c151de
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 46 deletions.
6 changes: 5 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version 1.7.3
=============
**Date:** 12-May-2015
**Date:** 01-Jul-2015

1. (enh #54): Auto guess input and set input options based on input type.
2. (enh #56): Reset/Clear help-block error messages before next validation.
Expand All @@ -17,6 +17,10 @@ version 1.7.3
9. (bug #63): Fix renderActionButtons to correctly parse submit & reset button options.
10. (enh #64): Better reset of error container help-block content.
11. (enh #69): Generate default `en` message translation file.
12. (enh #70): Added default `en` translations.
13. (enh #73): Added Polish translations.
14. (enh #76): Improved Spanish translations.
15. (enh #78): Added Chinese translations.

version 1.7.2
=============
Expand Down
1 change: 0 additions & 1 deletion Editable.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
Expand Down
3 changes: 1 addition & 2 deletions EditableAsset.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
Expand Down Expand Up @@ -33,4 +32,4 @@ public function init()
$this->setupAssets('js', ['js/editable']);
parent::init();
}
}
}
3 changes: 1 addition & 2 deletions EditablePjaxAsset.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

/**
* @package yii2-editable
* @author Kartik Visweswaran <kartikv2@gmail.com>
Expand Down Expand Up @@ -32,4 +31,4 @@ public function init()
$this->setupAssets('js', ['js/editable-pjax']);
parent::init();
}
}
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,31 +37,27 @@ Easily set any displayed content as editable in Yii Framework 2.0. This is an en
Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

## Demo

You can see detailed [documentation and examples](http://demos.krajee.com/editable) on usage of the extension.

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).


> Note: You must set the `minimum-stability` to `dev` in the **composer.json** file in your application root folder before installation of this extension OR
if your `minimum-stability` is set to `stable`, then set the following in the require section of your composer.json file

```
kartik-v/yii2-editable: "@dev",
kartik-v/yii2-krajee-base: "@dev"
```
> Note: Check the [composer.json](https://github.com/kartik-v/yii2-editable/blob/master/composer.json) for this extension's requirements and dependencies.
Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

Either run

```
$ php composer.phar require kartik-v/yii2-editable "dev-master"
$ php composer.phar require kartik-v/yii2-editable "@dev"
```

or add

```
"kartik-v/yii2-editable": "dev-master"
"kartik-v/yii2-editable": "@dev"
```

to the ```require``` section of your `composer.json` file.
Expand All @@ -73,12 +69,12 @@ to the ```require``` section of your `composer.json` file.
```php
use kartik\editable\Editable;
echo Editable::widget([
'model'=>$model,
'model' => $model,
'attribute' => 'rating',
'type'=>'primary',
'size'=>'lg',
'inputType'=>Editable::INPUT_RATING,
'editableValueOptions'=>['class'=>'text-success h3']
'type' => 'primary',
'size'=> 'lg',
'inputType' => Editable::INPUT_RATING,
'editableValueOptions' => ['class' => 'text-success h3']
]);
```

Expand Down
3 changes: 2 additions & 1 deletion assets/js/editable-pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* Year: 2015
* For more Yii related demos visit http://demos.krajee.com
*/
var initEditablePjax;
var initEditablePjax = function() {
};
(function ($) {
"use strict";
initEditablePjax = function (pjaxContainer, toggleButton, initPjaxVar) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/editable-pjax.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
* Author: Kartik Visweswaran
* Year: 2015
* For more Yii related demos visit http://demos.krajee.com
*/var initEditablePjax;!function(o){"use strict";initEditablePjax=function(t,n,i){o("#"+t).on("pjax:complete",function(){window[i]!==!0&&(o("#"+n).on("click",function(t){t.preventDefault();var n=o(this),i=o(n.attr("data-target")),a=i.data("popover-x")&&i.hasClass("in")?"toggle":n.data();"toggle"!==a?(a.$target=n,i.popoverX(a).popoverX("show").on("hide",function(){n.focus()})):i.popoverX(a).on("hide",function(){n.focus()})}),window[i]=!0)})}}(window.jQuery);
*/var initEditablePjax=function(){};!function(o){"use strict";initEditablePjax=function(t,n,i){o("#"+t).on("pjax:complete",function(){window[i]!==!0&&(o("#"+n).on("click",function(t){t.preventDefault();var n=o(this),i=o(n.attr("data-target")),a=i.data("popover-x")&&i.hasClass("in")?"toggle":n.data();"toggle"!==a?(a.$target=n,i.popoverX(a).popoverX("show").on("hide",function(){n.focus()})):i.popoverX(a).on("hide",function(){n.focus()})}),window[i]=!0)})}}(window.jQuery);
36 changes: 19 additions & 17 deletions assets/js/editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,34 @@
*/
(function ($) {
"use strict";

var isEmpty = function (value, trim) {
return value === null || value === undefined || value.length === 0 || (trim && $.trim(value) === '');
},
addCss = function ($el, css) {
$el.removeClass(css).addClass(css);
},
Editable = function (element, options) {
this.$container = $(element);
this.init(options);
this.listen();
var self = this;
self.$container = $(element);
self.init(options);
self.listen();
};

Editable.prototype = {
constructor: Editable,
init: function (options) {
var self = this;
self.$input = self.$container.find('.kv-editable-input');
self.$form = self.$container.find('.kv-editable-form');
self.$value = self.$container.find('.kv-editable-value');
self.$close = self.$container.find('.kv-editable-close');
self.$popover = self.$container.find('.kv-editable-popover');
self.$inline = self.$container.find('.kv-editable-inline');
self.$btnSubmit = self.$container.find('button.kv-editable-submit');
self.$btnReset = self.$container.find('button.kv-editable-reset');
self.$loading = self.$container.find('.kv-editable-loading');
self.$target = self.$container.find(options.target);
var self = this, $el = self.$container;
self.$input = $el.find('.kv-editable-input');
self.$form = $el.find('.kv-editable-form');
self.$value = $el.find('.kv-editable-value');
self.$close = $el.find('.kv-editable-close');
self.$popover = $el.find('.kv-editable-popover');
self.$inline = $el.find('.kv-editable-inline');
self.$btnSubmit = $el.find('button.kv-editable-submit');
self.$btnReset = $el.find('button.kv-editable-reset');
self.$loading = $el.find('.kv-editable-loading');
self.$target = $el.find(options.target);
$.each(options, function (key, value) {
self[key] = value;
});
Expand Down Expand Up @@ -77,11 +79,11 @@
var self = this, $form = self.$form, $btnSubmit = self.$btnSubmit, $btnReset = self.$btnReset,
$cont = $form.parent(), $el = self.$container, $popover = self.$popover, $close = self.$close,
$target = self.target === '.kv-editable-button' ? self.$target : self.$value, $inline = self.$inline,
$loading = self.$loading, $input = self.$input,
$loading = self.$loading, $input = self.$input, showError, chkError = '', out = '',
$parent = $input.closest('.field-' + $input.attr('id')), $parent2 = $input.closest('.kv-editable-parent'),
$message = $parent.find('.help-block'), displayValueConfig = self.displayValueConfig, settings,
$hasEditable = $form.find('input[name="hasEditable"]'), showError, chkError = '', out = '',
objActiveForm = self.$form.data('yiiActiveForm'), $msgBlock = $parent2.find('.kv-help-block'),
$hasEditable = $form.find('input[name="hasEditable"]'), $msgBlock = $parent2.find('.kv-help-block'),
objActiveForm = self.$form.data('yiiActiveForm'),
notActiveForm = isEmpty($parent.attr('class')) || isEmpty($message.attr('class'));
showError = function (message) {
if (notActiveForm) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/editable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"homepage": "http://www.krajee.com/"
}
],
"stability": "stable",
"require": {
"kartik-v/yii2-krajee-base": "*",
"kartik-v/yii2-popover-x": "*"
"kartik-v/yii2-krajee-base": "~1.7",
"kartik-v/yii2-popover-x": "~1.3"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions messages/config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

return [
// string, required, root directory of all source files
'sourcePath' => __DIR__ . DIRECTORY_SEPARATOR . '..',
Expand Down Expand Up @@ -49,4 +48,4 @@
// When format is "db", you may specify the following two options
//'db' => 'db',
//'sourceMessageTable' => '{{%source_message}}',
];
];

0 comments on commit 0c151de

Please sign in to comment.