Skip to content

Instantly share code, notes, and snippets.

@bwhite
Created February 27, 2014 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwhite/9261288 to your computer and use it in GitHub Desktop.
Save bwhite/9261288 to your computer and use it in GitHub Desktop.
[wearscriptold]
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function server() {
WS.displayCardTree();
var tree = new WS.Cards();
tree.add('Summary', 'Auto');
tree.add('Summary', 'Auto', function () {WS.say('selected')}); // Select
tree.add('Summary', 'Auto', function () {WS.say('selected')}, function () {WS.say('tap')}); // Select + Tap
tree.add('Summary', 'Auto', 'Say', function () {WS.say('Say clicked')}, 'Log', function () {WS.log('log clicked')}); // Menu
tree.add('Summary', 'Auto', function () {WS.say('selected')}, 'Say', function () {WS.say('Say clicked')}); // Menu + Select
tree.add('Summary', 'Auto', function () {WS.say('selected')}, function () {WS.say('tap')}, 'Say', function () {WS.say('Say clicked')}); // Menu + Select + Tap
WS.log(JSON.stringify(tree));
WS.cardTree(tree);
}
function main() {
WS = new WearScript();
if (WS.scriptVersion(1)) return;
ctx = document.getElementById('canvas').getContext("2d");
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