| 1 | // Copyright 2011 Dan Vanderkam (danvdk@gmail.com) |
| 2 | // MIT-licensed (http://opensource.org/licenses/MIT) |
| 3 | |
| 4 | // A dygraph "auto-loader". |
| 5 | |
| 6 | // Check where this script was sourced from. If it was sourced from |
| 7 | // '../dygraph-dev.js', then we should source all the other scripts with the |
| 8 | // same relative path ('../dygraph.js', '../dygraph-canvas.js', ...) |
| 9 | (function() { |
| 10 | var src=document.getElementsByTagName('script'); |
| 11 | var script = src[src.length-1].getAttribute("src"); |
| 12 | |
| 13 | // This list needs to be kept in sync w/ the one in generate-combined.sh |
| 14 | // and the one in jsTestDriver.conf. |
| 15 | var source_files = [ |
| 16 | "strftime/strftime-min.js", |
| 17 | "rgbcolor/rgbcolor.js", |
| 18 | "dygraph-layout.js", |
| 19 | "dygraph-canvas.js", |
| 20 | "dygraph.js", |
| 21 | "dygraph-utils.js", |
| 22 | "dygraph-gviz.js", |
| 23 | "dygraph-interaction-model.js", |
| 24 | "dygraph-options-reference.js", // Shouldn't be included in generate-combined.sh |
| 25 | "dygraph-tickers.js" |
| 26 | ]; |
| 27 | |
| 28 | for (var i = 0; i < source_files.length; i++) { |
| 29 | document.write('<script type="text/javascript" src="' + script.replace('dygraph-dev.js', source_files[i]) + '"></script>\n'); |
| 30 | } |
| 31 | })(); |