Skip to content

Instantly share code, notes, and snippets.

@timothyclemans
Created March 5, 2014 01:23
Show Gist options
  • Save timothyclemans/9359395 to your computer and use it in GitHub Desktop.
Save timothyclemans/9359395 to your computer and use it in GitHub Desktop.
[wearscript] Checklists for glass
<!-- checklistsforglass.com checklist creation -->
<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>
<link href='https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700' rel='stylesheet' type='text/css'>
<style>
/* recover from old-browser styling */
.oldbl {display: block !important;}
.oldin {display: inline !important;}
img.pic {display: block !important;}
.ahem, .skipper, #aboutsite, #aboutsite * {display: none !important;}
/* NS6.x-specific fix(es) */
*|*:-moz-list-bullet, *|*:-moz-list-number {font-size: 1em;}
/* IE image scaling fix */
img {-ms-interpolation-mode: bicubic;}
/* misc */
#present {z-index: 100000 !important;}
/*
http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, code,
del, dfn, img, ins, kbd, q, s, samp,
small, strike, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
font-family:roboto;
font-weight:100;
color:#FFF;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
h1 {font-size:30px; padding:10px; font-weight:300;}
li {font-size:30px; border-top:1px solid #FFF;padding:10px;}
.current {background:red;font-size:50px;font-weight:500;}
#serialnumber {padding:40px;font-size:40px;}
</style>
</head>
<body style="background:#000; color:#FFF; width:100%; height:100%; overflow:hidden; margin:0">
<script>
var name = '';
var elements = [];
function createElement(data) {
if (data == 'save checklist') {
WS.shutdown();
} else {
elements.push(data);
WS.speechRecognize('Element. To save checklist say "save checklist"', 'createElement');
}
}
function nameChecklist(data) {
name = data;
WS.say(name);
WS.speechRecognize('Element. To save checklist say "save checklist"', 'createElement')
}
function server() {
WS.log('hi');
WS.speechRecognize('Name of checklist', 'nameChecklist');
}
function main() {
$.ajaxSetup({
error: function(jqXHR, exception) {
if (jqXHR.status === 0) {
WS.log('Not connect.\n Verify Network.');
} else if (jqXHR.status == 404) {
WS.log('Requested page not found. [404]');
} else if (jqXHR.status == 500) {
WS.log('Internal Server Error [500].');
} else if (exception === 'parsererror') {
WS.log('Requested JSON parse failed.');
} else if (exception === 'timeout') {
WS.log('Time out error.');
} else if (exception === 'abort') {
WS.log('Ajax request aborted.');
} else {
WS.log('Uncaught Error.\n' + jqXHR.responseText);
}
}
});
//WS.gestureCallback('onGesture', 'onGesture');
//WS.gestureCallback('onEyeGesture', 'onGesture');
WS.liveCardCreate(false, .2);
WS.serverConnect('{{WSUrl}}', 'server');
WS.activityCreate();
//WS.say($('#todo_'+current_todo+' span').text());
var is_registered = 'False';
//isRegistered()
WS.say('hi');
}
window.onload = main;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment