tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1094209 [1/2] - in /tuscany/sca-cpp/trunk: ./ modules/edit/ modules/edit/htdocs/ modules/edit/htdocs/app/ modules/edit/htdocs/dash/ modules/edit/htdocs/data/ modules/edit/htdocs/graph/ modules/edit/htdocs/login/ modules/edit/htdocs/logout/...
Date Sun, 17 Apr 2011 22:14:12 GMT
Author: jsdelfino
Date: Sun Apr 17 22:14:11 2011
New Revision: 1094209

URL: http://svn.apache.org/viewvc?rev=1094209&view=rev
Log:
Cleanup HTML pages. Improvements and a few fixes to get consistent behavior across browsers including Safari/iOS.

Added:
    tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf
    tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/grid72.png
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notyet.html
Modified:
    tuscany/sca-cpp/trunk/.gitignore
    tuscany/sca-cpp/trunk/modules/edit/apps.py
    tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.js
    tuscany/sca-cpp/trunk/modules/edit/htdocs/props/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/props/props.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notauth.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/notfound.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/store/store.html
    tuscany/sca-cpp/trunk/modules/edit/mkapplinks
    tuscany/sca-cpp/trunk/modules/http/conf/mime.types
    tuscany/sca-cpp/trunk/modules/js/htdocs/scdl.js
    tuscany/sca-cpp/trunk/modules/js/htdocs/ui.css
    tuscany/sca-cpp/trunk/modules/js/htdocs/ui.js
    tuscany/sca-cpp/trunk/modules/js/htdocs/uicyan.css
    tuscany/sca-cpp/trunk/modules/js/htdocs/util.js

Modified: tuscany/sca-cpp/trunk/.gitignore
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/.gitignore?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/.gitignore (original)
+++ tuscany/sca-cpp/trunk/.gitignore Sun Apr 17 22:14:11 2011
@@ -55,6 +55,7 @@ m4/
 config.guess
 config.sub
 config.status
+config.js
 depcomp
 install-sh
 ltmain.sh
@@ -125,6 +126,7 @@ scribe-cat
 js-test
 js-eval
 file-test
+test-start
 xml-value
 value-xml
 json-value

Modified: tuscany/sca-cpp/trunk/modules/edit/apps.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/apps.py?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/apps.py (original)
+++ tuscany/sca-cpp/trunk/modules/edit/apps.py Sun Apr 17 22:14:11 2011
@@ -31,6 +31,7 @@ def mkapplink(id):
         os.symlink('../../../../../nuvem/nuvem-parallel/nuvem', 'apps/' + car(id) + '/nuvem')
         os.symlink('../../../../components', 'apps/' + car(id) + '/lib')
         os.mkdir('apps/' + car(id) + '/htdocs')
+        os.symlink('../../../htdocs/cache-manifest.cmf', 'apps/' + car(id) + '/htdocs/cache-manifest.cmf');
         os.symlink('../../../htdocs/login', 'apps/' + car(id) + '/htdocs/login');
         os.symlink('../../../htdocs/logout', 'apps/' + car(id) + '/htdocs/logout');
         os.symlink('../../../htdocs/public', 'apps/' + car(id) + '/htdocs/public');

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf?rev=1094209&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf Sun Apr 17 22:14:11 2011
@@ -0,0 +1,32 @@
+CACHE-MANIFEST
+
+# Common resources
+atomutil.js
+component.js
+elemutil.js
+jsconfig.js
+jsonutil.js
+scdl.js
+ui.css
+ui.js
+util.js
+xmlutil.js
+
+# App resources
+app.html
+data/index.html
+index.html
+favicon.ico
+login/index.html
+logout/index.html
+public/app.png
+public/grid72.png
+public/iframe.html
+public/img.png
+public/notauth.html
+public/notfound.html
+public/notyet.html
+public/oops.html
+public/touchicon.png
+robots.txt
+

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html Sun Apr 17 22:14:11 2011
@@ -1,22 +1,22 @@
 <!--
-    * 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.    
+ * 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.    
 -->
-<html>
+<html manifest="cache-manifest.cmf">
 <head>
 <title>App</title>
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
@@ -27,6 +27,7 @@ document.title = window.location.hostnam
 </script>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/elemutil.js"></script>
 <script type="text/javascript" src="/xmlutil.js"></script>
@@ -52,9 +53,10 @@ if (ui.isIE()) $('bodydiv').style.right 
 /**
  * Page, every and location components.
  */
-var pagecomp = sca.httpclient('page', '/page');
+var appstartcomp = sca.httpclient('appstart', '/appstart');
+var appstopcomp = sca.httpclient('appstop', '/appstop');
 var everycomp = sca.httpclient('every', '/every');
-var locationcomp = sca.httpclient('location', '/location');
+var geolocationcomp = sca.httpclient('geolocation', '/geolocation');
 
 /**
  * Find a named value in a tree of elements.
@@ -66,7 +68,6 @@ function datavalue(l, id) {
 
     // Element matches id segment
     if (car(id) == elementName(e)) {
-        log('match', car(id));
 
         // Found element matching the whole id path
         if (isNil(cdr(id)))
@@ -100,9 +101,11 @@ function inputvalue(e) {
         return car(childElements(e)).value;
     }
     if (e.className == 'checkbox') {
+        if (!car(childElements(e)).checked)
+            return null;
         return car(childElements(e)).value;
     }
-    if (e.className == 'list') {
+    if (e.className == 'select') {
         return car(childElements(car(childElements(e)))).value;
     }
     return null;
@@ -114,7 +117,10 @@ function inputvalue(e) {
 function setwidgetvalue(e, dv) {
 
     function datatext(dv) {
-        return elementHasValue(dv)? elementValue(dv) : '';
+        if (!elementHasValue(dv))
+            return '';
+        var t = elementValue(dv);
+        return t == null? '' : t;
     }
 
     if (e.className == 'h1' || e.className == 'h2' || e.className == 'text' || e.className == 'section') {
@@ -138,15 +144,20 @@ function setwidgetvalue(e, dv) {
         map(function(n) { if (n.nodeName == "SPAN") n.innerHTML = t; return n; }, nodeList(e.childNodes));
         return t;
     }
-    if (e.className == 'list') {
+    if (e.className == 'select') {
         var t = datatext(dv);
         var ce = car(childElements(car(childElements(e))));
         ce.value = t;
         ce.innerHTML = t;
         return t;
     }
+    if (e.className == 'list') {
+        var t = ui.datalist(mklist(dv));
+        car(childElements(e)).innerHTML = t;
+        return t;
+    }
     if (e.className == 'table') {
-        var t = ui.datatable(elementChildren(dv));
+        var t = ui.datatable(mklist(dv));
         car(childElements(e)).innerHTML = t;
         return t;
     }
@@ -159,7 +170,8 @@ function setwidgetvalue(e, dv) {
     }
     if (e.className == 'img') {
         var t = datatext(dv);
-        car(childElements(e)).src = t;
+        var img = car(childElements(e));
+        img.setAttribute('src', t);
         return t;
     }
     if (e.className == 'iframe') {
@@ -220,7 +232,7 @@ function bindwidgethandler(e) {
         car(childElements(e)).name = e.id;
         return e;
     }
-    if (e.className == 'list') {
+    if (e.className == 'select') {
         var ce = car(childElements(car(childElements(e))));
         ce.name = e.id;
         return e;
@@ -241,7 +253,13 @@ function fixupwidget(e) {
         e.style.width = '100%';
         return e;
     }
+    if (e.className == 'list') {
+        car(childElements(e)).innerHTML = '';
+        car(childElements(e)).style.width = '100%';
+        return e;
+    }
     if (e.className == 'table') {
+        car(childElements(e)).innerHTML = '';
         car(childElements(e)).style.width = '100%';
         return e;
     }
@@ -266,7 +284,6 @@ function getpagedata() {
 
         // Eval a component init script
         function evalcompinit(doc) {
-            log('comp init', doc);
             if (isNil(doc))
                 return true;
             var js = car(json.readJSON(mklist(doc)));
@@ -283,8 +300,7 @@ function getpagedata() {
         }
 
         // Get the component app data
-        var doc = pagecomp.get(window.location.search, function(doc) {
-            log('page return', doc);
+        var doc = appstartcomp.get(window.location.search, function(doc) {
             try {
                 $('app').innerHTML = $('appFrame').contentDocument.body.innerHTML;
 
@@ -296,11 +312,11 @@ function getpagedata() {
 
                 // Get and eval the optional timer and location watch setup scripts
                 everycomp.get('setup', evalcompinit);
-                locationcomp.get('setup', evalcompinit);
+                geolocationcomp.get('setup', evalcompinit);
                 return true;
 
             } catch(e) {
-                log('exception on pagecomp.get()', e);
+                log('exception on appstartcomp.get()', e);
             }
         });
 
@@ -315,7 +331,6 @@ function getpagedata() {
  */
 function getcompdata(comp, qs) {
     var doc = comp.get(qs, function(doc) {
-        log('comp data', doc);
         return displaydoc(doc);
     });
     return true;
@@ -329,7 +344,11 @@ function compquery() {
         return e.id + '=' + inputvalue(e);
     }
 
-    var args = map(queryarg, filter(function(e) { return !isNil(e.id) && !isNil(inputvalue(e)); }, nodeList(ui.elementByID($('app'), 'page').childNodes)));
+    function childrenList(n) {
+        return append(nodeList(n.childNodes), reduce(append, mklist(), map(childrenList, nodeList(n.childNodes))));
+    }
+
+    var args = map(queryarg, filter(function(e) { return !isNil(e.id) && !isNil(inputvalue(e)); }, childrenList(ui.elementByID($('app'), 'page'))));
 
     // Append current location properties if known
     if (!isNil(geoposition)) {
@@ -367,9 +386,9 @@ function intervalHandler() {
 /**
  * Setup an interval timer.
  */
-function setupIntervalHandler(sec) {
+function setupIntervalHandler(msec) {
     try {
-        return setInterval(intervalHandler, sec);
+        return setInterval(intervalHandler, msec);
     } catch(e) {
         log('exception in setupIntervalHandler()', e);
     }
@@ -378,20 +397,26 @@ function setupIntervalHandler(sec) {
 /**
  * Handle a location watch event.
  */
-var geoposition;
+var locationWatch = null;
+var geoposition = null;
 
 function locationHandler(pos) {
-    log('location pos', pos);
     try {
         geoposition = pos;
-        return getcompdata(locationcomp, compquery());
+        return getcompdata(geolocationcomp, compquery());
     } catch(e) {
-        log('exception in locationHandler()', e);
+        locationErrorHandler(e);
     }
 }
 
 function locationErrorHandler(e) {
     log('location error', e);
+    if (!isNil(locationWatch)) {
+        try {
+            navigator.geolocation.clearWatch(locationWatch);
+        } catch(e) {}
+        locationWatch = null;
+    }
     return true;
 }
 
@@ -399,13 +424,18 @@ function locationErrorHandler(e) {
  * Setup a location watch handler.
  */
 function setupLocationHandler() {
-    log('setup location');
-    try {
-        navigator.geolocation.getCurrentPosition(locationHandler, locationErrorHandler);
-        navigator.geolocation.watchPosition(locationHandler, locationErrorHandler);
-    } catch(e) {
-        log('exception in setupLocationHandler()', e);
+    function installLocationHandler() {
+        if (!isNil(locationWatch))
+            return true;
+        try {
+            locationWatch = navigator.geolocation.watchPosition(locationHandler, locationErrorHandler);
+        } catch(e) {
+            log('exception in installLocationHandler()', e);
+        }
     }
+
+    installLocationHandler();
+    setInterval(installLocationHandler, 10000);
     return true;
 }
 

Added: tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf?rev=1094209&view=auto
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf (added)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf Sun Apr 17 22:14:11 2011
@@ -0,0 +1,47 @@
+CACHE-MANIFEST
+
+# Common resources
+atomutil.js
+component.js
+elemutil.js
+jsconfig.js
+jsonutil.js
+scdl.js
+ui.css
+ui.js
+util.js
+xmlutil.js
+
+# App resources
+app/index.html
+dash/dashboard.html
+dash/index.html
+data/index.html
+favicon.ico
+graph/graph.html
+graph/graph.js
+graph/index.html
+home.png
+index.html
+login/index.html
+logout/index.html
+main.html
+menu.html
+page/index.html
+page/page.html
+page/page.js
+props/index.html
+props/props.html
+public/app.png
+public/grid72.png
+public/iframe.html
+public/img.png
+public/notauth.html
+public/notfound.html
+public/notyet.html
+public/oops.html
+public/touchicon.png
+robots.txt
+store/index.html
+store/store.html
+

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/dashboard.html Sun Apr 17 22:14:11 2011
@@ -1,24 +1,25 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>  
 <link rel="stylesheet" type="text/css" href="/ui.css">
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/elemutil.js"></script>
 <script type="text/javascript" src="/xmlutil.js"></script>
@@ -91,7 +92,7 @@ function getapps(sync) {
     function display(doc) {
         var apps = '<table style="width: 100%;">';
         apps += '<tr><th class="thl thr" style="width: 20px; padding-top: 4px; padding-right: 4px;">App</th>' +
-            '<th class="thr thl" style="width: 20px;">Domain</th>' +
+            '<th class="thr thl" style="width: 20px;">URL</th>' +
             '<th class="thr thl">Category</th>' +
             '<th class="thr thl" style="width: 100%;">Title</th>' +
             '<th class="thr thl">Updated</th>' +
@@ -103,7 +104,7 @@ function getapps(sync) {
             var entry = entries[i];
             var title = cadr(assoc("'title", entry))
             var name = cadr(assoc("'id", entry))
-            var editlink = '<a href=\"' + '/graph/?app=' + name + '\" target=\"_parent\">';
+            var editlink = '<a href=\"' + '/page/?app=' + name + '\" target=\"_parent\">';
             var domainlink = '<a href=\"' + applink(name) + '\" target=\"' + '_blank' + '\">' + name + '.' + window.location.hostname + '</a>';
             var category = 'coolapps';
             var updated = 'Feb 4, 2011';

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/dash/index.html Sun Apr 17 22:14:11 2011
@@ -1,20 +1,20 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>
@@ -24,6 +24,7 @@
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>
@@ -40,7 +41,7 @@
 // Load the menu bar
 ui.loadwidget('menu', '/menu.html', ui.showbody);
 
-$('h1').innerHTML = domaintitle(window.location.hostname);
+$('h1').innerHTML = hometitle(window.location.hostname);
 
 // Load the dashboard
 $('dashboard').innerHTML =

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/data/index.html Sun Apr 17 22:14:11 2011
@@ -1,20 +1,20 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>
@@ -28,6 +28,7 @@ document.title = 'View - ' + window.loca
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css">
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/elemutil.js"></script>
 <script type="text/javascript" src="/xmlutil.js"></script>
@@ -81,9 +82,7 @@ function mkdoctable(doc) {
  * Get and display the contents of the current component.
  */
 function getdata() {
-    log('comp', comp.uri);
     comp.get('', function(doc) {
-        log('doc', doc);
 
         if (json.isJSON(mklist(doc)))
             return display(datatable(json.readJSON(mklist(doc))));

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html Sun Apr 17 22:14:11 2011
@@ -1,24 +1,25 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>  
 <link rel="stylesheet" type="text/css" href="/ui.css">
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/elemutil.js"></script>
 <script type="text/javascript" src="/xmlutil.js"></script>
@@ -161,7 +162,6 @@ $('saveButton').onclick = function(e) {
  * Save the current composite.
  */
 function save() {
-    log('saving');
     $('saveButton').value = 'Saving';
     savedcomposxml = car(writeXML(composite, false));
     var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
@@ -178,15 +178,18 @@ function save() {
 /**
  * Handle a composite change event.
  */
-function oncomposchange() {
+function oncomposchange(prop) {
     if (savedcomposxml == car(writeXML(composite, false)))
         return false;
     $('saveButton').value = 'Save now';
 
-    // Autosave after 3 seconds
+    // Save property changes right away
+    if (prop)
+        return save();
+
+    // Autosave other changes after 3 seconds
+    $('saveButton').value = 'Save now';
     setTimeout(function() {
-        log('savedcomposxml', savedcomposxml);
-        log('newddcomposxml', car(writeXML(composite, false)));
         if (savedcomposxml == car(writeXML(composite, false)))
             return false;
         return save();
@@ -281,12 +284,12 @@ $('autoplayButton').onclick = function(e
     if (autoplay) {
         autoplay = false;
         showData('');
-        $('autoplayButton').value = 'Autorun is off';
+        $('autoplayButton').value = 'Preview is off';
         return true;
     }
     autoplay = true;
     showData(compname);
-    $('autoplayButton').value = 'Autorun is on';
+    $('autoplayButton').value = 'Preview is on';
     return true;
 };
 
@@ -299,11 +302,11 @@ var bg = graph.mkgroup(graph.mkpath());
 
 // Install the palettes
 var gpalettes = new Array();
-var spalette = 'event';
+var spalette = 'control';
 var pos = graph.mkpath();
-installpalette('event', pos.rmove(0,0), g, bg, spalette, gpalettes);
-installpalette('value', pos.rmove(0,40), g, bg, spalette, gpalettes);
-installpalette('list', pos.rmove(0, 40), g, bg, spalette, gpalettes);
+installpalette('control', pos.rmove(0,0), g, bg, spalette, gpalettes);
+installpalette('values', pos.rmove(0,40), g, bg, spalette, gpalettes);
+installpalette('lists', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('transform', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('text', pos.rmove(0, 40), g, bg, spalette, gpalettes);
 installpalette('http', pos.rmove(0, 40), g, bg, spalette, gpalettes);

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js Sun Apr 17 22:14:11 2011
@@ -47,6 +47,8 @@ graph.colors.blue1 = '#00c3c9';
 graph.colors.red1 = '#d03f41';
 graph.colors.yellow1 = '#fcee21';
 graph.colors.magenta1 = '#c0688a';
+graph.colors.cyan1 = '#d5dcf9';
+graph.colors.lightgray1 = '#dcdcdc'
 
 /**
  * Default positions and sizes.
@@ -55,10 +57,11 @@ var palcx = 250;
 var trashcx = 230;
 var proxcx = 20;
 var proxcy = 20;
-var buttoncx = 70;
+var buttoncx = 65;
 var buttoncy = 30;
 var curvsz = 6;
 var tabsz = 2;
+var fontsz = '';
 
 /**
  * Base path class.
@@ -134,6 +137,8 @@ if (ui.isIE()) {
         // Track element dragging and selection
         graph.dragging = null;
         graph.selected = null;
+        cname.disabled = true;
+        pvalue.disabled = true;
 
         /**
          * Find the first draggable element in a hierarchy of elements.
@@ -159,7 +164,9 @@ if (ui.isIE()) {
 
                 // Reset current selection
                 cname.value = '';
+                cname.disabled = true;
                 pvalue.value = '';
+                pvalue.disabled = true;
 
                 // Trigger component select event
                 vmlg.oncompselect('');
@@ -187,7 +194,9 @@ if (ui.isIE()) {
 
             // Update the component name and property value fields
             cname.value = graph.selected.id;
+            cname.disabled = false;
             pvalue.value = graph.property(graph.selected.comp);
+            pvalue.disabled = !graph.hasproperty(graph.selected.comp);
 
             // Trigger component select event
             vmlg.oncompselect(vmlg.appname, graph.selected.id);
@@ -237,14 +246,16 @@ if (ui.isIE()) {
                     // Reset current selection
                     graph.selected = null;
                     cname.value = '';
+                    cname.disabled = true;
                     pvalue.value = '';
+                    pvalue.disabled = true;
 
                     // Trigger component select event
                     vmlg.oncompselect('');
                 }
 
                 // Trigger composite change event
-                vmlg.oncomposchange();
+                vmlg.oncomposchange(false);
             }
 
             // Forget current dragged component
@@ -292,6 +303,7 @@ if (ui.isIE()) {
             // Change component name and refactor references to it
             var compos = scdl.composite(vmlg.compos);
             cname.value = graph.ucid(cname.value, compos);
+            cname.disabled = false;
             graph.selected.id = cname.value;
             setElement(compos, graph.renamecomp(graph.selected.comp, compos, cname.value));
 
@@ -302,7 +314,7 @@ if (ui.isIE()) {
             graph.refresh(vmlg);
 
             // Trigger composite change event
-            vmlg.oncomposchange();
+            vmlg.oncomposchange(true);
             return false;
         };
 
@@ -313,12 +325,13 @@ if (ui.isIE()) {
             // Change the component property value
             graph.setproperty(graph.selected.comp, pvalue.value);
             pvalue.value = graph.property(graph.selected.comp);
+            pvalue.disabled = !graph.hasproperty(graph.selected.comp);
 
             // Refresh the composite
             graph.refresh(vmlg);
 
             // Trigger composite change event
-            vmlg.oncomposchange();
+            vmlg.oncomposchange(true);
             return false;
         };
 
@@ -326,15 +339,20 @@ if (ui.isIE()) {
         // component, reference and property titles
         graph.comptitlewidthdiv = document.createElement('span');
         graph.comptitlewidthdiv.style.visibility = 'hidden'
+        if (fontsz != '')
+            graph.comptitlewidthdiv.style.fontSize = fontsz;
         div.appendChild(graph.comptitlewidthdiv);
 
         graph.reftitlewidthdiv = document.createElement('span');
         graph.reftitlewidthdiv.style.visibility = 'hidden'
+        if (fontsz != '')
+            graph.comptitlewidthdiv.style.fontSize = fontsz;
         div.appendChild(graph.reftitlewidthdiv);
 
         graph.proptitlewidthdiv = document.createElement('span');
         graph.proptitlewidthdiv.style.visibility = 'hidden'
-        graph.proptitlewidthdiv.style.fontWeight = 'bold'
+        if (fontsz != '')
+            graph.comptitlewidthdiv.style.fontSize = fontsz;
         div.appendChild(graph.proptitlewidthdiv);
 
         return vmlg;
@@ -379,14 +397,16 @@ if (ui.isIE()) {
     /**
      * Return an element representing a title.
      */
-    graph.mktitle = function(t, bold, pos) {
+    graph.mktitle = function(t, style, pos) {
         var title = document.createElement('v:textbox');
         title.style.position = 'absolute';
         title.style.left = pos.xpos() + 2;
         title.style.top = pos.ypos();
         title.inset = '' + 6 + 'px ' + pos.ypos() + 'px 0px 0px';
-        if (bold)
-            title.style.fontWeight = 'bold';
+        if (style != '')
+            title.style.cssText = style;
+        if (fontsz != '')
+            title.style.fontSize = fontsz;
         var tnode = document.createTextNode(t);
         title.appendChild(tnode);
         return title;
@@ -399,7 +419,7 @@ if (ui.isIE()) {
         var tsvcs = graph.tsvcs(comp);
         var lsvcs = graph.lsvcs(comp);
         var pos = graph.mkpath().move(isNil(lsvcs)? tabsz : (tabsz * 5), isNil(tsvcs)? tabsz : (tabsz * 5));
-        return graph.mktitle(graph.title(comp), false, pos);
+        return graph.mktitle(graph.title(comp), graph.compstyle(comp), pos);
     };
 
     /**
@@ -420,16 +440,16 @@ if (ui.isIE()) {
         var tsvcs = graph.tsvcs(comp);
         var lsvcs = graph.lsvcs(comp);
         var pos = graph.mkpath().move(graph.comptitlewidth(comp) + 7 + (isNil(lsvcs)? tabsz : (tabsz * 5)), isNil(tsvcs)? tabsz : (tabsz * 5));
-        return graph.mktitle(graph.property(comp), true, pos);
+        return graph.mktitle(graph.propertytitle(comp), graph.propstyle(comp), pos);
     };
 
     /**
      * Return the width of the value of a property.
      */
     graph.proptitlewidth = function(comp) {
-        var t = graph.property(comp);
+        var t = graph.proptitle(comp);
         graph.proptitlewidthdiv.innerHTML = t;
-        var twidth = graph.proptitlewidthdiv.offsetWidth + 2;
+        var twidth = graph.proptitlewidthdiv.offsetWidth + 4;
         graph.proptitlewidthdiv.innerHTML = '';
         return twidth;
     };
@@ -438,7 +458,7 @@ if (ui.isIE()) {
      * Return an element representing the title of a reference.
      */
     graph.reftitle = function(ref) {
-        return graph.mktitle(graph.title(ref), false, graph.mkpath().move(25,25));
+        return graph.mktitle(graph.title(ref), graph.refstyle(ref), graph.mkpath().move(25,25));
     };
 
     /**
@@ -527,7 +547,7 @@ if (ui.isIE()) {
     graph.mkbutton = function(t, pos) {
 
         // Make the title element
-        var title = graph.mktitle(t, true, graph.mkpath().move(4,4));
+        var title = graph.mktitle(t, '', graph.mkpath().move(4,4));
 
         // Compute the path of the button shape
         var path = graph.buttonpath().str();
@@ -616,6 +636,8 @@ if (ui.isIE()) {
         // Track element dragging and selection
         graph.dragging = null;
         graph.selected = null;
+        cname.disabled = true;
+        pvalue.disabled = true;
 
         /**
          * Find the first draggable element in a hierarchy of elements.
@@ -644,7 +666,9 @@ if (ui.isIE()) {
 
                 // Reset current selection
                 cname.value = '';
+                cname.disabled = true;
                 pvalue.value = '';
+                pvalue.disabled = true;
 
                 // Trigger component select event
                 svg.oncompselect('');
@@ -672,7 +696,9 @@ if (ui.isIE()) {
 
             // Update the component name and property value fields
             cname.value = graph.selected.id;
+            cname.disabled = false;
             pvalue.value = graph.property(graph.selected.comp);
+            pvalue.disabled = !graph.hasproperty(graph.selected.comp);
             
             // Trigger component select event
             svg.oncompselect(svg.appname, graph.selected.id);
@@ -725,7 +751,9 @@ if (ui.isIE()) {
                     // Reset current selection
                     graph.selected = null;
                     cname.value = '';
+                    cname.disabled = true;
                     pvalue.value = '';
+                    pvalue.disabled = true;
 
                     // Trigger component select event
                     svg.oncompselect('');
@@ -739,7 +767,7 @@ if (ui.isIE()) {
             graph.refresh(svg);
 
             // Trigger composite change event
-            svg.oncomposchange();
+            svg.oncomposchange(false);
             return false;
         };
 
@@ -808,7 +836,7 @@ if (ui.isIE()) {
             graph.refresh(svg);
 
             // Trigger composite change event
-            svg.oncomposchange();
+            svg.oncomposchange(true);
             return false;
         };
         
@@ -819,12 +847,13 @@ if (ui.isIE()) {
             // Change the component property value
             graph.setproperty(graph.selected.comp, pvalue.value);
             pvalue.value = graph.property(graph.selected.comp);
+            pvalue.disabled = !graph.hasproperty(graph.selected.comp);
 
             // Refresh the composite
             graph.refresh(svg);
 
             // Trigger composite change event
-            svg.oncomposchange();
+            svg.oncomposchange(true);
             return false;
         };
 
@@ -878,13 +907,15 @@ if (ui.isIE()) {
     /**
      * Return an element representing a title.
      */
-    graph.mktitle = function(t, bold) {
+    graph.mktitle = function(t, style) {
         var title = document.createElementNS(graph.svgns, 'text');
-        title.setAttribute('text-anchor', 'start');
         title.setAttribute('x', 5);
         title.setAttribute('y', 15);
-        if (bold)
-            title.style.fontWeight = 'bold';
+        title.setAttribute('text-anchor', 'start');
+        if (style != '')
+            title.style.cssText = style;
+        if (fontsz != '')
+            title.style.fontSize = fontsz;
         title.appendChild(document.createTextNode(t));
         return title;
     };
@@ -893,7 +924,7 @@ if (ui.isIE()) {
      * Return an element representing the title of a component.
      */
     graph.comptitle = function(comp) {
-        return graph.mktitle(graph.title(comp), false);
+        return graph.mktitle(graph.title(comp), graph.compstyle(comp));
     };
 
     /**
@@ -911,7 +942,7 @@ if (ui.isIE()) {
      * Return an element representing the title of a reference.
      */
     graph.reftitle = function(ref) {
-        return graph.mktitle(graph.title(ref), false);
+        return graph.mktitle(graph.title(ref), graph.refstyle(ref));
     };
 
     /**
@@ -929,7 +960,7 @@ if (ui.isIE()) {
      * Return an element representing the value of a property.
      */
     graph.proptitle = function(comp) {
-        var title = graph.mktitle(graph.property(comp), true);
+        var title = graph.mktitle(graph.propertytitle(comp), graph.propstyle(comp));
         title.setAttribute('x', graph.comptitlewidth(comp) + 7);
         return title;
     };
@@ -940,7 +971,7 @@ if (ui.isIE()) {
     graph.proptitlewidth = function(comp) {
         var title = graph.proptitle(comp);
         graph.titlewidthsvg.appendChild(title);
-        var width = title.getBBox().width + 2;
+        var width = title.getBBox().width + 4;
         graph.titlewidthsvg.removeChild(title);
         return width;
     };
@@ -1006,7 +1037,7 @@ if (ui.isIE()) {
     graph.mkbutton = function(t, pos) {
 
         // Make the button title
-        var title = graph.mktitle(t, true);
+        var title = graph.mktitle(t, '');
 
         // Compute the path of the button shape
         var path = graph.buttonpath().str();
@@ -1085,7 +1116,9 @@ graph.title = function(e) {
             return '>'
         if (t == 'lt')
             return '<';
-        if (t.indexOf('{') == -1)
+        if (t.indexOf('{propval}') != -1)
+            return '';
+        if (t.indexOf('{compname}') == -1)
             return t;
         return t.replace('{compname}', scdl.name(e));
     }
@@ -1093,6 +1126,14 @@ graph.title = function(e) {
 };
 
 /**
+ * Return the display style of an SCDL component or reference.
+ */
+graph.compstyle = graph.refstyle = function(e) {
+    var s = scdl.style(e);
+    return isNil(s)? '' : s;
+};
+
+/**
  * Return the property value of a SCDL component.
  */
 graph.property = function(e) {
@@ -1101,7 +1142,44 @@ graph.property = function(e) {
         return '';
     if (scdl.visible(car(p)) == 'false')
         return '';
-    return scdl.propertyValue(car(p));
+    var pv = scdl.propertyValue(car(p));
+    return pv;
+};
+
+/**
+ * Return the title of a property of a SCDL component.
+ */
+graph.propertytitle = function(e) {
+    var pv = graph.property(e);
+    var t = scdl.title(e);
+    if (t.indexOf('{propval}') == -1)
+        return pv;
+    return t[0] == ' '? t.substr(1).replace('{propval}', pv) : t.replace('{propval}', pv);
+};
+
+/**
+ * Return true if a SCDL component has a property.
+ */
+graph.hasproperty = function(e) {
+    var p = scdl.properties(e);
+    if (isNil(p))
+        return false;
+    if (scdl.visible(car(p)) == 'false')
+        return false;
+    return true;
+};
+
+/**
+ * Return the display style of the property of an SCDL component.
+ */
+graph.propstyle = function(e) {
+    var p = scdl.properties(e);
+    if (isNil(p))
+        return '';
+    if (scdl.visible(car(p)) == 'false')
+        return '';
+    var s = scdl.style(car(p));
+    return isNil(s)? '' : s;
 };
 
 /**

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/index.html Sun Apr 17 22:14:11 2011
@@ -1,52 +1,67 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>
-<title>Composition</title>
+<title>App</title>
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
 <meta name="apple-mobile-web-app-capable" content="yes"/>
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>
 <body class="delayed">
 <div id="menu"></div>
 
-<h1><span id="h1"></span> <span id="appNameHeader" style="font-weight: normal;"></span></h1>
+<h1><span id="h1"></span><span id="appNameHeader"></span></h1>
 <br/>
 
 <div id="graph"></div>
 
 <script type="text/javascript">
 
+/**
+ * Return the link to an app.
+ */
+function applink(appname) {
+    var protocol = window.location.protocol;
+    var host = window.location.hostname;
+    var port = ':' + window.location.port;
+    if (port == ':80' || port == ':443' || port == ':')
+        port = '';
+    var link = protocol + '//' + appname + '.' + host + port + '/';
+    return link;
+}
+
 // Get the app name
 var appname = ui.queryParams()['app'];
 
+// Update the window title
+document.title = windowtitle(window.location.hostname) + ' - ' + (isNil(config.compose)? 'Composition' : config.compose) + ' - ' + appname;
+$('h1').innerHTML = hometitle(window.location.hostname);
+$('appNameHeader').innerHTML = ' - <a href=\"' + applink(appname) + '\" target=\"' + '_blank' + '\">' + appname + '</a>';
+
 // Load the menu bar
 ui.loadwidget('menu', '/menu.html?app=' + appname, ui.showbody);
 
-$('h1').innerHTML = domaintitle(window.location.hostname);
-document.title = 'Composition - ' + appname;
-$('appNameHeader').innerHTML = ' - ' + appname;
-
 /**
  * Display the editor for an app.
  */

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/index.html Sun Apr 17 22:14:11 2011
@@ -1,22 +1,22 @@
 <!--
-    * 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.    
+ * 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.    
 -->
-<html>
+<html manifest="cache-manifest.cmf">
 <head>
 <title>Home</title>
 <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/> 
@@ -24,9 +24,10 @@
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript">
-document.title = domaintitle(window.location.hostname);
+document.title = windowtitle(window.location.hostname);
 </script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>
@@ -40,11 +41,11 @@ document.title = domaintitle(window.loca
 
 <script type="text/javascript">
 
+$('h1').innerHTML = hometitle(window.location.hostname);
+
 // Load the menu bar
 ui.loadwidget('menu', '/menu.html', ui.showbody);
 
-$('h1').innerHTML = domaintitle(window.location.hostname);
-
 // Load the main page
 ui.loadiframe('main', 'main.html');
 

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/login/index.html Sun Apr 17 22:14:11 2011
@@ -1,22 +1,21 @@
 <!--
-   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.
+ * 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.    
 -->
-
 <html>
 <head>
 <title>Sign in</title>
@@ -25,6 +24,7 @@
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/logout/index.html Sun Apr 17 22:14:11 2011
@@ -1,22 +1,21 @@
 <!--
-   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.
+ * 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.    
 -->
-
 <html>
 <head>
 <title>Sign out</title>
@@ -25,6 +24,7 @@
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/main.html Sun Apr 17 22:14:11 2011
@@ -1,24 +1,25 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>  
 <link rel="stylesheet" type="text/css" href="/ui.css">
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>  
@@ -27,19 +28,23 @@
 <div id="bodydiv" style="position: absolute; top: 0px; left: 0px; right: 0px;">
 
 <div style="margin-left: auto; margin-right: auto; text-align: center;">
-<br/><br/><br/>
 
-<a href="/dash/" target="_parent"><img src="home.png" width="426" height="145" style="width: 426px; height: 145px;"/></a>
+<h2><span id="maintitle"><span></h2>
+<br/><br/><br/><br/>
 
+<!--
+<a href="/dash/" target="_parent"><img src="home.png" width="426" height="145" style="width: 426px; height: 145px;"/></a>
 <br/><br/>
+-->
+
+<div id="maindiagram"></div>
+<br/><br/><br/><br/>
 
-<h1><a href="/dash/" target="_parent">Get Started</a></h1>
+<h1><a id="getstarted" href="">Get Started</a></h1>
 
 <br/><br/><br/>
-<div>This module implements a simple App store to help you create and share Tuscany apps.</div>
-<div>The user interface is minimalistic, by design.</div>
-<br/>
-<div>Works with Safari, Chrome and Firefox. Doesn't work with IE.</div>
+<div>Safari, Chrome, Firefox only for now.</div>
+
 </div>
 
 </div>
@@ -47,6 +52,10 @@
 <script type="text/javascript">
 if (ui.isIE()) $('bodydiv').style.right = -20;
 
+$('maintitle').innerHTML = isNil(config.maintitle)? 'Simple App Builder' : config.maintitle;
+$('maindiagram').innerHTML = isNil(config.maindiagram)? '&lt;&lt insert diagram here &gt;&gt;' : config.maindiagram;
+$('getstarted').href = ui.href('/store/', '_parent');
+
 ui.showbody();
 
 </script>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.html Sun Apr 17 22:14:11 2011
@@ -1,24 +1,25 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="/ui.css">
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 <script type="text/javascript" src="/component.js"></script>
@@ -38,7 +39,8 @@ var user = sca.defun(sca.reference(menuW
 function userMenu() {
     function UserMenu() {
         this.content = function() {
-            return '<span><b>' + user.id() + '</b></span>';
+            u = user.id()
+            return '<span>' + u + '</span>';
         };
     }
     return new UserMenu();
@@ -51,26 +53,18 @@ function appname() {
     return ui.queryParams()['app'];
 }
 
-/**
- * Return the link to an app.
- */
-function applink(appname) {
-    var protocol = window.location.protocol;
-    var host = window.location.hostname;
-    var port = ':' + window.location.port;
-    if (port == ':80' || port == ':443' || port == ':')
-        port = '';
-    var link = protocol + '//' + appname + '.' + host + port + '/';
-    return link;
-}
-
 // Display the menu bar
 var mdiv = $('menu'); 
 var name = appname();
+
 mdiv.innerHTML = ui.menubar(
-    append(mklist(ui.menu('Home', '/'), ui.menu('Store', '/store/'), ui.menu('Dashboard', '/dash/')),
-            (isNil(name) || name == 'undefined')? mklist() : mklist(ui.menu('Composition', '/graph/?app=' + name), ui.menu('Page', '/page/?app=' + name), ui.menu('Settings', '/props/?app=' + name), ui.menu(name + '.' + window.location.hostname, applink(name), '_blank'))),
-    mklist(userMenu(), ui.menu('Account', '/account/'), ui.menu('Sign out', '/logout/')));
+    append(mklist(ui.menu('Home', '/'), ui.menu('Store', '/store/')),
+            (isNil(name) || name == 'undefined')?
+                mklist() :
+                mklist(ui.menu('Page', '/page/?app=' + name),
+                ui.menu(isNil(config.compose)? 'Composition' : config.compose, '/graph/?app=' + name),
+                ui.menu('Stats', '/props/?app=' + name))),
+    mklist(ui.menu('Account', '/public/notyet.html'), ui.menu('Sign out', '/logout/')));
 
 </script>
 </body>

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/page/index.html Sun Apr 17 22:14:11 2011
@@ -1,20 +1,20 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>
@@ -24,30 +24,44 @@
 <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
 <link rel="apple-touch-icon" href="/public/touchicon.png"/>
 <link rel="stylesheet" type="text/css" href="/ui.css"/>
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/ui.js"></script>
 </head>
 <body class="delayed">
 <div id="menu"></div>
 
-<h1><span id="h1"></span>  <span id="appNameHeader" style="font-weight: normal;"></span></h1>
+<h1><span id="h1"></span><span id="appNameHeader"></span></h1>
 <br/>
 
 <div id="page"></div>
 
 <script type="text/javascript">
 
+/**
+ * Return the link to an app.
+ */
+function applink(appname) {
+    var protocol = window.location.protocol;
+    var host = window.location.hostname;
+    var port = ':' + window.location.port;
+    if (port == ':80' || port == ':443' || port == ':')
+        port = '';
+    var link = protocol + '//' + appname + '.' + host + port + '/';
+    return link;
+}
+
 // Get the app name
 var appname = ui.queryParams()['app'];
 
+// Update the window title
+document.title = windowtitle(window.location.hostname) + ' - Page - ' + appname;
+$('h1').innerHTML = hometitle(window.location.hostname);
+$('appNameHeader').innerHTML = ' - <a href=\"' + applink(appname) + '\" target=\"' + '_blank' + '\">' + appname + '</a>';
+
 // Load the menu bar
 ui.loadwidget('menu', '/menu.html?app=' + appname, ui.showbody);
 
-// Display the editor for the current app
-document.title = 'Page - ' + appname;
-$('h1').innerHTML = domaintitle(window.location.hostname);
-$('appNameHeader').innerHTML = ' - ' + appname;
-
 /**
  * Display the page editor for an app.
  */

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.html Sun Apr 17 22:14:11 2011
@@ -1,24 +1,25 @@
 <!--
-    * 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.    
+ * 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.    
 -->
 <html>
 <head>  
 <link rel="stylesheet" type="text/css" href="/ui.css">
+<script type="text/javascript" src="/config.js"></script>
 <script type="text/javascript" src="/util.js"></script>
 <script type="text/javascript" src="/elemutil.js"></script>
 <script type="text/javascript" src="/xmlutil.js"></script>
@@ -49,28 +50,36 @@
 <tr style="height: 5000px;"><td class="tdl"></td><td class="tdr" colspan="2"></td></tr>
 </table>
 
+<div id="bigscreen" style="position: absolute; left: 250px; top: 40px; right: 0px; bottom: 0px; border:1px; border-style: solid; border-color: #a2bae7; background: url(/public/grid72.png);"></div>
+<div id="iosportraitscreen" class="guide" style="position: absolute; left: 250px; top: 40px; width: 320px; height: 460px;"></div>
+<div id="ioslandscapescreen" class="guide" style="position: absolute; left: 250px; top: 40px; width: 480px; height: 300px;"></div>
+<div id="ipadportraitscreen" class="guide" style="position: absolute; left: 250px; top: 40px; width: 768px; height: 911px;"></div>
+<div id="ipadlandscapescreen" class="guide" style="position: absolute; left: 250px; top: 40px; width: 1024px; height: 655px;"></div>
+
 <div id="page" style="position: absolute; top: 40px; left: 0px; width: 5000px; height: 5000px;">
 
 <span class="h1" id="palette:h1" style="position: absolute; left: 0px; top: 0px;"><h1>Header1</h1></span>
 <span class="h2" id="palette:h2" style="position: absolute; left: 0px; top: 35px;"><h2>Header2</h2></span>
 <span class="section" id="palette:section" style="position: absolute; left: 0px; top: 70px; width: 200px;"><span class="section">section</span></span>
 <span class="button" id="palette:button" style="position: absolute; left: 0px; top: 100px;"><input type="button" value="button"/></span>
-<span class="entry" id="palette:entry" style="position: absolute; left: 0px; top: 130px;"><input type="text" value="field" size="20"/></span>
+<span class="entry" id="palette:entry" style="position: absolute; left: 0px; top: 130px;"><input type="text" value="field" size="20" autocapitalize="off"/></span>
 <span class="password" id="palette:password" style="position: absolute; left: 0px; top: 160px;"><input type="password" value="password" size="20"/></span>
 <span class="checkbox" id="palette:checkbox" style="position: absolute; left: 0px; top: 190px;"><input type="checkbox" value="checkbox"/><span>checkbox</span></span>
-<span class="list" id="palette:list" style="position: absolute; left: 0px; top: 220px;"><select><option value="list">list</option></select></span>
-<span class="table" id="palette:table" style="position: absolute; left: 0px; top: 250px; width: 200px;">
+<span class="select" id="palette:select" style="position: absolute; left: 0px; top: 220px;"><select><option value="select">select</option></select></span>
+<span class="list" id="palette:list" style="position: absolute; left: 0px; top: 250px; width: 200px;">
+<table class="datatable" style="width: 200px;"><tr><td class="datatd">list</td></tr><tr><td class="datatd">...</td></tr></table>
+</span>
+<span class="table" id="palette:table" style="position: absolute; left: 0px; top: 300px; width: 200px;">
 <table class="datatable" style="width: 200px;"><tr><td class="datatdl">table</td><td class="datatdr">...</td></tr><tr><td class="datatdl">...</td><td class="datatdr">...</td></tr></table>
 </span>
-<span class="link" id="palette:link" style="position: absolute; left: 0px; top: 300px;"><a href="/"><span>link</span></a></span>
-<span class="text" id="palette:text" style="position: absolute; left: 0px; top: 330px;"><span>text</span></span>
-<span class="iframe fakeframe" id="palette:iframe" style="position: absolute; left: 0px; top: 360px; width: 200px;"><a href="/public/iframe.html"><span class="fakeframe"><span>frame ...</span></span></a></span>
-<span class="img" id="palette:img" style="position: absolute; left: 0px; top: 390px;"><img src="/public/img.png"/></span>
+<span class="link" id="palette:link" style="position: absolute; left: 0px; top: 350px;"><a href="/"><span>link</span></a></span>
+<span class="text" id="palette:text" style="position: absolute; left: 0px; top: 380px;"><span>text</span></span>
+<span class="iframe fakeframe" id="palette:iframe" style="position: absolute; left: 0px; top: 410px; width: 200px;"><a href="/public/iframe.html"><span class="fakeframe"><span>frame ...</span></span></a></span>
+<span class="img" id="palette:img" style="position: absolute; left: 0px; top: 430px;"><img src="/public/img.png"/></span>
 
 </div>
 
-<div id="buffer" style="visibility: hidden; width: 0px; height: 0px">
-</div>
+<div id="buffer" style="visibility: hidden; width: 0px; height: 0px"></div>
 
 </div>
 
@@ -114,17 +123,17 @@ function getpage(name, edit) {
         // Convert the page to XHTML and place it in a hidden buffer
         var buffer = $('buffer');
         var el = atompage(doc);
-        if (isNil(el)) {
 
-            // Create a default empty page if necessary
+        // Create a default empty page if necessary
+        if (isNil(el))
             buffer.innerHTML = '<DIV id="page">\n</DIV>\n';
-        } else {
+        else
             buffer.innerHTML = writeStrings(writeXML(atompage(doc), false));
-        }
 
         // Append page nodes to editor
         map(function(e) {
-                e.style.left = ui.csspos(e.style.left) + 250;
+                if (!isNil(e.style))
+                    e.style.left = ui.csspos(e.style.left) + 250;
                 edit.appendChild(e);
                 return page.cover(e);
             }, nodeList(buffer.childNodes[0].childNodes));
@@ -204,12 +213,16 @@ function save() {
 /**
  * Handle a page change event
  */
-function onpagechange() {
+function onpagechange(prop) {
     if (savedpagexhtml == pagexhtml())
         return false;
     $('saveButton').value = 'Save now';
 
-    // Autosave after 3 seconds
+    // Save property changes right away
+    if (prop)
+        return save();
+
+    // Autosave other changes after 3 seconds
     setTimeout(function() {
         if (savedpagexhtml == pagexhtml())
             return false;

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.js
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.js?rev=1094209&r1=1094208&r2=1094209&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.js (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.js Sun Apr 17 22:14:11 2011
@@ -38,6 +38,8 @@ if (ui.isIE()) {
         // Track element dragging and selection
         page.dragging = null;
         page.selected = null;
+        wname.disabled = true;
+        wtext.disabled = true;
 
         // Trigger page change events
         page.onpagechange = onchange;
@@ -55,7 +57,9 @@ if (ui.isIE()) {
 
                 // Reset current selection
                 wname.value = '';
+                wname.disabled = true;
                 wtext.value = '';
+                wtext.disabled = true;
                 return false;
             }
 
@@ -75,7 +79,9 @@ if (ui.isIE()) {
 
             // Update the widget name and text fields
             wname.value = page.selected.id;
+            wname.disabled = false;
             wtext.value = page.text(page.selected);
+            wtext.disabled = !page.hastext(page.selected);
             return false;
         };
 
@@ -86,6 +92,17 @@ if (ui.isIE()) {
             if (page.dragging == null)
                 return false;
 
+            // Snap to grid
+            var newX = page.gridsnap(ui.csspos(page.dragging.style.left));
+            var newY = page.gridsnap(ui.csspos(page.dragging.style.top));
+            page.dragging.style.left = newX;
+            page.dragging.style.top = newY;
+            page.dragging.cover.style.left = newX;
+            page.dragging.cover.style.top = newY;
+
+            // Fixup widget style
+            page.fixupwidget(page.dragging);
+
             // Discard element dragged out of page area
             if (ui.csspos(page.dragging.style.left) < palcx && page.dragging.id.substring(0, 8) != 'palette:') {
                 if (ui.csspos(page.dragging.style.left) >= trashcx) {
@@ -99,7 +116,9 @@ if (ui.isIE()) {
                     // Reset current selection
                     page.selected = null;
                     wname.value = '';
+                    wname.disabled = true;
                     wtext.value = '';
+                    wtext.disabled = true;
                 }
             }
 
@@ -108,7 +127,7 @@ if (ui.isIE()) {
             elem.releaseCapture();
             
             // Trigger page change event
-            page.onpagechange();
+            page.onpagechange(false);
             return false;
         };
 
@@ -150,7 +169,7 @@ if (ui.isIE()) {
             page.selected.id = wname.value;
 
             // Trigger page change event
-            page.onpagechange();
+            page.onpagechange(true);
             return false;
         };
 
@@ -160,7 +179,7 @@ if (ui.isIE()) {
             page.settext(page.selected, wtext.value);
 
             // Trigger page change event
-            page.onpagechange();
+            page.onpagechange(true);
             return false;
         };
 
@@ -181,6 +200,8 @@ if (ui.isIE()) {
         // Track element dragging and selection
         page.dragging = null;
         page.selected = null;
+        wname.disabled = true;
+        wtext.disabled = true;
 
         // Trigger page change events
         page.onpagechange = onchange;
@@ -201,7 +222,9 @@ if (ui.isIE()) {
 
                 // Reset current selection
                 wname.value = '';
+                wname.disabled = true;
                 wtext.value = '';
+                wtext.disabled = true;
                 return false;
             }
 
@@ -221,7 +244,9 @@ if (ui.isIE()) {
 
             // Update the widget name and text fields
             wname.value = page.selected.id;
+            wname.disabled = false;
             wtext.value = page.text(page.selected);
+            wtext.disabled = !page.hastext(page.selected);
             return false;
         };
 
@@ -235,6 +260,17 @@ if (ui.isIE()) {
             if (page.dragging == null)
                 return false;
 
+            // Snap to grid
+            var newX = page.gridsnap(ui.csspos(page.dragging.style.left));
+            var newY = page.gridsnap(ui.csspos(page.dragging.style.top));
+            page.dragging.style.left = newX;
+            page.dragging.style.top = newY;
+            page.dragging.cover.style.left = newX;
+            page.dragging.cover.style.top = newY;
+
+            // Fixup widget style
+            page.fixupwidget(page.dragging);
+
             // Discard element dragged out of page area
             if (ui.csspos(page.dragging.style.left) < palcx && page.dragging.id.substring(0, 8) != 'palette:') {
                 if (ui.csspos(page.dragging.style.left) >= trashcx) {
@@ -248,7 +284,9 @@ if (ui.isIE()) {
                     // Reset current selection
                     page.selected = null;
                     wname.value = '';
+                    wname.disabled = true;
                     wtext.value = '';
+                    wtext.disabled = true;
                 }
             }
 
@@ -256,7 +294,7 @@ if (ui.isIE()) {
             page.dragging = null;
 
             // Trigger page change event
-            page.onpagechange();
+            page.onpagechange(false);
             return false;
         };
 
@@ -309,7 +347,7 @@ if (ui.isIE()) {
             page.selected.id = wname.value;
 
             // Trigger page change event
-            page.onpagechange();
+            page.onpagechange(true);
             return false;
         };
 
@@ -319,7 +357,7 @@ if (ui.isIE()) {
             page.settext(page.selected, wtext.value);
 
             // Trigger page change event
-            page.onpagechange();
+            page.onpagechange(true);
             return false;
         };
 
@@ -341,7 +379,7 @@ page.text = function(e) {
         return car(childElements(e)).value;
     if (e.className == 'entry' || e.className == 'password')
         return car(childElements(e)).defaultValue;
-    if (e.className == 'list')
+    if (e.className == 'select')
         return car(childElements(car(childElements(e)))).value;
     if (e.className == 'link') {
         var hr = car(childElements(e)).href;
@@ -354,12 +392,39 @@ page.text = function(e) {
     }
     if (e.className == 'iframe')
         return car(childElements(e)).href;
+    if (e.className == 'list')
+        return '';
     if (e.className == 'table')
         return '';
     return '';
 };
 
 /**
+ * Return true if a widget has editable text.
+ */
+page.hastext = function(e) {
+    if (e.className == 'h1' || e.className == 'h2' || e.className == 'text' || e.className == 'section')
+        return true;
+    if (e.className == 'button' || e.className == 'checkbox')
+        return true;
+    if (e.className == 'entry' || e.className == 'password')
+        return true;
+    if (e.className == 'select')
+        return false;
+    if (e.className == 'link')
+        return true;
+    if (e.className == 'img')
+        return true;
+    if (e.className == 'iframe')
+        return true;
+    if (e.className == 'list')
+        return false;
+    if (e.className == 'table')
+        return false;
+    return false;
+};
+
+/**
  * Set the text of a widget.
  */
 page.settext = function(e, t) {
@@ -376,12 +441,15 @@ page.settext = function(e, t) {
         map(function(n) { if (n.nodeName == "SPAN") n.innerHTML = t; return n; }, nodeList(e.childNodes));
         return t;
     }
-    if (e.className == 'list') {
+    if (e.className == 'select') {
         var ce = car(childElements(car(childElements(e))));
         ce.value = t;
         ce.innerHTML = t;
         return t;
     }
+    if (e.className == 'list') {
+        return '';
+    }
     if (e.className == 'table') {
         return '';
     }
@@ -404,6 +472,30 @@ page.settext = function(e, t) {
 };
 
 /**
+ * Initial fixup of a widget.
+ */
+page.fixupwidget = function(e) {
+    if (e.className == 'iframe') {
+        var f = car(childElements(e));
+        //e.innerHTML = '<iframe src="' + f.href + '" frameborder="no" scrolling="no"></iframe>';
+        return e;
+    }
+    if (e.className == 'section') {
+        e.style.width = '100%';
+        return e;
+    }
+    if (e.className == 'list') {
+        car(childElements(e)).style.width = '100%';
+        return e;
+    }
+    if (e.className == 'table') {
+        car(childElements(e)).style.width = '100%';
+        return e;
+    }
+    return e;
+}
+
+/**
  * Find a draggable element in a hierarchy of elements.
  */
 page.draggable = function(n, e) {
@@ -417,6 +509,13 @@ page.draggable = function(n, e) {
 }
 
 /**
+ * Align a pos along a 9pixel grid.
+ */
+page.gridsnap = function(x) {
+    return Math.round(x / 9) * 9;
+}
+
+/**
  * Bring an element and its parent to the top.
  */
 page.bringtotop = function(n) {



Mime
View raw message