This is a test for the Dojo CodeGlass which lets you create executed code examples and lets the user copy and paste that same code.
CodeGlass is a widget mainly intendet for easy to create examples for documentation or similar projects.
All the user has to do is to define the to be executed HTML, CSS and JavaScript, CodeGlass will assemble the code and execute it properly.
In this example we create a completely self contained Dojo layout which you can copy and past into your environment and which will work out of the box for you
The new Dojo docs will convert simple reST syntax into escaped HTML, check the source to see what CodeGlass does.
Take a look at the frickin cool Dojo charting. This makes use of CodeGlass in inline "mode".
Instantiation is super simple: dojo.query("#charting").CodeGlass({type: "inline"});
This is how you get the cool charting to run
<script type="text/javascript"> dojo.require("dojox.charting.Chart2D"); dojo.require("dojox.charting.themes.Wetland"); dojo.addOnLoad(function(){ var c = new dojox.charting.Chart2D("chartOne"); c.addPlot("default", {type: "StackedAreas", tension:3}) .addAxis("x", {fixLower: "major", fixUpper: "major"}) .addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", min: 0}) .setTheme(dojox.charting.themes.Wetland) .addSeries("Series A", [1, 2, 0.5, 1.5, 1, 2.8, 0.4]) .addSeries("Series B", [2.6, 1.8, 2, 1, 1.4, 0.7, 2]) .addSeries("Series C", [6.3, 1.8, 3, 0.5, 4.4, 2.7, 2]) .render(); }); </script>
Very simple
<div id="chartOne" style=""></div>
Some simple CSS
<style type="text/css"> #chartOne { padding-top:60px; font-family: Arial; font-size: 12px; margin: 0 50px; width: 400px; height: 240px; } </style>