Skip to content

Instantly share code, notes, and snippets.

@timothyclemans
Created April 10, 2014 18:30
Show Gist options
  • Save timothyclemans/10409691 to your computer and use it in GitHub Desktop.
Save timothyclemans/10409691 to your computer and use it in GitHub Desktop.
[wearscript] complex checklists v2
<!-- Complex checklists V2 -->
<html style="width:100%; height:100%; overflow:hidden">
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="https://raw.github.com/Glench/fuzzyset.js/master/lib/fuzzyset.js"></script>
<script src="http://checklistsforglass.com/static/js/show_checklist.js"></script>
<link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700' rel='stylesheet' type='text/css'>
<style>
body {
font-family:roboto;
font-weight:100;
}
</style>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="overflow:hidden; margin:40px; background:#000;color:#FFF;font-size:40px; font-family:roboto;">
<div id="preview"></div>
<script>
function onGesture(name) {
WS.log('gesture: '+name);
if (name == 'TAP' || name == 'WINK') {
WS.log('tap');
advance();
} else if (name == 'TWO_TAP' || name == 'DOUBLE_BLINK') {
select();
}
}
function server() {
checklist = eval($.ajax({url: "http://checklistsforglass.com/get_full_checklist/27/", async: false}).responseText);
currentPreview = checklist;
console.log('checklist '+checklist);
processItem(checklist[0]);
WS.gestureCallback('onGesture', function(name) {onGesture(name) });
WS.gestureCallback('onEyeGesture', function(name) {onGesture(name) });
}
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