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">
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
);
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>