summaryrefslogtreecommitdiff
path: root/examples/console/web/static/command.js
blob: 5b592fdd8a563991453e12f1c202535800c51c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
output_html = ''

function send_command() {
  var command_short = document.getElementById('command');
  var command_long = document.getElementById('command_long');
  var command = command_short.value;
  if (command == '') {
    command = command_long.value;
  }
  if (command == '') {
    return false;
  }
  command_short.value = '';
  command_long.value = '';
  var result = servlet.run(command);
  var output_div = document.getElementById('output');
  output_html += '<br>\n' + '<span class="input">'
    + command + '</span>';
  if (result != nil) {
    output_html += '<br>\n' + '<span class="output">'
      + result + '</span>';
  }
  output_div.innerHTML = output_html;
  return false;
}