diff options
Diffstat (limited to 'sca-cpp/trunk/modules/edit/htdocs/graph/graph.html')
-rw-r--r-- | sca-cpp/trunk/modules/edit/htdocs/graph/graph.html | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html index 2a92a5d11e..4a973a1ed6 100644 --- a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html +++ b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.html @@ -43,7 +43,6 @@ </th> <th class="thl thr" style="padding-top: 0px; padding-bottom: 0px; padding-right: 0px; text-align: right;"> -<span id="source" style="font-weight: normal;">[atom json]</span> <input type="button" id="saveButton" style="font-weight: bold;" Value="Saved"/> </th> </tr> @@ -67,7 +66,6 @@ var apps = sca.reference(editWidget, "apps"); * The current app name. */ var appname = ui.queryParams()['app']; -$('source').innerHTML = '[<a href="/apps/' + appname + '">atom</a> <a href="/appcache/' + appname + '/app.composite">json</a>]'; /** * The current app composite and corresponding saved XML content. @@ -79,9 +77,13 @@ var composite; * Return the composite in an ATOM entry. */ function atomcomposite(doc) { - var entry = atom.readATOMEntryDocument(doc); - var item = caddr(entry); - return cddr(item); + var entry = atom.readATOMEntry(mklist(doc)); + if (isNil(entry)) + return mklist(); + var content = namedElementChild("'content", car(entry)); + if (content == null) + return mklist(); + return elementChildren(content); } /** @@ -151,8 +153,8 @@ function save() { $('saveButton').value = 'Saving'; savedcomposxml = car(writeXML(composite, false)); var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' + - '<title type="text">' + appname + '</title><id>' + appname + '</id><content type="application/xml"><item>' + - savedcomposxml + '</item></content></entry>'; + '<title type="text">' + appname + '</title><id>' + appname + '</id><content type="application/xml">' + + savedcomposxml + '</content></entry>'; apps.put(appname, entry, function() { if (savedcomposxml == car(writeXML(composite, false))) $('saveButton').value = 'Saved'; |