Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Googleカレンダーで使用すると週・月以外で落ちるサンプルガジェット
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="CanvasAndPrefSetSample" author="katochin">
<Require feature="setprefs"/>
<Require feature="views"/>
</ModulePrefs>
<UserPref datatype="hidden" display_name="test" name="testPref" />
<Content type="html" view="canvas">
<![CDATA[<!DOCTYPE html>
<head>
<script type="text/javascript">
var prefs = new gadgets.Prefs();
function savePref() {
prefs.set("testPref",
document.getElementById("testPref").value);
}
function loadPref() {
document.getElementById("testPref").value =
prefs.getString("testPref");
}
</script>
</head>
<body onload="loadPref()">
<input type="text" id="testPref"/><a href="#" onclick="savePref(); return false;">Save</a>
</body>
</html>]]>
</Content>
<Content type="html" view="home">
<![CDATA[<!DOCTYPE html>
<head>
<script type="text/javascript">
function navigateTo(dest) {
var supported_views = gadgets.views.getSupportedViews();
gadgets.views.requestNavigateTo(supported_views[dest]);
};
function gotoCanvas() {
navigateTo("canvas");
};
</script>
</head>
<body>
<a href="#" onclick="gotoCanvas(); return false;">Goto Canvas</a>
</body>
</html>]]>
</Content>
</Module>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.