Skip to content

Commit f34ed0f

Browse files
committed
Updates to release v1.0.7
1 parent 002bd28 commit f34ed0f

38 files changed

+57
-42
lines changed

CHANGE.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ Change Log: `yii2-widget-fileinput`
33

44
## Version 1.0.7
55

6-
**Date:** 25-Jun-2017
6+
**Date:** 26-Jul-2018
77

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

1014
## Version 1.0.6

LICENSE.md

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

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ or add
3838

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

41-
## Latest Release
42-
43-
> 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.
41+
Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details of release wise changes.
4442

4543
## Demo
4644

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kartik-v/yii2-widget-fileinput",
3-
"description": "An enhanced FileInput widget for Bootstrap 3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)",
3+
"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)",
44
"keywords": ["yii2", "extension", "widget", "input", "file", "form", "upload", "jquery", "plugin"],
55
"homepage": "https://github.com/kartik-v/yii2-widget-fileinput",
66
"type": "yii2-extension",
@@ -18,7 +18,7 @@
1818
},
1919
"autoload": {
2020
"psr-4": {
21-
"kartik\\file\\": ""
21+
"kartik\\file\\": "src"
2222
}
2323
},
2424
"extra": {

src/BaseAsset.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
5+
* @package yii2-widgets
6+
* @subpackage yii2-widget-fileinput
7+
* @version 1.0.7
8+
*/
9+
10+
namespace kartik\file;
11+
12+
use kartik\base\AssetBundle;
13+
14+
/**
15+
* BaseAsset is the base asset bundle class used by all FileInput widget asset bundles.
16+
*
17+
* @author Kartik Visweswaran <[email protected]>
18+
* @since 1.0
19+
*/
20+
class BaseAsset extends AssetBundle {
21+
/**
22+
* @inheritdoc
23+
*/
24+
public $sourcePath = '@vendor/kartik-v/bootstrap-fileinput';
25+
}
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
55
* @package yii2-widgets
66
* @subpackage yii2-widget-fileinput
77
* @version 1.0.7
88
*/
99

1010
namespace kartik\file;
1111

12-
use kartik\base\AssetBundle;
13-
1412
/**
1513
* DomPurify asset bundle for FileInput Widget
1614
*
1715
* @author Kartik Visweswaran <[email protected]>
1816
* @since 1.0
1917
*/
20-
class DomPurifyAsset extends AssetBundle
18+
class DomPurifyAsset extends BaseAsset
2119
{
2220
/**
2321
* @inheritdoc
2422
*/
2523
public function init()
2624
{
27-
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
2825
$this->setupAssets('js', ['js/plugins/purify']);
2926
parent::init();
3027
}

FileInput.php renamed to src/FileInput.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
55
* @package yii2-widgets
66
* @subpackage yii2-widget-fileinput
77
* @version 1.0.7
@@ -16,10 +16,10 @@
1616
use kartik\base\TranslationTrait;
1717

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

40+
/**
41+
* @var boolean whether to auto orient images on client side
42+
*/
43+
public $autoOrientImages = true;
44+
4045
/**
4146
* @var boolean whether to load sortable plugin to rearrange initial preview images on client side
4247
*/
@@ -126,9 +131,10 @@ protected function validateIE($content, $validation = 'lt IE 10')
126131
public function registerAssetBundle()
127132
{
128133
$view = $this->getView();
129-
if ($this->resizeImages) {
134+
$this->pluginOptions['resizeImage'] = $this->resizeImages;
135+
$this->pluginOptions['autoOrientImage'] = $this->autoOrientImages;
136+
if ($this->resizeImages || $this->autoOrientImages) {
130137
PiExifAsset::register($view);
131-
$this->pluginOptions['resizeImage'] = true;
132138
}
133139
$theme = ArrayHelper::getValue($this->pluginOptions, 'theme');
134140
if (!empty($theme) && in_array($theme, self::$_themes)) {
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
55
* @package yii2-widgets
66
* @subpackage yii2-widget-fileinput
77
* @version 1.0.7
88
*/
99

1010
namespace kartik\file;
1111

12-
use kartik\base\AssetBundle;
13-
1412
/**
1513
* Asset bundle for FileInput Widget
1614
*
1715
* @author Kartik Visweswaran <[email protected]>
1816
* @since 1.0
1917
*/
20-
class FileInputAsset extends AssetBundle
18+
class FileInputAsset extends BaseAsset
2119
{
2220
/**
2321
* @inheritdoc
2422
*/
2523
public function init()
2624
{
27-
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
2825
$this->setupAssets('css', ['css/fileinput']);
2926
$this->setupAssets('js', ['js/fileinput']);
3027
parent::init();
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
55
* @package yii2-widgets
66
* @subpackage yii2-widget-fileinput
77
* @version 1.0.7
88
*/
99

1010
namespace kartik\file;
1111

12-
use kartik\base\AssetBundle;
1312
use Yii;
1413

1514
/**
@@ -18,13 +17,8 @@
1817
* @author Kartik Visweswaran <[email protected]>
1918
* @since 1.0
2019
*/
21-
class FileInputThemeAsset extends AssetBundle
20+
class FileInputThemeAsset extends BaseAsset
2221
{
23-
/**
24-
* @inheritdoc
25-
*/
26-
public $sourcePath = '@vendor/kartik-v/bootstrap-fileinput';
27-
2822
/**
2923
* @inheritdoc
3024
*/

PiExifAsset.php renamed to src/PiExifAsset.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
<?php
22

33
/**
4-
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2017
4+
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
55
* @package yii2-widgets
66
* @subpackage yii2-widget-fileinput
77
* @version 1.0.7
88
*/
99

1010
namespace kartik\file;
1111

12-
use kartik\base\AssetBundle;
13-
1412
/**
1513
* PiExif Asset bundle for FileInput Widget
1614
*
1715
* @author Kartik Visweswaran <[email protected]>
1816
* @since 1.0
1917
*/
20-
class PiExifAsset extends AssetBundle
18+
class PiExifAsset extends BaseAsset
2119
{
2220
/**
2321
* @inheritdoc
2422
*/
2523
public function init()
2624
{
27-
$this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput');
2825
$this->setupAssets('js', ['js/plugins/piexif']);
2926
parent::init();
3027
}

0 commit comments

Comments
 (0)