Inserting a standalone widget on a page requires only two lines of javascript:
<script type="text/javascript" src="http://live.deckmonitoring.com/deckinsert.js"></script>
<script type="text/javascript">insertDeck( "my_dashboard_id", "widget", 200, 200 );</script>
And a line of html like this:
<div id="widget"></div>
The first line includes the standard deckinsert.js into your page. This uses the light-weight and established swfobject method of inserting Flash on a page. The second line calls a function called insertDeck with the following signature:
insertDeck( id:String, div:String, width:Number/String, height:Number/String, bkColor:String, swfToInsert:String, wmode:String );
The dashboard id can be provided by the DECK team.
The string name of the block id (such as a div) to insert the Flash movie.
Width (in pixels)
Height (in pixels)
You may optionally add a background color. It should be formatted as a string like this: "#ffcc33".
insertDeck( "city_of_surprise_solar_generating_system_1", "widget", 200, 200, null, null, "transparent" );
Additionally, the function insertDeckUsingHash(hash) will accept the above parameters as named parameters. This is easier to read in most cases.
insertDeckUsingHash({
id: "city_of_surprise_solar_generating_system_1",
div: "widget",
width: 200,
height: 200,
wmode: "transparent"
});
When in doubt, they could always scroll down to the bottom of http://live.deckmonitoring.com/deckinsert.js and look at the code. The top is minified but the bottom is readable.
0 Comments