|
1 | 1 | /*
|
2 |
| - html2canvas 0.5.0-beta2 <http://html2canvas.hertzen.com> |
3 |
| - Copyright (c) 2015 Niklas von Hertzen |
| 2 | + html2canvas 0.5.0-beta3 <http://html2canvas.hertzen.com> |
| 3 | + Copyright (c) 2016 Niklas von Hertzen |
4 | 4 |
|
5 | 5 | Released under License
|
6 | 6 | */
|
7 | 7 |
|
8 |
| -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html2canvas = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
| 8 | +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.html2canvas=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
9 | 9 | (function (global){
|
10 |
| -/*! https://mths.be/punycode v1.3.2 by @mathias */ |
| 10 | +/*! http://mths.be/punycode v1.2.4 by @mathias */ |
11 | 11 | ;(function(root) {
|
12 | 12 |
|
13 | 13 | /** Detect free variables */
|
14 |
| - var freeExports = typeof exports == 'object' && exports && |
15 |
| - !exports.nodeType && exports; |
| 14 | + var freeExports = typeof exports == 'object' && exports; |
16 | 15 | var freeModule = typeof module == 'object' && module &&
|
17 |
| - !module.nodeType && module; |
| 16 | + module.exports == freeExports && module; |
18 | 17 | var freeGlobal = typeof global == 'object' && global;
|
19 |
| - if ( |
20 |
| - freeGlobal.global === freeGlobal || |
21 |
| - freeGlobal.window === freeGlobal || |
22 |
| - freeGlobal.self === freeGlobal |
23 |
| - ) { |
| 18 | + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { |
24 | 19 | root = freeGlobal;
|
25 | 20 | }
|
26 | 21 |
|
|
46 | 41 |
|
47 | 42 | /** Regular expressions */
|
48 | 43 | regexPunycode = /^xn--/,
|
49 |
| - regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars |
50 |
| - regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators |
| 44 | + regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars |
| 45 | + regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators |
51 | 46 |
|
52 | 47 | /** Error messages */
|
53 | 48 | errors = {
|
|
86 | 81 | */
|
87 | 82 | function map(array, fn) {
|
88 | 83 | var length = array.length;
|
89 |
| - var result = []; |
90 | 84 | while (length--) {
|
91 |
| - result[length] = fn(array[length]); |
| 85 | + array[length] = fn(array[length]); |
92 | 86 | }
|
93 |
| - return result; |
| 87 | + return array; |
94 | 88 | }
|
95 | 89 |
|
96 | 90 | /**
|
97 |
| - * A simple `Array#map`-like wrapper to work with domain name strings or email |
98 |
| - * addresses. |
| 91 | + * A simple `Array#map`-like wrapper to work with domain name strings. |
99 | 92 | * @private
|
100 |
| - * @param {String} domain The domain name or email address. |
| 93 | + * @param {String} domain The domain name. |
101 | 94 | * @param {Function} callback The function that gets called for every
|
102 | 95 | * character.
|
103 | 96 | * @returns {Array} A new string of characters returned by the callback
|
104 | 97 | * function.
|
105 | 98 | */
|
106 | 99 | function mapDomain(string, fn) {
|
107 |
| - var parts = string.split('@'); |
108 |
| - var result = ''; |
109 |
| - if (parts.length > 1) { |
110 |
| - // In email addresses, only the domain name should be punycoded. Leave |
111 |
| - // the local part (i.e. everything up to `@`) intact. |
112 |
| - result = parts[0] + '@'; |
113 |
| - string = parts[1]; |
114 |
| - } |
115 |
| - // Avoid `split(regex)` for IE8 compatibility. See #17. |
116 |
| - string = string.replace(regexSeparators, '\x2E'); |
117 |
| - var labels = string.split('.'); |
118 |
| - var encoded = map(labels, fn).join('.'); |
119 |
| - return result + encoded; |
| 100 | + return map(string.split(regexSeparators), fn).join('.'); |
120 | 101 | }
|
121 | 102 |
|
122 | 103 | /**
|
|
126 | 107 | * UCS-2 exposes as separate characters) into a single code point,
|
127 | 108 | * matching UTF-16.
|
128 | 109 | * @see `punycode.ucs2.encode`
|
129 |
| - * @see <https://mathiasbynens.be/notes/javascript-encoding> |
| 110 | + * @see <http://mathiasbynens.be/notes/javascript-encoding> |
130 | 111 | * @memberOf punycode.ucs2
|
131 | 112 | * @name decode
|
132 | 113 | * @param {String} string The Unicode input string (UCS-2).
|
|
335 | 316 | }
|
336 | 317 |
|
337 | 318 | /**
|
338 |
| - * Converts a string of Unicode symbols (e.g. a domain name label) to a |
339 |
| - * Punycode string of ASCII-only symbols. |
| 319 | + * Converts a string of Unicode symbols to a Punycode string of ASCII-only |
| 320 | + * symbols. |
340 | 321 | * @memberOf punycode
|
341 | 322 | * @param {String} input The string of Unicode symbols.
|
342 | 323 | * @returns {String} The resulting Punycode string of ASCII-only symbols.
|
|
449 | 430 | }
|
450 | 431 |
|
451 | 432 | /**
|
452 |
| - * Converts a Punycode string representing a domain name or an email address |
453 |
| - * to Unicode. Only the Punycoded parts of the input will be converted, i.e. |
454 |
| - * it doesn't matter if you call it on a string that has already been |
455 |
| - * converted to Unicode. |
| 433 | + * Converts a Punycode string representing a domain name to Unicode. Only the |
| 434 | + * Punycoded parts of the domain name will be converted, i.e. it doesn't |
| 435 | + * matter if you call it on a string that has already been converted to |
| 436 | + * Unicode. |
456 | 437 | * @memberOf punycode
|
457 |
| - * @param {String} input The Punycoded domain name or email address to |
458 |
| - * convert to Unicode. |
| 438 | + * @param {String} domain The Punycode domain name to convert to Unicode. |
459 | 439 | * @returns {String} The Unicode representation of the given Punycode
|
460 | 440 | * string.
|
461 | 441 | */
|
462 |
| - function toUnicode(input) { |
463 |
| - return mapDomain(input, function(string) { |
| 442 | + function toUnicode(domain) { |
| 443 | + return mapDomain(domain, function(string) { |
464 | 444 | return regexPunycode.test(string)
|
465 | 445 | ? decode(string.slice(4).toLowerCase())
|
466 | 446 | : string;
|
467 | 447 | });
|
468 | 448 | }
|
469 | 449 |
|
470 | 450 | /**
|
471 |
| - * Converts a Unicode string representing a domain name or an email address to |
472 |
| - * Punycode. Only the non-ASCII parts of the domain name will be converted, |
473 |
| - * i.e. it doesn't matter if you call it with a domain that's already in |
474 |
| - * ASCII. |
| 451 | + * Converts a Unicode string representing a domain name to Punycode. Only the |
| 452 | + * non-ASCII parts of the domain name will be converted, i.e. it doesn't |
| 453 | + * matter if you call it with a domain that's already in ASCII. |
475 | 454 | * @memberOf punycode
|
476 |
| - * @param {String} input The domain name or email address to convert, as a |
477 |
| - * Unicode string. |
478 |
| - * @returns {String} The Punycode representation of the given domain name or |
479 |
| - * email address. |
| 455 | + * @param {String} domain The domain name to convert, as a Unicode string. |
| 456 | + * @returns {String} The Punycode representation of the given domain name. |
480 | 457 | */
|
481 |
| - function toASCII(input) { |
482 |
| - return mapDomain(input, function(string) { |
| 458 | + function toASCII(domain) { |
| 459 | + return mapDomain(domain, function(string) { |
483 | 460 | return regexNonASCII.test(string)
|
484 | 461 | ? 'xn--' + encode(string)
|
485 | 462 | : string;
|
|
495 | 472 | * @memberOf punycode
|
496 | 473 | * @type String
|
497 | 474 | */
|
498 |
| - 'version': '1.3.2', |
| 475 | + 'version': '1.2.4', |
499 | 476 | /**
|
500 | 477 | * An object of methods to convert from JavaScript's internal character
|
501 | 478 | * representation (UCS-2) to Unicode code points, and back.
|
502 |
| - * @see <https://mathiasbynens.be/notes/javascript-encoding> |
| 479 | + * @see <http://mathiasbynens.be/notes/javascript-encoding> |
503 | 480 | * @memberOf punycode
|
504 | 481 | * @type Object
|
505 | 482 | */
|
|
524 | 501 | define('punycode', function() {
|
525 | 502 | return punycode;
|
526 | 503 | });
|
527 |
| - } else if (freeExports && freeModule) { |
528 |
| - if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ |
| 504 | + } else if (freeExports && !freeExports.nodeType) { |
| 505 | + if (freeModule) { // in Node.js or RingoJS v0.8.0+ |
529 | 506 | freeModule.exports = punycode;
|
530 | 507 | } else { // in Narwhal or RingoJS v0.7.0-
|
531 | 508 | for (key in punycode) {
|
@@ -938,8 +915,8 @@ function html2canvas(nodeList, options) {
|
938 | 915 | var index = html2canvasCloneIndex++;
|
939 | 916 | options = options || {};
|
940 | 917 | if (options.logging) {
|
941 |
| - window.html2canvas.logging = true; |
942 |
| - window.html2canvas.start = Date.now(); |
| 918 | + log.options.logging = true; |
| 919 | + log.options.start = Date.now(); |
943 | 920 | }
|
944 | 921 |
|
945 | 922 | options.async = typeof(options.async) === "undefined" ? true : options.async;
|
@@ -1509,12 +1486,15 @@ LinearGradientContainer.REGEXP_DIRECTION = /^\s*(?:to|left|right|top|bottom|cent
|
1509 | 1486 | module.exports = LinearGradientContainer;
|
1510 | 1487 |
|
1511 | 1488 | },{"./color":3,"./gradientcontainer":9}],13:[function(require,module,exports){
|
1512 |
| -module.exports = function() { |
1513 |
| - if (window.html2canvas.logging && window.console && window.console.log) { |
1514 |
| - Function.prototype.bind.call(window.console.log, (window.console)).apply(window.console, [(Date.now() - window.html2canvas.start) + "ms", "html2canvas:"].concat([].slice.call(arguments, 0))); |
| 1489 | +var logger = function() { |
| 1490 | + if (logger.options.logging && window.console && window.console.log) { |
| 1491 | + Function.prototype.bind.call(window.console.log, (window.console)).apply(window.console, [(Date.now() - logger.options.start) + "ms", "html2canvas:"].concat([].slice.call(arguments, 0))); |
1515 | 1492 | }
|
1516 | 1493 | };
|
1517 | 1494 |
|
| 1495 | +logger.options = {logging: false}; |
| 1496 | +module.exports = logger; |
| 1497 | + |
1518 | 1498 | },{}],14:[function(require,module,exports){
|
1519 | 1499 | var Color = require('./color');
|
1520 | 1500 | var utils = require('./utils');
|
|
0 commit comments