From d1146122184e153e1fac944eafe3535274859ca0 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Sat, 29 Oct 2011 17:47:19 +0000 Subject: Better network connectivity status reporting and handling of orientation change events. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1194948 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/edit/htdocs/stats/index.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'sca-cpp/trunk/modules/edit/htdocs/stats/index.html') diff --git a/sca-cpp/trunk/modules/edit/htdocs/stats/index.html b/sca-cpp/trunk/modules/edit/htdocs/stats/index.html index 9fa463e822..f049bea8a5 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/stats/index.html +++ b/sca-cpp/trunk/modules/edit/htdocs/stats/index.html @@ -22,7 +22,7 @@ - +

Saved
@@ -96,11 +96,16 @@ var savedappentryxml = ''; function getapp(name) { if (isNil(name)) return false; + showStatus('Loading'); + return apps.get(name, function(doc) { // Stop now if we didn't get the app - if (doc == null) + if (doc == null) { + showStatus('No data'); return false; + } + showStatus(defaultStatus()); appentry = doc != null? car(elementsToValues(atom.readATOMEntry(mklist(doc)))) : mklist("'entry", mklist("'title", ''), mklist("'id", name)); var title = cadr(assoc("'title", cdr(appentry))); @@ -116,12 +121,15 @@ function getapp(name) { * Save the current app. */ function save(entryxml) { - $('saveStatus').innerHTML = 'Saving'; + showStatus('Saving'); savedappentryxml = entryxml; dashboards.put(appname, savedappentryxml, function(e) { - if (e) + if (e) { + showStatus('Local copy'); return false; - $('saveStatus').innerHTML = 'Saved'; + } + + showStatus('Saved'); return false; }); return true; @@ -136,7 +144,7 @@ function onappchange() { var entryxml = car(atom.writeATOMEntry(valuesToElements(mklist(appentry)))); if (savedappentryxml == entryxml) return false; - $('saveStatus').innerHTML = 'Modified'; + showStatus('Modified'); return save(entryxml); } -- cgit v1.2.3