d3/index.js

16 строки
755 B
JavaScript
Исходник Обычный вид История

2013-06-27 20:46:35 +04:00
var fs = require("fs"),
2013-06-30 04:47:17 +04:00
path = require("path"),
2013-06-27 20:46:35 +04:00
document = require("jsdom").jsdom("<html><head></head><body></body></html>"),
window = document.createWindow();
// https://github.com/chad3814/CSSStyleDeclaration/issues/3
var CSSStyleDeclaration_prototype = window.CSSStyleDeclaration.prototype,
CSSStyleDeclaration_setProperty = CSSStyleDeclaration_prototype.setProperty;
CSSStyleDeclaration_prototype.setProperty = function(name, value, priority) {
return CSSStyleDeclaration_setProperty.call(this, name + "", value == null ? null : value + "", priority == null ? null : priority + "");
};
module.exports = (new Function("window", "document",
2013-06-30 04:47:17 +04:00
"return " + fs.readFileSync(path.join(__dirname, "d3.js"), "utf-8"))
2013-06-27 20:46:35 +04:00
)(window, document);