Fixes an error with xml output / to strict type checking
[shindig.git] / javascript / container / sample2.html
blobd33d9dd1df106e369ba6148b6f1339b9c15f2aa9
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Sample: Dynamic Height</title>
5 <!-- default container look and feel -->
6 <link rel="stylesheet" href="gadgets.css">
7 <script type="text/javascript" src="../../js/rpc.js?c=1&debug=1"></script>
8 <script type="text/javascript" src="cookies.js"></script>
9 <script type="text/javascript" src="util.js"></script>
10 <script type="text/javascript" src="gadgets.js"></script>
11 <script type="text/javascript" src="cookiebaseduserprefstore.js"></script>
12 <script type="text/javascript">
13 var my = {};
15 my.gadgetSpecUrls = [
16 'http://www.google.com/ig/modules/horoscope.xml',
17 'http://www.google.com/ig/modules/aue07otr.xml',
18 'http://www.labpixies.com/campaigns/todo/todo.xml'
22 // This container lays out and renders gadgets itself.
24 my.LayoutManager = function() {
25 gadgets.LayoutManager.call(this);
28 my.LayoutManager.inherits(gadgets.LayoutManager);
30 my.LayoutManager.prototype.getGadgetChrome = function(gadget) {
31 var chromeId = 'gadget-chrome-' + gadget.id;
32 return chromeId ? document.getElementById(chromeId) : null;
35 my.init = function() {
36 gadgets.container.layoutManager = new my.LayoutManager();
39 my.renderGadgets = function() {
40 for (var i = 0; i < my.gadgetSpecUrls.length; ++i) {
41 var gadget = gadgets.container.createGadget(
42 {specUrl: my.gadgetSpecUrls[i]});
43 gadgets.container.addGadget(gadget);
44 gadgets.container.renderGadget(gadget);
47 </script>
48 </head>
49 <body onLoad="my.init();my.renderGadgets()">
50 <h2>Sample: Dynamic Height</h2>
51 <div id="gadget-chrome-0" class="gadgets-gadget-chrome"></div>
52 <div id="gadget-chrome-1" class="gadgets-gadget-chrome"></div>
53 <div id="gadget-chrome-2" class="gadgets-gadget-chrome"></div>
54 </body>
55 </html>