From 0efe5441c5ae67bf40daf04ea66538a946f2f0ad Mon Sep 17 00:00:00 2001 From: Gerd Flaig Date: Sun, 23 Nov 2008 01:47:56 +0100 Subject: [PATCH] add basic Ajax test --- static/ajax.txt | 1 + static/eow.js | 29 +++++++++++++++++++++++++++++ static/style.css | 18 ++++++++++++++++++ static/test.html | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 static/ajax.txt create mode 100644 static/eow.js create mode 100644 static/style.css create mode 100644 static/test.html diff --git a/static/ajax.txt b/static/ajax.txt new file mode 100644 index 0000000..e671beb --- /dev/null +++ b/static/ajax.txt @@ -0,0 +1 @@ +eowOut("Hello, Ajax world!"); diff --git a/static/eow.js b/static/eow.js new file mode 100644 index 0000000..f856075 --- /dev/null +++ b/static/eow.js @@ -0,0 +1,29 @@ +function eowOut(output) { + var t = document.createTextNode(output); + var p = document.createElement("p"); + p.appendChild(t); + dojo.byId("output").appendChild(p); +} + +function hello() { + dojo.xhrGet( { + // The following URL must match that used to test the server. + url: "/eow/static/ajax.txt", + handleAs: "javascript", + + timeout: 5000, // Time in milliseconds + + // The LOAD function will be called on a successful response. + load: function(response, ioArgs) { + console.log(response); + return response; + }, + + // The ERROR function will be called in an error case. + error: function(response, ioArgs) { + console.error("HTTP status code: ", ioArgs.xhr.status); + return response; + } + }); +} + diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..cc60f10 --- /dev/null +++ b/static/style.css @@ -0,0 +1,18 @@ +html { height: 100%; } +body { background: #fff; font-size: 12px; font-family: monospace; height: 99%; margin:0px; padding: 0px; } +form { padding: 0px; margin: 0px; } +pre { font-size: 12px; } +br { clear: both; } +:focus { outline: 0; } +input.cmdline { border: none; border: 0px; font-size: 12px; font-family: monospace; padding: 0px; margin:0px; width:100%; } +table.inputtable { width:100%; vertical-align:top; } +td.inputtd { width:100%; } +#input { margin-left: 8px; color: #666; overflow: hidden; } +#output{ margin-left: 8px; margin-top: 8px; } +.less { color: #666; } +.info { color: #090; } +table { padding: 0px; margin: 0px; border-collapse: collapse; border-spacing: 0px; } +td { padding: 0px; margin: 0px; vertical-align: top; font-size: 12px; font-family: monospace; } +.help td { padding-right: 25px; font-size: 12px; } +div#prompt { display: inline; white-space:nowrap; padding:0px; margin:0px; } +img { border: none; } diff --git a/static/test.html b/static/test.html new file mode 100644 index 0000000..3f6cc9f --- /dev/null +++ b/static/test.html @@ -0,0 +1,35 @@ + + + +Empire Web Client + + + + + + + + +
+EOW alpha0 Empire/Ajax +
+
+Welcome to the Empire over the Web client (EOW). +
+
+
+
>
+
+
+ +
+
+ Last modified: Sun Nov 23 01:38:22 CET 2008 + -- 2.43.0