TODOs:
* Remove the awful tables in interaction.html (that I wrote)
* Move all style to css
- * Create links to get code
* Consider moving HTML to HTML files that are read via XMLHTTP
* Add margin-left: 30px to #workarea, and then make #workarea h2 { margin-left: -30px}
- * Replace <input type='button'> with <button>
* Standard width. No need for very wide graphs.
* Remove runtime warnings.
\ No newline at end of file
};
Gallery.start = function() {
- google.load('visualization', '1', {'packages':['annotatedtimeline']});
Gallery.toc = document.getElementById("toc");
Gallery.workarea = document.getElementById("workarea");
+ Gallery.subtitle = Gallery.create("div", Gallery.workarea);
Gallery.workareaChild = Gallery.create("div", Gallery.workarea);
Gallery.workarea.style.visibility = "hidden";
+ Gallery.title = document.getElementById("title");
+ Gallery.textarea = new TextArea();
+
for (var idx in Gallery.entryOrder) {
var id = Gallery.entryOrder[idx];
var demo = Gallery.entries[id];
Gallery.runningDemo.clean(Gallery.workareaChild);
}
}
+ Gallery.subtitle.innerHTML = "";
+ var codeLink = Gallery.create("a", Gallery.subtitle);
+ codeLink.textContent = "code";
+ codeLink.href = "#";
Gallery.workarea.style.visibility = "visible";
- document.getElementById("title").textContent = demo.title ? demo.title : "";
+ Gallery.title.textContent = demo.title ? demo.title : "";
demo.innerDiv.className = "selected";
Gallery.workareaChild.id = id;
location.hash = "g/" + id;
if (demo.setup) {
demo.setup(Gallery.workareaChild);
}
+ var html = Gallery.workareaChild.innerHTML;
+ codeLink.onclick = function() {
+ var javascript = demo.run.toString();
+ Gallery.textarea.show("Code", "HTML\n\n" + html + "\n\njavascript\n\n" + javascript);
+ };
demo.run(Gallery.workareaChild);
Gallery.runningDemo = demo;
}; }(demo, id);
<![endif]-->
<script src="../dygraph-dev.js"></script>
+ <script src="../common/textarea.js"></script>
<script src="gallery.js"></script>
<script src="data.js"></script>
<script src="interaction-api.js"></script>
- <script src='http://www.google.com/jsapi'></script> <!-- required in some cases -->
+ <!-- script src='http://www.google.com/jsapi'></script> -->
<!-- gallery entries. Can these be auto-loaded? -->
<script src="annotation.js"></script>
<script src="interaction.js"></script>
<script src="linear-regression.js"></script>
- <!-- These might not remain in the gallery -->
+ <!-- These might not remain in the gallery
<script src="dygraph-simple.js"></script>
<script src="demo.js"></script>
<script src="border.js"></script>
<script src="negative.js"></script>
<script src="annotation-gviz.js"></script>
<script src="annotation-native.js"></script>
-
+ -->
<link rel="stylesheet" type="text/css" href="gallery.css" />
</head>
<body>