6 $("#cmdline").ajaxForm({
12 function eowOut(output) {
13 $("#output").append("<pre>" + output + "</pre>");
14 window.scrollTo(0, window.scrollMaxY);
17 function get_next_update() {
18 $.getScript("/eow/update", function(data, textStatus) {
19 console.log(textStatus);
24 function submit_cmdline(command) {
26 // The following URL must match that used to test the server.
30 timeout: 30000, // Time in milliseconds
32 // The LOAD function will be called on a successful response.
33 success: function(data, textStatus) {
34 console.log(textStatus + " " + data);
37 // The ERROR function will be called in an error case.
38 error: function(xhr, textStatus, error) {
39 if (textStatus == "timeout") {
43 console.error("HTTP status code: ", xhr.status);
64 function setup_client() {
65 $("#inputfield").focus();
68 function inputfield_keyup(e) {
69 if (e.keyCode == 13) { // Enter
70 eowOut($("#prompt").text() + e.target.value);
71 submit_cmdline(e.target.value);
72 window.scrollTo(0, window.scrollMaxY);