mirror of
https://github.com/documize/community.git
synced 2025-08-02 03:55:24 +02:00
parent
9f4715a494
commit
bbed3e5a08
11 changed files with 770 additions and 766 deletions
|
@ -46,44 +46,47 @@ export default Component.extend(Modals, Notifier, {
|
|||
let url = this.get('appMeta.endpoint');
|
||||
let uploadUrl = `${url}/documents/${documentId}/attachments`;
|
||||
|
||||
let dzone = new Dropzone("#upload-document-files > div", {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + self.get('session.authToken')
|
||||
},
|
||||
url: uploadUrl,
|
||||
method: "post",
|
||||
paramName: 'attachment',
|
||||
clickable: true,
|
||||
maxFilesize: 50,
|
||||
parallelUploads: 5,
|
||||
uploadMultiple: false,
|
||||
addRemoveLinks: false,
|
||||
autoProcessQueue: true,
|
||||
|
||||
init: function () {
|
||||
this.on("success", function (/*file, response*/ ) {
|
||||
});
|
||||
// Handle upload clicks on button and anything inside that button.
|
||||
let sel = ['#upload-document-files ', '#upload-document-files > div'];
|
||||
for (var i=0; i < 2; i++) {
|
||||
let dzone = new Dropzone(sel[i], {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + self.get('session.authToken')
|
||||
},
|
||||
url: uploadUrl,
|
||||
method: "post",
|
||||
paramName: 'attachment',
|
||||
clickable: true,
|
||||
maxFilesize: 50,
|
||||
parallelUploads: 5,
|
||||
uploadMultiple: false,
|
||||
addRemoveLinks: false,
|
||||
autoProcessQueue: true,
|
||||
|
||||
this.on("queuecomplete", function () {
|
||||
self.notifySuccess('Uploaded file');
|
||||
self.getAttachments();
|
||||
});
|
||||
init: function () {
|
||||
this.on("success", function (/*file, response*/ ) {
|
||||
});
|
||||
|
||||
this.on("addedfile", function ( /*file*/ ) {
|
||||
});
|
||||
this.on("queuecomplete", function () {
|
||||
self.notifySuccess('Uploaded file');
|
||||
self.getAttachments();
|
||||
});
|
||||
|
||||
this.on("error", function (error, msg) {
|
||||
self.notifyError(msg);
|
||||
self.notifyError(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
this.on("addedfile", function ( /*file*/ ) {
|
||||
});
|
||||
|
||||
dzone.on("complete", function (file) {
|
||||
dzone.removeFile(file);
|
||||
});
|
||||
this.on("error", function (error, msg) {
|
||||
self.notifyError(msg);
|
||||
self.notifyError(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.set('drop', dzone);
|
||||
dzone.on("complete", function (file) {
|
||||
dzone.removeFile(file);
|
||||
});
|
||||
}
|
||||
|
||||
// For authenticated users we send server auth token.
|
||||
let qry = '';
|
||||
|
|
|
@ -27,7 +27,7 @@ export default Service.extend({
|
|||
orgId: '',
|
||||
title: '',
|
||||
version: '',
|
||||
revision: 1000,
|
||||
revision: '1000',
|
||||
message: '',
|
||||
edition: 'Community',
|
||||
valid: true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "documize",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.3",
|
||||
"description": "The Document IDE",
|
||||
"repository": "",
|
||||
"license": "AGPL",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue