From e7b9be722d4d02499020449b7d72aa24c6c38931 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 18 Jun 2010 12:17:58 +0200 Subject: [login] add new demo Signed-off-by: Michael Olbrich --- Makefile.am | 2 +- configure.ac | 22 +++ services/python/hello-world.py | 10 ++ web-gui/Makefile.am | 6 +- web-gui/index.sh | 1 + web-gui/login/Makefile.am | 28 ++++ web-gui/login/Manifest.json | 34 +++++ web-gui/login/config.json.in | 78 +++++++++++ web-gui/login/dbus-session.conf.in | 86 ++++++++++++ web-gui/login/generate.py.in | 72 ++++++++++ web-gui/login/lighttpd.conf.in | 67 ++++++++++ web-gui/login/passwd.admin | 1 + web-gui/login/passwd.user | 1 + web-gui/login/run.sh.in | 73 ++++++++++ web-gui/login/source/class/login/Application.js | 147 +++++++++++++++++++++ web-gui/login/source/class/login/test/DemoTest.js | 55 ++++++++ .../login/source/class/login/theme/Appearance.js | 18 +++ web-gui/login/source/class/login/theme/Color.js | 18 +++ .../login/source/class/login/theme/Decoration.js | 18 +++ web-gui/login/source/class/login/theme/Font.js | 18 +++ web-gui/login/source/class/login/theme/Theme.js | 21 +++ web-gui/login/source/index.html | 9 ++ web-gui/login/source/resource/login/back.png | Bin 0 -> 98107 bytes web-gui/login/source/script/login.js | 20 +++ web-gui/login/source/translation/readme.txt | 3 + 25 files changed, 806 insertions(+), 2 deletions(-) create mode 100644 web-gui/login/Makefile.am create mode 100644 web-gui/login/Manifest.json create mode 100644 web-gui/login/config.json.in create mode 100644 web-gui/login/dbus-session.conf.in create mode 100755 web-gui/login/generate.py.in create mode 100644 web-gui/login/lighttpd.conf.in create mode 100644 web-gui/login/passwd.admin create mode 100644 web-gui/login/passwd.user create mode 100755 web-gui/login/run.sh.in create mode 100644 web-gui/login/source/class/login/Application.js create mode 100644 web-gui/login/source/class/login/test/DemoTest.js create mode 100644 web-gui/login/source/class/login/theme/Appearance.js create mode 100644 web-gui/login/source/class/login/theme/Color.js create mode 100644 web-gui/login/source/class/login/theme/Decoration.js create mode 100644 web-gui/login/source/class/login/theme/Font.js create mode 100644 web-gui/login/source/class/login/theme/Theme.js create mode 100644 web-gui/login/source/index.html create mode 100644 web-gui/login/source/resource/login/back.png create mode 100644 web-gui/login/source/script/login.js create mode 100644 web-gui/login/source/translation/readme.txt diff --git a/Makefile.am b/Makefile.am index fd8f9d9..91cfabf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ -DISTCHECK_CONFIGURE_FLAGS = --with-qooxdoo-sdk=@QOOXDOO_SDK@ +DISTCHECK_CONFIGURE_FLAGS = --with-qooxdoo-sdk=@QOOXDOO_SDK@ --with-admin-role=@ADMIN_ROLE@ SUBDIRS = \ web-gui \ diff --git a/configure.ac b/configure.ac index 5461f87..fe17e6b 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,22 @@ AC_ARG_WITH([qooxdoo-sdk],AS_HELP_STRING([--with-qooxdoo-sdk=PATH], [Path to qoo ) AC_SUBST(QOOXDOO_SDK) +AC_ARG_WITH([admin-role],AS_HELP_STRING([--with-admin-role=NAME], [user name for admin role. Default: `whoami`.]), + ADMIN_ROLE="$withval", ADMIN_ROLE=`whoami`) +AC_SUBST(ADMIN_ROLE) + +AC_ARG_WITH([user-role],AS_HELP_STRING([--with-user-role=NAME], [user name for admin role. Default: `whoami`.]), + USER_ROLE="$withval", USER_ROLE=`whoami`) +AC_SUBST(USER_ROLE) + +LIGHTTPD_USER=`whoami` +AC_SUBST(LIGHTTPD_USER) + +if test "x$USER_ROLE" = "x$ADMIN_ROLE"; then + AC_MSG_ERROR([The user names for admin and user roles are the same. \ +Use --with-admin-role=NAME and --with-user-role=NAME to provide different user names.]) +fi + AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2]) AC_CONFIG_FILES([ @@ -73,6 +89,10 @@ AC_CONFIG_FILES([ web-gui/logging/config.json web-gui/plot/Makefile web-gui/plot/config.json + web-gui/login/Makefile + web-gui/login/config.json + web-gui/login/lighttpd.conf + web-gui/login/dbus-session.conf ]) AC_CONFIG_FILES([run.sh],[chmod +x run.sh]) AC_CONFIG_FILES([web-gui/hello-world/generate.py],[chmod +x web-gui/hello-world/generate.py]) @@ -80,6 +100,8 @@ AC_CONFIG_FILES([web-gui/calculator/generate.py],[chmod +x web-gui/calculator/ge AC_CONFIG_FILES([web-gui/live/generate.py],[chmod +x web-gui/live/generate.py]) AC_CONFIG_FILES([web-gui/logging/generate.py],[chmod +x web-gui/logging/generate.py]) AC_CONFIG_FILES([web-gui/plot/generate.py],[chmod +x web-gui/plot/generate.py]) +AC_CONFIG_FILES([web-gui/login/generate.py],[chmod +x web-gui/login/generate.py]) +AC_CONFIG_FILES([web-gui/login/run.sh],[chmod +x web-gui/login/run.sh]) AC_CONFIG_COMMANDS([services/qt4/dbus-info-service/Makefile], [(cd services/qt4/dbus-info-service && $QMAKE ../../../${srcdir}/services/qt4/dbus-info-service/dbus-info-service.pro)]) AC_OUTPUT diff --git a/services/python/hello-world.py b/services/python/hello-world.py index 92450ea..cbdc222 100755 --- a/services/python/hello-world.py +++ b/services/python/hello-world.py @@ -32,6 +32,16 @@ class Service(dbus.service.Object): def Echo(self, text): return text + @dbus.service.method("com.pengutronix.jdb.Hello", + in_signature='', out_signature='s') + def HelloUser(self): + return "Hello User!" + + @dbus.service.method("com.pengutronix.jdb.Hello", + in_signature='', out_signature='s') + def HelloAdmin(self): + return "Hello Admin!" + dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) object = Service() diff --git a/web-gui/Makefile.am b/web-gui/Makefile.am index 2f4009a..1e81a4a 100644 --- a/web-gui/Makefile.am +++ b/web-gui/Makefile.am @@ -1,5 +1,9 @@ SUBDIRS = \ + $(DEMODIRS) \ + login + +DEMODIRS = \ hello-world \ calculator \ live \ @@ -9,7 +13,7 @@ SUBDIRS = \ all: index.html index.html: index.sh Makefile - sh $< $(SUBDIRS) > $@ + sh $< $(DEMODIRS) > $@ clean-local: rm -rf qooxdoo-cache diff --git a/web-gui/index.sh b/web-gui/index.sh index 6a9622c..61efe3f 100755 --- a/web-gui/index.sh +++ b/web-gui/index.sh @@ -18,6 +18,7 @@ for example in "$@"; do done cat << EOF +
  • Run the run.sh script in web-gui/login for the login demo
  • diff --git a/web-gui/login/Makefile.am b/web-gui/login/Makefile.am new file mode 100644 index 0000000..f6344d8 --- /dev/null +++ b/web-gui/login/Makefile.am @@ -0,0 +1,28 @@ + +QOOXDOO_SOURCE = \ + Manifest.json \ + generate.py \ + source/resource/login/back.png \ + source/index.html \ + source/translation/readme.txt \ + source/class/login/Application.js \ + source/class/login/test/DemoTest.js \ + source/class/login/theme/Color.js \ + source/class/login/theme/Theme.js \ + source/class/login/theme/Decoration.js \ + source/class/login/theme/Font.js \ + source/class/login/theme/Appearance.js + +all: + ./generate.py build + +clean-local: + rm -rf build + +EXTRA_DIST = \ + config.json.in \ + $(QOOXDOO_SOURCE) + +MAINTAINERCLEANFILES = \ + Makefile.in + diff --git a/web-gui/login/Manifest.json b/web-gui/login/Manifest.json new file mode 100644 index 0000000..247562e --- /dev/null +++ b/web-gui/login/Manifest.json @@ -0,0 +1,34 @@ +{ + "info" : + { + "name" : "login", + + "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" : "login", + "encoding" : "utf-8", + "class" : "source/class", + "resource" : "source/resource", + "translation" : "source/translation", + "type" : "application" + } +} + diff --git a/web-gui/login/config.json.in b/web-gui/login/config.json.in new file mode 100644 index 0000000..a581c70 --- /dev/null +++ b/web-gui/login/config.json.in @@ -0,0 +1,78 @@ +{ + "name" : "login", + + "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" : "login", + "QOOXDOO_PATH" : "@QOOXDOO_SDK@", + "QXTHEME" : "login.theme.Theme", + "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"], + "LOCALES" : [ "en" ], + "CACHE" : "@abs_builddir@/../qooxdoo-cache", + "BUILD_PATH" : "@abs_builddir@/build", + "ROOT" : "@abs_srcdir@" + } + + // 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/login/dbus-session.conf.in b/web-gui/login/dbus-session.conf.in new file mode 100644 index 0000000..447378c --- /dev/null +++ b/web-gui/login/dbus-session.conf.in @@ -0,0 +1,86 @@ + + + + + + session + + + + + unix:tmpdir=/tmp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + session-local.conf + + contexts/dbus_contexts + + + + + 1000000000 + 1000000000 + 1000000000 + 120000 + 240000 + 100000 + 10000 + 100000 + 10000 + 50000 + 50000 + 50000 + 300000 + + diff --git a/web-gui/login/generate.py.in b/web-gui/login/generate.py.in new file mode 100755 index 0000000..2e1f102 --- /dev/null +++ b/web-gui/login/generate.py.in @@ -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 = '@QOOXDOO_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/login/lighttpd.conf.in b/web-gui/login/lighttpd.conf.in new file mode 100644 index 0000000..6da14ec --- /dev/null +++ b/web-gui/login/lighttpd.conf.in @@ -0,0 +1,67 @@ +server.document-root = "@abs_builddir@/build" + +server.port = 8080 +server.bind = "localhost" +server.tag = "lighttpd" + +server.errorlog = "@abs_builddir@/error.log" + +server.modules = ( + "mod_fastcgi", + "mod_auth" +) + +# mimetype mapping +mimetype.assign = ( + ".gif" => "image/gif", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".png" => "image/png", + ".css" => "text/css", + ".html" => "text/html", + ".htm" => "text/html", + ".js" => "text/javascript", + ".xml" => "text/xml", +) + +index-file.names = ( "index.html" ) + +fastcgi.server = ( + "/rpc/user" => (( + "socket" => "/tmp/json-dbus-bridge.user.socket", + "check-local" => "disable", + "mode" => "responder", + "max-procs" => 1, + )), + "/rpc/admin" => (( + "socket" => "/tmp/json-dbus-bridge.admin.socket", + "check-local" => "disable", + "mode" => "responder", + "max-procs" => 1, + )), +) + +$HTTP["url"] =~ "^/rpc/user" { + auth.backend = "plain" + auth.backend.plain.userfile = "@abs_srcdir@/passwd.user" + auth.require = ( + "/rpc/user" => ( + "method" => "basic", + "realm" => "web-user", + "require" => "valid-user" + ) + ) +} + +$HTTP["url"] =~ "^/rpc/admin" { + auth.backend = "plain" + auth.backend.plain.userfile = "@abs_srcdir@/passwd.admin" + auth.require = ( + "/rpc/admin" => ( + "method" => "basic", + "realm" => "web-admin", + "require" => "valid-user" + ) + ) +} + diff --git a/web-gui/login/passwd.admin b/web-gui/login/passwd.admin new file mode 100644 index 0000000..19fdd99 --- /dev/null +++ b/web-gui/login/passwd.admin @@ -0,0 +1 @@ +admin:geheim diff --git a/web-gui/login/passwd.user b/web-gui/login/passwd.user new file mode 100644 index 0000000..ac26a20 --- /dev/null +++ b/web-gui/login/passwd.user @@ -0,0 +1 @@ +tux:fisch diff --git a/web-gui/login/run.sh.in b/web-gui/login/run.sh.in new file mode 100755 index 0000000..9154591 --- /dev/null +++ b/web-gui/login/run.sh.in @@ -0,0 +1,73 @@ +#!/bin/bash +# +# json dbus bridge +# +# Copyright (c) 2010 by Michael Olbrich +# +# To the extent possible under law, Pengutronix e.K. has waived all copyright +# and related or neighboring rights to JSON-DBus-Bridge Demo Code. +# + +if [ "`whoami`" != "root" ]; then + echo This script must be run by root. +fi + +if [ ! -f "@abs_builddir@/build/index.html" ]; then + echo + echo 'You must run "make" before running this script' + echo + exit 1 +fi + +finish() { + kill $hello_pid + kill $lighttpd_pid + kill $jdb_user_pid + kill $jdb_admin_pid + kill $DBUS_SESSION_BUS_PID + exit +} + +trap finish SIGINT + +eval `su -c "dbus-launch --config-file='@abs_builddir@/dbus-session.conf' --sh-syntax" @LIGHTTPD_USER@` + +su -c "@abs_top_srcdir@/services/python/hello-world.py" @LIGHTTPD_USER@ & +hello_pid=$! + +su -c "'@JSON_DBUS_BRIDGE@' '/tmp/json-dbus-bridge.user.socket'" @USER_ROLE@ & +jdb_user_pid=$! + +su -c "'@JSON_DBUS_BRIDGE@' '/tmp/json-dbus-bridge.admin.socket'" @ADMIN_ROLE@ & +jdb_admin_pid=$! +sleep 0.5 +chmod a+rw '/tmp/json-dbus-bridge.admin.socket' + +su -c "@LIGHTTPD@ -f '@abs_builddir@/lighttpd.conf' -D" @LIGHTTPD_USER@ & +lighttpd_pid=$! + +echo -n "waiting for lighttpd " +for i in `seq 10`; do + sleep 1 + echo -n "." + wget -e no_proxy=localhost -O - -q http://localhost:8080/ > /dev/null && break +done + +if [ $? -ne 0 ]; then + echo + echo + echo starting lighttpd failed! + finish + exit 1 +else + echo + echo + echo lighttpd sucessfully started. + echo + echo The demo page can be view at http://localhost:8080/ +fi + +while [ 1 ]; do + sleep 100 +done + diff --git a/web-gui/login/source/class/login/Application.js b/web-gui/login/source/class/login/Application.js new file mode 100644 index 0000000..6d0e0e5 --- /dev/null +++ b/web-gui/login/source/class/login/Application.js @@ -0,0 +1,147 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/* ************************************************************************ + +#asset(login/*) + +************************************************************************ */ + +/** + * This is the main application class of your custom application "login" + */ +qx.Class.define("login.Application", +{ +extend : qx.application.Standalone, + + + +/* +***************************************************************************** + MEMBERS +***************************************************************************** +*/ + +members : +{ + __users: null, + __result: null, + __error: null, + __rpc: null, + /** + * 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... + ------------------------------------------------------------------------- + */ + + var doc = this.getRoot(); + doc.setBackgroundColor("#ffffff"); + + var back = new qx.ui.basic.Image("login/back.png"); + back.setScale(true); + doc.add(back, {left:0, top: 0}); + + + var core = new qx.ui.container.Composite(new qx.ui.layout.Grid()); + doc.add(core, {left: 120, top: 100}); + core.getLayout().setSpacing(10); + core.getLayout().setColumnAlign(0, "left", "middle"); + core.getLayout().setColumnFlex(3, 100); + core.setWidth(800); + + + core.add( new qx.ui.basic.Label("Login Data:"), {row: 0, column: 0, colSpan: 3}); + + var lUser = new qx.ui.form.RadioButton("User Role"); + core.add(lUser, {row: 1, column: 0}); + lUser.user = "tux"; + lUser.passwd = "fisch"; + lUser.url = "http://localhost:8080/rpc/user" + var lAdmin = new qx.ui.form.RadioButton("Admin Role"); + core.add(lAdmin, {row: 1, column: 1}); + lAdmin.user = "admin"; + lAdmin.passwd = "geheim"; + lAdmin.url = "http://localhost:8080/rpc/admin" + var lInvalid = new qx.ui.form.RadioButton("Invalid Login Data"); + core.add(lInvalid, {row: 1, column: 2}); + lInvalid.user = "tux"; + lInvalid.passwd = "wrong"; + lInvalid.url = "http://localhost:8080/rpc/user" + + this.__users = new qx.ui.form.RadioGroup(lUser, lAdmin, lInvalid); + + core.add( new qx.ui.basic.Label("Call:"), {row: 2, column: 0, colSpan: 3}); + this.__users.setSelection([lUser]); + + var helloWorld = new qx.ui.form.Button("Hello World"); + core.add(helloWorld, {row: 3, column: 0}); + helloWorld.addListener("execute", function() { + this.__call("HelloWorld");}, this); + var helloUser = new qx.ui.form.Button("Hello User"); + core.add(helloUser, {row: 3, column: 1}); + helloUser.addListener("execute", function() { + this.__call("HelloUser");}, this); + var helloAdmin = new qx.ui.form.Button("Hello Admin"); + core.add(helloAdmin, {row: 3, column: 2}); + helloAdmin.addListener("execute", function() { + this.__call("HelloAdmin");}, this); + + core.add( new qx.ui.basic.Label("Result:"), {row: 4, column: 0}); + this.__result = new qx.ui.basic.Label(""); + core.add(this.__result, {row: 4, column: 1, colSpan: 3}); + + core.add( new qx.ui.basic.Label("Error:"), {row: 5, column: 0}); + this.__error = new qx.ui.basic.Label(""); + this.__error.setRich(true); + core.add(this.__error, {row: 5, column: 1, colSpan: 4}); + + this.__rpc = new qx.io.remote.Rpc("http://localhost:8080/rpc", "com.pengutronix.jdb.Hello|/"); + this.__rpc.setUseBasicHttpAuth(true); + }, + __call: function(func) { + var radio = this.__users.getSelection()[0]; + this.__rpc.setUsername(radio.user); + this.__rpc.setPassword(radio.passwd); + this.__rpc.setUrl(radio.url); + this.__rpc.callAsync(qx.lang.Function.bind(this.__callback, this), + "com.pengutronix.jdb.Hello." + func); + }, + __callback: function(result, error) { + if (error != null) { + this.__result.setValue(""); + this.__error.setValue(error); + } + else { + this.__result.setValue(result); + this.__error.setValue(""); + } + } +} +}); diff --git a/web-gui/login/source/class/login/test/DemoTest.js b/web-gui/login/source/class/login/test/DemoTest.js new file mode 100644 index 0000000..3edeff0 --- /dev/null +++ b/web-gui/login/source/class/login/test/DemoTest.js @@ -0,0 +1,55 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +/** + * This class demonstrates how to define unit tests for your application. + * + * Execute generate.py test to generate a testrunner application + * and open it from test/index.html + * + * The methods that contain the tests are instance methods with a + * test 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 + * test folder. + */ +qx.Class.define("login.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/login/source/class/login/theme/Appearance.js b/web-gui/login/source/class/login/theme/Appearance.js new file mode 100644 index 0000000..4d4f9bf --- /dev/null +++ b/web-gui/login/source/class/login/theme/Appearance.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("login.theme.Appearance", +{ + extend : qx.theme.modern.Appearance, + + appearances : + { + } +}); \ No newline at end of file diff --git a/web-gui/login/source/class/login/theme/Color.js b/web-gui/login/source/class/login/theme/Color.js new file mode 100644 index 0000000..916c1d5 --- /dev/null +++ b/web-gui/login/source/class/login/theme/Color.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("login.theme.Color", +{ + extend : qx.theme.modern.Color, + + colors : + { + } +}); \ No newline at end of file diff --git a/web-gui/login/source/class/login/theme/Decoration.js b/web-gui/login/source/class/login/theme/Decoration.js new file mode 100644 index 0000000..f55b36e --- /dev/null +++ b/web-gui/login/source/class/login/theme/Decoration.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("login.theme.Decoration", +{ + extend : qx.theme.modern.Decoration, + + decorations : + { + } +}); \ No newline at end of file diff --git a/web-gui/login/source/class/login/theme/Font.js b/web-gui/login/source/class/login/theme/Font.js new file mode 100644 index 0000000..5768e84 --- /dev/null +++ b/web-gui/login/source/class/login/theme/Font.js @@ -0,0 +1,18 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("login.theme.Font", +{ + extend : qx.theme.modern.Font, + + fonts : + { + } +}); \ No newline at end of file diff --git a/web-gui/login/source/class/login/theme/Theme.js b/web-gui/login/source/class/login/theme/Theme.js new file mode 100644 index 0000000..6b5439f --- /dev/null +++ b/web-gui/login/source/class/login/theme/Theme.js @@ -0,0 +1,21 @@ +/* ************************************************************************ + + Copyright: + + License: + + Authors: + +************************************************************************ */ + +qx.Theme.define("login.theme.Theme", +{ + meta : + { + color : login.theme.Color, + decoration : login.theme.Decoration, + font : login.theme.Font, + icon : qx.theme.icon.Tango, + appearance : login.theme.Appearance + } +}); \ No newline at end of file diff --git a/web-gui/login/source/index.html b/web-gui/login/source/index.html new file mode 100644 index 0000000..5a7c664 --- /dev/null +++ b/web-gui/login/source/index.html @@ -0,0 +1,9 @@ + + + + + login + + + + diff --git a/web-gui/login/source/resource/login/back.png b/web-gui/login/source/resource/login/back.png new file mode 100644 index 0000000..fd06541 Binary files /dev/null and b/web-gui/login/source/resource/login/back.png differ diff --git a/web-gui/login/source/script/login.js b/web-gui/login/source/script/login.js new file mode 100644 index 0000000..999122f --- /dev/null +++ b/web-gui/login/source/script/login.js @@ -0,0 +1,20 @@ +/* + * 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); +} diff --git a/web-gui/login/source/translation/readme.txt b/web-gui/login/source/translation/readme.txt new file mode 100644 index 0000000..66975e6 --- /dev/null +++ b/web-gui/login/source/translation/readme.txt @@ -0,0 +1,3 @@ +This directory will contain translation (.po) files once you run the +'translation' job in your project. + -- cgit v1.2.3