diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..410fa6d --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,128 @@ +Contributing to yii2-widget-fileinput +===================================== +Looking to contribute something to yii2-widget-fileinput? **Here's how you can help.** + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + +Using the issue tracker +----------------------- +When [reporting bugs][reporting-bugs] or +[requesting features][requesting-features], the +[issue tracker on GitHub][issue-tracker] is the recommended channel to use. + +The issue tracker **is not** a place for support requests. Refer the +[widget documentation and demos](http://demos.krajee.com/widget-details/fileinput) 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-widget-fileinput +----------------------------------------- +We really appreciate clear bug reports that _consistently_ show an issue +_within yii2-widget-fileinput_. + +The ideal bug report follows these guidelines: + +1. **Use the [GitHub issue search][issue-search]** — Check if the issue + 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 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 +to are: + +- What steps can be used to reproduce the issue? +- What is the bug and what is the expected outcome? +- What browser(s) and Operating System have you tested with? +- Does the bug happen consistently across all tested browsers? +- What version of jQuery are you using? And what version of yii2-widget-fileinput? +- Are you using yii2-widget-fileinput with other plugins? + +All of these questions will help others fix and identify any potential bugs. + +Requesting features in yii2-widget-fileinput +-------------------------------------------- +Before starting work on a major feature for yii2-widget-fileinput, **read the +[documentation](http://demos.krajee.com/widget-details/fileinput) 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. + +### Submitting a pull request + +We use GitHub's pull request system for submitting patches. Here are some +guidelines to follow when creating the pull request for your fix. + +1. Make sure to create a ticket for your pull request. This will serve as the +bug ticket, and any discussion about the bug will take place there. Your pull +request will be focused on the specific changes that fix the bug. +2. Make sure to reference the ticket you are fixing within your pull request. +This will allow us to close off the ticket once we merge the pull request, or +follow up on the ticket if there are any related blocking issues. +3. Explain why the specific change was made. Not everyone who is reviewing your +pull request will be familiar with the problem it is fixing. +4. Run your tests first. If your tests aren't passing, the pull request won't +be able to be merged. If you're breaking existing tests, make sure that you +aren't causing any breaking changes. +5. Only include source changes. While it's not required, only including changes +from the `src` directory will prevent merge conflicts from occuring. Making +this happen can be as a simple as not committing changes from the `dist` +directory. + +By following these steps, you will make it easier for your pull request to be +reviewed and eventually merged. + +Triaging issues and pull requests +--------------------------------- +Anyone can help the project maintainers triage issues and review pull requests. + +### Handling new issues + +yii2-widget-fileinput regularly receives new issues which need to be tested and organized. + +When a new issue that comes in that is similar to another existing issue, it +should be checked to make sure it is not a duplicate. Duplicates issues should +be marked by replying to the issue with "Duplicate of #[issue number]" where +`[issue number]` is the url or issue number for the existing issue. This will +allow the project maintainers to quickly close off additional issues and keep +the discussion focused within a single issue. + +If you can test issues that are reported to yii2-widget-fileinput that contain test cases and +confirm under what conditions bugs happen, that will allow others to identify +what causes a bug quicker. + +### Reviewing pull requests + +It is very common for pull requests to be opened for issues that contain a clear +solution to the problem. These pull requests should be rigorously reviewed by +the community before being accepted. If you are not sure about a piece of +submitted code, or know of a better way to do something, do not hesitate to make +a comment on the pull request. + +### Reviving old tickets + +If you come across tickets which have not been updated for a while, you are +encouraged to revive them. While this can be as simple as saying `:+1:`, it is +best if you can include more information on the issue. Common bugs and feature +requests are more likely to be fixed, whether it is by the community or the +developers, so keeping tickets up to date is encouraged. + +Licensing +--------- + +It should also be made clear that **all code contributed to yii2-widget-fileinput** must be +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-widget-fileinput/search?q=&type=Issues +[issue-tracker]: https://github.com/kartik-v/yii2-widget-fileinput/issues +[licensing]: https://github.com/kartik-v/yii2-widget-fileinput/blob/master/LICENSE.md +[reporting-bugs]: #reporting-bugs-with-yii2-widget-fileinput +[requesting-features]: #requesting-features-in-yii2-widget-fileinput \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..4191063 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,49 @@ +## Prerequisites + +- [ ] 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-widget-fileinput. +- [ ] This is not an usage question. I confirm having read the [widget documentation and demos](http://demos.krajee.com/widget-details/fileinput). +- [ ] 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 (fileinput) issue. (Those should be directed to the [plugin issues repo](https://github.com/fileinput/fileinput/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). + +## Steps to reproduce the issue + +1. +2. +3. + +## Expected behavior and actual behavior + +When I follow those steps, I see... + +I was expecting... + +## Environment + +Browsers + +- [ ] Google Chrome +- [ ] Mozilla Firefox +- [ ] Internet Explorer +- [ ] Safari + +Operating System + +- [ ] Windows +- [ ] Mac OS X +- [ ] Linux +- [ ] Mobile + +Libraries + +- jQuery version: +- yii2-widget-fileinput version: + +## Isolating the problem + +- [ ] This bug happens [on the widget demos page](http://demos.krajee.com/widget-details/fileinput) +- [ ] The bug happens consistently across all tested browsers +- [ ] This bug happens when using yii2-widget-fileinput 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 new file mode 100644 index 0000000..f48880f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Scope +This pull request includes a + +- [ ] Bug fix +- [ ] New feature +- [ ] Translation + +## Changes +The following changes were made + +- +- +- + +## Related Issues +If this is related to an existing ticket, include a link to it as well. \ No newline at end of file diff --git a/CHANGE.md b/CHANGE.md index 05c0021..8b6f47b 100644 --- a/CHANGE.md +++ b/CHANGE.md @@ -1,24 +1,38 @@ Change Log: `yii2-widget-fileinput` =================================== +## Version 1.0.6 + +**Date:** 26-May-2017 + +- Enhancements for plugin v4.4.1 (inclusion of `PiExifAsset` and removal of `CanvasBlobAsset`). +- Add github contribution and issue/PR log templates. +- Update copyright year to current. +- (enh #117): Add Bulgarian Translations. +- (enh #114): Automatically add `enctype` to form options when using with Yii Active Field and Active Form. +- (enh #112): Add Explorer Theme support. +- (enh #90): Fixed namespace fatal error. +- (enh #88): Add Vietnamese Translations. +- (enh #79): Add Lithuanian Translations. + ## Version 1.0.5 **Date:** 16-Jun-2016 -- (enh #70): Add Estonian Translations. +- (enh #74): Add Ukranian Translations. - (enh #71): Enhancements for plugin v4.3.2. +- (enh #70): Add Estonian Translations. - Add branch alias for dev-master latest release. -- (enh #74): Add Ukranian Translations. ## Version 1.0.4 **Date:** 10-Jan-2016 -- (enh #36): Add Indonesian Translations -- (enh #37): Add Greek Translations -- (enh #40): Add Persian Translations -- (enh #57): Enhance localizations and allow yii to generate message files via config. - (enh #58): Enhancements for PJAX based reinitialization. Complements enhancements in kartik-v/yii2-krajee-base#52 and kartik-v/yii2-krajee-base#53. +- (enh #57): Enhance localizations and allow yii to generate message files via config. +- (enh #40): Add Persian Translations +- (enh #37): Add Greek Translations +- (enh #36): Add Indonesian Translations ## Version 1.0.3 @@ -30,24 +44,24 @@ Change Log: `yii2-widget-fileinput` **Date:** 03-May-2015 -- (enh #23): Add Chinese translations. -- (enh kartik-v/yii2-krajee-base#34, kartik-v/yii2-krajee-base#35): Enhance i18n translation locales. - (enh #29): Better validation for graceful downgrade for older browsers. +- (enh kartik-v/yii2-krajee-base#34, kartik-v/yii2-krajee-base#35): Enhance i18n translation locales. +- (enh #23): Add Chinese translations. ## Version 1.0.1 **Date:** 30-Mar-2015 -- (enh #4): Hungarian translations -- (enh #20): Croatian translations +- (enh #22): Added Thai language translations. - (enh #21): Updates to widget for v4.1.8 bootstrap-fileinput plugin - All plugin related translations now reside in the [locales files in the plugin folder](http://github.com/kartik-v/bootstrap-fileinput/js). Pull requests for new translations or editing translations needs to be done in the plugin folder. - The `language` property can be set at the widget level to set the language (this will default to `Yii::$app->language`). -- (enh #22): Added Thai language translations. +- (enh #20): Croatian translations +- (enh #4): Hungarian translations ## Version 1.0.0 **Date:** 08-Nov-2014 -- Initial release - Sub repo split from [yii2-widgets](https://github.com/kartik-v/yii2-widgets) +- Initial release \ No newline at end of file diff --git a/DomPurifyAsset.php b/DomPurifyAsset.php index 692a1a9..011aee2 100644 --- a/DomPurifyAsset.php +++ b/DomPurifyAsset.php @@ -1,10 +1,10 @@ pluginLoading) { Html::addCssClass($this->options, 'file-loading'); } + if (isset($this->field) && isset($this->field->form) && !isset($this->field->form->options['enctype'])) { + $this->field->form->options['enctype'] = 'multipart/form-data'; + } $input = $this->getInput('fileInput'); $script = 'document.getElementById("' . $this->options['id'] . '").className.replace(/\bfile-loading\b/,"");'; if ($this->showMessage) { @@ -124,7 +127,7 @@ public function registerAssetBundle() { $view = $this->getView(); if ($this->resizeImages) { - CanvasBlobAsset::register($view); + PiExifAsset::register($view); $this->pluginOptions['resizeImage'] = true; } $theme = ArrayHelper::getValue($this->pluginOptions, 'theme'); diff --git a/FileInputAsset.php b/FileInputAsset.php index 6a3a05d..aeac075 100644 --- a/FileInputAsset.php +++ b/FileInputAsset.php @@ -1,10 +1,10 @@ * @since 1.0 */ -class CanvasBlobAsset extends AssetBundle +class PiExifAsset extends AssetBundle { /** * @inheritdoc @@ -25,7 +25,7 @@ class CanvasBlobAsset extends AssetBundle public function init() { $this->setSourcePath('@vendor/kartik-v/bootstrap-fileinput'); - $this->setupAssets('js', ['js/plugins/canvas-to-blob']); + $this->setupAssets('js', ['js/plugins/piexif']); parent::init(); } } diff --git a/README.md b/README.md index dcee22f..a22267b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ to the ```require``` section of your `composer.json` file. ## Latest Release -> NOTE: The latest version of the module is v1.0.4. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details. +> 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. ## Demo diff --git a/SortableAsset.php b/SortableAsset.php index 15608c0..2161565 100644 --- a/SortableAsset.php +++ b/SortableAsset.php @@ -1,10 +1,10 @@