summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/edit/htdocs/account/index.html
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-08-06 05:59:32 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-08-06 05:59:32 +0000
commit3b3beac5adfa1995a9a4c92fd92a881f024be08e (patch)
treed958076da28db597359af0ae27db369925e253e4 /sca-cpp/trunk/modules/edit/htdocs/account/index.html
parent4b14cefc9e79850ebb18844752771c3f141c7385 (diff)
Javascript improvements: add local storage, improve caching using URI fragments instead of query strings, simplify component layout and optimize some of the Javascript functions, and add the ability to clone components.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1154447 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/edit/htdocs/account/index.html')
-rw-r--r--sca-cpp/trunk/modules/edit/htdocs/account/index.html24
1 files changed, 18 insertions, 6 deletions
diff --git a/sca-cpp/trunk/modules/edit/htdocs/account/index.html b/sca-cpp/trunk/modules/edit/htdocs/account/index.html
index d83ca4562b..ef1deb0527 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/account/index.html
+++ b/sca-cpp/trunk/modules/edit/htdocs/account/index.html
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<html>
+<html manifest="/cache-manifest.cmf">
<head>
<title>Account</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
@@ -28,8 +28,8 @@
<script type="text/javascript" src="/all-min.js"></script>
<script type="text/javascript" src="/menu.js"></script>
</head>
-<body class="delayed" onload="ui.onload();">
-<div id="bodydiv" class="devicewidth">
+<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>
@@ -97,13 +97,18 @@
</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 = user.id()
+var username = '';
+try {
+ username = user.id()
+} catch(e) {}
// Set page titles
document.title = windowtitle(window.location.hostname) + ' - Account - ' + username;
@@ -123,6 +128,11 @@ var savedaccountentryxml = '';
*/
function getaccount(name) {
return accounts.get(name, function(doc) {
+
+ // Stop now if we didn't get an account
+ if (doc == null)
+ return false;
+
accountentry = doc != null? car(elementsToValues(atom.readATOMEntry(mklist(doc)))) : mklist("'entry", mklist("'title", ''), mklist("'id", name));
var title = cadr(assoc("'title", cdr(accountentry)));
$('userTitle').value = title;
@@ -162,8 +172,10 @@ function getaccount(name) {
function save(entryxml) {
$('saveStatus').innerHTML = 'Saving';
savedaccountentryxml = entryxml;
- accounts.put(username, savedaccountentryxml);
- $('saveStatus').innerHTML = 'Saved';
+ accounts.put(username, savedaccountentryxml, function(e) {
+ if (!e)
+ $('saveStatus').innerHTML = 'Saved';
+ });
return true;
}