Skip to content

Commit

Permalink
Updates to release v1.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Jul 26, 2018
1 parent 002bd28 commit f34ed0f
Show file tree
Hide file tree
Showing 38 changed files with 57 additions and 42 deletions.
6 changes: 5 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ Change Log: `yii2-widget-fileinput`

## Version 1.0.7

**Date:** 25-Jun-2017
**Date:** 26-Jul-2018

- Reorganize relevant code in "src" directory.
- Optimize asset bundles.
- (enh #134): Add Slovak Translations.
- (enh #126): Add Finnish Translations.
- (enh #120): Add Explorer FA Theme support.

## Version 1.0.6
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 - 2017, Kartik Visweswaran
Copyright (c) 2014 - 2018, Kartik Visweswaran
Krajee.com
All rights reserved.

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ or add

to the ```require``` section of your `composer.json` file.

## Latest Release

> NOTE: The latest version of the module is v1.0.6. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details.
Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details of release wise changes.

## Demo

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kartik-v/yii2-widget-fileinput",
"description": "An enhanced FileInput widget for Bootstrap 3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)",
"description": "An enhanced FileInput widget for Bootstrap 3.x & 4.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)",
"keywords": ["yii2", "extension", "widget", "input", "file", "form", "upload", "jquery", "plugin"],
"homepage": "https://github.com/kartik-v/yii2-widget-fileinput",
"type": "yii2-extension",
Expand All @@ -18,7 +18,7 @@
},
"autoload": {
"psr-4": {
"kartik\\file\\": ""
"kartik\\file\\": "src"
}
},
"extra": {
Expand Down
25 changes: 25 additions & 0 deletions src/BaseAsset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
*/

namespace kartik\file;

use kartik\base\AssetBundle;

/**
* BaseAsset is the base asset bundle class used by all FileInput widget asset bundles.
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class BaseAsset extends AssetBundle {
/**
* @inheritdoc
*/
public $sourcePath = '@vendor/kartik-v/bootstrap-fileinput';
}
7 changes: 2 additions & 5 deletions DomPurifyAsset.php → src/DomPurifyAsset.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
*/

namespace kartik\file;

use kartik\base\AssetBundle;

/**
* DomPurify asset bundle for FileInput Widget
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class DomPurifyAsset extends AssetBundle
class DomPurifyAsset extends BaseAsset
{
/**
* @inheritdoc
*/
public function init()
{
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
$this->setupAssets('js', ['js/plugins/purify']);
parent::init();
}
Expand Down
20 changes: 13 additions & 7 deletions FileInput.php → src/FileInput.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
Expand All @@ -16,10 +16,10 @@
use kartik\base\TranslationTrait;

/**
* Wrapper for the Bootstrap FileInput JQuery Plugin by Krajee. The FileInput widget is styled for Bootstrap 3.x with
* ability to multiple file selection and preview, format button styles and inputs. Runs on all modern browsers
* supporting HTML5 File Inputs and File Processing API. For browser versions IE9 and below, this widget will
* gracefully degrade to normal HTML file input.
* Wrapper for the Bootstrap FileInput JQuery Plugin by Krajee. The FileInput widget is styled for Bootstrap 3.x
* & 4.x with ability to multiple file selection and preview, format button styles and inputs. Runs on all modern
* browsers supporting HTML5 File Inputs and File Processing API. For browser versions IE9 and below, this widget
* will gracefully degrade to a native HTML file input.
*
* @see http://plugins.krajee.com/bootstrap-fileinput
* @see https://github.com/kartik-v/bootstrap-fileinput
Expand All @@ -37,6 +37,11 @@ class FileInput extends InputWidget
*/
public $resizeImages = false;

/**
* @var boolean whether to auto orient images on client side
*/
public $autoOrientImages = true;

/**
* @var boolean whether to load sortable plugin to rearrange initial preview images on client side
*/
Expand Down Expand Up @@ -126,9 +131,10 @@ protected function validateIE($content, $validation = 'lt IE 10')
public function registerAssetBundle()
{
$view = $this->getView();
if ($this->resizeImages) {
$this->pluginOptions['resizeImage'] = $this->resizeImages;
$this->pluginOptions['autoOrientImage'] = $this->autoOrientImages;
if ($this->resizeImages || $this->autoOrientImages) {
PiExifAsset::register($view);
$this->pluginOptions['resizeImage'] = true;
}
$theme = ArrayHelper::getValue($this->pluginOptions, 'theme');
if (!empty($theme) && in_array($theme, self::$_themes)) {
Expand Down
7 changes: 2 additions & 5 deletions FileInputAsset.php → src/FileInputAsset.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
*/

namespace kartik\file;

use kartik\base\AssetBundle;

/**
* Asset bundle for FileInput Widget
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class FileInputAsset extends AssetBundle
class FileInputAsset extends BaseAsset
{
/**
* @inheritdoc
*/
public function init()
{
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
$this->setupAssets('css', ['css/fileinput']);
$this->setupAssets('js', ['js/fileinput']);
parent::init();
Expand Down
10 changes: 2 additions & 8 deletions FileInputThemeAsset.php → src/FileInputThemeAsset.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
*/

namespace kartik\file;

use kartik\base\AssetBundle;
use Yii;

/**
Expand All @@ -18,13 +17,8 @@
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class FileInputThemeAsset extends AssetBundle
class FileInputThemeAsset extends BaseAsset
{
/**
* @inheritdoc
*/
public $sourcePath = '@vendor/kartik-v/bootstrap-fileinput';

/**
* @inheritdoc
*/
Expand Down
7 changes: 2 additions & 5 deletions PiExifAsset.php → src/PiExifAsset.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
*/

namespace kartik\file;

use kartik\base\AssetBundle;

/**
* PiExif Asset bundle for FileInput Widget
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class PiExifAsset extends AssetBundle
class PiExifAsset extends BaseAsset
{
/**
* @inheritdoc
*/
public function init()
{
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
$this->setupAssets('js', ['js/plugins/piexif']);
parent::init();
}
Expand Down
7 changes: 2 additions & 5 deletions SortableAsset.php → src/SortableAsset.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.7
*/

namespace kartik\file;

use kartik\base\AssetBundle;

/**
* Sortable asset bundle for FileInput Widget
*
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @since 1.0
*/
class SortableAsset extends AssetBundle
class SortableAsset extends BaseAsset
{
/**
* @inheritdoc
*/
public function init()
{
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
$this->setupAssets('js', ['js/plugins/sortable']);
parent::init();
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f34ed0f

Please sign in to comment.