X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=view%2Fjs%2Fdropzone-factory.js;h=4f14551be8a270b0bc65e5be806f9981a0c7684a;hb=a74bb57298e28f3b499d166aecb4f2ee9e627332;hp=ca77bb6d500652fcfbb4fbe3d4b36164bdc39555;hpb=cf63cbde72e5fd41d237a3fe3aef3de4d07c9f1b;p=friendica.git diff --git a/view/js/dropzone-factory.js b/view/js/dropzone-factory.js index ca77bb6d50..4f14551be8 100644 --- a/view/js/dropzone-factory.js +++ b/view/js/dropzone-factory.js @@ -1,4 +1,5 @@ -var DzFactory = function () { +Dropzone.autoDiscover = false; +var DzFactory = function (max_imagesize) { this.createDropzone = function(dropSelector, textareaElementId) { return new Dropzone(dropSelector, { paramName: 'userfile', // The name that will be used to transfer the file @@ -6,6 +7,17 @@ var DzFactory = function () { url: '/media/photo/upload?album=', acceptedFiles: 'image/*', clickable: true, + dictDefaultMessage: dzStrings.dictDefaultMessage, + dictFallbackMessage: dzStrings.dictFallbackMessage, + dictFallbackText: dzStrings.dictFallbackText, + dictFileTooBig: dzStrings.dictFileTooBig, + dictInvalidFileType: dzStrings.dictInvalidFileType, + dictResponseError: dzStrings.dictResponseError, + dictCancelUpload: dzStrings.dictCancelUpload, + dictUploadCanceled: dzStrings.dictUploadCanceled, + dictCancelUploadConfirmation: dzStrings.dictCancelUploadConfirmation, + dictRemoveFile: dzStrings.dictRemoveFile, + dictMaxFilesExceeded: dzStrings.dictMaxFilesExceeded, accept: function(file, done) { done(); }, @@ -54,9 +66,10 @@ var DzFactory = function () { }; this.setupDropzone = function(dropSelector, textareaElementId) { + const self = this; var dropzone = this.createDropzone(dropSelector, textareaElementId); $(dropSelector).on('paste', function(event) { - dzFactory.copyPaste(event, dropzone); + self.copyPaste(event, dropzone); }) }; }