summaryrefslogtreecommitdiff
path: root/swat/esptest/qooxdoo.esp
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-08-10 06:58:05 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:34 -0500
commit8942ac69f01acc2e09a56e6accef6034622d40d4 (patch)
tree0b89121731965c95eee5e67053538c063815690e /swat/esptest/qooxdoo.esp
parent922f28fcbda983dcd6141f7c746d0f228302d368 (diff)
downloadsamba-8942ac69f01acc2e09a56e6accef6034622d40d4.tar.gz
samba-8942ac69f01acc2e09a56e6accef6034622d40d4.tar.bz2
samba-8942ac69f01acc2e09a56e6accef6034622d40d4.zip
r9227: cleanup and simplify the AJAJ code
(This used to be commit ceb7669e5991e9dda759d60a09a0a65e6caba991)
Diffstat (limited to 'swat/esptest/qooxdoo.esp')
-rw-r--r--swat/esptest/qooxdoo.esp28
1 files changed, 25 insertions, 3 deletions
diff --git a/swat/esptest/qooxdoo.esp b/swat/esptest/qooxdoo.esp
index 76d3236fc9..554a4e90d5 100644
--- a/swat/esptest/qooxdoo.esp
+++ b/swat/esptest/qooxdoo.esp
@@ -1,4 +1,26 @@
-<%
+<%
+/******************************/
+/* server side AJAJ functions */
+libinclude("server_call.js");
+
+/* this is a call that the client js code can make - it just adds
+ some more elements to the passed object, then returns the object */
+function testfunc(x) {
+ var sys = sys_init();
+ x.nttime = sys.nttime();
+ x.timestring = sys.httptime(x.nttime);
+ return x;
+}
+
+/* register a call for clients to make */
+var call = servCallObj();
+call.add('testfunc', testfunc);
+
+/* run the function that was asked for */
+call.run();
+
+ /***********************/
+ /* now the main page */
page_header("columns", "ESP qooxdoo test", "esptest");
%>
@@ -48,7 +70,7 @@
shared.rate = shared.counter / (shared.time_diff * 0.0000001);
shared.counter++;
if (stopit == 0) {
- server_call('remote.esp', 'testfunc', callback, shared);
+ server_call_url("@@request.REQUEST_URI", 'testfunc', callback, shared);
}
}
@@ -57,7 +79,7 @@
stopit = 0;
shared.counter = 0;
shared.start_time = 0;
- server_call('remote.esp', 'testfunc', callback, shared);
+ server_call_url("@@request.REQUEST_URI", 'testfunc', callback, shared);
};
function stop_call() {