Discard unsupported files

Fixes #534

// FREEBIE
This commit is contained in:
lilia 2015-12-20 22:12:57 -08:00
parent 41357b4a24
commit fa6d6974ed

View file

@ -8,6 +8,9 @@
Whisper.FileSizeToast = Whisper.ToastView.extend({ Whisper.FileSizeToast = Whisper.ToastView.extend({
templateName: 'file-size-modal' templateName: 'file-size-modal'
}); });
Whisper.UnsupportedFileTypeToast = Whisper.ToastView.extend({
template: "Unsupported file type"
});
Whisper.FileInputView = Backbone.View.extend({ Whisper.FileInputView = Backbone.View.extend({
tagName: 'span', tagName: 'span',
@ -115,6 +118,12 @@
this.oUrl = URL.createObjectURL(file); this.oUrl = URL.createObjectURL(file);
this.addThumb(this.oUrl); this.addThumb(this.oUrl);
break; break;
default:
var toast = new Whisper.UnsupportedFileTypeToast();
toast.$el.insertAfter(this.$el);
toast.render();
this.deleteFiles();
break;
} }
this.autoScale(file).then(function(blob) { this.autoScale(file).then(function(blob) {