tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r1188045 [1/4] - in /tuscany/sca-cpp/trunk: ./ modules/edit/ modules/edit/htdocs/ modules/edit/htdocs/account/ modules/edit/htdocs/app/ modules/edit/htdocs/clone/ modules/edit/htdocs/create/ modules/edit/htdocs/data/ modules/edit/htdocs/gra...
Date Mon, 24 Oct 2011 08:45:56 GMT
Author: jsdelfino
Date: Mon Oct 24 08:45:54 2011
New Revision: 1188045

URL: http://svn.apache.org/viewvc?rev=1188045&view=rev
Log:
Refactor and simplify edit app, and optimize app resource loading and caching.

Added:
    tuscany/sca-cpp/trunk/modules/edit/htdocs/home/
    tuscany/sca-cpp/trunk/modules/edit/htdocs/home/home.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/home/home.png
      - copied, changed from r1175987, tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png
    tuscany/sca-cpp/trunk/modules/edit/htdocs/home/index.html
      - copied, changed from r1175987, tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/notauth/
    tuscany/sca-cpp/trunk/modules/edit/htdocs/notauth/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/notfound/
    tuscany/sca-cpp/trunk/modules/edit/htdocs/notfound/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/notyet/
    tuscany/sca-cpp/trunk/modules/edit/htdocs/notyet/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/oops/
    tuscany/sca-cpp/trunk/modules/edit/htdocs/oops/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/app.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/delete.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/grid72.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/img.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/touchicon.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.b64
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/user.png
Removed:
    tuscany/sca-cpp/trunk/modules/edit/htdocs/app/frame.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/data/
    tuscany/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
    tuscany/sca-cpp/trunk/modules/edit/htdocs/home.png
    tuscany/sca-cpp/trunk/modules/edit/htdocs/menu.js
    tuscany/sca-cpp/trunk/modules/edit/htdocs/page/page.js
    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/notyet.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/oops.html
Modified:
    tuscany/sca-cpp/trunk/.gitignore
    tuscany/sca-cpp/trunk/modules/edit/Makefile.am
    tuscany/sca-cpp/trunk/modules/edit/accounts.py
    tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf
    tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf
    tuscany/sca-cpp/trunk/modules/edit/htdocs/clone/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/create/index.html
    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/page/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/public/iframe.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/stats/index.html
    tuscany/sca-cpp/trunk/modules/edit/htdocs/store/index.html
    tuscany/sca-cpp/trunk/modules/edit/ssl-start
    tuscany/sca-cpp/trunk/modules/edit/start
    tuscany/sca-cpp/trunk/modules/http/conf/mime.types
    tuscany/sca-cpp/trunk/modules/http/httpd-conf
    tuscany/sca-cpp/trunk/modules/http/httpd-ssl-conf
    tuscany/sca-cpp/trunk/modules/http/mod-openauth.cpp
    tuscany/sca-cpp/trunk/modules/http/proxy-conf
    tuscany/sca-cpp/trunk/modules/http/proxy-ssl-conf
    tuscany/sca-cpp/trunk/modules/js/htdocs/all-min.js
    tuscany/sca-cpp/trunk/modules/js/htdocs/component.js
    tuscany/sca-cpp/trunk/modules/js/htdocs/ui-min.css
    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/util.js
    tuscany/sca-cpp/trunk/modules/server/mod-wiring.cpp

Modified: tuscany/sca-cpp/trunk/.gitignore
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/.gitignore?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/.gitignore (original)
+++ tuscany/sca-cpp/trunk/.gitignore Mon Oct 24 08:45:54 2011
@@ -59,6 +59,7 @@ config.status
 *config.js
 all.js
 intro*.png
+intro*.b64
 depcomp
 install-sh
 ltmain.sh

Modified: tuscany/sca-cpp/trunk/modules/edit/Makefile.am
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/Makefile.am?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/Makefile.am (original)
+++ tuscany/sca-cpp/trunk/modules/edit/Makefile.am Mon Oct 24 08:45:54 2011
@@ -20,7 +20,7 @@ if WANT_PYTHON
 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/*.png htdocs/*.txt htdocs/account/*.html htdocs/create/*.html htdocs/clone/*.html htdocs/data/*.html
htdocs/app/*.html htdocs/store/*.html htdocs/stats/*.html htdocs/graph/*.html htdocs/graph/*.js
htdocs/page/*.html htdocs/page/*.js htdocs/login/*.html htdocs/logout/*.html htdocs/public/*.html
htdocs/public/*.png 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/*.png
htdocs/*.txt htdocs/account/*.html htdocs/create/*.html htdocs/clone/*.html htdocs/data/*.html
htdocs/app/*.html htdocs/store/*.html htdocs/stats/*.html htdocs/graph/*.html htdocs/graph/*.js
htdocs/page/*.html htdocs/page/*.js htdocs/login/*.html htdocs/logout/*.html htdocs/public/*.html
htdocs/public/*.png palettes/*/palette.composite apps/*/app.composite apps/*/app.stats apps/*/htdocs/app.html
dashboards/*/user.apps store/*/store.apps
+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
 
 endif

Modified: tuscany/sca-cpp/trunk/modules/edit/accounts.py
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/accounts.py?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/accounts.py (original)
+++ tuscany/sca-cpp/trunk/modules/edit/accounts.py Mon Oct 24 08:45:54 2011
@@ -22,7 +22,7 @@ from util import *
 def accountid(user):
     return ("'" + user.id(), "'user.account")
 
-# Get the user's account
+# Get the current user's account
 def get(id, user, cache):
     account = cache.get(accountid(user))
     if isNil(account):

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/account/index.html Mon Oct 24 08:45:54 2011
@@ -17,26 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
-<head>
-<title>Account</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-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
-</head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
 <div id="bodydiv" class="bodydiv">
 
-<div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="menu"></div>
-
 <table style="width: 100%;">
 <tr>
 <td><h2><span id="h1"></span><span id="userNameHeader"></span></h2></td>
@@ -53,7 +35,7 @@
 <form id="userForm">
 <table style="width: 100%;">
 <tr><tr><td><b>Photo:</b></td></tr>
-<tr><td><img src="/public/app.png" style="width: 50px; height: 50px; vertical-align:
top;"></td></tr>
+<tr><td><img id="userimg" style="width: 50px; height: 50px; vertical-align:
top;"></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>Name:</b></td></tr>
 <tr><td><input type="text" id="userTitle" size="30" placeholder="Enter your
name" style="width: 300px;"/></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>Description:</b></td></tr>
@@ -97,29 +79,22 @@
 </form>
 
 <script type="text/javascript">
-ui.initbody();
 
 // Init service references
 var editWidget = sca.component("EditWidget");
 var user= sca.defun(sca.reference(editWidget, "user"), "id");
 var accounts = sca.reference(editWidget, "accounts");
 
-// Get the user name
-var username = '';
-try {
-    username = user.id()
-} catch(e) {}
-
 // Set page titles
-document.title = windowtitle(window.location.hostname) + ' - Account - ' + username;
-$('userNameHeader').innerHTML = username;
+document.title = ui.windowtitle(location.hostname) + ' - Account';
 
-// Load the menu bar
-displaymenu();
+// Set images
+$('userimg').src = ui.b64img(appcache.get('/public/user.b64'));
 
 /**
  * The current account entry and corresponding saved XML content.
  */
+var username;
 var accountentry;
 var savedaccountentryxml = '';
 
@@ -134,7 +109,9 @@ function getaccount(name) {
             return false;
 
         accountentry = doc != null? car(elementsToValues(atom.readATOMEntry(mklist(doc))))
: mklist("'entry", mklist("'title", ''), mklist("'id", name));
+        username = cadr(assoc("'id", cdr(accountentry)));
         var title = cadr(assoc("'title", cdr(accountentry)));
+        $('userNameHeader').innerHTML = username;
         $('userTitle').value = title;
 
         var content = cadr(assoc("'content", cdr(accountentry)));
@@ -170,6 +147,8 @@ function getaccount(name) {
  * Save the user's account.
  */
 function save(entryxml) {
+    if (isNil(username))
+        return false;
     $('saveStatus').innerHTML = 'Saving';
     savedaccountentryxml = entryxml;
     accounts.put(username, savedaccountentryxml, function(e) {
@@ -228,14 +207,8 @@ $('userForm').onsubmit = function() {
 };
 
 // Get the user's account
-getaccount(username);
-</script>
+getaccount();
 
-<div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
-</div>
+</script>
 
 </div>
-</body>
-</html>
-

Modified: 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=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/app/cache-manifest.cmf Mon Oct 24 08:45:54 2011
@@ -1,25 +1,17 @@
 CACHE MANIFEST
 
-# Common resources
-/all-min.js
-/ui-min.css
+# Version 5
 
 # App resources
 /
-/data/index.html
 /favicon.ico
-/footconfig.js
-/frame.html
-/headconfig.js
-/public/app.png
+/notauth/
+/notfound/
+/notyet/
+/oops/
 /public/iframe.html
 /public/img.png
-/public/notauth.html
-/public/notfound.html
-/public/notyet.html
-/public/oops.html
 /public/touchicon.png
-/robots.txt
 
 NETWORK:
 *

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=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/app/index.html Mon Oct 24 08:45:54 2011
@@ -23,36 +23,77 @@
 <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"/>
+<base href="/"/>
 <script type="text/javascript">
-document.title = window.location.hostname.split('.')[0];
+
+window.appcache = {};
+
+/**
+ * Get and cache a resource.
+ */
+appcache.get = function(uri) {
+    var h = uri.indexOf('#');
+    var u = h == -1? uri : uri.substring(0, h);
+
+    // Get resource from local storage first
+    var item = localStorage.getItem(u);
+    if (item != null && item != '')
+        return item;
+
+    // Get resource from network
+    var http = new XMLHttpRequest();
+    http.open("GET", u, false);
+    http.send(null);
+    if (http.status == 200) {
+        if (http.getResponseHeader("X-Login") != null) {
+            if (log) log('http err', u, 'X-Login');
+            return null;
+        } else if (http.responseText == '' || http.getResponseHeader("Content-Type") == null)
{
+            if (log) log('http err', u, 'No-Content');
+            return null;
+        }
+        localStorage.setItem(u, http.responseText);
+        return http.responseText;
+    }
+    if (log) log('http err', u, http.status, http.statusText);
+    return null;
+};
+
+// Load Javascript and CSS
+(function() {
+    var bootjs = document.createElement('script');
+    bootjs.type = 'text/javascript';
+    bootjs.text = appcache.get('/all-min.js');
+    document.head.appendChild(bootjs);
+    document.head.appendChild(ui.declareCSS(appcache.get('/ui-min.css')));
+})();
+
 </script>
-<link rel="apple-touch-icon" href="/public/touchicon.png"/>
-<link rel="stylesheet" type="text/css" href="/ui-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
 </head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
-<div id="bodydiv" class="bodydiv">
+<body class="delayed" onload="onload();">
+<div id="mainbodydiv" class="mainbodydiv">
 
 <div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="app">
-<iframe id="appframe" style="position: relative; height: 5000px; width: 100%;" scrolling="no"
frameborder="0" src="/frame.html"></iframe>
+<script type="text/javascript">
+(function() {
+$('headdiv').appendChild(ui.declareScript(appcache.get('/headconfig.js')));
+})();
+</script>
 </div>
 
-<div id="appbuffer" style="visibility: hidden">
+<div id="content">
 </div>
 
 <script type="text/javascript">
-ui.initbody();
+
+// Set the document title
+document.title = location.hostname.split('.')[0];
 
 /**
- * The main app div.
+ * The main page div.
  */
-var appdiv = $('app');
-var appframe = $('appframe');
-var appbody;
+var contentdiv = $('content');
 
 /**
  * Start, stop, timer, animation and location components.
@@ -64,6 +105,59 @@ var animationcomp = sca.httpclient('anim
 var locationcomp = sca.httpclient('location', '/location');
 
 /**
+ * Pre-fetch app resources.
+ */
+var appresources = [
+    ['/all-min.js'],
+    ['/app.html'],
+    ['/ui-min.css'],
+    ['/footconfig.js'],
+    ['/headconfig.js'],
+];
+
+/**
+ * Handle application cache events.
+ */
+applicationCache.addEventListener('checking', function(e) {
+    //log('appcache checking', e);
+}, false);
+applicationCache.addEventListener('error', function(e) {
+    //log('appcache error', e);
+}, false);
+applicationCache.addEventListener('noupdate', function(e) {
+    //log('appcache noupdate', e);
+}, false);
+applicationCache.addEventListener('downloading', function(e) {
+    //log('appcache downloading', e);
+}, false);
+applicationCache.addEventListener('progress', function(e) {
+    //log('appcache progress', e);
+}, false);
+applicationCache.addEventListener('updateready', function(e) {
+    //log('appcache updateready', e);
+    applicationCache.swapCache();
+    //log('appcache swapped', e);
+}, false);
+applicationCache.addEventListener('cached', function(e) {
+    //log('appcache cached', e);
+    map(function(res) {
+        appcache.get(res[0]);
+    }, appresources);
+}, false);
+
+/**
+ * Handle network offline/online events.
+ */
+window.addEventListener('offline', function(e) {
+      //log('going offline');
+}, false);
+window.addEventListener('online', function(e) {
+      //log('going online');
+}, false);
+
+//log(navigator.onLine? 'online' : 'offline');
+
+/**
  * Find a named value in a tree of elements. The value name is given
  * as a list of ids.
  */
@@ -172,12 +266,12 @@ function setwidgetvalue(e, dv) {
 
                 // Define the stylesheet
                 if (s != '') {
-                    var esheet = appframe.contentDocument.getElementById('style_' + e.id);
+                    var esheet = contentdiv.getElementById('style_' + e.id);
                     if (isNil(esheet)) {
                         var nesheet = document.createElement('style');
                         nesheet.id = 'style_' + e.id;
                         nesheet.type = 'text/css';
-                        appframe.contentDocument.getElementsByTagName('head')[0].appendChild(nesheet);
+                        contentdiv.getElementsByTagName('head')[0].appendChild(nesheet);
                         nesheet.innerHTML = s;
                     } else {
                         esheet.innerHTML = s;
@@ -294,7 +388,7 @@ function updatepage(l) {
         return e;
     }
 
-    map(updatewidget, filter(function(e) { return !isNil(e.id) && e.id.substring(0,
5) != 'page:'; }, nodeList(ui.elementByID(appbody, 'page').childNodes)));
+    map(updatewidget, filter(function(e) { return !isNil(e.id) && e.id.substring(0,
5) != 'page:'; }, nodeList(ui.elementByID(contentdiv, 'page').childNodes)));
     return true;
 }
 
@@ -474,16 +568,10 @@ function getpagedata() {
         }
 
         // Get the component app data
-        var doc = getdoc(startcomp, 'start', window.location.search);
-
-        // Prepare app HTML page
-        appbody = appframe.contentDocument.body;
-        var appbufferbody = $('appbufferframe').contentDocument.body;
-        appbody.innerHTML = appbufferbody.innerHTML;
-        appbufferbody.innerHTML = '';
+        var doc = getdoc(startcomp, 'start', location.search);
 
         // Setup the widgets
-        map(setupwidget, filter(function(e) { return !isNil(e.id); }, nodeList(ui.elementByID(appbody,
'page').childNodes)));
+        map(setupwidget, filter(function(e) { return !isNil(e.id); }, nodeList(ui.elementByID(contentdiv,
'page').childNodes)));
 
         // Display data on the page
         displaypage(doc);
@@ -513,7 +601,7 @@ function compquery() {
         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(appbody, 'page'))));
+    var args = map(queryarg, filter(function(e) { return !isNil(e.id) && !isNil(inputvalue(e));
}, childrenList(ui.elementByID(contentdiv, 'page'))));
 
     // Append current location properties if known
     if (!isNil(geoposition)) {
@@ -677,12 +765,35 @@ function setupLocationHandler() {
     return true;
 }
 
-// Load the app frame
-$('appbuffer').innerHTML = '<iframe id="appbufferframe" style="position: relative; height:
5000px; width: 100%;" scrolling="no" frameborder="0" src="app.html" onload="getpagedata()"></iframe>';
+// Load the app page
+var appcontent = appcache.get('/app.html');
+contentdiv.innerHTML = appcontent;
+
+// Merge in the app data
+getpagedata();
+
+/**
+ * Document load post processing.
+ */
+function onload() {
+    //log('onload');
+
+    // Show the page
+    document.body.style.visibility = 'visible';
+
+    // Scroll to the top and hide the address bar
+    window.scrollTo(0, 0);
+    return true;
+}
+
 </script>
 
 <div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
+<script type="text/javascript">
+(function() {
+$('footdiv').appendChild(ui.declareScript(appcache.get('/footconfig.js')));
+})();
+</script>
 </div>
 
 </div>

Modified: 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=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/cache-manifest.cmf Mon Oct 24 08:45:54 2011
@@ -1,39 +1,17 @@
 CACHE MANIFEST
 
-# Version 2
-
-# Common resources
-/all-min.js
-/ui-min.css
+# Version 5
 
 # App resources
 /
-/account/
-/app/
-/clone/
-/data/
-/create/
 /favicon.ico
-/footconfig.js
-/graph/graph.js
-/graph/
-/headconfig.js
-/home.png
-/menu.js
-/page/
-/page/page.js
-/public/app.png
-/public/grid72.png
+/notauth/
+/notfound/
+/notyet/
+/oops/
 /public/iframe.html
 /public/img.png
-/public/notauth.html
-/public/notfound.html
-/public/notyet.html
-/public/oops.html
 /public/touchicon.png
-/robots.txt
-/stats/
-/store/
 
 NETWORK:
 *

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/clone/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/clone/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/clone/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/clone/index.html Mon Oct 24 08:45:54 2011
@@ -17,26 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
-<head>
-<title></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-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
-</head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
 <div id="bodydiv" class="bodydiv">
 
-<div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="menu"></div>
-
 <table style="width: 100%;">
 <tr>
 <td><h2><span id="h1"></span><span id="appNameHeader"></span></h2></td>
@@ -54,7 +36,7 @@
 <tr><td><b>New App Name:</b></td></tr>
 <tr><td><input type="text" id="appName" size="15" autocapitalize="off" placeholder="Your
app name"/>&nbsp;<span id="appDomain"></span></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>App Icon:</b></td></tr>
-<tr><td><img src="/public/app.png" style="width: 50px; height: 50px; vertical-align:
top;"></td></tr>
+<tr><td><img id="appimg" style="width: 50px; height: 50px; vertical-align:
top;"></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>Sharing:</b></td></tr>
 <tr><td><input type="checkbox" value="shared"/><span>Shared</span></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>App Title:</b></td></tr>
@@ -69,20 +51,17 @@
 </form>
 
 <script type="text/javascript">
-ui.initbody();
 
 // Get the app name
-var appname = ui.fragmentParams()['app'];
-if (isNil(appname))
-    window.open('/', '_self');
+var appname = ui.fragmentParams(location)['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;
+    var protocol = location.protocol;
+    var host = location.hostname;
+    var port = ':' + location.port;
     if (port == ':80' || port == ':443' || port == ':')
         port = '';
     var link = protocol + '//' + appname + '.' + host + port + '/';
@@ -91,17 +70,17 @@ function applink(appname) {
 
 // Set page titles
 var tclone = isNil(config.clone)? 'Clone' : config.clone;
-document.title = windowtitle(window.location.hostname) + ' - ' + tclone + ' - ' + appname;
+document.title = ui.windowtitle(location.hostname) + ' - ' + tclone + ' - ' + appname;
 $('appNameHeader').innerHTML = '<a href=\"' + applink(appname) + '\" target=\"' + '_blank'
+ '\">' + appname + '</a>';
 $('th').innerHTML = tclone + ' this App';
 $('cloneAppOKButton').value = tclone;
 $('cloneAppOKButton').title = tclone + ' this app';
 
-// Load the menu bar
-displaymenu();
+// Set images
+$('appimg').src = ui.b64img(appcache.get('/public/app.b64'));
 
 // Init form
-$('appDomain').innerHTML = '.' + window.location.hostname;
+$('appDomain').innerHTML = '.' + location.hostname;
 
 // Init service references
 var editWidget = sca.component("EditWidget");
@@ -152,7 +131,7 @@ $('cloneAppForm').onsubmit = function() 
             return false;
 
         // Open it in the page editor
-        ui.navigate('/page/#app=' + name, '_self');
+        ui.navigate('/#view=page&app=' + name, '_view');
         return false;
     });
     return false;
@@ -162,18 +141,12 @@ $('cloneAppForm').onsubmit = function() 
  * Cancel cloning an app.
  */
 $('cloneAppCancelButton').onclick = function() {
-    ui.navigate('/stats/#app=' + appname, '_self');
+    history.back();
 };
 
 // Get the current app
 getapp(appname);
-</script>
 
-<div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
-</div>
+</script>
 
 </div>
-</body>
-</html>
-

Modified: tuscany/sca-cpp/trunk/modules/edit/htdocs/create/index.html
URL: http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/edit/htdocs/create/index.html?rev=1188045&r1=1188044&r2=1188045&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/edit/htdocs/create/index.html (original)
+++ tuscany/sca-cpp/trunk/modules/edit/htdocs/create/index.html Mon Oct 24 08:45:54 2011
@@ -17,26 +17,8 @@
  * specific language governing permissions and limitations
  * under the License.    
 -->
-<html manifest="/cache-manifest.cmf">
-<head>
-<title>Create 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-min.css"/>
-<script type="text/javascript" src="/all-min.js"></script>
-<script type="text/javascript" src="/menu.js"></script>
-</head>
-<body class="delayed" onload="ui.onload();" onbeforeunload="ui.onbeforeunload();">
 <div id="bodydiv" class="bodydiv">
 
-<div id="headdiv" class="hsection">
-<script type="text/javascript" src="/headconfig.js"></script>
-</div>
-
-<div id="menu"></div>
-
 <table style="width: 100%;">
 <tr><td><h2><span id="h1"></span></h2></td></tr>
 </table>
@@ -52,7 +34,7 @@
 <tr><td><b>App Name:</b></td></tr>
 <tr><td><input type="text" id="appName" size="15" autocapitalize="off" placeholder="Your
app name"/>&nbsp;<span id="appDomain"></span></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>App Icon:</b></td></tr>
-<tr><td><img src="/public/app.png" style="width: 50px; height: 50px; vertical-align:
top;"></td></tr>
+<tr><td><img id="appimg" style="width: 50px; height: 50px; vertical-align:
top;"></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>Sharing:</b></td></tr>
 <tr><td><input type="checkbox" value="shared"/><span>Shared</span></td></tr>
 <tr><tr><td style="padding-top: 6px;"><b>App Title:</b></td></tr>
@@ -67,17 +49,16 @@
 </form>
 
 <script type="text/javascript">
-ui.initbody();
 
 // Set page titles
-document.title = windowtitle(window.location.hostname) + ' - Create App';
-$('h1').innerHTML = hometitle(window.location.hostname);
+document.title = ui.windowtitle(location.hostname) + ' - Create App';
+$('h1').innerHTML = ui.hometitle(location.hostname);
 
-// Load the menu bar
-displaymenu();
+// Set images
+$('appimg').src = ui.b64img(appcache.get('/public/app.b64'));
 
 // Init form
-$('appDomain').innerHTML = '.' + window.location.hostname;
+$('appDomain').innerHTML = '.' + location.hostname;
 
 // Init service references
 var editWidget = sca.component("EditWidget");
@@ -101,7 +82,7 @@ $('createAppForm').onsubmit = function()
             return false;
 
         // Open it in the page editor
-        ui.navigate('/page/#app=' + name, '_self');
+        ui.navigate('/#view=page&app=' + name, '_view');
         return false;
     });
     return false;
@@ -111,15 +92,9 @@ $('createAppForm').onsubmit = function()
  * Cancel creating an app.
  */
 $('createAppCancelButton').onclick = function() {
-    return ui.navigate('/store/', '_self');
+    history.back();
 };
-</script>
 
-<div id="footdiv" class="fsection">
-<script type="text/javascript" src="/footconfig.js"></script>
-</div>
+</script>
 
 </div>
-</body>
-</html>
-



Mime
View raw message