Commit | Line | Data |
---|---|---|
88e95c46 DV |
1 | /** |
2 | * @license | |
3 | * Copyright 2011 Dan Vanderkam (danvdk@gmail.com) | |
4 | * MIT-licensed (http://opensource.org/licenses/MIT) | |
5 | */ | |
5108eb20 | 6 | |
74a5af31 DV |
7 | // A dygraph "auto-loader". |
8 | ||
9 | // Check where this script was sourced from. If it was sourced from | |
10 | // '../dygraph-dev.js', then we should source all the other scripts with the | |
11 | // same relative path ('../dygraph.js', '../dygraph-canvas.js', ...) | |
12 | (function() { | |
13 | var src=document.getElementsByTagName('script'); | |
14 | var script = src[src.length-1].getAttribute("src"); | |
74a5af31 | 15 | |
3609c9aa DV |
16 | // This list needs to be kept in sync w/ the one in generate-combined.sh |
17 | // and the one in jsTestDriver.conf. | |
18 | var source_files = [ | |
19 | "strftime/strftime-min.js", | |
20 | "rgbcolor/rgbcolor.js", | |
00639fab | 21 | "stacktrace.js", |
fb63bf1b | 22 | "dashed-canvas.js", |
3609c9aa DV |
23 | "dygraph-layout.js", |
24 | "dygraph-canvas.js", | |
25 | "dygraph.js", | |
26 | "dygraph-utils.js", | |
27 | "dygraph-gviz.js", | |
28 | "dygraph-interaction-model.js", | |
ccd9d7c2 PF |
29 | "dygraph-range-selector.js", |
30 | "dygraph-tickers.js", | |
e2c21500 | 31 | "plugins/base.js", |
cbe41be1 | 32 | "plugins/annotations.js", |
f8540c66 | 33 | "plugins/axes.js", |
6dca682f | 34 | "plugins/chart-labels.js", |
cbe41be1 DV |
35 | "plugins/grid.js", |
36 | "plugins/legend.js", | |
e2c21500 | 37 | "plugins/install.js", |
ccd9d7c2 | 38 | "dygraph-options-reference.js" // Shouldn't be included in generate-combined.sh |
3609c9aa | 39 | ]; |
74a5af31 | 40 | |
3609c9aa DV |
41 | for (var i = 0; i < source_files.length; i++) { |
42 | document.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n'); | |
74a5af31 DV |
43 | } |
44 | })(); |