diff --git a/src/main/twirl/issues/editissue.scala.html b/src/main/twirl/issues/editissue.scala.html
index 80554f7..b97d1f5 100644
--- a/src/main/twirl/issues/editissue.scala.html
+++ b/src/main/twirl/issues/editissue.scala.html
@@ -2,7 +2,9 @@
@import context._
diff --git a/src/main/webapp/assets/common/js/dropzone.js b/src/main/webapp/assets/common/js/dropzone.js
index d98c8ed..d835bb2 100644
--- a/src/main/webapp/assets/common/js/dropzone.js
+++ b/src/main/webapp/assets/common/js/dropzone.js
@@ -1,36 +1,22 @@
+
;(function(){
/**
- * Require the given path.
+ * Require the module at `name`.
*
- * @param {String} path
+ * @param {String} name
* @return {Object} exports
* @api public
*/
-function require(path, parent, orig) {
- var resolved = require.resolve(path);
+function require(name) {
+ var module = require.modules[name];
+ if (!module) throw new Error('failed to require "' + name + '"');
- // lookup failed
- if (null == resolved) {
- orig = orig || path;
- parent = parent || 'root';
- var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
- err.path = orig;
- err.parent = parent;
- err.require = true;
- throw err;
- }
-
- var module = require.modules[resolved];
-
- // perform real require()
- // by invoking the module's
- // registered function
- if (!module.exports) {
- module.exports = {};
+ if (!('exports' in module) && typeof module.definition === 'function') {
module.client = module.component = true;
- module.call(this, module.exports, require.relative(resolved), module);
+ module.definition.call(this, module.exports = {}, module);
+ delete module.definition;
}
return module.exports;
@@ -43,160 +29,33 @@
require.modules = {};
/**
- * Registered aliases.
- */
-
-require.aliases = {};
-
-/**
- * Resolve `path`.
+ * Register module at `name` with callback `definition`.
*
- * Lookup:
- *
- * - PATH/index.js
- * - PATH.js
- * - PATH
- *
- * @param {String} path
- * @return {String} path or null
- * @api private
- */
-
-require.resolve = function(path) {
- if (path.charAt(0) === '/') path = path.slice(1);
-
- var paths = [
- path,
- path + '.js',
- path + '.json',
- path + '/index.js',
- path + '/index.json'
- ];
-
- for (var i = 0; i < paths.length; i++) {
- var path = paths[i];
- if (require.modules.hasOwnProperty(path)) return path;
- if (require.aliases.hasOwnProperty(path)) return require.aliases[path];
- }
-};
-
-/**
- * Normalize `path` relative to the current path.
- *
- * @param {String} curr
- * @param {String} path
- * @return {String}
- * @api private
- */
-
-require.normalize = function(curr, path) {
- var segs = [];
-
- if ('.' != path.charAt(0)) return path;
-
- curr = curr.split('/');
- path = path.split('/');
-
- for (var i = 0; i < path.length; ++i) {
- if ('..' == path[i]) {
- curr.pop();
- } else if ('.' != path[i] && '' != path[i]) {
- segs.push(path[i]);
- }
- }
-
- return curr.concat(segs).join('/');
-};
-
-/**
- * Register module at `path` with callback `definition`.
- *
- * @param {String} path
+ * @param {String} name
* @param {Function} definition
* @api private
*/
-require.register = function(path, definition) {
- require.modules[path] = definition;
+require.register = function (name, definition) {
+ require.modules[name] = {
+ definition: definition
+ };
};
/**
- * Alias a module definition.
+ * Define a module's exports immediately with `exports`.
*
- * @param {String} from
- * @param {String} to
+ * @param {String} name
+ * @param {Generic} exports
* @api private
*/
-require.alias = function(from, to) {
- if (!require.modules.hasOwnProperty(from)) {
- throw new Error('Failed to alias "' + from + '", it does not exist');
- }
- require.aliases[to] = from;
-};
-
-/**
- * Return a require function relative to the `parent` path.
- *
- * @param {String} parent
- * @return {Function}
- * @api private
- */
-
-require.relative = function(parent) {
- var p = require.normalize(parent, '..');
-
- /**
- * lastIndexOf helper.
- */
-
- function lastIndexOf(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) return i;
- }
- return -1;
- }
-
- /**
- * The relative require() itself.
- */
-
- function localRequire(path) {
- var resolved = localRequire.resolve(path);
- return require(resolved, parent, path);
- }
-
- /**
- * Resolve relative to the parent.
- */
-
- localRequire.resolve = function(path) {
- var c = path.charAt(0);
- if ('/' == c) return path.slice(1);
- if ('.' == c) return require.normalize(p, path);
-
- // resolve deps by returning
- // the dep in the nearest "deps"
- // directory
- var segs = parent.split('/');
- var i = lastIndexOf(segs, 'deps') + 1;
- if (!i) i = 0;
- path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
- return path;
+require.define = function (name, exports) {
+ require.modules[name] = {
+ exports: exports
};
-
- /**
- * Check if module is defined at `path`.
- */
-
- localRequire.exists = function(path) {
- return require.modules.hasOwnProperty(localRequire.resolve(path));
- };
-
- return localRequire;
};
-require.register("component-emitter/index.js", function(exports, require, module){
+require.register("component~emitter@1.1.2", function (exports, module) {
/**
* Expose `Emitter`.
@@ -238,7 +97,8 @@
* @api public
*/
-Emitter.prototype.on = function(event, fn){
+Emitter.prototype.on =
+Emitter.prototype.addEventListener = function(event, fn){
this._callbacks = this._callbacks || {};
(this._callbacks[event] = this._callbacks[event] || [])
.push(fn);
@@ -264,7 +124,7 @@
fn.apply(this, arguments);
}
- fn._off = on;
+ on.fn = fn;
this.on(event, on);
return this;
};
@@ -281,8 +141,17 @@
Emitter.prototype.off =
Emitter.prototype.removeListener =
-Emitter.prototype.removeAllListeners = function(event, fn){
+Emitter.prototype.removeAllListeners =
+Emitter.prototype.removeEventListener = function(event, fn){
this._callbacks = this._callbacks || {};
+
+ // all
+ if (0 == arguments.length) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
var callbacks = this._callbacks[event];
if (!callbacks) return this;
@@ -293,8 +162,14 @@
}
// remove specific handler
- var i = callbacks.indexOf(fn._off || fn);
- if (~i) callbacks.splice(i, 1);
+ var cb;
+ for (var i = 0; i < callbacks.length; i++) {
+ cb = callbacks[i];
+ if (cb === fn || cb.fn === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
return this;
};
@@ -347,50 +222,52 @@
};
});
-require.register("dropzone/index.js", function(exports, require, module){
+
+require.register("dropzone", function (exports, module) {
/**
* Exposing dropzone
*/
-module.exports = require("./lib/dropzone.js");
+module.exports = require("dropzone/lib/dropzone.js");
});
-require.register("dropzone/lib/dropzone.js", function(exports, require, module){
-/*
-#
-# More info at [www.dropzonejs.com](http://www.dropzonejs.com)
-#
-# Copyright (c) 2012, Matias Meno
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-*/
+require.register("dropzone/lib/dropzone.js", function (exports, module) {
+
+/*
+ *
+ * More info at [www.dropzonejs.com](http://www.dropzonejs.com)
+ *
+ * Copyright (c) 2012, Matias Meno
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
(function() {
- var Dropzone, Em, camelize, contentLoaded, noop, without,
+ var Dropzone, Em, camelize, contentLoaded, detectVerticalSquash, drawImageIOSFix, noop, without,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__slice = [].slice;
- Em = typeof Emitter !== "undefined" && Emitter !== null ? Emitter : require("emitter");
+ Em = typeof Emitter !== "undefined" && Emitter !== null ? Emitter : require("component~emitter@1.1.2");
noop = function() {};
@@ -399,16 +276,16 @@
__extends(Dropzone, _super);
+
/*
This is a list of all available events you can register on a dropzone object.
You can register an event handler like this:
dropzone.on("dragEnter", function() { });
- */
+ */
-
- Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "selectedfiles", "addedfile", "removedfile", "thumbnail", "error", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset"];
+ Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached"];
Dropzone.prototype.defaultOptions = {
url: null,
@@ -422,6 +299,7 @@
maxThumbnailFilesize: 10,
thumbnailWidth: 100,
thumbnailHeight: 100,
+ maxFiles: null,
params: {},
clickable: true,
ignoreHiddenFiles: true,
@@ -433,12 +311,14 @@
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}}MB). Max filesize: {{maxFilesize}}MB.",
+ 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",
dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
dictRemoveFile: "Remove file",
+ dictRemoveFileConfirmation: null,
+ dictMaxFilesExceeded: "You can not upload any more files.",
accept: function(file, done) {
return done();
},
@@ -494,6 +374,7 @@
info.srcY = (file.height - info.srcHeight) / 2;
return info;
},
+
/*
Those functions register themselves to the events on init and handle all
the user interface specific stuff. Overwriting them won't break the upload
@@ -501,8 +382,7 @@
You can overwrite them if you don't like the default behavior. If you just
want to add an additional event handler, register it on the dropzone object
and don't overwrite those options.
- */
-
+ */
drop: function(e) {
return this.element.classList.remove("dz-drag-hover");
},
@@ -519,53 +399,94 @@
dragleave: function(e) {
return this.element.classList.remove("dz-drag-hover");
},
- selectedfiles: function(files) {
- if (this.element === this.previewsContainer) {
- return this.element.classList.add("dz-started");
- }
- },
+ paste: noop,
reset: function() {
return this.element.classList.remove("dz-started");
},
addedfile: function(file) {
- var _this = this;
- file.previewElement = Dropzone.createElement(this.options.previewTemplate);
+ var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
+ if (this.element === this.previewsContainer) {
+ this.element.classList.add("dz-started");
+ }
+ file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
file.previewTemplate = file.previewElement;
this.previewsContainer.appendChild(file.previewElement);
- file.previewElement.querySelector("[data-dz-name]").textContent = file.name;
- file.previewElement.querySelector("[data-dz-size]").innerHTML = this.filesize(file.size);
+ _ref = file.previewElement.querySelectorAll("[data-dz-name]");
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ node = _ref[_i];
+ node.textContent = file.name;
+ }
+ _ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
+ for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+ node = _ref1[_j];
+ node.innerHTML = this.filesize(file.size);
+ }
if (this.options.addRemoveLinks) {
- file._removeLink = Dropzone.createElement("
" + this.options.dictRemoveFile + "");
- file._removeLink.addEventListener("click", function(e) {
+ file._removeLink = Dropzone.createElement("
" + this.options.dictRemoveFile + "");
+ file.previewElement.appendChild(file._removeLink);
+ }
+ removeFileEvent = (function(_this) {
+ return function(e) {
e.preventDefault();
e.stopPropagation();
if (file.status === Dropzone.UPLOADING) {
- if (window.confirm(_this.options.dictCancelUploadConfirmation)) {
+ return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function() {
+ return _this.removeFile(file);
+ });
+ } else {
+ if (_this.options.dictRemoveFileConfirmation) {
+ return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function() {
+ return _this.removeFile(file);
+ });
+ } else {
return _this.removeFile(file);
}
- } else {
- return _this.removeFile(file);
}
- });
- return file.previewElement.appendChild(file._removeLink);
+ };
+ })(this);
+ _ref2 = file.previewElement.querySelectorAll("[data-dz-remove]");
+ _results = [];
+ for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
+ removeLink = _ref2[_k];
+ _results.push(removeLink.addEventListener("click", removeFileEvent));
}
+ return _results;
},
removedfile: function(file) {
var _ref;
- return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
+ if ((_ref = file.previewElement) != null) {
+ _ref.parentNode.removeChild(file.previewElement);
+ }
+ return this._updateMaxFilesReachedClass();
},
thumbnail: function(file, dataUrl) {
- var thumbnailElement;
+ var thumbnailElement, _i, _len, _ref, _results;
file.previewElement.classList.remove("dz-file-preview");
file.previewElement.classList.add("dz-image-preview");
- thumbnailElement = file.previewElement.querySelector("[data-dz-thumbnail]");
- thumbnailElement.alt = file.name;
- return thumbnailElement.src = dataUrl;
+ _ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]");
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ thumbnailElement = _ref[_i];
+ thumbnailElement.alt = file.name;
+ _results.push(thumbnailElement.src = dataUrl);
+ }
+ return _results;
},
error: function(file, message) {
+ var node, _i, _len, _ref, _results;
file.previewElement.classList.add("dz-error");
- return file.previewElement.querySelector("[data-dz-errormessage]").textContent = message;
+ if (typeof message !== "String" && message.error) {
+ message = message.error;
+ }
+ _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ node = _ref[_i];
+ _results.push(node.textContent = message);
+ }
+ return _results;
},
+ errormultiple: noop,
processing: function(file) {
file.previewElement.classList.add("dz-processing");
if (file._removeLink) {
@@ -574,7 +495,14 @@
},
processingmultiple: noop,
uploadprogress: function(file, progress, bytesSent) {
- return file.previewElement.querySelector("[data-dz-uploadprogress]").style.width = "" + progress + "%";
+ var node, _i, _len, _ref, _results;
+ _ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]");
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ node = _ref[_i];
+ _results.push(node.style.width = "" + progress + "%");
+ }
+ return _results;
},
totaluploadprogress: noop,
sending: noop,
@@ -593,6 +521,8 @@
}
},
completemultiple: noop,
+ maxfilesexceeded: noop,
+ maxfilesreached: noop,
previewTemplate: "
\n
\n
\n
\n
![]()
\n
\n
\n
✔
\n
✘
\n
\n
"
};
@@ -627,11 +557,14 @@
throw new Error("Dropzone already attached.");
}
Dropzone.instances.push(this);
- element.dropzone = this;
+ this.element.dropzone = this;
elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {};
this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {});
+ if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {
+ return this.options.fallback.call(this);
+ }
if (this.options.url == null) {
- this.options.url = this.element.action;
+ this.options.url = this.element.getAttribute("action");
}
if (!this.options.url) {
throw new Error("No URL provided.");
@@ -644,9 +577,6 @@
delete this.options.acceptedMimeTypes;
}
this.options.method = this.options.method.toUpperCase();
- if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {
- return this.options.fallback.call(this);
- }
if ((fallback = this.getExistingFallback()) && fallback.parentNode) {
fallback.parentNode.removeChild(fallback);
}
@@ -718,8 +648,7 @@
};
Dropzone.prototype.init = function() {
- var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1,
- _this = this;
+ var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1;
if (this.element.tagName === "form") {
this.element.setAttribute("enctype", "multipart/form-data");
}
@@ -727,35 +656,40 @@
this.element.appendChild(Dropzone.createElement("
" + this.options.dictDefaultMessage + "
"));
}
if (this.clickableElements.length) {
- setupHiddenFileInput = function() {
- if (_this.hiddenFileInput) {
- document.body.removeChild(_this.hiddenFileInput);
- }
- _this.hiddenFileInput = document.createElement("input");
- _this.hiddenFileInput.setAttribute("type", "file");
- if (_this.options.uploadMultiple) {
- _this.hiddenFileInput.setAttribute("multiple", "multiple");
- }
- if (_this.options.acceptedFiles != null) {
- _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
- }
- _this.hiddenFileInput.style.visibility = "hidden";
- _this.hiddenFileInput.style.position = "absolute";
- _this.hiddenFileInput.style.top = "0";
- _this.hiddenFileInput.style.left = "0";
- _this.hiddenFileInput.style.height = "0";
- _this.hiddenFileInput.style.width = "0";
- document.body.appendChild(_this.hiddenFileInput);
- return _this.hiddenFileInput.addEventListener("change", function() {
- var files;
- files = _this.hiddenFileInput.files;
- if (files.length) {
- _this.emit("selectedfiles", files);
- _this.handleFiles(files);
+ setupHiddenFileInput = (function(_this) {
+ return function() {
+ if (_this.hiddenFileInput) {
+ document.body.removeChild(_this.hiddenFileInput);
}
- return setupHiddenFileInput();
- });
- };
+ _this.hiddenFileInput = document.createElement("input");
+ _this.hiddenFileInput.setAttribute("type", "file");
+ if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) {
+ _this.hiddenFileInput.setAttribute("multiple", "multiple");
+ }
+ _this.hiddenFileInput.className = "dz-hidden-input";
+ if (_this.options.acceptedFiles != null) {
+ _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
+ }
+ _this.hiddenFileInput.style.visibility = "hidden";
+ _this.hiddenFileInput.style.position = "absolute";
+ _this.hiddenFileInput.style.top = "0";
+ _this.hiddenFileInput.style.left = "0";
+ _this.hiddenFileInput.style.height = "0";
+ _this.hiddenFileInput.style.width = "0";
+ document.body.appendChild(_this.hiddenFileInput);
+ return _this.hiddenFileInput.addEventListener("change", function() {
+ var file, files, _i, _len;
+ files = _this.hiddenFileInput.files;
+ if (files.length) {
+ for (_i = 0, _len = files.length; _i < _len; _i++) {
+ file = files[_i];
+ _this.addFile(file);
+ }
+ }
+ return setupHiddenFileInput();
+ });
+ };
+ })(this);
setupHiddenFileInput();
}
this.URL = (_ref = window.URL) != null ? _ref : window.webkitURL;
@@ -764,15 +698,30 @@
eventName = _ref1[_i];
this.on(eventName, this.options[eventName]);
}
- this.on("uploadprogress", function() {
- return _this.updateTotalUploadProgress();
- });
- this.on("removedfile", function() {
- return _this.updateTotalUploadProgress();
- });
- this.on("canceled", function(file) {
- return _this.emit("complete", file);
- });
+ this.on("uploadprogress", (function(_this) {
+ return function() {
+ return _this.updateTotalUploadProgress();
+ };
+ })(this));
+ this.on("removedfile", (function(_this) {
+ return function() {
+ return _this.updateTotalUploadProgress();
+ };
+ })(this));
+ this.on("canceled", (function(_this) {
+ return function(file) {
+ return _this.emit("complete", file);
+ };
+ })(this));
+ this.on("complete", (function(_this) {
+ return function(file) {
+ if (_this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
+ return setTimeout((function() {
+ return _this.emit("queuecomplete");
+ }), 0);
+ }
+ };
+ })(this));
noPropagation = function(e) {
e.stopPropagation();
if (e.preventDefault) {
@@ -785,43 +734,61 @@
{
element: this.element,
events: {
- "dragstart": function(e) {
- return _this.emit("dragstart", e);
- },
- "dragenter": function(e) {
- noPropagation(e);
- return _this.emit("dragenter", e);
- },
- "dragover": function(e) {
- noPropagation(e);
- return _this.emit("dragover", e);
- },
- "dragleave": function(e) {
- return _this.emit("dragleave", e);
- },
- "drop": function(e) {
- noPropagation(e);
- _this.drop(e);
- return _this.emit("drop", e);
- },
- "dragend": function(e) {
- return _this.emit("dragend", e);
- }
+ "dragstart": (function(_this) {
+ return function(e) {
+ return _this.emit("dragstart", e);
+ };
+ })(this),
+ "dragenter": (function(_this) {
+ return function(e) {
+ noPropagation(e);
+ return _this.emit("dragenter", e);
+ };
+ })(this),
+ "dragover": (function(_this) {
+ return function(e) {
+ var efct;
+ try {
+ efct = e.dataTransfer.effectAllowed;
+ } catch (_error) {}
+ e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy';
+ noPropagation(e);
+ return _this.emit("dragover", e);
+ };
+ })(this),
+ "dragleave": (function(_this) {
+ return function(e) {
+ return _this.emit("dragleave", e);
+ };
+ })(this),
+ "drop": (function(_this) {
+ return function(e) {
+ noPropagation(e);
+ return _this.drop(e);
+ };
+ })(this),
+ "dragend": (function(_this) {
+ return function(e) {
+ return _this.emit("dragend", e);
+ };
+ })(this)
}
}
];
- this.clickableElements.forEach(function(clickableElement) {
- return _this.listeners.push({
- element: clickableElement,
- events: {
- "click": function(evt) {
- if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
- return _this.hiddenFileInput.click();
+ this.clickableElements.forEach((function(_this) {
+ return function(clickableElement) {
+ return _this.listeners.push({
+ element: clickableElement,
+ events: {
+ "click": function(evt) {
+ if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
+ return _this.hiddenFileInput.click();
+ }
}
}
- }
- });
- });
+ });
+ };
+ })(this));
this.enable();
return this.options.init.call(this);
};
@@ -834,7 +801,8 @@
this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
this.hiddenFileInput = null;
}
- return delete this.element.dropzone;
+ delete this.element.dropzone;
+ return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
};
Dropzone.prototype.updateTotalUploadProgress = function() {
@@ -865,7 +833,7 @@
if (this.options.dictFallbackText) {
fieldsString += "
" + this.options.dictFallbackText + "
";
}
- fieldsString += "