3 * Copyright 2011 Dan Vanderkam (danvdk@gmail.com)
4 * MIT-licensed (http://opensource.org/licenses/MIT)
7 // A dygraph "auto-loader".
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', ...)
13 var src
=document
.getElementsByTagName('script');
14 var script
= src
[src
.length
-1].getAttribute("src");
16 // This list needs to be kept in sync w/ the one
in generate
-combined
.sh
17 // and the one in jsTestDriver.conf.
19 "polyfills/console.js",
27 "dygraph-interaction-model.js",
29 "dygraph-plugin-base.js",
30 "plugins/annotations.js",
32 "plugins/chart-labels.js",
35 "plugins/range-selector.js",
36 "dygraph-plugin-install.js",
37 "dygraph-options-reference.js", // Shouldn't be included in generate-combined.sh
38 "datahandler/datahandler.js",
39 "datahandler/default.js",
40 "datahandler/default-fractions.js",
41 "datahandler/bars.js",
42 "datahandler/bars-error.js",
43 "datahandler/bars-custom.js",
44 "datahandler/bars-fractions.js"
47 for (var i
= 0; i
< source_files
.length
; i
++) {
48 document
.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n');