From e156872419a6979ceaee6cf97c5b900ef167292a Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Wed, 26 Oct 2011 08:11:35 +0000 Subject: Use Page Speed to minify Web resources at build time, and a few more improvements to the offline support. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1189069 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/.gitignore | 3 + sca-cpp/trunk/configure.ac | 39 +++ sca-cpp/trunk/macos/macos-install | 16 +- sca-cpp/trunk/modules/edit/Makefile.am | 14 + .../modules/edit/htdocs/app/cache-manifest.cmf | 2 +- sca-cpp/trunk/modules/edit/htdocs/app/index.html | 195 +++++++---- .../trunk/modules/edit/htdocs/cache-manifest.cmf | 2 +- sca-cpp/trunk/modules/edit/htdocs/graph/index.html | 2 +- sca-cpp/trunk/modules/edit/htdocs/index.html | 10 +- .../trunk/modules/edit/htdocs/notauth/index.html | 4 +- .../trunk/modules/edit/htdocs/notfound/index.html | 4 +- .../trunk/modules/edit/htdocs/notyet/index.html | 4 +- sca-cpp/trunk/modules/edit/htdocs/oops/index.html | 4 +- sca-cpp/trunk/modules/edit/htdocs/page/index.html | 4 +- sca-cpp/trunk/modules/http/Makefile.am | 16 +- sca-cpp/trunk/modules/http/httpd-conf | 2 +- sca-cpp/trunk/modules/http/minify-css | 34 ++ sca-cpp/trunk/modules/http/minify-html | 34 ++ sca-cpp/trunk/modules/http/minify-js | 34 ++ sca-cpp/trunk/modules/js/Makefile.am | 10 +- sca-cpp/trunk/modules/js/htdocs/all-min.js | 355 --------------------- sca-cpp/trunk/modules/js/htdocs/ui-min.css | 89 ------ sca-cpp/trunk/ubuntu/ubuntu-install | 16 +- sca-cpp/trunk/ubuntu/ubuntu-install-all | 16 +- 24 files changed, 369 insertions(+), 540 deletions(-) create mode 100755 sca-cpp/trunk/modules/http/minify-css create mode 100755 sca-cpp/trunk/modules/http/minify-html create mode 100755 sca-cpp/trunk/modules/http/minify-js delete mode 100644 sca-cpp/trunk/modules/js/htdocs/all-min.js delete mode 100644 sca-cpp/trunk/modules/js/htdocs/ui-min.css (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/.gitignore b/sca-cpp/trunk/.gitignore index 93663ee63c..0a161b3717 100644 --- a/sca-cpp/trunk/.gitignore +++ b/sca-cpp/trunk/.gitignore @@ -58,6 +58,9 @@ config.sub config.status *config.js all.js +*-min.html +*-min.js +*-min.css intro*.png intro*.b64 depcomp diff --git a/sca-cpp/trunk/configure.ac b/sca-cpp/trunk/configure.ac index 116a71df4b..3413bc2678 100644 --- a/sca-cpp/trunk/configure.ac +++ b/sca-cpp/trunk/configure.ac @@ -405,6 +405,45 @@ else AM_CONDITIONAL([WANT_PYTHON], false) fi +# Configure path to Page Speed. +AC_MSG_CHECKING([for pagespeed]) +AC_ARG_WITH([pagespeed], [AC_HELP_STRING([--with-pagespeed=PATH], [path to installed Page Speed [default=/usr/bin]])], [ + PAGESPEED_PREFIX="${withval}" + AC_MSG_RESULT("${withval}") +], [ + PAGESPEED_PREFIX="/usr/bin" + AC_MSG_RESULT(/usr/bin) +]) +AC_SUBST(PAGESPEED_PREFIX) + +# Enable Page Speed optimizations. +AC_MSG_CHECKING([whether to run Page Speed optimizations]) +AC_ARG_ENABLE(pagespeed, [AS_HELP_STRING([--enable-pagespeed], [run Page Speed optimizations [default=no]])], +[ case "${enableval}" in + no) + AC_MSG_RESULT(no) + ;; + *) + AC_MSG_RESULT(yes) + want_pagespeed=true + ;; + esac ], +[ AC_MSG_RESULT(no)]) +if test "${want_pagespeed}" = "true"; then + AC_PATH_PROG(MINIFY_HTML, minify_html_bin, , ${PAGESPEED_PREFIX}) + if test "${MINIFY_HTML}" = ""; then + AC_MSG_ERROR([could not find Page Speed minify_html_bin]) + fi + AC_PATH_PROG(MINIFY_JS, jsmin_bin, , ${PAGESPEED_PREFIX}) + if test "${MINIFY_JS}" = ""; then + AC_MSG_ERROR([could not find Page Speed jsmin_bin]) + fi + AM_CONDITIONAL([WANT_PAGESPEED], true) + AC_DEFINE([WANT_PAGESPEED], 1, [run Page Speed optimizations]) +else + AM_CONDITIONAL([WANT_PAGESPEED], false) +fi + # Enable OpenCL support. AC_MSG_CHECKING([whether to enable OpenCL support]) AC_ARG_ENABLE(opencl, [AS_HELP_STRING([--enable-opencl], [enable OpenCL support [default=no]])], diff --git a/sca-cpp/trunk/macos/macos-install b/sca-cpp/trunk/macos/macos-install index 4c0f868b29..6072997c79 100755 --- a/sca-cpp/trunk/macos/macos-install +++ b/sca-cpp/trunk/macos/macos-install @@ -285,6 +285,16 @@ if [ "$?" != "0" ]; then fi cd $build +# Build Google Page Speed +curl -OL https://dl-ssl.google.com/page-speed/sdk/current/page-speed-sdk.zip +unzip page-speed-sdk.zip +cd page-speed-1.9 +make builddir=$build/page-speed-1.9-bin +if [ "$?" != "0" ]; then + exit $? +fi +cd $build + # Build Apache Nuvem git clone git://git.apache.org/nuvem.git if [ "$?" != "0" ]; then @@ -296,7 +306,7 @@ cd $build git clone git://git.apache.org/tuscany-sca-cpp.git cd tuscany-sca-cpp ./bootstrap -./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.19.5-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.10-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin +./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.19.5-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.10-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin make make install if [ "$?" != "0" ]; then @@ -305,8 +315,8 @@ fi cd $build # Create src archive -tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.1 modsecurity-crs_2.2.1.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.19.5 curl-7.19.5-bin curl-7.19.5.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.10 httpd-2.3.10-alpha.tar.gz httpd-2.3.10-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.1 modsecurity-crs_2.2.1.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin # Create bin archive -tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.19.5-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.10-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.19.5-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.10-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pcre-8.12-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin diff --git a/sca-cpp/trunk/modules/edit/Makefile.am b/sca-cpp/trunk/modules/edit/Makefile.am index 55eca3ed7e..241d06d3f0 100644 --- a/sca-cpp/trunk/modules/edit/Makefile.am +++ b/sca-cpp/trunk/modules/edit/Makefile.am @@ -21,6 +21,20 @@ moddir = $(prefix)/modules/edit dist_mod_SCRIPTS = start stop ssl-start mkapplinks nobase_dist_mod_DATA = edit.composite *.py htdocs/*.html htdocs/*.js htdocs/*.cmf htdocs/*.ico htdocs/home/*.png htdocs/home/*.b64 htdocs/*.txt htdocs/account/*.html htdocs/create/*.html htdocs/clone/*.html htdocs/app/*.html htdocs/store/*.html htdocs/stats/*.html htdocs/graph/*.html htdocs/home/*.html htdocs/page/*.html htdocs/login/*.html htdocs/logout/*.html htdocs/notauth/*.html htdocs/notfound/*.html htdocs/oops/*.html htdocs/public/*.html htdocs/public/*.png htdocs/public/*.b64 palettes/*/palette.composite apps/*/app.composite apps/*/app.stats apps/*/htdocs/app.html dashboards/*/user.apps store/*/store.apps + EXTRA_DIST = edit.composite *.py htdocs/*.html htdocs/*.js htdocs/*.cmf htdocs/*.ico htdocs/home/*.png htdocs/home/*.b64 htdocs/*.txt htdocs/account/*.html htdocs/create/*.html htdocs/clone/*.html htdocs/app/*.html htdocs/store/*.html htdocs/stats/*.html htdocs/graph/*.html htdocs/home/*.html htdocs/page/*.html htdocs/login/*.html htdocs/logout/*.html htdocs/notauth/*.html htdocs/notfound/*.html htdocs/oops/*.html htdocs/public/*.html htdocs/public/*.png htdocs/public/*.b64 palettes/*/palette.composite apps/*/app.composite apps/*/app.stats apps/*/htdocs/app.html dashboards/*/user.apps store/*/store.apps +BUILT_SOURCES = minify_html.stamp minify_js.stamp +minify_html.stamp: htdocs/*.html htdocs/*/*.html + find htdocs -name "*-min.html" -exec rm {} \; + find htdocs -name "*.html" -exec ../http/minify-html {} \; + touch minify_html.stamp + +minify_js.stamp: htdocs/*.js + find htdocs -name "*-min.js" -exec rm {} \; + find htdocs -name "*.js" -exec ../http/minify-js {} \; + touch minify_js.stamp + +CLEANFILES = *.stamp + endif diff --git a/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf b/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf index 4f3358edef..0be3e662d7 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf +++ b/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf @@ -9,7 +9,7 @@ CACHE MANIFEST /notfound/ /notyet/ /oops/ -/public/iframe.html +/public/iframe-min.html /public/img.png /public/touchicon.png diff --git a/sca-cpp/trunk/modules/edit/htdocs/app/index.html b/sca-cpp/trunk/modules/edit/htdocs/app/index.html index cb89cd0ced..9309c7cebe 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/app/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/app/index.html @@ -77,7 +77,7 @@ appcache.get = function(uri) {
@@ -96,8 +96,9 @@ document.title = location.hostname.split('.')[0]; var contentdiv = $('content'); /** - * Start, stop, timer, animation and location components. + * Initialize the app HTTP clients. */ +var pagecomp = sca.httpclient('page', ''); var startcomp = sca.httpclient('start', '/start'); var stopcomp = sca.httpclient('stop', '/stop'); var timercomp = sca.httpclient('timer', '/timer'); @@ -109,10 +110,9 @@ var locationcomp = sca.httpclient('location', '/location'); */ var appresources = [ ['/all-min.js'], - ['/app.html'], ['/ui-min.css'], - ['/footconfig.js'], - ['/headconfig.js'], + ['/footconfig-min.js'], + ['/headconfig-min.js'], ]; /** @@ -266,12 +266,12 @@ function setwidgetvalue(e, dv) { // Define the stylesheet if (s != '') { - var esheet = contentdiv.getElementById('style_' + e.id); + var esheet = ui.elementByID(contentdiv, 'style_' + e.id); if (isNil(esheet)) { var nesheet = document.createElement('style'); nesheet.id = 'style_' + e.id; nesheet.type = 'text/css'; - contentdiv.getElementsByTagName('head')[0].appendChild(nesheet); + document.head.appendChild(nesheet); nesheet.innerHTML = s; } else { esheet.innerHTML = s; @@ -525,18 +525,6 @@ function initwidget(e) { return e; } -/** - * Get document from a component. - */ -function getdoc(comp, name, uri) { - try { - return comp.getnocache(uri); - } catch(e) { - log('exception on get(' + name + ', ' + uri + ')', e); - return null; - } -} - /** * Get app data from the main app page component. */ @@ -567,19 +555,48 @@ function getpagedata() { bindwidgethandler(e); } - // Get the component app data - var doc = getdoc(startcomp, 'start', location.search); - // Setup the widgets map(setupwidget, filter(function(e) { return !isNil(e.id); }, nodeList(ui.elementByID(contentdiv, 'page').childNodes))); - // Display data on the page - displaypage(doc); + // Get the component app data + startcomp.get(location.search, function(doc, e) { + if (isNil(doc)) { + log('exception on get(start, ' + location.search + ')', e); + return false; + } + + // Display data on the page + displaypage(doc); + }); // Get and eval the optional timer, animation and location watch setup scripts - evalcompinit(getdoc(timercomp, 'timer', 'setup')); - evalcompinit(getdoc(animationcomp, 'animation', 'setup')); - evalcompinit(getdoc(locationcomp, 'location', 'setup')); + timercomp.get('setup', function(doc, e) { + if (isNil(doc)) { + log('exception on get(timer, setup)', e); + return false; + } + + // Evaluate the component init expression + return evalcompinit(doc); + }); + animationcomp.get('setup', function(doc, e) { + if (isNil(doc)) { + log('exception on get(animation, setup)', e); + return false; + } + + // Evaluate the component init expression + return evalcompinit(doc); + }); + locationcomp.get('setup', function(doc, e) { + if (isNil(doc)) { + log('exception on get(location, setup)', e); + return false; + } + + // Evaluate the component init expression + return evalcompinit(doc); + }); return true; @@ -619,7 +636,16 @@ function compquery() { */ function buttonClickHandler(id) { try { - return updatepage(docdata(getdoc(sca.component(id), 'button', compquery()))); + var uri = compquery(); + return sca.component(id).get(uri, function(doc, e) { + if (isNil(doc)) { + log('exception on get(button, ' + uri + ')', e); + return false; + } + + // Inject data into the page + updatepage(docdata(doc)); + }); } catch(e) { log('exception in buttonClickHandler()', e); return true; @@ -631,7 +657,16 @@ function buttonClickHandler(id) { */ function intervalHandler() { try { - return updatepage(docdata(getdoc(timercomp, 'timer', compquery()))); + var uri = compquery(); + return timercomp.get(uri, function(doc, e) { + if (isNil(doc)) { + log('exception on get(timer, ' + uri + ')', e); + return false; + } + + // Inject data into the page + updatepage(docdata(doc)); + }); } catch(e) { log('exception in intervalHandler()', e); return true; @@ -655,50 +690,64 @@ function setupIntervalHandler(msec) { * Handle an animation event. */ var animationData = null; +var gettingAnimationData = false; var currentAnimationData = null; var animationLoop = 0; var currentAnimationLoop = 0; function animationHandler() { try { - // Get animation data if necessary - if (isNil(animationData)) { - animationData = docdata(getdoc(animationcomp, 'animation', compquery())); - if (isNil(animationData)) { - // Retry later - return true; - } - currentAnimationData = animationData; - currentAnimationLoop = animationLoop; - } + function applyAnimation() { + // Update page with current animation data + updatepage(car(currentAnimationData)); + + // End of animation? + if (isNil(cdr(currentAnimationData))) { + if (currentAnimationLoop == -1) { + // Repeat current animation forever + currentAnimationData = animationData; + return true; + } - // Update page with animation data - updatepage(car(currentAnimationData)); + currentAnimationLoop = currentAnimationLoop - 1; + if (currentAnimationLoop <= 0) { + // Get next animation data + currentAnimationData = null; + animationData = null; + return true; + } - // End of animation? - if (isNil(cdr(currentAnimationData))) { - if (currentAnimationLoop == -1) { - // Repeat current animation forever + // Repeat animation currentAnimationData = animationData; return true; } - currentAnimationLoop = currentAnimationLoop - 1; - if (currentAnimationLoop <= 0) { - // Get next animation data - currentAnimationData = null; - animationData = null; + // Move to the next animation frame + currentAnimationData = cdr(currentAnimationData); + return true; + } + + // Get new animation data if necessary + if (isNil(animationData)) { + if (gettingAnimationData) return true; - } + var uri = compquery(); + return animationcomp.get(uri, function(doc, e) { + if (isNil(doc)) { + log('exception on get(animation, ' + uri + ')', e); + return false; + } - // Repeat animation - currentAnimationData = animationData; - return true; + // Apply the new animation + currentAnimationData = docdata(doc); + currentAnimationLoop = animationLoop; + gettingAnimationData = false; + applyAnimation(); + }); } - // Move to the next animation frame - currentAnimationData = cdr(currentAnimationData); - return true; + // Apply the current animation + return applyAnimation(); } catch(e) { log('exception in animationHandler()', e); @@ -729,9 +778,18 @@ var geoposition = null; function locationHandler(pos) { try { geoposition = pos; - return updatepage(docdata(getdoc(locationcomp, 'location', compquery()))); + var uri = compquery(); + return locationcomp.get(uri, function(doc, e) { + if (isNil(doc)) { + log('exception on get(location, ' + uri + ')', e); + return false; + } + + // Inject data into the page + updatepage(docdata(doc)); + }); } catch(e) { - locationErrorHandler(e); + return locationErrorHandler(e); } } @@ -758,6 +816,7 @@ function setupLocationHandler() { } catch(e) { log('exception in installLocationHandler()', e); } + return true; } installLocationHandler(); @@ -766,11 +825,19 @@ function setupLocationHandler() { } // Load the app page -var appcontent = appcache.get('/app.html'); -contentdiv.innerHTML = appcontent; +pagecomp.get('app.html', function(doc, e) { + log('page get'); + if (isNil(doc)) { + log('exception getting app page', e); + return false; + } + + // Set the app HTML page into the content div + contentdiv.innerHTML = doc; -// Merge in the app data -getpagedata(); + // Merge in the app data + getpagedata(); +}); /** * Document load post processing. @@ -791,7 +858,7 @@ function onload() {
diff --git a/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf b/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf index 4f3358edef..0be3e662d7 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf +++ b/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf @@ -9,7 +9,7 @@ CACHE MANIFEST /notfound/ /notyet/ /oops/ -/public/iframe.html +/public/iframe-min.html /public/img.png /public/touchicon.png diff --git a/sca-cpp/trunk/modules/edit/htdocs/graph/index.html b/sca-cpp/trunk/modules/edit/htdocs/graph/index.html index 730506c9a1..3cc735971c 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/graph/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/graph/index.html @@ -2092,7 +2092,7 @@ function showdata(gcomp) { // Get the component result data var comp = sca.component(gcomp.id, appname); - comp.getnocache('', function(doc) { + comp.get('', function(doc) { function displaydata(t, w) { pdiv.style.width = w; pdiv.innerHTML = t; diff --git a/sca-cpp/trunk/modules/edit/htdocs/index.html b/sca-cpp/trunk/modules/edit/htdocs/index.html index bba70baa61..869ae30628 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/index.html @@ -77,7 +77,7 @@ appcache.get = function(uri) {
@@ -117,15 +117,15 @@ var appresources = [ ['/account/', 'flip'], ['/clone/', 'flip'], ['/create/', 'flip'], - ['/footconfig.js'], + ['/footconfig-min.js'], ['/graph/', 'flip'], - ['/headconfig.js'], + ['/headconfig-min.js'], ['/home/', 'right'], ['/home/home.b64'], ['/page/', 'flip'], ['/public/app.b64'], ['/public/grid72.b64'], - ['/public/iframe.html'], + ['/public/iframe-min.html'], ['/public/img.b64'], ['/public/user.b64'], ['/stats/', 'flip'], @@ -427,7 +427,7 @@ function onload() {
diff --git a/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html b/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html index 4b6eb7e3f0..4827238435 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html @@ -76,7 +76,7 @@ appcache.get = function(uri) {
@@ -133,7 +133,7 @@ function onload() {
diff --git a/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html b/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html index 4d11a1a7dc..743ae59a84 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html @@ -76,7 +76,7 @@ appcache.get = function(uri) {
@@ -134,7 +134,7 @@ function onload() {
diff --git a/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html b/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html index 2f9f7751d1..fba173f0d2 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html @@ -76,7 +76,7 @@ appcache.get = function(uri) {
@@ -134,7 +134,7 @@ function onload() {
diff --git a/sca-cpp/trunk/modules/edit/htdocs/oops/index.html b/sca-cpp/trunk/modules/edit/htdocs/oops/index.html index 70fe3994a2..1e9ea06687 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/oops/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/oops/index.html @@ -76,7 +76,7 @@ appcache.get = function(uri) {
@@ -133,7 +133,7 @@ function onload() {
diff --git a/sca-cpp/trunk/modules/edit/htdocs/page/index.html b/sca-cpp/trunk/modules/edit/htdocs/page/index.html index dd33f34ac2..1b4c455ff7 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/page/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/page/index.html @@ -75,7 +75,7 @@ link text -frame ... +frame ... @@ -555,7 +555,7 @@ page.settext = function(e, t) { return t; } if (e.className == 'iframe') { - car(childElements(e)).href = isNil(c)? '/public/iframe.html' : car(c); + car(childElements(e)).href = isNil(c)? '/public/iframe-min.html' : car(c); return t; } return ''; diff --git a/sca-cpp/trunk/modules/http/Makefile.am b/sca-cpp/trunk/modules/http/Makefile.am index 07a797926a..89b285ea35 100644 --- a/sca-cpp/trunk/modules/http/Makefile.am +++ b/sca-cpp/trunk/modules/http/Makefile.am @@ -20,7 +20,7 @@ INCLUDES = -I${HTTPD_INCLUDE} incl_HEADERS = *.hpp incldir = $(prefix)/include/modules/http -dist_mod_SCRIPTS = httpd-conf httpd-addr httpd-start httpd-stop httpd-restart ssl-ca-conf ssl-cert-conf ssl-cert-find httpd-ssl-conf basic-auth-conf cert-auth-conf form-auth-conf open-auth-conf passwd-auth-conf group-auth-conf proxy-conf proxy-ssl-conf proxy-member-conf proxy-ssl-member-conf vhost-conf vhost-ssl-conf tunnel-ssl-conf httpd-worker-conf httpd-event-conf +dist_mod_SCRIPTS = httpd-conf httpd-addr httpd-start httpd-stop httpd-restart ssl-ca-conf ssl-cert-conf ssl-cert-find httpd-ssl-conf basic-auth-conf cert-auth-conf form-auth-conf open-auth-conf passwd-auth-conf group-auth-conf proxy-conf proxy-ssl-conf proxy-member-conf proxy-ssl-member-conf vhost-conf vhost-ssl-conf tunnel-ssl-conf httpd-worker-conf httpd-event-conf minify-html minify-js minify-css moddir = $(prefix)/modules/http curl_test_SOURCES = curl-test.cpp @@ -45,7 +45,7 @@ libmod_tuscany_openauth_la_LDFLAGS = -lxml2 -lcurl -lmozjs libmod_tuscany_openauth${libsuffix}: ln -s .libs/libmod_tuscany_openauth${libsuffix} -mod_DATA = httpd.prefix httpd-apachectl.prefix httpd-modules.prefix curl.prefix +mod_DATA = httpd.prefix httpd-apachectl.prefix httpd-modules.prefix curl.prefix pagespeed.prefix nobase_dist_mod_DATA = conf/* EXTRA_DIST = htdocs/index.html htdocs/login/index.html htdocs/logout/index.html @@ -59,6 +59,18 @@ httpd-modules.prefix: $(top_builddir)/config.status curl.prefix: $(top_builddir)/config.status echo ${CURL_PREFIX} >curl.prefix +if WANT_PAGESPEED + +pagespeed.prefix: $(top_builddir)/config.status + echo ${PAGESPEED_PREFIX} >pagespeed.prefix + +else + +pagespeed.prefix: $(top_builddir)/config.status + echo "" >pagespeed.prefix + +endif + if WANT_MODSECURITY modsecurity.prefix: $(top_builddir)/config.status diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index d672b2dce5..6c80e1a28f 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -98,7 +98,7 @@ Header set Expires "Tue, 01 Jan 1980 00:00:00 GMT" env=must-revalidate # Set default document root DocumentRoot $htdocs -DirectoryIndex index.html +DirectoryIndex index-min.html index.html # Protect server files diff --git a/sca-cpp/trunk/modules/http/minify-css b/sca-cpp/trunk/modules/http/minify-css new file mode 100755 index 0000000000..e337f173c8 --- /dev/null +++ b/sca-cpp/trunk/modules/http/minify-css @@ -0,0 +1,34 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Minify a CSS file +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +pagespeed_prefix=`cat $here/pagespeed.prefix` + +if [ "${pagespeed_prefix}" = "" ]; then + minify_css="cat" +else + minify_css="${pagespeed_prefix}/jsmin_bin" +fi + +css="$1" +mincss="${css%.*}-min.css" + +${minify_css} <${css} >${mincss} + diff --git a/sca-cpp/trunk/modules/http/minify-html b/sca-cpp/trunk/modules/http/minify-html new file mode 100755 index 0000000000..a1946d1190 --- /dev/null +++ b/sca-cpp/trunk/modules/http/minify-html @@ -0,0 +1,34 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Minify an HTML file +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +pagespeed_prefix=`cat $here/pagespeed.prefix` + +if [ "${pagespeed_prefix}" = "" ]; then + minify_html="cp" +else + minify_html="${pagespeed_prefix}/minify_html_bin" +fi + +html="$1" +minhtml="${html%.*}-min.html" + +${minify_html} ${html} ${minhtml} + diff --git a/sca-cpp/trunk/modules/http/minify-js b/sca-cpp/trunk/modules/http/minify-js new file mode 100755 index 0000000000..41fbe82224 --- /dev/null +++ b/sca-cpp/trunk/modules/http/minify-js @@ -0,0 +1,34 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Minify a JS file +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` +pagespeed_prefix=`cat $here/pagespeed.prefix` + +if [ "${pagespeed_prefix}" = "" ]; then + minify_js="cat" +else + minify_js="${pagespeed_prefix}/jsmin_bin" +fi + +js="$1" +minjs="${js%.*}-min.js" + +${minify_js} <${js} >${minjs} + diff --git a/sca-cpp/trunk/modules/js/Makefile.am b/sca-cpp/trunk/modules/js/Makefile.am index b2933e89b9..1ef3fbd3ea 100644 --- a/sca-cpp/trunk/modules/js/Makefile.am +++ b/sca-cpp/trunk/modules/js/Makefile.am @@ -18,11 +18,17 @@ incl_HEADERS = *.hpp incldir = $(prefix)/include/modules/js -BUILT_SOURCES = htdocs/all.js +BUILT_SOURCES = htdocs/all.js htdocs/all-min.js htdocs/ui-min.css htdocs/all.js: htdocs/util.js htdocs/elemutil.js htdocs/xmlutil.js htdocs/atomutil.js htdocs/jsonutil.js htdocs/scdl.js htdocs/ui.js htdocs/component.js cat htdocs/util.js htdocs/elemutil.js htdocs/xmlutil.js htdocs/atomutil.js htdocs/jsonutil.js htdocs/scdl.js htdocs/ui.js htdocs/component.js >htdocs/all.js -CLEANFILES = htdocs/all.js +htdocs/all-min.js: htdocs/all.js + ../http/minify-js htdocs/all.js + +htdocs/ui-min.css: htdocs/ui.css + ../http/minify-css htdocs/ui.css + +CLEANFILES = htdocs/all.js htdocs/all-min.js moddir = $(prefix)/modules/js nobase_dist_mod_DATA = htdocs/*.js htdocs/*.css diff --git a/sca-cpp/trunk/modules/js/htdocs/all-min.js b/sca-cpp/trunk/modules/js/htdocs/all-min.js deleted file mode 100644 index b214be0ad8..0000000000 --- a/sca-cpp/trunk/modules/js/htdocs/all-min.js +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -function cons(car,cdr){var a=new Array();a.push(car);return a.concat(cdr);} -function car(l){return l[0];} -function first(l){return l[0];} -function cdr(l){return l.slice(1);} -function rest(l){return l.slice(1);} -function cadr(l){return l[1];} -function cddr(l){return l.slice(2);} -function caddr(l){return l[2];} -function cdddr(l){return l.slice(3);} -function cadddr(l){return l[3];} -function append(a,b){return a.concat(b);} -function reverse(l){return l.slice(0).reverse();} -function range(a,b){var l=new Array();for(var x=a;x2;} -function format(){var i=0;var s='';for(a in arguments){s=i==0?arguments[a]:s.replace('{'+a+'}',arguments[a]);i++;} -return s;} -function setcar(l,v){l[0]=v;return l;} -function setcadr(l,v){l[1]=v;return l;} -function setcaddr(l,v){l[2]=v;return l;} -function setappend(a,b){if(isNil(b)) -return a;a.push(car(b));return setappend(a,cdr(b));} -function setcdr(a,b){a.length=1;return setappend(a,b);} -function setlist(a,b){if(b==a) -return b;a.length=0;return setappend(a,b);} -var element="'element" -var attribute="'attribute" -var atsign="'@" -function isElement(v){return(!(!isList(v)||isNil(v)||car(v)!=element));} -function isAttribute(v){return(!(!isList(v)||isNil(v)||car(v)!=attribute));} -attributeName=cadr;attributeValue=caddr;elementName=cadr;function elementHasChildren(l){return!isNil(cddr(l));} -elementChildren=cddr;function elementHasValue(l){var r=reverse(l);if(isSymbol(car(r))) -return false;return(!(isList(car(r))&&!isNil(car(r))&&isSymbol(car(car(r)))))} -function elementValue(l){return car(reverse(l));} -function elementToValueIsList(v){if(!isList(v)) -return false;return isNil(v)||!isSymbol(car(v));} -function elementToValue(t){if(isTaggedList(t,attribute)) -return mklist(atsign+attributeName(t).substring(1),attributeValue(t));if(isTaggedList(t,element)){if(elementHasValue(t)){if(!elementToValueIsList(elementValue(t))) -return mklist(elementName(t),elementValue(t));return cons(elementName(t),mklist(elementsToValues(elementValue(t))));} -return cons(elementName(t),elementsToValues(elementChildren(t)));} -if(!isList(t)) -return t;return elementsToValues(t);} -function elementToValueIsSymbol(v){return(!(!isList(v))||isNil(v)||!isSymbol(car(v)));} -function elementToValueGroupValues(v,l){if(isNil(l)||!elementToValueIsSymbol(v)||!elementToValueIsSymbol(car(l))) -return cons(v,l);if(car(car(l))!=car(v)) -return cons(v,l);if(!elementToValueIsList(cadr(car(l)))){var g=mklist(car(v),mklist(cdr(v),cdr(car(l))));return elementToValueGroupValues(g,cdr(l));} -var g=mklist(car(v),cons(cdr(v),cadr(car(l))));return elementToValueGroupValues(g,cdr(l));} -function elementsToValues(e){if(isNil(e)) -return e;return elementToValueGroupValues(elementToValue(car(e)),elementsToValues(cdr(e)));} -function valueToElement(t){if(isList(t)&&!isNil(t)&&isSymbol(car(t))){var n=car(t);var v=isNil(cdr(t))?mklist():cadr(t);if(!isList(v)){if(n.substring(0,2)==atsign) -return mklist(attribute,"'"+n.substring(2),v);return mklist(element,n,v);} -if(isNil(v)||!isSymbol(car(v))) -return cons(element,cons(n,mklist(valuesToElements(v))));return cons(element,cons(n,valuesToElements(cdr(t))));} -if(!isList(t)) -return t;return valuesToElements(t);} -function valuesToElements(l){if(isNil(l)) -return l;return cons(valueToElement(car(l)),valuesToElements(cdr(l)));} -function selector(s){function evalSelect(s,v){if(isNil(s)) -return true;if(isNil(v)) -return false;if(car(s)!=car(v)) -return false;return evalSelect(cdr(s),cdr(v));} -return function(v){return evalSelect(s,v);};} -function namedAttribute(name,l){return memo(l,name,function(){var f=filter(function(v){return isAttribute(v)&&attributeName(v)==name;},l);if(isNil(f)) -return null;return car(f);});} -function namedAttributeValue(name,l){var a=namedAttribute(name,l);if(a==null) -return null -return attributeValue(a);} -function namedElementChildren(name,l){return memo(l,name,function(){return filter(function(v){return isElement(v)&&elementName(v)==name;},l);});} -function namedElementChild(name,l){var f=namedElementChildren(name,l);if(isNil(f)) -return null;return car(f);} -function setElement(l,e){setlist(l,e);l.memo={};} -function nodeList(n){var l=new Array();if(isNil(n)) -return l;for(var i=0;i\n'+writeXMLDocument(doc)+'\n');} -var atom={};atom.entryElementValues=function(e){var lt=filter(selector(mklist(element,"'title")),e);var t=isNil(lt)?'':elementValue(car(lt));var li=filter(selector(mklist(element,"'id")),e);var i=isNil(li)?'':elementValue(car(li));var lc=filter(selector(mklist(element,"'content")),e);return append(mklist(element,"'entry",mklist(element,"'title",t),mklist(element,"'id",i)),isNil(lc)?mklist():mklist(mklist(element,"'content",elementValue(car(lc)))))};atom.entriesElementValues=function(e){if(isNil(e)) -return e;return cons(atom.entryElementValues(car(e)),atom.entriesElementValues(cdr(e)));};atom.isATOMEntry=function(l){if(!isXML(l)) -return false;return car(l).match('=128) -parts[i]=json.escapeJSONChar(parts[i]);} -return"\""+parts.join("")+"\"";};json.toJSON=function(o){if(o==null) -return"null";if(o.constructor==String) -return json.escapeJSONString(o);if(o.constructor==Number) -return o.toString();if(o.constructor==Boolean) -return o.toString();if(o.constructor==Date) -return'{javaClass: "java.util.Date", time: '+o.valueOf()+'}';if(o.constructor==Array){var v=[];for(var i=0;i=0?u.substring(q+1):'';};ui.fragment=function(url){var u=''+url;var h=u.indexOf('#');return h>=0?u.substring(h+1):'';};ui.pathandparams=function(url){var u=''+url;var ds=u.indexOf('//');var u2=ds>0?u.substring(ds+2):u;var s=u2.indexOf('/');return s>0?u2.substring(s):'';};ui.queryParams=function(url){var qp=new Array();var qs=ui.query(url).split('&');for(var i=0;i0) -qp[qs[i].substring(0,e)]=unescape(qs[i].substring(e+1));} -return qp;};ui.fragmentParams=function(url){var qp=new Array();var qs=ui.fragment(url).split('&');for(var i=0;i0) -qp[qs[i].substring(0,e)]=unescape(qs[i].substring(e+1));} -return qp;};ui.b64img=function(b64){return'data:image/png;base64,'+b64;};ui.declareCSS=function(s){var e=document.createElement('style');e.type='text/css';e.textContent=s;return e;};ui.declareScript=function(s){var e=document.createElement('script');e.type='text/javascript';e.text=s;return e;};ui.innerScripts=function(e){return map(function(s){return s.text;},nodeList(e.getElementsByTagName('script')));};ui.evalScript=function(s){return eval('(function() {\n'+s+'\n})();');};ui.includeScript=function(s){log('include',s);return eval(s);};ui.mobiledetected=false;ui.mobile=false;ui.isMobile=function(){if(ui.mobiledetected) -return ui.mobile;var ua=navigator.userAgent;if(ua.match(/iPhone/i)||ua.match(/iPad/i)||ua.match(/Android/i)||ua.match(/Blackberry/i)||ua.match(/WebOs/i)) -ui.mobile=true;ui.mobiledetected=true;return ui.mobile;};ui.hometitle=function(host){if(!isNil(window.top.config.hometitle)) -return window.top.config.hometitle;var h=reverse(host.split('.'));var d=isNil(cdr(h))?car(h):cadr(h);return d.substr(0,1).toUpperCase()+d.substr(1);};ui.windowtitle=function(host){if(!isNil(window.top.config.windowtitle)) -return window.top.config.windowtitle;var h=reverse(host.split('.'));var d=isNil(cdr(h))?car(h):cadr(h);return d.substr(0,1).toUpperCase()+d.substr(1);};ui.numpos=function(p){return p==''?0:Number(p.substr(0,p.length-2));};ui.pixpos=function(p){return p+'px';};ui.onorientationchange=function(){window.location.reload();return true;} -ui.navigate=function(url,win){log('navigate',url,win);if(win=='_blank') -return window.top.open(url,win);if(win=='_self') -return window.top.open(url,win);if(win=='_reload'){window.top.location=url;return window.top.location.reload();} -if(win=='_view'){if(!window.top.onnavigate) -return window.top.open(url,'_self');return window.top.onnavigate(url);} -return window.top.open(url,win);} -ui.ahref=function(loc,target,html){if(target=='_blank') -return''+html+'';return''+html+'';};ui.menu=function(name,href,target,hilight){function Menu(){this.content=function(){if(hilight) -return ui.ahref(href,target,''+name+'');return ui.ahref(href,target,''+name+'');};} -return new Menu();};ui.menubar=function(left,right){var bar=''+''+'
';for(i in left) -bar=bar+'' -bar=bar+'
'+left[i].content()+'
';for(i in right) -bar=bar+'' -bar=bar+'
'+right[i].content()+'
';return bar;};ui.datatable=function(l){function indent(i){if(i==0) -return'';return'  '+indent(i-1);} -function rows(l,i){if(isNil(l)) -return'';var e=car(l);if(!isList(e)) -return rows(expandElementValues("'value",l),i);if(isList(car(e))) -return rows(expandElementValues("'value",l),i);if(elementHasValue(e)){var v=elementValue(e);if(!isList(v)){return''+indent(i)+elementName(e).slice(1)+''+''+(v!=null?v:'')+''+rows(cdr(l),i);} -return rows(expandElementValues(elementName(e),v),i)+rows(cdr(l),i);} -return''+indent(i)+elementName(e).slice(1)+''+''+''+rows(elementChildren(e),i+1)+rows(cdr(l),i);} -return''+rows(l,0)+'
';} -ui.datalist=function(l){function rows(l,i){if(isNil(l)) -return'';var e=car(l);if(!isList(e)) -return rows(expandElementValues("'value",l),i);if(isList(car(e))) -return rows(expandElementValues("'value",l),i);if(elementHasValue(e)){var v=elementValue(e);if(!isList(v)){return''+(v!=null?v:'')+''+rows(cdr(l),i);} -return rows(expandElementValues(elementName(e),v),i)+rows(cdr(l),i);} -return rows(elementChildren(e),i+1)+rows(cdr(l),i);} -return''+rows(l,0)+'
';} -ui.selectSuggestion=function(node,value){for(;;){node=node.parentNode;if(node.tagName.toLowerCase()=='div') -break;} -node.selectSuggestion(value);};ui.hilightSuggestion=function(node,over){if(over) -node.className='suggestHilighted';node.className='suggestItem';};ui.suggest=function(input,suggestFunction){input.suggest=suggestFunction;input.selectSuggestion=function(value){this.hideSuggestDiv();this.value=value;} -input.hideSuggestDiv=function(){if(this.suggestDiv!=null){this.suggestDiv.style.visibility='hidden';}} -input.showSuggestDiv=function(){if(this.suggestDiv==null){this.suggestDiv=document.createElement('div');this.suggestDiv.input=this;this.suggestDiv.className='suggest';input.parentNode.insertBefore(this.suggestDiv,input);this.suggestDiv.style.visibility='hidden';this.suggestDiv.style.zIndex='99';this.suggestDiv.selectSuggestion=function(value){this.input.selectSuggestion(value);}} -var values=this.suggest();var items='';for(var i=0;i'+values[i]+'';} -if(items.length!=0) -items+='';this.suggestDiv.innerHTML=items;if(items.length!=0){var node=input;var left=0;var top=0;for(;;){left+=node.offsetLeft;top+=node.offsetTop;node=node.offsetParent;if(node.tagName.toLowerCase()=='body') -break;} -this.suggestDiv.style.left=left;this.suggestDiv.style.top=top+input.offsetHeight;this.suggestDiv.style.visibility='visible';}else -this.suggestDiv.style.visibility='hidden';} -input.onkeydown=function(event){this.showSuggestDiv();};input.onkeyup=function(event){this.showSuggestDiv();};input.onmousedown=function(event){this.showSuggestDiv();};input.onblur=function(event){setTimeout(function(){input.hideSuggestDiv();},50);};};var JSONClient={};JSONClient.escapeJSONChar=function(c){if(c=="\""||c=="\\")return"\\"+c;if(c=="\b")return"\\b";if(c=="\f")return"\\f";if(c=="\n")return"\\n";if(c=="\r")return"\\r";if(c=="\t")return"\\t";var hex=c.charCodeAt(0).toString(16);if(hex.length==1)return"\\u000"+hex;if(hex.length==2)return"\\u00"+hex;if(hex.length==3)return"\\u0"+hex;return"\\u"+hex;};JSONClient.escapeJSONString=function(s){var parts=s.split("");for(var i=0;i=128) -parts[i]=JSONClient.escapeJSONChar(parts[i]);} -return"\""+parts.join("")+"\"";};JSONClient.toJSON=function(o){if(o==null) -return"null";if(o.constructor==String) -return JSONClient.escapeJSONString(o);if(o.constructor==Number) -return o.toString();if(o.constructor==Boolean) -return o.toString();if(o.constructor==Date) -return'{javaClass: "java.util.Date", time: '+o.valueOf()+'}';if(o.constructor==Array){var v=[];for(var i=0;i