From fa6d6974ed48691412e77684bf46fa4debb49a2b Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 20 Dec 2015 22:12:57 -0800 Subject: [PATCH] Discard unsupported files Fixes #534 // FREEBIE --- js/views/file_input_view.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/views/file_input_view.js b/js/views/file_input_view.js index dc5e59b8..28340f8f 100644 --- a/js/views/file_input_view.js +++ b/js/views/file_input_view.js @@ -8,6 +8,9 @@ Whisper.FileSizeToast = Whisper.ToastView.extend({ templateName: 'file-size-modal' }); + Whisper.UnsupportedFileTypeToast = Whisper.ToastView.extend({ + template: "Unsupported file type" + }); Whisper.FileInputView = Backbone.View.extend({ tagName: 'span', @@ -115,6 +118,12 @@ this.oUrl = URL.createObjectURL(file); this.addThumb(this.oUrl); break; + default: + var toast = new Whisper.UnsupportedFileTypeToast(); + toast.$el.insertAfter(this.$el); + toast.render(); + this.deleteFiles(); + break; } this.autoScale(file).then(function(blob) {