mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-11 09:50:59 +00:00
31 lines
No EOL
936 B
JavaScript
31 lines
No EOL
936 B
JavaScript
/*! Fabric.js Copyright 2008-2012, Printio (Juriy Zaytsev, Maxim Chernyak) */
|
|
|
|
var fabric = fabric || { version: "0.9.20" };
|
|
|
|
if (typeof exports != 'undefined') {
|
|
exports.fabric = fabric;
|
|
}
|
|
|
|
if (typeof document != 'undefined' && typeof window != 'undefined') {
|
|
fabric.document = document;
|
|
fabric.window = window;
|
|
}
|
|
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>");
|
|
fabric.window = fabric.document.createWindow();
|
|
}
|
|
|
|
/**
|
|
* True when in environment that supports touch events
|
|
* @property isTouchSupported
|
|
* @type boolean
|
|
*/
|
|
fabric.isTouchSupported = "ontouchstart" in fabric.document.documentElement;
|
|
|
|
/**
|
|
* True when in environment that's probably Node.js
|
|
* @property isLikelyNode
|
|
* @type boolean
|
|
*/
|
|
fabric.isLikelyNode = typeof Buffer !== 'undefined' && typeof window === 'undefined'; |