Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x

This commit is contained in:
Zach Copley 2011-03-16 16:17:49 -07:00
commit 74387e75cf
2 changed files with 21 additions and 3 deletions

View File

@ -253,16 +253,34 @@ var SN = { // StatusNet
.attr(SN.C.S.Disabled, SN.C.S.Disabled); .attr(SN.C.S.Disabled, SN.C.S.Disabled);
}, },
error: function (xhr, textStatus, errorThrown) { error: function (xhr, textStatus, errorThrown) {
alert(errorThrown || textStatus); // If the server end reported an error from StatusNet,
// find it -- otherwise we'll see what was reported
// from the browser.
var errorReported = null;
if (xhr.responseXML) {
errorReported = $('#error', xhr.responseXML).text();
}
alert(errorReported || errorThrown || textStatus);
// Restore the form to original state.
// Hopefully. :D
form
.removeClass(SN.C.S.Processing)
.find('.submit')
.removeClass(SN.C.S.Disabled)
.removeAttr(SN.C.S.Disabled);
}, },
success: function(data, textStatus) { success: function(data, textStatus) {
if (typeof($('form', data)[0]) != 'undefined') { if (typeof($('form', data)[0]) != 'undefined') {
form_new = document._importNode($('form', data)[0], true); form_new = document._importNode($('form', data)[0], true);
form.replaceWith(form_new); form.replaceWith(form_new);
} }
else { else if (typeof($('p', data)[0]) != 'undefined') {
form.replaceWith(document._importNode($('p', data)[0], true)); form.replaceWith(document._importNode($('p', data)[0], true));
} }
else {
alert('Unknown error.');
}
} }
}); });
}, },

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long