sagacity/script/dropzone/dropzone.min.js

2 lines
49 KiB
JavaScript
Raw Permalink Normal View History

2018-07-26 08:33:50 -04:00
"use strict";var _createClass=function(){function a(e,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||false;d.configurable=true;if("value" in d){d.writable=true}Object.defineProperty(e,d.key,d)}}return function(d,b,c){if(b){a(d.prototype,b)}if(c){a(d,c)}return d}}();function _possibleConstructorReturn(a,b){if(!a){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return b&&(typeof b==="object"||typeof b==="function")?b:a}function _inherits(b,a){if(typeof a!=="function"&&a!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof a)}b.prototype=Object.create(a&&a.prototype,{constructor:{value:b,enumerable:false,writable:true,configurable:true}});if(a){Object.setPrototypeOf?Object.setPrototypeOf(b,a):b.__proto__=a}}function _classCallCheck(a,b){if(!(a instanceof b)){throw new TypeError("Cannot call a class as a function")}}var Emitter=function(){function c(){_classCallCheck(this,c)}_createClass(c,[{key:"on",value:function a(f,e){this._callbacks=this._callbacks||{};if(!this._callbacks[f]){this._callbacks[f]=[]}this._callbacks[f].push(e);return this}},{key:"emit",value:function b(e){this._callbacks=this._callbacks||{};var j=this._callbacks[e];if(j){for(var m=arguments.length,k=Array(m>1?m-1:0),f=1;f<m;f++){k[f-1]=arguments[f]}for(var i=j,l=true,g=0,i=l?i:i[Symbol.iterator]();;){var h;if(l){if(g>=i.length){break}h=i[g++]}else{g=i.next();if(g.done){break}h=g.value}var n=h;n.apply(this,k)}}return this}},{key:"off",value:function d(h,f){if(!this._callbacks||arguments.length===0){this._callbacks={};return this}var g=this._callbacks[h];if(!g){return this}if(arguments.length===1){delete this._callbacks[h];return this}for(var e=0;e<g.length;e++){var j=g[e];if(j===f){g.splice(e,1);break}}return this}}]);return c}();var Dropzone=function(j){_inherits(C,j);_createClass(C,null,[{key:"initClass",value:function B(){this.prototype.Emitter=Emitter;this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"];this.prototype.defaultOptions={url:null,method:"post",withCredentials:false,timeout:30000,parallelUploads:2,uploadMultiple:false,chunking:false,forceChunking:false,chunkSize:2000000,parallelChunkUploads:false,retryChunks:false,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:true,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:0.8,resizeMethod:"contain",filesizeBase:1000,maxFiles:null,headers:null,clickable:true,ignoreHiddenFiles:true,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:true,autoQueue:true,addRemoveLinks:false,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:false,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function aM(){},params:function aj(aT,aU,aS){if(aS){return{dzuuid:aS.file.upload.uuid,dzchunkindex:aS.index,dztotalfilesize:aS.file.size,dzchunksize:this.options.chunkSize,dztota