diff options
| author | ianb <devnull@localhost> | 2005-08-22 18:22:27 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-08-22 18:22:27 +0000 |
| commit | 27f2c911e823216a8db5873a53b1da10c0a4c4d1 (patch) | |
| tree | 1ed476b090fdda9834d088b38c54c27687e8e23b /examples/console/web/static/command.js | |
| parent | e17ed7b172e6b8e914c28cd3dfec53fa7b452eb7 (diff) | |
| download | paste-27f2c911e823216a8db5873a53b1da10c0a4c4d1.tar.gz | |
Examples will be kept in a separate location in the repository in the future; build-pkg is deprecated also
Diffstat (limited to 'examples/console/web/static/command.js')
| -rw-r--r-- | examples/console/web/static/command.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/examples/console/web/static/command.js b/examples/console/web/static/command.js deleted file mode 100644 index ad7b87e..0000000 --- a/examples/console/web/static/command.js +++ /dev/null @@ -1,56 +0,0 @@ -output_html = '' - -urllib = importModule('urllib'); - -function servlet_comm(s) { - urllib.sendRequest('post', - '?_action_=postrun', - 'command=' + escape(s, true), - [['Content-type', 'application/x-www-form-urlencoded']], - add_response); -} - - -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 = ''; - output_html += '<span class="input">>>> ' - + html_quote(command) + '</span>\n'; - servlet_comm(command); - return false; -} - -function add_response(res) { - var result = res.responseText; - var command_short = document.getElementById('command'); - if (result != null) { - output_html += '<span class="output">' - + html_quote(result) + '<span>\n'; - } - refresh_display(); - command_short.focus(); -} - -function refresh_display() { - var output_div = document.getElementById('output'); - output_div.innerHTML = output_html; -} - -function html_quote(s) { - return s.replace('&', '&').replace('<', '<'); -} - -function clear_output() { - output_html = ''; - refresh_display(); - return false; -} |
