2009-11-28 80 views
1

我正在學習Google Wave小工具。Google Wave小工具:gadgets.window未定義

我試圖強制my gadget重新調整自己。

但我不斷收到錯誤,gadgets.window未定義。

這裏是我的小工具:

<?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> 

順便說一句,如果你知道小工具嵌入的GitHub學家到谷歌波浪,請告訴我。 :-)

+0

你有沒有完成這個?我一直在尋找一種在Waves中嵌入代碼的方法。 'Gist.GitHub'是*完美的*。 – ELLIOTTCABLE 2010-07-21 07:41:42

+0

我認爲我已經完成了它的工作(見要點),但從未完成小工具本身。 Google Wave當時太慢了,沒有用處。 隨意從該要點的代碼派生你的工作,在MIT許可證下考慮它。 – 2010-07-21 07:51:35

回答

2

替換動態高度動態高度

gadgets.window.adjustHeight()gadgets.util.registerOnLoadHandler(gadgets.window.adjustHeight)被替換,becouse gadgets.window可當你初始化小工具中沒有加載。