summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-05-07 07:47:19 +0000
committerianb <devnull@localhost>2005-05-07 07:47:19 +0000
commite7bbc111c20354079823d3e05a0bf5e60781ca3a (patch)
treeac0a64df1329119974822d9a49cb0ffc7e265cdc
parenteec76ab8390411bac735bc7fa1a139ae6d5def3c (diff)
downloadpaste-e7bbc111c20354079823d3e05a0bf5e60781ca3a.tar.gz
Tried to add a reset command
-rw-r--r--examples/console/web/static/command.js15
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">&gt;&gt;&gt; '
+ 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('&', '&amp;').replace('<', '&lt;');
}
+
+function clear() {
+ alert(output_html);
+ output_html = '';
+ refresh_display();
+ return false;
+}