1

I'm learning Google Wave gadgets.

I'm trying to force my gadget to resize itself.

But I'm keep getting error that gadgets.window is undefined.

Here is my gadget:

<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
<ModulePrefs title="GitHub Gist Gadget">
  <Require feature="wave" /> 
  <!--Require feature="locked-domain" /-->
  <Require feature="dynamic-heights" />
</ModulePrefs>
<Content type="html">
<![CDATA[ 
<div id="content_div"> 

<input type=button onclick="gadgets.window.adjustHeight()" />

<script src="http://gist.github.com/244697.js"></script>

<script type="text/javascript">
  gadgets.window.adjustHeight()
</script>

</div>
  ]]> 
  </Content>
</Module>

BTW, if you know about gadget to embed GitHub gists into Google Waves, please tell me. :-)

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Alexander Gladysh
  • 39,865
  • 32
  • 103
  • 160
  • Did you ever finish this? I’ve been looking for a way to embed code in Waves. `Gist.GitHub` is *perfect* for this. – ELLIOTTCABLE Jul 21 '10 at 07:41
  • I think I've got it working (see gist), but never finished the gadget itself. Google Wave was way too slow to be useful those days. Feel free to derive your work from the code in that gist, consider it under MIT license. – Alexander Gladysh Jul 21 '10 at 07:51

2 Answers2

2

replace dynamic-heights with dynamic-height.

gadgets.window.adjustHeight() should be replaced with gadgets.util.registerOnLoadHandler(gadgets.window.adjustHeight), becouse gadgets.window may be not loaded while you initialize gadget.

ghisguth
  • 36
  • 2
1

For the same problem but with igoogle gadget design.

i found out that the gadgets.window object was only available in the sandbox, but you can use the igoogle function:

_IG_AdjustIFrameHeight();

that will automatically adjust the iframe, igoogle. ;)

source: http://code.google.com/p/opensocial-resources/issues/detail?id=572

sth
  • 222,467
  • 53
  • 283
  • 367
Daithí
  • 4,717
  • 5
  • 26
  • 35