Skip to content

Commit

Permalink
merge jsdom decl
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed Dec 28, 2016
1 parent f8b3607 commit 582cd4d
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions HEADER.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */

var fabric = fabric || { version: "2.0.0b" };
var fabric = fabric || { version: '2.0.0b' };
if (typeof exports !== 'undefined') {
exports.fabric = fabric;
}
Expand All @@ -13,12 +13,14 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
}
else {
// assume we're running under node.js when document/window are not present
fabric.document = require("jsdom")
.jsdom("<!DOCTYPE html><html><head></head><body></body></html>", {
features: {
FetchExternalResources: ['img']
}
});
fabric.document = require('jsdom')
.jsdom(
decodeURIComponent('%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E', {
features: {
FetchExternalResources: ['img']
}
})
);

fabric.window = fabric.document.defaultView;
}
Expand All @@ -27,7 +29,7 @@ else {
* True when in environment that supports touch events
* @type boolean
*/
fabric.isTouchSupported = "ontouchstart" in fabric.document.documentElement;
fabric.isTouchSupported = 'ontouchstart' in fabric.document.documentElement;

/**
* True when in environment that's probably Node.js
Expand All @@ -42,14 +44,14 @@ fabric.isLikelyNode = typeof Buffer !== 'undefined' &&
* @type array
*/
fabric.SHARED_ATTRIBUTES = [
"display",
"transform",
"fill", "fill-opacity", "fill-rule",
"opacity",
"stroke", "stroke-dasharray", "stroke-linecap",
"stroke-linejoin", "stroke-miterlimit",
"stroke-opacity", "stroke-width",
"id"
'display',
'transform',
'fill', 'fill-opacity', 'fill-rule',
'opacity',
'stroke', 'stroke-dasharray', 'stroke-linecap',
'stroke-linejoin', 'stroke-miterlimit',
'stroke-opacity', 'stroke-width',
'id'
];
/* _FROM_SVG_END_ */

Expand Down

0 comments on commit 582cd4d

Please sign in to comment.