Files
WebODF/programs/benchmark/webodf.js
T
Friedrich W. H. Kossebau 7f20c22627 Set runtime.currentDirectory/libraryPaths in faked webodf.js for out-of-source runs
Frees "production" code from adjustments for out-of-source developer code
2014-02-17 17:19:46 +01:00

20 lines
467 B
JavaScript

var xhr = new XMLHttpRequest(),
path = "../../webodf/lib",
runtimeFilePath = path + "/runtime.js",
code;
xhr.open("GET", runtimeFilePath, false);
xhr.send(null);
code = xhr.responseText;
code += "\n//# sourceURL=" + runtimeFilePath;
code += "\n//@ sourceURL=" + runtimeFilePath; // Chrome
eval(code);
// adapt for out-of-sources run
runtime.currentDirectory = function () {
return path;
};
runtime.libraryPaths = function () {
return [path];
};