Commit 7ded2d18 authored by XhmikosR's avatar XhmikosR Committed by XhmikosR

Update Blob.js to v2014-07-24.

parent 07f1d89d
...@@ -128,7 +128,7 @@ module.exports = function (grunt) { ...@@ -128,7 +128,7 @@ module.exports = function (grunt) {
'docs/assets/js/vendor/less.min.js', 'docs/assets/js/vendor/less.min.js',
'docs/assets/js/vendor/jszip.min.js', 'docs/assets/js/vendor/jszip.min.js',
'docs/assets/js/vendor/uglify.min.js', 'docs/assets/js/vendor/uglify.min.js',
'docs/assets/js/vendor/blob.js', 'docs/assets/js/vendor/Blob.js',
'docs/assets/js/vendor/filesaver.js', 'docs/assets/js/vendor/filesaver.js',
'docs/assets/js/raw-files.min.js', 'docs/assets/js/raw-files.min.js',
'docs/assets/js/src/customizer.js' 'docs/assets/js/src/customizer.js'
......
/* Blob.js /* Blob.js
* A Blob implementation. * A Blob implementation.
* 2014-07-01 * 2014-07-24
* *
* By Eli Grey, http://eligrey.com * By Eli Grey, http://eligrey.com
* By Devin Samarin, https://github.com/eboyjr * By Devin Samarin, https://github.com/dsamarin
* License: X11/MIT * License: X11/MIT
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md * See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
*/ */
...@@ -62,13 +62,31 @@ ...@@ -62,13 +62,31 @@
, ArrayBuffer = view.ArrayBuffer , ArrayBuffer = view.ArrayBuffer
, Uint8Array = view.Uint8Array , Uint8Array = view.Uint8Array
, origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
; ;
FakeBlob.fake = FB_proto.fake = true; FakeBlob.fake = FB_proto.fake = true;
while (file_ex_code--) { while (file_ex_code--) {
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1; FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
} }
// Polyfill URL
if (!real_URL.createObjectURL) { 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) { URL.createObjectURL = function(blob) {
var var
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment