From 7ded2d185d9c6354b29e44fa0fce0591139e55d5 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 25 Jul 2014 08:40:05 +0300 Subject: [PATCH] Update Blob.js to v2014-07-24. --- Gruntfile.js | 2 +- docs/assets/js/vendor/{blob.js => Blob.js} | 28 ++++++++++++++++++---- 2 files changed, 24 insertions(+), 6 deletions(-) rename docs/assets/js/vendor/{blob.js => Blob.js} (89%) diff --git a/Gruntfile.js b/Gruntfile.js index 4b968f9db2..08da04ce56 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -128,7 +128,7 @@ module.exports = function (grunt) { 'docs/assets/js/vendor/less.min.js', 'docs/assets/js/vendor/jszip.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/raw-files.min.js', 'docs/assets/js/src/customizer.js' diff --git a/docs/assets/js/vendor/blob.js b/docs/assets/js/vendor/Blob.js similarity index 89% rename from docs/assets/js/vendor/blob.js rename to 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