mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Make html2canvas requireable in nodejs
This commit is contained in:
16
dist/html2canvas.js
vendored
16
dist/html2canvas.js
vendored
@ -1,11 +1,11 @@
|
||||
/*
|
||||
html2canvas 0.5.0-alpha <http://html2canvas.hertzen.com>
|
||||
html2canvas 0.5.0-alpha1 <http://html2canvas.hertzen.com>
|
||||
Copyright (c) 2015 Niklas von Hertzen
|
||||
|
||||
Released under MIT License
|
||||
*/
|
||||
|
||||
(function(window, document, module, exports, global, define, undefined){
|
||||
(function(window, document, exports, global, define, undefined){
|
||||
|
||||
/*!
|
||||
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||||
@ -24,10 +24,14 @@ Object.prototype.toString.call(a)},l=0,w="undefined"!==typeof window?window:{},B
|
||||
function(){this.b=Array(this.length)};k.prototype.k=function(){for(var a=this.length,b=this.c,c=this.m,d=0;void 0===b.a&&d<a;d++)this.j(c[d],d)};k.prototype.j=function(a,b){var c=this.n;"object"===typeof a&&null!==a?a.constructor===c&&void 0!==a.a?(a.f=null,this.g(a.a,b,a.b)):this.q(c.resolve(a),b):(this.d--,this.b[b]=this.h(a))};k.prototype.g=function(a,b,c){var d=this.c;void 0===d.a&&(this.d--,this.i&&2===a?g(d,c):this.b[b]=this.h(c));0===this.d&&m(d,this.b)};k.prototype.h=function(a){return a};
|
||||
k.prototype.q=function(a,b){var c=this;u(a,void 0,function(a){c.g(1,b,a)},function(a){c.g(2,b,a)})};var O=0;h.all=function(a,b){return(new k(this,a,!0,b)).c};h.race=function(a,b){function c(a){q(e,a)}function d(a){g(e,a)}var e=new this(p,b);if(!E(a))return (g(e,new TypeError("You must pass an array to race.")), e);for(var f=a.length,h=0;void 0===e.a&&h<f;h++)u(this.resolve(a[h]),void 0,c,d);return e};h.resolve=function(a,b){if(a&&"object"===typeof a&&a.constructor===this)return a;var c=new this(p,b);
|
||||
q(c,a);return c};h.reject=function(a,b){var c=new this(p,b);g(c,a);return c};h.prototype={constructor:h,then:function(a,b){var c=this.a;if(1===c&&!a||2===c&&!b)return this;var d=new this.constructor(p),e=this.b;if(c){var f=arguments[c-1];r(function(){C(c,d,f,e)})}else u(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}};var z={Promise:h,polyfill:function(){var a;a="undefined"!==typeof global?global:"undefined"!==typeof window&&window.document?window:self;"Promise"in a&&"resolve"in
|
||||
a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;new a.Promise(function(a){b=a});return s(b)}()||(a.Promise=h)}};"function"===typeof define&&define.amd?define(function(){return z}):"undefined"!==typeof module&&module.exports?module.exports=z:"undefined"!==typeof this&&(this.ES6Promise=z);}).call(window);window.ES6Promise.polyfill();
|
||||
a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;new a.Promise(function(a){b=a});return s(b)}()||(a.Promise=h)}};"function"===typeof define&&define.amd?define(function(){return z}):"undefined"!==typeof module&&module.exports?module.exports=z:"undefined"!==typeof this&&(this.ES6Promise=z);}).call(window);
|
||||
if (window) {
|
||||
window.ES6Promise.polyfill();
|
||||
}
|
||||
|
||||
if (typeof(Object.create) !== "function" || typeof(document.createElement("canvas").getContext) !== "function") {
|
||||
window.html2canvas = function() {
|
||||
|
||||
if (typeof(document) === "undefined" || typeof(Object.create) !== "function" || typeof(document.createElement("canvas").getContext) !== "function") {
|
||||
(window || module.exports).html2canvas = function() {
|
||||
return Promise.reject("No canvas support");
|
||||
};
|
||||
return;
|
||||
@ -3368,4 +3372,4 @@ function hasEntries(array) {
|
||||
return array.length > 0;
|
||||
}
|
||||
|
||||
}).call({}, window, document);
|
||||
}).call({}, typeof(window) !== "undefined" ? window : undefined, typeof(document) !== "undefined" ? document : undefined);
|
6
dist/html2canvas.min.js
vendored
6
dist/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/html2canvas.svg.js
vendored
2
dist/html2canvas.svg.js
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
html2canvas 0.5.0-alpha <http://html2canvas.hertzen.com>
|
||||
html2canvas 0.5.0-alpha1 <http://html2canvas.hertzen.com>
|
||||
Copyright (c) 2015 Niklas von Hertzen
|
||||
|
||||
Released under MIT License
|
||||
|
2
dist/html2canvas.svg.min.js
vendored
2
dist/html2canvas.svg.min.js
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
html2canvas 0.5.0-alpha <http://html2canvas.hertzen.com>
|
||||
html2canvas 0.5.0-alpha1 <http://html2canvas.hertzen.com>
|
||||
Copyright (c) 2015 Niklas von Hertzen
|
||||
|
||||
Released under MIT License
|
||||
|
Reference in New Issue
Block a user