Last active
August 29, 2015 14:10
-
-
Save kevint2u/f6c27f6d6ac8cf56545f to your computer and use it in GitHub Desktop.
[wearscript] insight-app-test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- WearScript on Glass/Android --> | |
<html style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<script> | |
function main() { | |
if (WS.scriptVersion(1)) return; | |
var localIP = "192.168.0.17"; | |
var port = "5000"; | |
var customEndpoint = "ws://" + localIP + ":" + port ; // + "/google-glass.jpg"; | |
//WS.say('begin'); | |
WS.serverConnect(customEndpoint, function () { | |
//WS.say('connected'); | |
//var imgURL = "image.jpg"; | |
var imgURL = "http://the-gadgeteer.com/wp-content/uploads/2014/01/google-glass.jpg"; | |
$.ajax({ | |
type: "GET", | |
url: imgURL, | |
crossDomain:true, | |
success: function(img) { | |
//WS.say(success); | |
$("#target").hide(); | |
$("#img-targ").attr("src", "data:image/png;base64," + img); | |
// $("#img-targ").attr("src", "http://the-gadgeteer.com/wp-content/uploads/2014/01/google-glass.jpg"); | |
WS.say('hi'); | |
}, | |
error: function(error, txtStatus) { | |
WS.say(txtStatus); | |
} | |
}); | |
}); | |
} | |
window.onload = main; | |
</script> | |
<style> | |
#target{ | |
color:white; | |
font-size: 50px; | |
text-align: center; | |
line-height: 360px; | |
} | |
#img-targ{ | |
} | |
</style> | |
<div id="target">Welcome to In-sight</div> | |
<img id="img-targ" src="/image.jpg"/> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Card Tree Example" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment