diff options
Diffstat (limited to 'web-gui')
-rw-r--r-- | web-gui/Makefile.am | 7 | ||||
-rw-r--r-- | web-gui/hello-world/Makefile.am | 10 | ||||
-rw-r--r-- | web-gui/hello-world/Manifest.json | 2 | ||||
-rw-r--r-- | web-gui/hello-world/config.json.in (renamed from web-gui/hello-world/config.json) | 4 | ||||
-rw-r--r-- | web-gui/hello-world/source/class/hello_world/Application.js | 23 | ||||
-rw-r--r-- | web-gui/hello-world/source/script/hello_world.js | 20 |
6 files changed, 35 insertions, 31 deletions
diff --git a/web-gui/Makefile.am b/web-gui/Makefile.am new file mode 100644 index 0000000..c10e6fb --- /dev/null +++ b/web-gui/Makefile.am @@ -0,0 +1,7 @@ + +SUBDIRS = \ + hello-world + +MAINTAINERCLEANFILES = \ + Makefile.in + diff --git a/web-gui/hello-world/Makefile.am b/web-gui/hello-world/Makefile.am new file mode 100644 index 0000000..af29dd7 --- /dev/null +++ b/web-gui/hello-world/Makefile.am @@ -0,0 +1,10 @@ + +all: + if [ "@srcdir@" != "@builddir@" ]; then \ + cp -a "@srcdir@/"{source,generate.py,Manifest.json} "@builddir@/"; \ + fi + ./generate.py build + +MAINTAINERCLEANFILES = \ + Makefile.in + diff --git a/web-gui/hello-world/Manifest.json b/web-gui/hello-world/Manifest.json index 48425cb..a0f0dfa 100644 --- a/web-gui/hello-world/Manifest.json +++ b/web-gui/hello-world/Manifest.json @@ -26,7 +26,7 @@ "namespace" : "hello_world", "encoding" : "utf-8", "class" : "source/class", - //"resource" : "source/resource", + "resource" : "source/resource", "translation" : "source/translation", "type" : "application" } diff --git a/web-gui/hello-world/config.json b/web-gui/hello-world/config.json.in index 55aa274..0952a8f 100644 --- a/web-gui/hello-world/config.json +++ b/web-gui/hello-world/config.json.in @@ -31,11 +31,11 @@ "let" : { "APPLICATION" : "hello_world", - "QOOXDOO_PATH" : "../../../../src/qooxdoo-1.1-sdk", + "QOOXDOO_PATH" : "@QOOXDOO_SDK@", "QXTHEME" : "hello_world.theme.Theme", "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"], "LOCALES" : [ "en" ], - "CACHE" : "${TMPDIR}/cache", + "CACHE" : "@abs_builddir@/../qooxdoo-cache", "ROOT" : "." } diff --git a/web-gui/hello-world/source/class/hello_world/Application.js b/web-gui/hello-world/source/class/hello_world/Application.js index a8369bd..0834bce 100644 --- a/web-gui/hello-world/source/class/hello_world/Application.js +++ b/web-gui/hello-world/source/class/hello_world/Application.js @@ -64,32 +64,39 @@ qx.Class.define("hello_world.Application", doc.add(helloLabel, {left: 100, top: 50}); var echoEdit = new qx.ui.form.TextField(); - doc.add(echoEdit, {left: 100, top: 100, right: 300}); + doc.add(echoEdit, {left: 100, top: 100}); + echoEdit.setWidth(200); - var echoButton = new new qx.ui.form.Button("Echo"); + var echoButton = new qx.ui.form.Button("Echo"); doc.add(echoButton, {left: 320, top: 100}); - var rpc = new qx.io.remote.Rpc("http://localhost:8080/", "com.pengutronix.jdb.Hello|/"); + var echoLabel = new qx.ui.basic.Label("<waiting for echo>"); + doc.add(echoLabel, {left: 500, top: 100}); + + var rpc = new qx.io.remote.Rpc("http://localhost:8080/rpc", "com.pengutronix.jdb.Hello|/"); rpc.callAsync(function(result, error) { if (error == null) { - helloLabel.setText(result); + helloLabel.setValue(result); } else { - helloLabel.setText("Error: " + error); + helloLabel.setValue("Error: " + error); } }, "com.pengutronix.jdb.Hello.HelloWorld"); // Add an event listener echoButton.addListener("execute", function(e) { + var text = echoEdit.getValue(); + if (text == null) + text = ""; rpc.callAsync(function(result, error) { if (error == null) { - echoLabel.setText(result); + echoLabel.setValue(result); } else { - echoLabel.setText("Error: " + error); + echoLabel.setValue("Error: " + error); } - }, "com.pengutronix.jdb.Hello.Echo", echoEdit.getValue()); + }, "com.pengutronix.jdb.Hello.Echo", "s", text); }); } } diff --git a/web-gui/hello-world/source/script/hello_world.js b/web-gui/hello-world/source/script/hello_world.js deleted file mode 100644 index 999122f..0000000 --- a/web-gui/hello-world/source/script/hello_world.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * This is mock content and will be overwritten with the first 'generate.py source'. - */ -function inform(){ - var message = - "<div style='font-family: Verdana'>" + - "<h2>Application not yet ready!</h2>" + - "<div>Please use the generator to build this application, i.e. run <i>'generate.py source'</i> in an OS shell; then reload this page.</div>" + - "</div>"; - - window.setTimeout(function() { - document.body.innerHTML = message; - }, 0); -} - -if (window.attachEvent) { - window.attachEvent("onload", inform); -} else { - window.addEventListener("load", inform, false); -} |