Created
February 24, 2012 10:34
-
-
Save tkatochin/1900029 to your computer and use it in GitHub Desktop.
Googleカレンダーで使用すると週・月以外で落ちるサンプルガジェット
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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