html2canvas
Advanced tools
Comparing version 1.0.0-alpha.9 to 1.0.0-alpha.10
### Changelog ### | ||
#### v1.0.0-alpha.10 - 15.2.2018 #### | ||
* Re-introduce `onclone` option (Fix #1434) | ||
* Add `ignoreElements` predicate function option | ||
* Fix version console logging | ||
#### v1.0.0-alpha.9 - 7.1.2018 #### | ||
@@ -4,0 +9,0 @@ * Fix dynamic style sheets |
@@ -244,5 +244,7 @@ 'use strict'; | ||
for (var child = node.firstChild; child; child = child.nextSibling) { | ||
if (child.nodeType !== Node.ELEMENT_NODE || | ||
if (child.nodeType !== Node.ELEMENT_NODE || child.nodeName !== 'SCRIPT' && | ||
// $FlowFixMe | ||
child.nodeName !== 'SCRIPT' && !child.hasAttribute(IGNORE_ATTRIBUTE)) { | ||
!child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== 'function' || | ||
// $FlowFixMe | ||
!this.options.ignoreElements(child))) { | ||
if (!this.copyStyles || child.nodeName !== 'STYLE') { | ||
@@ -526,3 +528,12 @@ clone.appendChild(this.cloneNode(child)); | ||
} | ||
return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]) : Promise.reject(process.env.NODE_ENV !== 'production' ? 'Error finding the ' + referenceElement.nodeName + ' in the cloned document' : ''); | ||
var result = Promise.resolve([cloneIframeContainer, cloner.clonedReferenceElement, cloner.resourceLoader]); | ||
var onclone = options.onclone; | ||
return cloner.clonedReferenceElement instanceof cloneWindow.HTMLElement || cloner.clonedReferenceElement instanceof ownerDocument.defaultView.HTMLElement || cloner.clonedReferenceElement instanceof HTMLElement ? typeof onclone === 'function' ? Promise.resolve().then(function () { | ||
return onclone(documentClone); | ||
}).then(function () { | ||
return result; | ||
}) : result : Promise.reject(process.env.NODE_ENV !== 'production' ? 'Error finding the ' + referenceElement.nodeName + ' in the cloned document' : ''); | ||
}); | ||
@@ -529,0 +540,0 @@ |
@@ -5,4 +5,2 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var _CanvasRenderer = require('./renderer/CanvasRenderer'); | ||
@@ -23,10 +21,5 @@ | ||
var html2canvas = function html2canvas(element, conf) { | ||
// eslint-disable-next-line no-console | ||
if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && typeof console.log === 'function') { | ||
// eslint-disable-next-line no-console | ||
console.log('html2canvas ' + "$npm_package_version"); | ||
} | ||
var config = conf || {}; | ||
var logger = new _Logger2.default(typeof config.logging === 'boolean' ? config.logging : true); | ||
logger.log('html2canvas ' + "$npm_package_version"); | ||
@@ -33,0 +26,0 @@ if (process.env.NODE_ENV !== 'production' && typeof config.onrendered === 'function') { |
@@ -15,3 +15,3 @@ 'use strict'; | ||
this.enabled = enabled; | ||
this.enabled = typeof window !== 'undefined' && enabled; | ||
this.start = start ? start : Date.now(); | ||
@@ -18,0 +18,0 @@ this.id = id; |
@@ -201,3 +201,3 @@ 'use strict'; | ||
_this4.rectangle(text.bounds.left, Math.round(text.bounds.top + text.bounds.height - baseline), text.bounds.width, 1, textDecorationColor); | ||
_this4.rectangle(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1, textDecorationColor); | ||
break; | ||
@@ -204,0 +204,0 @@ case _textDecoration.TEXT_DECORATION_LINE.OVERLINE: |
@@ -6,3 +6,3 @@ { | ||
"main": "dist/npm/index.js", | ||
"version": "1.0.0-alpha.9", | ||
"version": "1.0.0-alpha.10", | ||
"author": { | ||
@@ -69,3 +69,3 @@ "name": "Niklas von Hertzen", | ||
"build:browser": "webpack", | ||
"format": "prettier --single-quote --no-bracket-spacing --tab-width 4 --print-width 100 --write \"{src,www,tests,scripts}/**/*.js\"", | ||
"format": "prettier --single-quote --no-bracket-spacing --tab-width 4 --print-width 100 --write \"{src,www/src,tests,scripts}/**/*.js\"", | ||
"flow": "flow", | ||
@@ -72,0 +72,0 @@ "lint": "eslint src/**", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
20870
1080681