1 // A dygraph "auto-loader".
3 // Check where this script was sourced from. If it was sourced from
4 // '../dygraph-dev
.js
', then we should source all the other scripts with the
5 // same relative path ('../dygraph.js', '../dygraph-canvas.js', ...)
7 var src
=document
.getElementsByTagName('script');
8 var script
= src
[src
.length
-1].getAttribute("src");
10 // This list needs to be kept in sync w/ the one
in generate
-combined
.sh
11 // and the one in jsTestDriver.conf.
13 "strftime/strftime-min.js",
14 "rgbcolor/rgbcolor.js",
20 "dygraph-interaction-model.js",
21 "dygraph-options-reference.js" // Shouldn't be included in generate-combined.sh
24 for (var i
= 0; i
< source_files
.length
; i
++) {
25 document
.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n');