| 1 | /** |
| 2 | * @license |
| 3 | * Copyright 2011 Dan Vanderkam (danvdk@gmail.com) |
| 4 | * MIT-licensed (http://opensource.org/licenses/MIT) |
| 5 | */ |
| 6 | |
| 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"); |
| 15 | |
| 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", |
| 21 | "stacktrace.js", |
| 22 | "dashed-canvas.js", |
| 23 | "dygraph-options.js", |
| 24 | "dygraph-layout.js", |
| 25 | "dygraph-canvas.js", |
| 26 | "dygraph.js", |
| 27 | "dygraph-utils.js", |
| 28 | "dygraph-gviz.js", |
| 29 | "dygraph-interaction-model.js", |
| 30 | "dygraph-tickers.js", |
| 31 | "dygraph-plugin-base.js", |
| 32 | "plugins/annotations.js", |
| 33 | "plugins/axes.js", |
| 34 | "plugins/chart-labels.js", |
| 35 | "plugins/grid.js", |
| 36 | "plugins/legend.js", |
| 37 | "plugins/range-selector.js", |
| 38 | "dygraph-plugin-install.js", |
| 39 | "dygraph-options-reference.js", // Shouldn't be included in generate-combined.sh |
| 40 | "datahandler/datahandler.js", |
| 41 | "datahandler/default.js", |
| 42 | "datahandler/default-fractions.js", |
| 43 | "datahandler/bars.js", |
| 44 | "datahandler/bars-error.js", |
| 45 | "datahandler/bars-custom.js", |
| 46 | "datahandler/bars-fractions.js" |
| 47 | ]; |
| 48 | |
| 49 | for (var i = 0; i < source_files.length; i++) { |
| 50 | document.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n'); |
| 51 | } |
| 52 | })(); |