Commits

Atsushi Odagiri committed dcba3df

first commit.

  • Participants

Comments (0)

Files changed (3)

+<?xml version="1.0" encoding="UTF-8"?>
+<Module>
+<ModulePrefs title="Hello Wave!" >
+</ModulePrefs>
+<Content type="html"><![CDATA[
+  <input id="name"><button id="push-button">PUSH</button>
+    <span id="message"></span>
+  <script>
+    function init() {
+        var b = document.getElementById('push-button');
+        b.onclick = function() {
+            var name = document.getElementById('name').value;
+            document.getElementById('message').innerHTML = "Hello, " + name;
+        }
+    }
+    gadgets.util.registerOnLoadHandler(init);
+    </script>
+]]></Content>
+</Module>
+
+<?xml version="1.0" encoding="UTF-8"?>
+<Module>
+<ModulePrefs title="Hello Wave!" >
+  <Require feature="wave" />
+  </ModulePrefs>
+<Content type="html"><![CDATA[
+  <input id="name"><button id="push-button">PUSH</button>
+    <span id="message"></span>
+  <script>
+    function init() {
+        var b = document.getElementById('push-button');
+        b.onclick = function() {
+            var name = document.getElementById('name').value;
+            document.getElementById('message').innerHTML = wave.getViewer().getDisplayName() + 'Say, "Hello, ' + name + '"';
+        }
+    }
+    gadgets.util.registerOnLoadHandler(init);
+    </script>
+]]></Content>
+</Module>
+
+
+dule>
+<ModulePrefs title="Hello Wave!" >
+  <Require feature="wave" />
+  </ModulePrefs>
+<Content type="html"><![CDATA[
+  <input id="name"><button id="push-button">PUSH</button>
+    <span id="message"></span>
+  <script>
+    function init() {
+        wave.setStateCallback(stateCallback);
+        var b = document.getElementById('push-button');
+        b.onclick = function() {
+            var name = document.getElementById('name').value;
+            var s = wave.getState();
+            s.submitValue('message', wave.getViewer().getDisplayName() + ' Say, "Hello, ' + name + '"');
+        }
+    }
+    function stateCallback() {
+        var s = wave.getState();
+        var message = s.get('message');
+        document.getElementById('message').innerHTML = message;
+    }
+    gadgets.util.registerOnLoadHandler(init);
+    </script>
+]]></Content>
+</Module>
+