From 62aa0bc7b947879843880fa5ea84983b851853c3 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 2 Jun 2010 17:19:44 +0200 Subject: [web-gui] update hello-world Signed-off-by: Michael Olbrich --- web-gui/Makefile.am | 7 ++ web-gui/hello-world/Makefile.am | 10 +++ web-gui/hello-world/Manifest.json | 2 +- web-gui/hello-world/config.json | 77 ---------------------- web-gui/hello-world/config.json.in | 77 ++++++++++++++++++++++ .../source/class/hello_world/Application.js | 23 ++++--- web-gui/hello-world/source/script/hello_world.js | 20 ------ 7 files changed, 110 insertions(+), 106 deletions(-) create mode 100644 web-gui/Makefile.am create mode 100644 web-gui/hello-world/Makefile.am delete mode 100644 web-gui/hello-world/config.json create mode 100644 web-gui/hello-world/config.json.in delete mode 100644 web-gui/hello-world/source/script/hello_world.js (limited to 'web-gui') 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 deleted file mode 100644 index 55aa274..0000000 --- a/web-gui/hello-world/config.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name" : "hello_world", - - "include" : - [ - { - "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" - } - ], - - "export" : - [ - "api", - "build", - "clean", - "distclean", - "fix", - "info", - "inspector", - "lint", - "migration", - "pretty", - "profiling", - "source", - "source-all", - "test", - "test-source", - "translation" - ], - - "let" : - { - "APPLICATION" : "hello_world", - "QOOXDOO_PATH" : "../../../../src/qooxdoo-1.1-sdk", - "QXTHEME" : "hello_world.theme.Theme", - "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"], - "LOCALES" : [ "en" ], - "CACHE" : "${TMPDIR}/cache", - "ROOT" : "." - } - - // You only need to edit the remainder of this file, if you want to customize - // specific jobs, or add own job definitions. - - /* - "jobs" : - { - // Uncomment the following entry to add a contrib or library to your - // project; make sure to adapt the path to the Manifest.json; if you are - // using a contrib: library, it will be downloaded into the path specified - // by the 'cache/downloads' config key - "libraries" : - { - "library" : - [ - { - "manifest" : "contrib://SkeletonApplication/trunk/Manifest.json" - } - ] - }, - - // If you want to tweak a job setting, see the following sample where - // the "format" feature of the "build-script" job is overridden. - // To see a list of available jobs, invoke 'generate.py x'. - "build-script" : - { - "compile-options" : - { - "code" : - { - "format" : false - } - } - } - } - */ -} diff --git a/web-gui/hello-world/config.json.in b/web-gui/hello-world/config.json.in new file mode 100644 index 0000000..0952a8f --- /dev/null +++ b/web-gui/hello-world/config.json.in @@ -0,0 +1,77 @@ +{ + "name" : "hello_world", + + "include" : + [ + { + "path" : "${QOOXDOO_PATH}/tool/data/config/application.json" + } + ], + + "export" : + [ + "api", + "build", + "clean", + "distclean", + "fix", + "info", + "inspector", + "lint", + "migration", + "pretty", + "profiling", + "source", + "source-all", + "test", + "test-source", + "translation" + ], + + "let" : + { + "APPLICATION" : "hello_world", + "QOOXDOO_PATH" : "@QOOXDOO_SDK@", + "QXTHEME" : "hello_world.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"], + "LOCALES" : [ "en" ], + "CACHE" : "@abs_builddir@/../qooxdoo-cache", + "ROOT" : "." + } + + // You only need to edit the remainder of this file, if you want to customize + // specific jobs, or add own job definitions. + + /* + "jobs" : + { + // Uncomment the following entry to add a contrib or library to your + // project; make sure to adapt the path to the Manifest.json; if you are + // using a contrib: library, it will be downloaded into the path specified + // by the 'cache/downloads' config key + "libraries" : + { + "library" : + [ + { + "manifest" : "contrib://SkeletonApplication/trunk/Manifest.json" + } + ] + }, + + // If you want to tweak a job setting, see the following sample where + // the "format" feature of the "build-script" job is overridden. + // To see a list of available jobs, invoke 'generate.py x'. + "build-script" : + { + "compile-options" : + { + "code" : + { + "format" : false + } + } + } + } + */ +} 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(""); + 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 = - "
" + - "

Application not yet ready!

" + - "
Please use the generator to build this application, i.e. run 'generate.py source' in an OS shell; then reload this page.
" + - "
"; - - window.setTimeout(function() { - document.body.innerHTML = message; - }, 0); -} - -if (window.attachEvent) { - window.attachEvent("onload", inform); -} else { - window.addEventListener("load", inform, false); -} -- cgit v1.2.3