Skip to Main Content
Google Wave: Up and Running
book

Google Wave: Up and Running

by Andres Ferrate
March 2010
Intermediate to advanced content levelIntermediate to advanced
304 pages
8h 23m
English
O'Reilly Media, Inc.
Content preview from Google Wave: Up and Running

Appendix B. Sample Gadgets Code

In this appendix you will find the complete, uninterrupted source code for the gadgets covered in Chapters 5 and 7.

Wave Mood Gadget

You can browse or check out the source code at http://code.google.com/p/gwave-mood-gadget.

Code

<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Wave Mood Gadget" height="160"> <Require feature="wave" /> </ModulePrefs> <Content type="html"> <![CDATA[ <div id="wrapper" style="height: 160px;"> <img id="mood_chart" src="http://chart.apis.google.com/chart?chs=200x100& cht=gom&chd=t:50&chl=Luke+Warm" alt="Wave Mood" /> <br/> This wave is: <input type="radio" value="10" name="radio_mood" id="radio_10" onClick="moodSelected(this.value)"> Cold &nbsp;| <input type="radio" value="50" name="radio_mood" id="radio_50" onClick="moodSelected(this.value)" checked> Luke Warm &nbsp;| <input type="radio" value="90" name="radio_mood" id="radio_90" onClick="moodSelected(this.value)"> Hot <br/> <span id="lastChanged"></span> </div> <script type="text/javascript"> var moodImage = document.getElementById('mood_chart'); var moodLabels = []; moodLabels[10] = 'Cold'; moodLabels[50] = 'Luke+Warm'; moodLabels[90] = 'Hot'; function moodSelected(mood) { wave.getState().submitDelta({'mood': mood}); var viewer = wave.getViewer().getDisplayName(); wave.getState().submitDelta({'lastChanged': viewer}); } function stateUpdated() { if(!wave.getState().get('mood')) { var moodSrc = 'http://chart.apis.google.com/chart?'; moodSrc += 'chs=200x100&cht=gom&chd=t:50&chl=Luke+Warm'; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Google™ Search and Tools in a Snap

Google™ Search and Tools in a Snap

Preston Gralla
SUSE™ Linux 10 Unleashed

SUSE™ Linux 10 Unleashed

Michael McCallister

Publisher Resources

ISBN: 9781449378646Errata PagePurchase book