|
|
|
@ -3,6 +3,7 @@
@@ -3,6 +3,7 @@
|
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
|
|
|
|
<script src="webdice.js"></script> |
|
|
|
|
<script> |
|
|
|
|
var previous = ""; |
|
|
|
|
function send(){ |
|
|
|
|
var input = document.getElementById('inputBox').value; |
|
|
|
|
var size = lengthBytesUTF8(input) + 1; |
|
|
|
@ -12,13 +13,28 @@
@@ -12,13 +13,28 @@
|
|
|
|
|
_free(pointer); |
|
|
|
|
inputBox.value = ''; |
|
|
|
|
} |
|
|
|
|
function keypress(code){ |
|
|
|
|
switch(code){ |
|
|
|
|
case 13: |
|
|
|
|
previous = document.getElementById('inputBox').value; |
|
|
|
|
send(); |
|
|
|
|
break; |
|
|
|
|
case 38: |
|
|
|
|
document.getElementById('inputBox').value = previous; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
</head> |
|
|
|
|
<body> |
|
|
|
|
<div id="output"></div> |
|
|
|
|
<form action="javascript:void(0);"> |
|
|
|
|
<input type="text" id="inputBox" onkeydown="if (event.keyCode == 13) send()"> |
|
|
|
|
<input type="button" onclick="send()" value="Submit"> |
|
|
|
|
<div id="container" style="position: absolute; bottom: 7em; left: 1em; top: 1em; right: 1em; font-family: sans-serif; overflow-y: scroll; "> |
|
|
|
|
<div id="output"></div> |
|
|
|
|
</div> |
|
|
|
|
<form style="position: absolute; left: 1em; bottom: 1em; right: 1em; " action="javascript:void(0);"> |
|
|
|
|
<input style="width: 100%;" type="text" id="inputBox" onkeydown="keypress(event.keyCode)"> |
|
|
|
|
<input style="width: 100%;" type="button" onclick="keypress(13)" value="Submit"> |
|
|
|
|
</form> |
|
|
|
|
</body> |
|
|
|
|
</html> |
|
|
|
|