Skip to content

Instantly share code, notes, and snippets.

@bwhite
Created Apr 27, 2014
Embed
What would you like to do?
[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