diff options
author | XhmikosR <xhmikosr@users.sourceforge.net> | 2014-07-25 09:40:05 +0400 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2014-10-09 09:16:31 +0400 |
commit | 7ded2d185d9c6354b29e44fa0fce0591139e55d5 (patch) | |
tree | db1306ef860ccd5a1fadeabd6203e9b7fb66f718 /docs/assets | |
parent | 07f1d89dd2bb893f7753797bf3b37f2d6cb33feb (diff) |
Update Blob.js to v2014-07-24.
Diffstat (limited to 'docs/assets')
-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 c740cd81f9..3b44c651f8 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 |