All the code that handles AJAX updates currently uses XML. While this might be easy enough to understand on the PHP side, it becomes rather confusing on the Javascript side.
It exists in sample_scripts/js/ttorp.js on around line 165 (as of v0.9.14). The XML parsing in Javascript is basically this:
if($(xmlObj).find('changesbykey').text()) {
for (var iNode = 0; iNode < xmlObj.childNodes.length; iNode++) {
var node = xmlObj.childNodes.item(iNode);
for (i = 0; i < node.childNodes.length; i++) {
var sibling = node.childNodes.item(i);
for (x = 0; x < sibling.childNodes.length; x++) {
var forceChange = false;
var sibling2 = sibling.childNodes.item(x);
if(sibling2.nodeName == forceNameChange) {
forceChange=true;
}
if (sibling2.childNodes.length > 0) {
var sibling3 = sibling2.childNodes.item(0);
markUpdatedInput($("#" + sibling2.nodeName), sibling3.data, forceChange);
}
else if(sibling2.nodeName.match(/^[aZ-zZ]/)) {
//This handles clearing-out data.
markUpdatedInput($("#" + sibling2.nodeName), "", forceChange);
}
}
}
}
}
All the code that handles AJAX updates currently uses XML. While this might be easy enough to understand on the PHP side, it becomes rather confusing on the Javascript side.
It exists in
sample_scripts/js/ttorp.js
on around line 165 (as of v0.9.14). The XML parsing in Javascript is basically this: