Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bupy7/yii2-widget-cropbox
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.0.1
Choose a base ref
...
head repository: bupy7/yii2-widget-cropbox
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 7 commits
  • 12 files changed
  • 1 contributor

Commits on May 13, 2017

  1. Added code fixer

    bupy7 committed May 13, 2017
    Copy the full SHA
    717d6de View commit details
  2. removed hhvm

    bupy7 committed May 13, 2017
    Copy the full SHA
    1fbfa8c View commit details
  3. Merge pull request #42 from bupy7/dev

    v5.0.2
    bupy7 authored May 13, 2017
    Copy the full SHA
    e213e1b View commit details

Commits on May 20, 2017

  1. v5.1.0

    bupy7 committed May 20, 2017
    Copy the full SHA
    45a5ceb View commit details
  2. 5.1.0

    bupy7 committed May 20, 2017
    Copy the full SHA
    797d005 View commit details
  3. Merge pull request #43 from bupy7/dev

    v5.1.0
    bupy7 authored May 20, 2017
    Copy the full SHA
    5c293f9 View commit details

Commits on May 22, 2017

  1. fixed uploaded bug

    bupy7 committed May 22, 2017
    Copy the full SHA
    d17b7db View commit details
Showing with 59 additions and 19 deletions.
  1. +2 −0 .gitignore
  2. +17 −0 .php_cs
  3. +0 −1 .travis.yml
  4. +16 −0 CHANGELOG.md
  5. +9 −3 composer.json
  6. +6 −6 src/CropboxWidget.php
  7. +0 −1 src/assets/WidgetAsset.php
  8. +1 −1 src/messages/hu/core.php
  9. +1 −1 src/messages/it/core.php
  10. +2 −2 src/resources/cropbox.js
  11. +1 −1 src/resources/cropbox.min.js
  12. +4 −3 src/views/field.php
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,3 +2,5 @@
/vendor
/composer.lock
/build
/.php_cs.cache
/nbproject
17 changes: 17 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

use PhpCsFixer\Finder;
use PhpCsFixer\Config;

$finder = Finder::create()->in([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
return Config::create()
->setRules([
'@PSR2' => true,
'array_syntax' => [
'syntax' => 'short',
],
])
->setFinder($finder);
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ php:
- '5.5'
- '5.6'
- '7.0'
- hhvm

before_script:
- travis_retry composer self-update && composer --version
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
yii2-widget-cropbox
===================

v5.1.1 [2017-05-22]
-------------------

- Fixed uploaded bug.

v5.1.0 [2017-05-20]
-------------------

- Update js-cropbox extension.

v5.0.2 [2017-05-13]
-------------------

- Added code fixer.
- Removed HHVM from tests.

v5.0.1 [2017-05-13]
-------------------

12 changes: 9 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
"description": "This is widget wrapper of https://github.com/bupy7/js-cropbox. This widget allows crop image before to upload to server and send informations about crop as JSON string.",
"keywords": ["yii2", "extension", "widget", "crop", "image"],
"homepage": "https://github.com/bupy7/yii2-widget-cropbox",
"version": "5.0.1",
"version": "5.1.1",
"type": "yii2-extension",
"license": "BSD-3-Clause",
"authors": [
@@ -17,7 +17,7 @@
"require": {
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"bower-asset/js-cropbox": "0.11.0"
"bower-asset/js-cropbox": "~0.12.0"
},
"autoload": {
"psr-4": {
@@ -27,12 +27,18 @@
},
"require-dev": {
"phpunit/phpunit": ">=4.8 <6.0.0",
"satooshi/php-coveralls": "^1.0.1"
"satooshi/php-coveralls": "^1.0.1",
"friendsofphp/php-cs-fixer": "2.2.3"
},
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
},
"scripts": {
"fixer": "php vendor/bin/php-cs-fixer fix",
"test": "php vendor/bin/phpunit"
}
}

12 changes: 6 additions & 6 deletions src/CropboxWidget.php
Original file line number Diff line number Diff line change
@@ -48,13 +48,13 @@ class CropboxWidget extends InputWidget
public $originalImageUrl;
/**
* @var array URL to images for display before upload to preview URL.
*
*
* Example:
* [
* '/uploads/1.png',
* '/uploads/2.png',
* ];
*
*
* or simply string to image.
*/
public $croppedImagesUrl;
@@ -65,10 +65,10 @@ class CropboxWidget extends InputWidget

public function init()
{
parent::init();
parent::init();
WidgetAsset::register($this->view);
$this->registerTranslations();
$this->configuration();
$this->registerTranslations();
$this->configuration();
}

public function run()
@@ -82,7 +82,7 @@ public function run()

/**
* Translates a message to the specified language.
*
*
* @param string $message the message to be translated.
* @param array $params the parameters that will be used to replace the corresponding placeholders in the message.
* @param string $language the language code (e.g. `en-US`, `en`). If this is null, the current of application
1 change: 0 additions & 1 deletion src/assets/WidgetAsset.php
Original file line number Diff line number Diff line change
@@ -27,4 +27,3 @@ public function init()
parent::init();
}
}

2 changes: 1 addition & 1 deletion src/messages/hu/core.php
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@
'Height' => 'Magasság',
'Width' => 'Szélesség',
'Reset' => 'Visszaállítása'
];
];
2 changes: 1 addition & 1 deletion src/messages/it/core.php
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@
'Height' => 'Altezza',
'Width' => 'Larghezza',
'Reset' => 'Reset',
];
];
4 changes: 2 additions & 2 deletions src/resources/cropbox.js
Original file line number Diff line number Diff line change
@@ -87,8 +87,8 @@
$(s.croppedDataInput).val('');
};
$th.on('cb:reset', resetHandler);
// the loaded event
$th.on('cb:loaded', resetHandler);
// the ready event
$th.on('cb:ready', resetHandler);
// the disabled/enabled event
function disabledHandler() {
$(s.btnScaleIn).attr('disabled', 'disabled');
2 changes: 1 addition & 1 deletion src/resources/cropbox.min.js

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

7 changes: 4 additions & 3 deletions src/views/field.php
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

use yii\helpers\Html;
use bupy7\cropbox\CropboxWidget;

?>
<div id="<?= $this->context->id; ?>" class="cropbox">
<div class="alert alert-info message-container-cropbox"></div>
@@ -36,13 +37,13 @@
if (!empty($this->context->originalImageUrl)) {
echo Html::a(
'<i class="glyphicon glyphicon-eye-open"></i> ' . CropboxWidget::t('Show original'),
$this->context->originalImageUrl,
$this->context->originalImageUrl,
[
'target' => '_blank',
'class' => 'btn btn-info',
]
);
}
}
?>
</p>
<?php
@@ -57,6 +58,6 @@
echo Html::activeHiddenInput($this->context->model, $this->context->croppedDataAttribute);
} else {
echo Html::hiddenInput($this->context->croppedDataName, $this->context->croppedDataValue);
}
}
?>
</div>