aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/assets/js/vendor/Blob.js (renamed from docs/assets/js/vendor/blob.js)28
1 files changed, 23 insertions, 5 deletions
diff --git a/docs/assets/js/vendor/blob.js b/docs/assets/js/vendor/Blob.js
index c740cd81f..3b44c651f 100644
--- a/docs/assets/js/vendor/blob.js
+++ b/docs/assets/js/vendor/Blob.js
@@ -1,9 +1,9 @@
/* Blob.js
* A Blob implementation.
- * 2014-07-01
- *
+ * 2014-07-24
+ *
* By Eli Grey, http://eligrey.com
- * By Devin Samarin, https://github.com/eboyjr
+ * By Devin Samarin, https://github.com/dsamarin
* License: X11/MIT
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
*/
@@ -59,16 +59,34 @@
, URL = real_URL
, btoa = view.btoa
, atob = view.atob
-
+
, ArrayBuffer = view.ArrayBuffer
, Uint8Array = view.Uint8Array
+
+ , origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
;
FakeBlob.fake = FB_proto.fake = true;
while (file_ex_code--) {
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
}
+ // Polyfill URL
if (!real_URL.createObjectURL) {
- URL = view.URL = {};
+ URL = view.URL = function(uri) {
+ var
+ uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
+ , uri_origin
+ ;
+ uri_info.href = uri;
+ if (!("origin" in uri_info)) {
+ if (uri_info.protocol.toLowerCase() === "data:") {
+ uri_info.origin = null;
+ } else {
+ uri_origin = uri.match(origin);
+ uri_info.origin = uri_origin && uri_origin[1];
+ }
+ }
+ return uri_info;
+ };
}
URL.createObjectURL = function(blob) {
var