", {"class": "success"});
this.errorDiv = $("
", {"class": "error"});
@@ -214,13 +314,65 @@ DllPatcher.prototype.createUI = function() {
saveButton.on('click', this.saveDll.bind(this));
this.saveButton = saveButton;
- container.append(this.fileInput);
- container.append(label);
- container.append(this.successDiv);
- container.append(this.errorDiv);
- container.append(this.patchDiv);
- container.append(saveButton);
- $('body').append(container);
+ if (!this.multiPatcher) {
+ $('html').on('dragover dragenter', function() {
+ self.container.addClass('dragover');
+ return true;
+ })
+ .on('dragleave dragend drop', function() {
+ self.container.removeClass('dragover');
+ return true;
+ })
+ .on('dragover dragenter dragleave dragend drop', function(e) {
+ e.preventDefault();
+ });
+
+ this.container.on('drop', function(e) {
+ var files = e.originalEvent.dataTransfer.files;
+ if(files && files.length > 0)
+ self.loadFile(files[0]);
+ })
+
+ this.fileInput = $("",
+ {"class": "fileInput",
+ "id" : this.filename + '-file',
+ "type" : 'file'});
+ var label = $("