387 Tag(e) seit
Google IO - Live-Stream

Small Gadget Tutorial

Wave-Gadget – What's that?
  • small application within a wave
  • embed non-trusted code from third party
  • XML with embedded HTML and JavaScript
  • example: chess game

Wave-Gadget - Tools/Prerequisites

Wave-Gadget - XML-File

<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
<ModulePrefs title="X and O" height="300">
  <Require feature="wave" /> 
  <Require feature="dynamic-height"/>
</ModulePrefs>
<Content type="html">
<![CDATA[
// your code goes here
]]>
/Content>
</Module>


Wave-Gadget – JavaScript

gadgets.util.registerOnLoadHandler(init)

function init() {
 if (wave && wave.isInWaveContainer()) {
wave.setStateCallback(stateUpdated);
 }
}

function stateUpdated() {
// read state, do something ...
MyVar = wave.getState().get('var');

// do something with MyVar
}

Function xy() {
wave.getState().submitDelta({'var': 'someContent'})
}


Wave-Gadget – Demo

Tic Tac Toe – Gadget
        



Small Gadget Tutorial by Norbert R. Möhring moehring.n [ at ] googlemail.com
Č
ċ
ď
jqWaveTest.xml
(1k)
Norbert R. Möhring,
03.09.2009 14:26
ċ
ď
xandoGadget.xml
(5k)
Norbert R. Möhring,
02.09.2009 15:03