diff options
| author | ianb <devnull@localhost> | 2005-05-07 07:47:19 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-05-07 07:47:19 +0000 |
| commit | e7bbc111c20354079823d3e05a0bf5e60781ca3a (patch) | |
| tree | ac0a64df1329119974822d9a49cb0ffc7e265cdc /examples/console/web/static/command.js | |
| parent | eec76ab8390411bac735bc7fa1a139ae6d5def3c (diff) | |
| download | paste-e7bbc111c20354079823d3e05a0bf5e60781ca3a.tar.gz | |
Tried to add a reset command
Diffstat (limited to 'examples/console/web/static/command.js')
| -rw-r--r-- | examples/console/web/static/command.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/console/web/static/command.js b/examples/console/web/static/command.js index 37c7075..d5c7aa9 100644 --- a/examples/console/web/static/command.js +++ b/examples/console/web/static/command.js @@ -13,17 +13,28 @@ function send_command() { command_short.value = ''; command_long.value = ''; var result = servlet.run(command); - var output_div = document.getElementById('output'); output_html += '<span class="input">>>> ' + html_quote(command) + '</span>\n'; if (result != null) { output_html += '<span class="output">' + html_quote(result) + '<span>\n'; } - output_div.innerHTML = output_html; + refresh_display(); return false; } +function refresh_display() { + var output_div = document.getElementById('output'); + output_div.innerHTML = output_html; +} + function html_quote(s) { return s.replace('&', '&').replace('<', '<'); } + +function clear() { + alert(output_html); + output_html = ''; + refresh_display(); + return false; +} |
