summaryrefslogtreecommitdiffstats
path: root/web-gui
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-06-02 12:43:21 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-06-02 18:24:53 +0200
commit52b669d1c4654a9e2f5a45f62cea5a2fe79ea83a (patch)
tree58a00ac2c837bd4cd8711290b699ff3e713c9b9e /web-gui
parent3f065cee2177340e877331a6b08b5a1d92e0f19d (diff)
downloadjson-dbus-bridge-examples-52b669d1c4654a9e2f5a45f62cea5a2fe79ea83a.tar.gz
[web-gui] qooxdoo hello world demo
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'web-gui')
-rw-r--r--web-gui/hello-world/Manifest.json34
-rw-r--r--web-gui/hello-world/config.json77
-rwxr-xr-xweb-gui/hello-world/generate.py72
-rw-r--r--web-gui/hello-world/readme.txt10
-rw-r--r--web-gui/hello-world/source/class/hello_world/Application.js96
-rw-r--r--web-gui/hello-world/source/class/hello_world/test/DemoTest.js55
-rw-r--r--web-gui/hello-world/source/class/hello_world/theme/Appearance.js18
-rw-r--r--web-gui/hello-world/source/class/hello_world/theme/Color.js18
-rw-r--r--web-gui/hello-world/source/class/hello_world/theme/Decoration.js18
-rw-r--r--web-gui/hello-world/source/class/hello_world/theme/Font.js18
-rw-r--r--web-gui/hello-world/source/class/hello_world/theme/Theme.js21
-rw-r--r--web-gui/hello-world/source/index.html9
-rw-r--r--web-gui/hello-world/source/resource/hello-world/test.pngbin0 -> 2478 bytes
-rw-r--r--web-gui/hello-world/source/script/hello_world.js20
-rw-r--r--web-gui/hello-world/source/translation/readme.txt3
15 files changed, 469 insertions, 0 deletions
diff --git a/web-gui/hello-world/Manifest.json b/web-gui/hello-world/Manifest.json
new file mode 100644
index 0000000..48425cb
--- /dev/null
+++ b/web-gui/hello-world/Manifest.json
@@ -0,0 +1,34 @@
+{
+ "info" :
+ {
+ "name" : "hello_world",
+
+ "summary" : "Custom Application",
+ "description" : "This is a skeleton for a custom application with qooxdoo.",
+
+ "homepage" : "http://some.homepage.url/",
+
+ "license" : "SomeLicense",
+ "authors" :
+ [
+ {
+ "name" : "First Author (uid)",
+ "email" : "first.author@some.domain"
+ }
+ ],
+
+ "version" : "trunk",
+ "qooxdoo-versions": ["1.1"]
+ },
+
+ "provides" :
+ {
+ "namespace" : "hello_world",
+ "encoding" : "utf-8",
+ "class" : "source/class",
+ //"resource" : "source/resource",
+ "translation" : "source/translation",
+ "type" : "application"
+ }
+}
+
diff --git a/web-gui/hello-world/config.json b/web-gui/hello-world/config.json
new file mode 100644
index 0000000..55aa274
--- /dev/null
+++ b/web-gui/hello-world/config.json
@@ -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" : "../../../../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/generate.py b/web-gui/hello-world/generate.py
new file mode 100755
index 0000000..2d7794d
--- /dev/null
+++ b/web-gui/hello-world/generate.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+################################################################################
+#
+# qooxdoo - the new era of web development
+#
+# http://qooxdoo.org
+#
+# Copyright:
+# 2008 - 2009 1&1 Internet AG, Germany, http://www.1und1.de
+#
+# License:
+# LGPL: http://www.gnu.org/licenses/lgpl.html
+# EPL: http://www.eclipse.org/org/documents/epl-v10.php
+# See the LICENSE file in the project's top-level directory for details.
+#
+# Authors:
+# * Thomas Herchenroeder (thron7)
+#
+################################################################################
+
+##
+# This is a stub proxy for the real generator.py
+##
+
+import sys, os, re, subprocess
+
+CMD_PYTHON = 'python'
+QOOXDOO_PATH = '../../../../src/qooxdoo-1.1-sdk'
+
+def getQxPath():
+ path = QOOXDOO_PATH
+ # try updating from config file
+ if os.path.exists('config.json'):
+ # "using QOOXDOO_PATH from config.json"
+ qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?')
+ conffile = open('config.json')
+ aconffile = conffile.readlines()
+ for line in aconffile:
+ mo = qpathr.search(line)
+ if mo:
+ path = mo.group(1)
+ break # assume first occurrence is ok
+ path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path))
+
+ return path
+
+os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir
+qxpath = getQxPath()
+REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py')
+
+if not os.path.exists(REAL_GENERATOR):
+ print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR
+ sys.exit(1)
+
+argList = []
+argList.append(CMD_PYTHON)
+argList.append(REAL_GENERATOR)
+argList.extend(sys.argv[1:])
+if sys.platform == "win32":
+ argList1=[]
+ for arg in argList:
+ if arg.find(' ')>-1:
+ argList1.append('"%s"' % arg)
+ else:
+ argList1.append(arg)
+ argList = argList1
+else:
+ argList = ['"%s"' % x for x in argList] # quote argv elements
+
+cmd = " ".join(argList)
+retval = subprocess.call(cmd, shell=True)
+sys.exit(retval)
diff --git a/web-gui/hello-world/readme.txt b/web-gui/hello-world/readme.txt
new file mode 100644
index 0000000..a7b3d84
--- /dev/null
+++ b/web-gui/hello-world/readme.txt
@@ -0,0 +1,10 @@
+GUI Skeleton - A qooxdoo Application Template
+=============================================
+
+This is a qooxdoo application skeleton which is used as a template. The
+'create-application.py' script (usually under tool/bin/create-application.py)
+will use this and expand it into a self-contained qooxdoo application which
+can then be further extended. Please refer to the script and other documentation
+for further information.
+
+short:: is a standard qooxdoo GUI application \ No newline at end of file
diff --git a/web-gui/hello-world/source/class/hello_world/Application.js b/web-gui/hello-world/source/class/hello_world/Application.js
new file mode 100644
index 0000000..a8369bd
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/Application.js
@@ -0,0 +1,96 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#asset(hello_world/*)
+
+************************************************************************ */
+
+/**
+ * This is the main application class of your custom application "hello_world"
+ */
+qx.Class.define("hello_world.Application",
+{
+ extend : qx.application.Standalone,
+
+
+
+ /*
+ *****************************************************************************
+ MEMBERS
+ *****************************************************************************
+ */
+
+ members :
+ {
+ /**
+ * This method contains the initial application code and gets called
+ * during startup of the application
+ *
+ * @lint ignoreDeprecated(alert)
+ */
+ main : function()
+ {
+ // Call super class
+ this.base(arguments);
+
+ // Enable logging in debug variant
+ if (qx.core.Variant.isSet("qx.debug", "on"))
+ {
+ // support native logging capabilities, e.g. Firebug for Firefox
+ qx.log.appender.Native;
+ // support additional cross-browser console. Press F7 to toggle visibility
+ qx.log.appender.Console;
+ }
+
+ /*
+ -------------------------------------------------------------------------
+ Below is your actual application code...
+ -------------------------------------------------------------------------
+ */
+
+ // Document is the application root
+ var doc = this.getRoot();
+
+ var helloLabel = new qx.ui.basic.Label("<waiting for hello>");
+ doc.add(helloLabel, {left: 100, top: 50});
+
+ var echoEdit = new qx.ui.form.TextField();
+ doc.add(echoEdit, {left: 100, top: 100, right: 300});
+
+ var echoButton = new 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|/");
+
+ rpc.callAsync(function(result, error) {
+ if (error == null) {
+ helloLabel.setText(result);
+ }
+ else {
+ helloLabel.setText("Error: " + error);
+ }
+ }, "com.pengutronix.jdb.Hello.HelloWorld");
+
+ // Add an event listener
+ echoButton.addListener("execute", function(e) {
+ rpc.callAsync(function(result, error) {
+ if (error == null) {
+ echoLabel.setText(result);
+ }
+ else {
+ echoLabel.setText("Error: " + error);
+ }
+ }, "com.pengutronix.jdb.Hello.Echo", echoEdit.getValue());
+ });
+ }
+ }
+});
diff --git a/web-gui/hello-world/source/class/hello_world/test/DemoTest.js b/web-gui/hello-world/source/class/hello_world/test/DemoTest.js
new file mode 100644
index 0000000..2333e41
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/test/DemoTest.js
@@ -0,0 +1,55 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/**
+ * This class demonstrates how to define unit tests for your application.
+ *
+ * Execute <code>generate.py test</code> to generate a testrunner application
+ * and open it from <tt>test/index.html</tt>
+ *
+ * The methods that contain the tests are instance methods with a
+ * <code>test</code> prefix. You can create an arbitrary number of test
+ * classes like this one. They can be organized in a regular class hierarchy,
+ * i.e. using deeper namespaces and a corresponding file structure within the
+ * <tt>test</tt> folder.
+ */
+qx.Class.define("hello_world.test.DemoTest",
+{
+ extend : qx.dev.unit.TestCase,
+
+ members :
+ {
+ /*
+ ---------------------------------------------------------------------------
+ TESTS
+ ---------------------------------------------------------------------------
+ */
+
+ /**
+ * Here are some simple tests
+ */
+ testSimple : function()
+ {
+ this.assertEquals(4, 3+1, "This should never fail!");
+ this.assertFalse(false, "Can false be true?!");
+ },
+
+ /**
+ * Here are some more advanced tests
+ */
+ testAdvanced: function ()
+ {
+ var a = 3;
+ var b = a;
+ this.assertIdentical(a, b, "A rose by any other name is still a rose");
+ this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!");
+ }
+ }
+});
diff --git a/web-gui/hello-world/source/class/hello_world/theme/Appearance.js b/web-gui/hello-world/source/class/hello_world/theme/Appearance.js
new file mode 100644
index 0000000..ee5a135
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/theme/Appearance.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("hello_world.theme.Appearance",
+{
+ extend : qx.theme.modern.Appearance,
+
+ appearances :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/hello-world/source/class/hello_world/theme/Color.js b/web-gui/hello-world/source/class/hello_world/theme/Color.js
new file mode 100644
index 0000000..1cd7692
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/theme/Color.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("hello_world.theme.Color",
+{
+ extend : qx.theme.modern.Color,
+
+ colors :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/hello-world/source/class/hello_world/theme/Decoration.js b/web-gui/hello-world/source/class/hello_world/theme/Decoration.js
new file mode 100644
index 0000000..9dc79bc
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/theme/Decoration.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("hello_world.theme.Decoration",
+{
+ extend : qx.theme.modern.Decoration,
+
+ decorations :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/hello-world/source/class/hello_world/theme/Font.js b/web-gui/hello-world/source/class/hello_world/theme/Font.js
new file mode 100644
index 0000000..957646d
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/theme/Font.js
@@ -0,0 +1,18 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("hello_world.theme.Font",
+{
+ extend : qx.theme.modern.Font,
+
+ fonts :
+ {
+ }
+}); \ No newline at end of file
diff --git a/web-gui/hello-world/source/class/hello_world/theme/Theme.js b/web-gui/hello-world/source/class/hello_world/theme/Theme.js
new file mode 100644
index 0000000..3c07b4c
--- /dev/null
+++ b/web-gui/hello-world/source/class/hello_world/theme/Theme.js
@@ -0,0 +1,21 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+qx.Theme.define("hello_world.theme.Theme",
+{
+ meta :
+ {
+ color : hello_world.theme.Color,
+ decoration : hello_world.theme.Decoration,
+ font : hello_world.theme.Font,
+ icon : qx.theme.icon.Tango,
+ appearance : hello_world.theme.Appearance
+ }
+}); \ No newline at end of file
diff --git a/web-gui/hello-world/source/index.html b/web-gui/hello-world/source/index.html
new file mode 100644
index 0000000..f31da7f
--- /dev/null
+++ b/web-gui/hello-world/source/index.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>hello_world</title>
+ <script type="text/javascript" src="script/hello_world.js"></script>
+</head>
+<body></body>
+</html>
diff --git a/web-gui/hello-world/source/resource/hello-world/test.png b/web-gui/hello-world/source/resource/hello-world/test.png
new file mode 100644
index 0000000..ef360cd
--- /dev/null
+++ b/web-gui/hello-world/source/resource/hello-world/test.png
Binary files differ
diff --git a/web-gui/hello-world/source/script/hello_world.js b/web-gui/hello-world/source/script/hello_world.js
new file mode 100644
index 0000000..999122f
--- /dev/null
+++ b/web-gui/hello-world/source/script/hello_world.js
@@ -0,0 +1,20 @@
+/*
+ * 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);
+}
diff --git a/web-gui/hello-world/source/translation/readme.txt b/web-gui/hello-world/source/translation/readme.txt
new file mode 100644
index 0000000..66975e6
--- /dev/null
+++ b/web-gui/hello-world/source/translation/readme.txt
@@ -0,0 +1,3 @@
+This directory will contain translation (.po) files once you run the
+'translation' job in your project.
+