Skip to content

Instantly share code, notes, and snippets.

@palladius
Created November 22, 2012 14:48
Show Gist options
  • Save palladius/4131532 to your computer and use it in GitHub Desktop.
Save palladius/4131532 to your computer and use it in GitHub Desktop.
HelloWorld Riccardo GGadget v1.2
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Developer Forum v1.2"
title_url="http://groups.google.com/group/Google-Gadgets-API"
height="200"
category="from_googlers"
author="Riccardo Carlesso"
author_email="ricc@google.com"
>
<Require feature="setprefs" />
</ModulePrefs>
<UserPref name="test_string" datatype="string" />
<Content type="html" view="home"><![CDATA[
Test String: __UP_test_string__
]]></Content>
<Content type="html" view="configuration"><![CDATA[
<script type="text/javascript">
function registerHandlers() {
// Get userprefs
var prefs = new gadgets.Prefs();
var pref = document.getElementById('string_pref');
pref.onkeyup = function() {
prefs.set('test_string', pref.value);
};
}
gadgets.util.registerOnLoadHandler(registerHandlers);
</script>
Test String - <input type="text" id="string_pref" value="__UP_test_string__"/><br/>
]]></Content>
</Module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment