fix indentation in index.html

master
adbenitez 2022-01-19 18:52:27 -05:00
parent 2889ed5098
commit dde8e25cea
1 changed files with 20 additions and 21 deletions

View File

@ -1,27 +1,26 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8"/>
<script src="webxdc.js"></script> <script src="webxdc.js"></script>
</head> </head>
<body> <body>
<input id="input" type="text"/> <input id="input" type="text"/>
<a href="" onclick="sendMsg(); return false;">Send</a> <a href="" onclick="sendMsg(); return false;">Send</a>
<p id="output"></p> <p id="output"></p>
<script> <script>
function sendMsg() { function sendMsg() {
msg = document.getElementById("input").value; msg = document.getElementById("input").value;
window.webxdc.sendUpdate({payload: {name: window.webxdc.selfName(), msg: msg}}, 'someone typed "'+msg+'"'); window.webxdc.sendUpdate({payload: {name: window.webxdc.selfName(), msg: msg}}, 'someone typed "'+msg+'"');
} }
function receiveUpdate(update) { function receiveUpdate(update) {
document.getElementById('output').innerHTML += "<strong>&lt;" + update.payload.name + "&gt;</strong> " + update.payload.msg + "<br>"; document.getElementById('output').innerHTML += "<strong>&lt;" + update.payload.name + "&gt;</strong> " + update.payload.msg + "<br>";
} }
window.webxdc.setUpdateListener(receiveUpdate); window.webxdc.setUpdateListener(receiveUpdate);
window.webxdc.getAllUpdates().forEach(receiveUpdate); window.webxdc.getAllUpdates().forEach(receiveUpdate);
</script>
</script> </body>
</body>
</html> </html>