display parse errors in web interface

This commit is contained in:
Ron Pedde 2006-01-16 22:28:44 +00:00
parent c7233f0947
commit 839386f86e
2 changed files with 43 additions and 3 deletions

View File

@ -31,7 +31,40 @@ function pl_errormsg(msg) {
}
}
function pl_displayresults(xmldoc) {
function pl_displayresults(xmldoc,query) {
var status_string;
var status;
if(!xmldoc) {
pl_errormsg("No xmldoc!");
return;
}
if(!xmldoc.getElementsByTagName("dmap.status")) {
pl_errormsg("No dmap.status??");
return;
}
status = xmldoc.getElementsByTagName("dmap.status")[0].firstChild.nodeValue;
if(!status)
return;
status = status * 1;
if(status != 200) {
status_string = "Error " + status + ": ";
if(xmldoc.getElementsByTagName("dmap.statusstring")) {
status_string = status_string + xmldoc.getElementsByTagName("dmap.statusstring")[0].firstChild.nodeValue;
} else {
status_string = status_string + "Unspecified error";
}
pl_errormsg(status_string);
} else {
pl_errormsg("Success");
}
}
function pl_update() {
@ -50,7 +83,9 @@ function pl_update() {
var url='/databases/1/containers/edit?output=xml&dmap.itemid=' + id + '&dmap.itemname=' + name + '&org.mt-daapd.smart-playlist-spec=' + spec;
result = pl_exec(url,false);
}
pl_displayresults(req.responseXML);
init();
pl_editor_state(false);
}

View File

@ -16,7 +16,7 @@ AC_CANONICAL_HOST
AM_CONDITIONAL(COND_REND_OSX,false)
rend_posix=true
db_sqlite=true
db_sqlite=false
db_sqlite3=false
STATIC_LIBS=no
@ -88,6 +88,11 @@ if test x$db_sqlite = xtrue -o x$db_sqlite3 = xtrue; then
AM_CONDITIONAL(COND_SQL,true)
fi
if test x$db_sqlite = xfalse -a x$db_sqlite3 = xfalse; then
echo "Must use either --enable-sqlite or --enable-sqlite3"
exit;
fi
dnl Darwin's stupid cpp preprocessor....
echo Host type is $host
CPPFLAGS="$CPPFLAGS -DHOST='\"$host\"'"