Skip to content

Instantly share code, notes, and snippets.

@bwhite
Created April 27, 2014 19:57
Show Gist options
  • Save bwhite/11354297 to your computer and use it in GitHub Desktop.
Save bwhite/11354297 to your computer and use it in GitHub Desktop.
[wearscript] Phone + Glass
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000">
<script>
function server() {
WS.gestureCallback('onGestureTAP', function () {
WS.publish('say', 'Tapped');
});
}
function main() {
if (WS.scriptVersion(1)) return;
WS.serverConnect('{{WSUrl}}', server);
}
window.onload = main;
</script>
</body>
</html>
{"name":"Glass and Phone",
"scripts": {"android:glass": "glass.html", "android:phone": "phone.html"}
}
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000">
<script>
function server() {
WS.subscribe('say', function (channel, x) {
WS.say(x)
})
}
function main() {
if (WS.scriptVersion(1)) return;
WS.serverConnect('{{WSUrl}}', server);
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment