6 $("#cmdline").ajaxForm({
12 function eowOut(output) {
13 $("#output").append("<pre>" + output + "</pre>");
14 $("input")[0].scrollIntoView(false);
17 function get_next_update() {
21 success: function(data, textStatus) {
22 console.log(textStatus + " " + data);
24 error: function(xhr, textStatus, error) {
25 if (textStatus == "timeout") {
30 console.error("HTTP status code: ", xhr.status);
35 function submit_cmdline(command) {
37 // The following URL must match that used to test the server.
41 timeout: 30000, // Time in milliseconds
43 // The LOAD function will be called on a successful response.
44 success: function(data, textStatus) {
45 console.log(textStatus + " " + data);
48 // The ERROR function will be called in an error case.
49 error: function(xhr, textStatus, error) {
50 if (textStatus == "timeout") {
54 console.error("HTTP status code: ", xhr.status);
75 function setup_client() {
76 $("#inputfield").focus();
79 function inputfield_keyup(e) {
80 if (e.keyCode == 13) { // Enter
81 eowOut($("#prompt").text() + e.target.value);
82 submit_cmdline(e.target.value);
83 $("#inputfield").focus();