diff --git a/CHANGELOG.md b/CHANGELOG.md
index c786b00..c95a1a8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@ Prism Library Changelog
### v1.20
* Upgraded [VueJS](https://vuejs.org/) to v2.4.2.
+* Upgraded [jQuery Cropper](https://fengyuanchen.github.io/cropper/) to v3.0.0.
* Upgraded [jQuery AutoComplete](https://github.com/devbridge/jQuery-Autocomplete) to v1.4.1.
* Upgraded [jQuery File Upload](https://github.com/blueimp/jQuery-File-Upload) to v9.18.0.
* Upgraded [SweetAlert2](https://limonte.github.io/sweetalert2/) to v6.6.5.
@@ -16,6 +17,7 @@ Prism Library Changelog
* Renamed folder __libs__ to __vendor__.
* The antbuilder reworked. Now, it builds Joomla! package from current source.
* Published to Packagist. The library can be installed to any framework via Composer.
+* It was decreased minimum image size to 25 when resize or crop.
### v1.19.6
* Improved Log class.
diff --git a/build/build.xml b/build/build.xml
index 5f48df1..98d5ac3 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -21,20 +21,21 @@
-
+
+
+
-
-
-
+
+
@@ -69,7 +70,7 @@
-
+
@@ -96,8 +97,13 @@
-
+
+
+
+
+
+
diff --git a/src/Database/Condition/Condition.php b/src/Database/Condition/Condition.php
index 0210908..acfac37 100644
--- a/src/Database/Condition/Condition.php
+++ b/src/Database/Condition/Condition.php
@@ -55,8 +55,8 @@ public function __construct(array $data = array())
$this->raw = array_key_exists('raw', $data) ? (string)$data['raw'] : '';
$this->column = array_key_exists('column', $data) ? (string)$data['column'] : '';
$this->value = array_key_exists('value', $data) ? $data['value'] : '';
- $this->table = array_key_exists('table', $data) ? (string)$data['table'] : '';
- $this->operator = array_key_exists('operator', $data) ? (string)$data['operator'] : '';
+ $this->table = array_key_exists('table', $data) ? (string)$data['table'] : 'a';
+ $this->operator = array_key_exists('operator', $data) ? (string)$data['operator'] : '=';
}
/**
diff --git a/src/Database/JoomlaDatabaseGateway.php b/src/Database/JoomlaDatabaseGateway.php
index ec643b8..d8eeffd 100644
--- a/src/Database/JoomlaDatabaseGateway.php
+++ b/src/Database/JoomlaDatabaseGateway.php
@@ -126,10 +126,11 @@ protected function limit(\JDatabaseQuery $query, Request $request)
*
* @param Request $request
* @param array $defaultFields
+ * @param array $aliasFields
*
* @return array
*/
- protected function prepareFields($request, array $defaultFields)
+ protected function prepareFields($request, array $defaultFields, array $aliasFields = array())
{
$fields = array();
@@ -140,16 +141,20 @@ protected function prepareFields($request, array $defaultFields)
if (count($requiredFields) > 0) {
/** @var Field $field */
foreach ($requiredFields as $field) {
- $requireField = $field->getTable() ? $field->getTable() . '.' . $field->getColumn() : 'a.' . $field->getColumn();
- if (!in_array($requireField, $defaultFields, true)) {
- continue;
+ if ($field->isAlias() && array_key_exists($field->getColumn(), $aliasFields)) {
+ $fields[] = $aliasFields[$field->getColumn()];
+ } else {
+ $requireField = $field->getTable() ? $field->getTable() . '.' . $field->getColumn() : 'a.' . $field->getColumn();
+ if (!in_array($requireField, $defaultFields, true)) {
+ continue;
+ }
+
+ if ($field->getAlias()) {
+ $requireField .= ' AS ' . $field->getAlias();
+ }
+
+ $fields[] = $requireField;
}
-
- if ($field->getAlias()) {
- $requireField .= ' AS ' . $field->getAlias();
- }
-
- $fields[] = $requireField;
}
}
}
diff --git a/src/Database/Request/Field.php b/src/Database/Request/Field.php
index 21d23d9..076293e 100644
--- a/src/Database/Request/Field.php
+++ b/src/Database/Request/Field.php
@@ -45,12 +45,20 @@ class Field
*/
protected $raw;
+ /**
+ * It shows us the column name is an alias of expression.
+ *
+ * @var string
+ */
+ protected $is_alias = false;
+
public function __construct(array $data)
{
- $this->raw = array_key_exists('raw', $data) ? (string)$data['raw'] : '';
- $this->alias = array_key_exists('alias', $data) ? (string)$data['alias'] : '';
- $this->column = array_key_exists('column', $data) ? (string)$data['column'] : '';
- $this->table = array_key_exists('table', $data) ? (string)$data['table'] : '';
+ $this->raw = array_key_exists('raw', $data) ? (string)$data['raw'] : '';
+ $this->alias = array_key_exists('alias', $data) ? (string)$data['alias'] : '';
+ $this->column = array_key_exists('column', $data) ? (string)$data['column'] : '';
+ $this->table = array_key_exists('table', $data) ? (string)$data['table'] : '';
+ $this->is_alias = array_key_exists('is_alias', $data) ? (bool)$data['is_alias'] : false;
}
/**
@@ -116,4 +124,14 @@ public function setRaw($raw)
{
$this->raw = $raw;
}
+
+ /**
+ * Check if the filed is an alias of expression.
+ *
+ * @return bool
+ */
+ public function isAlias()
+ {
+ return (bool)$this->is_alias;
+ }
}
diff --git a/src/Database/Request/Request.php b/src/Database/Request/Request.php
index b836507..49793d7 100644
--- a/src/Database/Request/Request.php
+++ b/src/Database/Request/Request.php
@@ -9,6 +9,7 @@
namespace Prism\Database\Request;
+use Prism\Database\Condition\Condition;
use Prism\Database\Condition\Conditions;
use Prism\Database\Condition\Order;
use Prism\Database\Condition\Ordering;
@@ -50,10 +51,10 @@ class Request
public function __construct()
{
- $this->fields = new Fields();
- $this->conditions = new Conditions();
- $this->ordering = new Ordering();
- $this->limit = new Limit();
+ $this->fields = new Fields;
+ $this->conditions = new Conditions;
+ $this->ordering = new Ordering;
+ $this->limit = new Limit;
}
/**
@@ -135,4 +136,40 @@ public function getLimit()
{
return $this->limit;
}
+
+ /**
+ * @param Condition $condition
+ *
+ * @return self
+ */
+ public function addCondition(Condition $condition)
+ {
+ $this->conditions->addCondition($condition);
+
+ return $this;
+ }
+
+ /**
+ * @param Field $field
+ *
+ * @return self
+ */
+ public function requestField(Field $field)
+ {
+ $this->fields->addField($field);
+
+ return $this;
+ }
+
+ /**
+ * @param Order $condition
+ *
+ * @return self
+ */
+ public function addOrderCondition(Order $condition)
+ {
+ $this->ordering->addCondition($condition);
+
+ return $this;
+ }
}
diff --git a/src/Domain/PropertiesMethods.php b/src/Domain/PropertiesMethods.php
index 87841da..c99efda 100644
--- a/src/Domain/PropertiesMethods.php
+++ b/src/Domain/PropertiesMethods.php
@@ -18,7 +18,7 @@
trait PropertiesMethods
{
/**
- * Returns object properties as associative array;
+ * Returns object properties as associative array.
*
* @return array
*/
diff --git a/src/Domain/ToOptionsMethod.php b/src/Domain/ToOptionsMethod.php
index 9a86546..b7b5c22 100644
--- a/src/Domain/ToOptionsMethod.php
+++ b/src/Domain/ToOptionsMethod.php
@@ -35,7 +35,7 @@ public function toOptions($key, $text, $suffix = '')
$properties = is_object($item) ? $item->getProperties() : $item;
if ($suffix !== '' && (array_key_exists($suffix, $properties) && (string)$properties[$suffix] !== '')) {
- $options[] = array('value' => $properties[$key], 'text' => $properties[$text] . ' ['.(string)$properties[$suffix].']');
+ $options[] = array('value' => $properties[$key], 'text' => $properties[$text] . ', '.(string)$properties[$suffix]);
} else {
$options[] = array('value' => $properties[$key], 'text' => $properties[$text]);
}
diff --git a/src/File/Image.php b/src/File/Image.php
index c362792..f377083 100644
--- a/src/File/Image.php
+++ b/src/File/Image.php
@@ -94,9 +94,9 @@ public function resize($destinationFolder, Registry $options)
// Resize to general size.
$width = $options->get('width', 640);
- $width = ($width < 50) ? 50 : $width;
+ $width = ($width < 25) ? 25 : $width;
$height = $options->get('height', 480);
- $height = ($height < 50) ? 50 : $height;
+ $height = ($height < 25) ? 25 : $height;
$scale = $options->get('scale', \JImage::SCALE_INSIDE);
$createNew = (bool)$options->get('create_new', Constants::NO);
@@ -157,9 +157,9 @@ public function crop($destinationFolder, Registry $options)
// Resize to general size.
$width = $options->get('width', 200);
- $width = ($width < 50) ? 50 : $width;
+ $width = ($width < 25) ? 25 : $width;
$height = $options->get('height', 200);
- $height = ($height < 50) ? 50 : $height;
+ $height = ($height < 25) ? 25 : $height;
$left = (int)abs($options->get('x', 0));
$top = (int)abs($options->get('y', 0));
$createNew = (bool)$options->get('create_new', Constants::NO);
diff --git a/src/Version.php b/src/Version.php
index 9dfd389..a5841be 100644
--- a/src/Version.php
+++ b/src/Version.php
@@ -57,7 +57,7 @@ class Version
*
* @var string
*/
- public $releaseDate = '10 September, 2017';
+ public $releaseDate = '08 September, 2017';
/**
* License
diff --git a/src/lib_prism.xml b/src/lib_prism.xml
index e7b94ce..8f871f4 100644
--- a/src/lib_prism.xml
+++ b/src/lib_prism.xml
@@ -10,7 +10,7 @@
ITPrism
http://itprism.com
1.20
- 10 September, 2017
+ 08 September, 2017
Prism Library is a collection of PHP classes used in many ITPrism extensions.
Subscribe for the newsletter to receive information about updates and new ITPrism extensions.
diff --git a/src/ui/cropper/cropper.min.css b/src/ui/cropper/cropper.min.css
index 9426dac..cc4fa28 100644
--- a/src/ui/cropper/cropper.min.css
+++ b/src/ui/cropper/cropper.min.css
@@ -1,9 +1,11 @@
/*!
- * Cropper v2.3.4
+ * Cropper v3.0.0
* https://github.com/fengyuanchen/cropper
*
- * Copyright (c) 2014-2016 Fengyuan Chen and contributors
+ * Copyright (c) 2017 Fengyuan Chen
* Released under the MIT license
*
- * Date: 2016-09-03T05:50:45.412Z
- */.cropper-container{font-size:0;line-height:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;direction:ltr!important}.cropper-container img{display:block;width:100%;min-width:0!important;max-width:none!important;height:100%;min-height:0!important;max-height:none!important;image-orientation:0deg!important}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{position:absolute;top:0;right:0;bottom:0;left:0}.cropper-wrap-box{overflow:hidden}.cropper-drag-box{opacity:0;background-color:#fff;filter:alpha(opacity=0)}.cropper-dashed,.cropper-modal{opacity:.5;filter:alpha(opacity=50)}.cropper-modal{background-color:#000}.cropper-view-box{display:block;overflow:hidden;width:100%;height:100%;outline:#39f solid 1px;outline-color:rgba(51,153,255,.75)}.cropper-dashed{position:absolute;display:block;border:0 dashed #eee}.cropper-dashed.dashed-h{top:33.33333%;left:0;width:100%;height:33.33333%;border-top-width:1px;border-bottom-width:1px}.cropper-dashed.dashed-v{top:0;left:33.33333%;width:33.33333%;height:100%;border-right-width:1px;border-left-width:1px}.cropper-center{position:absolute;top:50%;left:50%;display:block;width:0;height:0;opacity:.75;filter:alpha(opacity=75)}.cropper-center:after,.cropper-center:before{position:absolute;display:block;content:' ';background-color:#eee}.cropper-center:before{top:0;left:-3px;width:7px;height:1px}.cropper-center:after{top:-3px;left:0;width:1px;height:7px}.cropper-face,.cropper-line,.cropper-point{position:absolute;display:block;width:100%;height:100%;opacity:.1;filter:alpha(opacity=10)}.cropper-face{top:0;left:0;background-color:#fff}.cropper-line,.cropper-point{background-color:#39f}.cropper-line.line-e{top:0;right:-3px;width:5px;cursor:e-resize}.cropper-line.line-n{top:-3px;left:0;height:5px;cursor:n-resize}.cropper-line.line-w{top:0;left:-3px;width:5px;cursor:w-resize}.cropper-line.line-s{bottom:-3px;left:0;height:5px;cursor:s-resize}.cropper-point{width:5px;height:5px;opacity:.75;filter:alpha(opacity=75)}.cropper-point.point-e{top:50%;right:-3px;margin-top:-3px;cursor:e-resize}.cropper-point.point-n{top:-3px;left:50%;margin-left:-3px;cursor:n-resize}.cropper-point.point-w{top:50%;left:-3px;margin-top:-3px;cursor:w-resize}.cropper-point.point-s{bottom:-3px;left:50%;margin-left:-3px;cursor:s-resize}.cropper-point.point-ne{top:-3px;right:-3px;cursor:ne-resize}.cropper-point.point-nw{top:-3px;left:-3px;cursor:nw-resize}.cropper-point.point-sw{bottom:-3px;left:-3px;cursor:sw-resize}.cropper-point.point-se{right:-3px;bottom:-3px;width:20px;height:20px;cursor:se-resize;opacity:1;filter:alpha(opacity=100)}.cropper-point.point-se:before{position:absolute;right:-50%;bottom:-50%;display:block;width:200%;height:200%;content:' ';opacity:0;background-color:#39f;filter:alpha(opacity=0)}@media (min-width:768px){.cropper-point.point-se{width:15px;height:15px}}@media (min-width:992px){.cropper-point.point-se{width:10px;height:10px}}@media (min-width:1200px){.cropper-point.point-se{width:5px;height:5px;opacity:.75;filter:alpha(opacity=75)}}.cropper-invisible{opacity:0;filter:alpha(opacity=0)}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{position:absolute;display:block;width:0;height:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}
\ No newline at end of file
+ * Date: 2017-09-03T13:13:53.439Z
+ */
+
+.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline-color:rgba(51,153,255,.75);outline:1px solid #39f;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:e-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:n-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:w-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:s-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:e-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:n-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:w-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:ne-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nw-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:sw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:se-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}
\ No newline at end of file
diff --git a/src/ui/cropper/cropper.min.js b/src/ui/cropper/cropper.min.js
index d285e2c..58b32b7 100644
--- a/src/ui/cropper/cropper.min.js
+++ b/src/ui/cropper/cropper.min.js
@@ -1,10 +1,11 @@
/*!
- * Cropper v2.3.4
+ * Cropper v3.0.0
* https://github.com/fengyuanchen/cropper
*
- * Copyright (c) 2014-2016 Fengyuan Chen and contributors
+ * Copyright (c) 2017 Fengyuan Chen
* Released under the MIT license
*
- * Date: 2016-09-03T05:50:45.412Z
+ * Date: 2017-09-03T13:13:53.439Z
*/
-!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){"use strict";function i(t){return"number"==typeof t&&!isNaN(t)}function e(t){return"undefined"==typeof t}function s(t,e){var s=[];return i(e)&&s.push(e),s.slice.apply(t,s)}function a(t,i){var e=s(arguments,2);return function(){return t.apply(i,e.concat(s(arguments)))}}function o(t){var i=t.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return i&&(i[1]!==C.protocol||i[2]!==C.hostname||i[3]!==C.port)}function h(t){var i="timestamp="+(new Date).getTime();return t+(t.indexOf("?")===-1?"?":"&")+i}function n(t){return t?' crossOrigin="'+t+'"':""}function r(t,i){var e;return t.naturalWidth&&!mt?i(t.naturalWidth,t.naturalHeight):(e=document.createElement("img"),e.onload=function(){i(this.width,this.height)},void(e.src=t.src))}function p(t){var e=[],s=t.rotate,a=t.scaleX,o=t.scaleY;return i(s)&&0!==s&&e.push("rotate("+s+"deg)"),i(a)&&1!==a&&e.push("scaleX("+a+")"),i(o)&&1!==o&&e.push("scaleY("+o+")"),e.length?e.join(" "):"none"}function l(t,i){var e,s,a=Ct(t.degree)%180,o=(a>90?180-a:a)*Math.PI/180,h=bt(o),n=Bt(o),r=t.width,p=t.height,l=t.aspectRatio;return i?(e=r/(n+h/l),s=e/l):(e=r*n+p*h,s=r*h+p*n),{width:e,height:s}}function c(e,s){var a,o,h,n=t("