fabric.js/HEADER.js

31 lines
938 B
JavaScript
Raw Normal View History

2013-01-25 13:31:31 +00:00
/*! Fabric.js Copyright 2008-2013, Printio (Juriy Zaytsev, Maxim Chernyak) */
2013-02-03 16:01:39 +00:00
var fabric = fabric || { version: "1.0.5" };
2011-08-05 23:00:26 +00:00
2012-11-13 17:06:53 +00:00
if (typeof exports !== 'undefined') {
2011-08-05 23:00:26 +00:00
exports.fabric = fabric;
2011-08-11 19:18:18 +00:00
}
2012-11-13 17:06:53 +00:00
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
2011-08-11 19:18:18 +00:00
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();
2011-09-21 23:29:00 +00:00
}
/**
* 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';