function onopen() {
document.getElementById("background").style.background = "lightgray";
+ document.getElementById("main").style.visibility = "visible";
+ callbinder("ll-auth", "getuser", "");
ws.onevent("*", gotevent);
}
function replyok(obj) {
console.log("replyok:" + JSON.stringify(obj));
document.getElementById("output").innerHTML = "OK: "+JSON.stringify(obj);
+
+ document.getElementById("usertitle").innerHTML = "A valid user is logged in";
+ document.getElementById("userid").innerHTML = obj.response.user;
+ document.getElementById("userdevice").innerHTML = obj.response.device;
+ document.getElementById("background").style.background = "lightgreen";
}
function replyerr(obj) {
function gotevent(obj) {
console.log("gotevent:" + JSON.stringify(obj));
- //document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
+ document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
+ document.getElementById("question").innerHTML = "";
+ document.getElementById("output").innerHTML = "";
document.getElementById("message").innerHTML = "";
if (obj.event == "ll-auth/login") {
</ul>
</div>
<div id="message" style="color:red;"></div>
+ <div id="main" style="visibility:hidden">
+ <h2>Debug: </h2>
+ <ol>
+ <li>Question <div id="question"></div></li>
+ <li>Response <div id="output"></div></li>
+ <li>Events: <div id="outevt"></div></li>
+ </ol>
+ </div>
</body>
</html>