Comparing version 1.4.3 to 1.4.4
@@ -1,2 +0,2 @@ | ||
//download.js v4.1, by dandavis; 2008-2015. [CCBY2] see http://danml.com/download.html for tests/usage | ||
(function(q,k){"function"==typeof define&&define.amd?define([],k):"object"==typeof exports?module.exports=k():q.download=k()})(this,function(){return function k(b,c,e){function r(n){var a=n.split(/[:;,]/);n=a[1];var a=("base64"==a[2]?atob:decodeURIComponent)(a.pop()),b=a.length,d=0,c=new Uint8Array(b);for(d;d<b;++d)c[d]=a.charCodeAt(d);return new g([c],{type:n})}function l(a,b){if("download"in d)return d.href=a,d.setAttribute("download",m),d.className="download-js-link",d.innerHTML="downloading...",h.body.appendChild(d),setTimeout(function(){d.click(),h.body.removeChild(d),!0===b&&setTimeout(function(){f.URL.revokeObjectURL(d.href)},250)},66),!0;if("undefined"!=typeof safari)return a="data:"+a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream"),!window.open(a)&&confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=a),!0;var c=h.createElement("iframe");h.body.appendChild(c),b||(a="data:"+a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream")),c.src=a,setTimeout(function(){h.body.removeChild(c)},333)}var f=window,a=e||"application/octet-stream";e=!c&&!e&&b;var h=document,d=h.createElement("a"),p=function(a){return String(a)},g=f.Blob||f.MozBlob||f.WebKitBlob||p,m=c||"download",g=g.call?g.bind(f):Blob;"true"===String(this)&&(b=[b,a],a=b[0],b=b[1]);if(e&&2048>e.length&&(m=e.split("/").pop().split("?")[0],d.href=e,-1!==d.href.indexOf(e)))return a=new XMLHttpRequest,a.open("GET",e,!0),a.responseType="blob",a.onload=function(a){k(a.target.response,m,"application/octet-stream")},a.send(),a;if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(b))return navigator.msSaveBlob?navigator.msSaveBlob(r(b),m):l(b);c=b instanceof g?b:new g([b],{type:a});if(navigator.msSaveBlob)return navigator.msSaveBlob(c,m);if(f.URL)l(f.URL.createObjectURL(c),!0);else{if("string"==typeof c||c.constructor===p)try{return l("data:"+a+";base64,"+f.btoa(c))}catch(n){return l("data:"+a+","+encodeURIComponent(c))}a=new FileReader,a.onload=function(a){l(this.result)},a.readAsDataURL(c)}return!0}}); | ||
//download.js v4.2, by dandavis; 2008-2016. [CCBY2] see http://danml.com/download.html for tests/usage | ||
(function(r,k){"function"==typeof define&&define.amd?define([],k):"object"==typeof exports?module.exports=k():r.download=k()})(this,function(){return function k(a,b,g){function q(p){var a=p.split(/[:;,]/);p=a[1];var a=("base64"==a[2]?atob:decodeURIComponent)(a.pop()),d=a.length,b=0,c=new Uint8Array(d);for(b;b<d;++b)c[b]=a.charCodeAt(b);return new f([c],{type:p})}function l(a,b){if("download"in d)return d.href=a,d.setAttribute("download",m),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout(function(){d.click(),document.body.removeChild(d),!0===b&&setTimeout(function(){e.URL.revokeObjectURL(d.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return a=a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream"),!window.open(a)&&confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=a),!0;var c=document.createElement("iframe");document.body.appendChild(c),b||(a="data:"+a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream")),c.src=a,setTimeout(function(){document.body.removeChild(c)},333)}var e=window,c=g||"application/octet-stream",h=!b&&!g&&a,d=document.createElement("a");g=function(a){return String(a)};var f=e.Blob||e.MozBlob||e.WebKitBlob||g,m=b||"download",f=f.call?f.bind(e):Blob;"true"===String(this)&&(a=[a,c],c=a[0],a=a[1]);if(h&&2048>h.length&&(m=h.split("/").pop().split("?")[0],d.href=h,-1!==d.href.indexOf(h))){var n=new XMLHttpRequest;return n.open("GET",h,!0),n.responseType="blob",n.onload=function(a){k(a.target.response,m,"application/octet-stream")},setTimeout(function(){n.send()},0),n}if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(a)){if(!(2096103.424<a.length&&f!==g))return navigator.msSaveBlob?navigator.msSaveBlob(q(a),m):l(a);a=q(a),c=a.type||"application/octet-stream"}b=a instanceof f?a:new f([a],{type:c});if(navigator.msSaveBlob)return navigator.msSaveBlob(b,m);if(e.URL)l(e.URL.createObjectURL(b),!0);else{if("string"==typeof b||b.constructor===g)try{return l("data:"+c+";base64,"+e.btoa(b))}catch(p){return l("data:"+c+","+encodeURIComponent(b))}c=new FileReader,c.onload=function(a){l(this.result)},c.readAsDataURL(b)}return!0}}); |
{ | ||
"name": "downloadjs", | ||
"main": "download.js", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"description": "file downloading using client-side javascript", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25781
145