Commit 00cf99d1 authored by Henning Leutz's avatar Henning Leutz 🥋

Merge branch 'dev'

parents 7b4d52db d8d38535
......@@ -104,6 +104,7 @@ define('controls/upload/File', [
this.$result = null;
this.$error = false;
this.$errors = 0;
this.$uploaded = false;
this.$ContextMenu = null;
this.$slice_method = 'slice';
......@@ -409,6 +410,7 @@ define('controls/upload/File', [
}
if (this.$error === false) {
this.$uploaded = true;
this.fireEvent('complete', [this, this.$result]);
}
......@@ -498,7 +500,7 @@ define('controls/upload/File', [
* @return {Boolean}
*/
isFinished: function () {
return this.$range_end === this.$file_size;
return this.$uploaded;
},
/**
......@@ -566,10 +568,10 @@ define('controls/upload/File', [
response.text().then(function (text) {
this.$parseResult(text);
}.bind(this));
this.refresh();
this.upload();
this.refresh();
this.upload();
}.bind(this));
}.bind(this)).catch(function (err) {
console.error('Information about the upload error: ', err);
......
......@@ -33,7 +33,6 @@
.controls-upload-buttons {
clear: both;
float: left;
height: 30px;
position: relative;
width: 100%;
z-index: 2;
......
......@@ -25,13 +25,14 @@ define('controls/upload/Form', [
'qui/controls/Control',
'qui/controls/utils/Progressbar',
'qui/controls/buttons/Button',
'qui/controls/loader/Loader',
'utils/Media',
'classes/request/Upload',
'Locale',
'css!controls/upload/Form.css'
], function (QUI, QUIControl, QUIProgressbar, QUIButton, MediaUtils, Upload, Locale) {
], function (QUI, QUIControl, QUIProgressbar, QUIButton, QUILoader, MediaUtils, Upload, Locale) {
"use strict";
var lg = 'quiqqer/quiqqer';
......@@ -69,7 +70,8 @@ define('controls/upload/Form', [
'$onFileUploadFinish',
'$onFileUploadRefresh',
'$onFileUploadCancel',
'$onError'
'$onError',
'$onInject'
],
/**
......@@ -118,6 +120,7 @@ define('controls/upload/Form', [
this.$Info = null;
this.addEvents({
onInject : this.$onInject,
onDestroy: function () {
if (self.$Form) {
self.$Form.destroy();
......@@ -256,6 +259,8 @@ define('controls/upload/Form', [
}
});
this.Loader = new QUILoader().inject(this.$Elm);
this.$Buttons = this.$Elm.getElement('.controls-upload-buttons');
this.$BgText = this.$Elm.getElement('.controls-upload-bg-text');
this.$Info = this.$Elm.getElement('.controls-upload-info');
......@@ -389,6 +394,24 @@ define('controls/upload/Form', [
return this.$Elm;
},
/**
* event: on inject
*/
$onInject: function () {
this.resize();
},
/**
* resize the form
*/
resize: function () {
var buttonsHeight = this.$Buttons.getSize().y;
var inforHeight = this.$Info.getSize().y;
var height = buttonsHeight + inforHeight;
this.$Form.setStyle('height', 'calc(100% - ' + height + 'px)');
},
/**
* Create the icon view
*/
......@@ -913,6 +936,7 @@ define('controls/upload/Form', [
return;
}
this.Loader.show();
this.fireEvent('submit', [this.getFiles(), this]);
// send to upload manager
......@@ -992,6 +1016,7 @@ define('controls/upload/Form', [
}
}
this.Loader.hide();
this.fireEvent('finished', [this]);
this.$finished = true;
}.bind(this));
......
......@@ -36,7 +36,7 @@ define('controls/upload/Manager', [
return new Class({
Extends: QUIPanel,
Type: 'controls/upload/Manager',
Type : 'controls/upload/Manager',
Binds: [
'$onCreate',
......@@ -47,19 +47,19 @@ define('controls/upload/Manager', [
],
options: {
icon: 'fa fa-upload',
icon : 'fa fa-upload',
pauseAllowed: true,
contextMenu: true
contextMenu : true
},
initialize: function (options) {
this.parent(options);
this.$files = [];
this.$files = [];
this.$container = null;
this.$uploads = {};
this.$uploads = {};
this.$maxPercent = 0;
this.$maxPercent = 0;
this.$uploadPerCents = {};
this.$Container = null;
......@@ -79,8 +79,8 @@ define('controls/upload/Manager', [
}).inject(this.getContent());
this.addButton({
icon: 'fa fa-trash',
title: Locale.get(lg, 'upload.manager.clear'),
icon : 'fa fa-trash',
title : Locale.get(lg, 'upload.manager.clear'),
styles: {
'float': 'right'
},
......@@ -219,10 +219,10 @@ define('controls/upload/Manager', [
// ask for extraction
new QUIAlert({
title: Locale.get(lg, 'upload.manager.message.archivfile.title'),
content: Locale.get(lg, 'upload.manager.message.archivfile.text') + '<br />' + list,
title : Locale.get(lg, 'upload.manager.message.archivfile.title'),
content : Locale.get(lg, 'upload.manager.message.archivfile.text') + '<br />' + list,
closeButtonText: Locale.get(lg, 'upload.manager.message.archivfile.btn.start'),
events: {
events : {
onClose: function (Win) {
var i, len;
......@@ -311,7 +311,7 @@ define('controls/upload/Manager', [
};
for (i = 0, len = files.length; i < len; i++) {
file_params = Object.clone(params);
file_params = Object.clone(params);
file_params.extract = false;
if (extract && extract[files[i].name]) {
......@@ -325,18 +325,18 @@ define('controls/upload/Manager', [
}
var QUIFile = new UploadFile(files[i], {
phpfunc: rf,
params: file_params,
events: events,
phpfunc : rf,
params : file_params,
events : events,
pauseAllowed: this.getAttribute('pauseAllowed'),
contextMenu: this.getAttribute('contextMenu')
contextMenu : this.getAttribute('contextMenu')
});
QUIFile.addEvents({
onComplete: onComplete,
onRefresh: onRefresh,
onError: onError,
onCancel: onCancel
onRefresh : onRefresh,
onError : onError,
onCancel : onCancel
});
if (file_params.phponstart) {
......@@ -359,13 +359,13 @@ define('controls/upload/Manager', [
Node.setStyles({
background: '#fff',
border: '1px solid #f1f1f1',
bottom: 10,
boxShadow: '0 0 10px rgba(0, 0, 0, 0.3)',
position: 'absolute',
right: 10,
width: 300,
zIndex: 1000
border : '1px solid #f1f1f1',
bottom : 10,
boxShadow : '0 0 10px rgba(0, 0, 0, 0.3)',
position : 'absolute',
right : 10,
width : 300,
zIndex : 1000
});
Node.inject(document.body);
......@@ -444,10 +444,10 @@ define('controls/upload/Manager', [
QUIFile = new UploadFile(params.file, {
phpfunc: params.phpfunc,
params: params,
events: {
params : params,
events : {
onComplete: func_oncomplete,
onCancel: func_oncancel
onCancel : func_oncancel
}
});
......
......@@ -25,6 +25,24 @@ class QuiqqerMongoDriver extends AbstractDriver
*/
private $collection;
/**
* QuiqqerMongoDriver constructor.
* @param array $options
*/
public function __construct(array $options = [])
{
parent::__construct($options);
// workaround for mongo auto loading, // load mongo functions
if (!\function_exists('\MongoDB\is_in_transaction')) {
$file = OPT_DIR.'mongodb/mongodb/src/functions.php';
if (\file_exists($file)) {
require $file;
}
}
}
/**
* @param array $key
* @return string
......@@ -64,7 +82,7 @@ class QuiqqerMongoDriver extends AbstractDriver
try {
$this->collection->replaceOne(['_id' => $id], [
'_id' => $id,
'data' => serialize($data),
'data' => \serialize($data),
'expiration' => $expiration
], ['upsert' => true]);
} catch (\MongoDB\Driver\Exception\BulkWriteException $ignored) {
......
......@@ -309,7 +309,7 @@
</locale>
<locale name="projects.project.settings.panel.mediaSettings.maxUploadFileSize.description" html="true">
<de><![CDATA[
Bilder, die grösser als der angegebene Wert sind, werden beim Upload automatisch auf diese Größe verkleinert.
Bilder, die grösser als der angegebene Wert sind, werden beim Upload blockiert.
]]></de>
</locale>
<locale name="projects.project.settings.panel.mediaSettings.maxImageCacheSize">
......
......@@ -309,7 +309,7 @@
</locale>
<locale name="projects.project.settings.panel.mediaSettings.maxUploadFileSize.description" html="true">
<en><![CDATA[
Images that are larger than the specified value are automatically reduced to this size when uploaded.
Images that are larger than the specified value will be blocked during upload.
]]></en>
</locale>
<locale name="projects.project.settings.panel.mediaSettings.maxImageCacheSize">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment