From 5503080ca58a56c3e803325457987703bbbe6afe Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 24 Oct 2014 17:18:13 -0500 Subject: [PATCH] forms: Some browsers require windows.FileReader --- js/filedrop.field.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/js/filedrop.field.js b/js/filedrop.field.js index d07a2a675..4eb5d27e9 100644 --- a/js/filedrop.field.js +++ b/js/filedrop.field.js @@ -554,7 +554,7 @@ if (fileIndex === files_count) { return; } - var reader = new FileReader(), + var reader = new window.FileReader(), max_file_size = 1048576 * opts.maxfilesize; reader.index = fileIndex; @@ -807,26 +807,4 @@ function empty() {} - try { - if (XMLHttpRequest.prototype.sendAsBinary) { - return; - } - XMLHttpRequest.prototype.sendAsBinary = function(datastr) { - function byteValue(x) { - return x.charCodeAt(0) & 0xff; - } - var ords = Array.prototype.map.call(datastr, byteValue); - var ui8a = new Uint8Array(ords); - - // Not pretty: Chrome 22 deprecated sending ArrayBuffer, moving instead - // to sending ArrayBufferView. Sadly, no proper way to detect this - // functionality has been discovered. Happily, Chrome 22 also introduced - // the base ArrayBufferView class, not present in Chrome 21. - if ('ArrayBufferView' in window) - this.send(ui8a); - else - this.send(ui8a.buffer); - }; - } catch (e) {} - })(jQuery); -- GitLab