Revert "Revert back to using document._importNode() for ajax posting"

This reverts commit b6ed694995.
This commit is contained in:
Zach Copley 2011-05-02 11:55:16 -07:00
parent 3187d6184f
commit 6af7f8cd64
2 changed files with 9 additions and 9 deletions

View File

@ -273,14 +273,15 @@ var SN = { // StatusNet
},
success: function(data, textStatus) {
if (typeof($('form', data)[0]) != 'undefined') {
var form_new = document._importNode($('form', data)[0], true);
var form_new = $('form', $(data).children());
form.replaceWith(form_new);
if (onSuccess) {
onSuccess();
}
}
else if (typeof($('p', data)[0]) != 'undefined') {
form.replaceWith(document._importNode($('p', data)[0], true));
var p_new = $('p', $(data).children());
form.replaceWith(p_new);
if (onSuccess) {
onSuccess();
}
@ -502,11 +503,11 @@ var SN = { // StatusNet
success: function(data, textStatus) {
var results_placeholder = $('#profile_search_results');
if (typeof($('ul', data)[0]) != 'undefined') {
var list = document._importNode($('ul', data)[0], true);
var list = $('ul', $(data).children());
results_placeholder.replaceWith(list);
}
else {
var _error = $('<li/>').append(document._importNode($('p', data)[0], true));
var _error = $('<li/>').append($('p', $(data).children()));
results_placeholder.html(_error);
}
form
@ -536,12 +537,12 @@ var SN = { // StatusNet
success: function(data, textStatus) {
var results_placeholder = form.parents('.entity_tags');
if (typeof($('.entity_tags', data)[0]) != 'undefined') {
var tags = document._importNode($('.entity_tags', data)[0], true);
var tags = $('.entity_tags', $(data).children());
$(tags).find('.editable').append($('<button class="peopletags_edit_button"/>'));
results_placeholder.replaceWith(tags);
} else {
results_placeholder.find('p').remove();
results_placeholder.append(document._importNode($('p', data)[0], true));
results_placeholder.append($('p', $(data).children()));
form.removeClass(SN.C.S.Processing)
.find('.submit')
.removeClass(SN.C.S.Disabled)
@ -693,7 +694,7 @@ var SN = { // StatusNet
nextStep();
} else {
// Hide the placeholder...
placeholder = list.find('li.notice-reply-placeholder').hide();
var placeholder = list.find('li.notice-reply-placeholder').hide();
// Create the reply form entry at the end
var replyItem = $('li.notice-reply', list);
@ -712,7 +713,6 @@ var SN = { // StatusNet
if (SN.C.I.NoticeFormMaster) {
// We've already saved a master copy of the form.
// Clone it in!
console.debug("we have a saved for, using it");
intermediateStep(SN.C.I.NoticeFormMaster);
} else {
// Fetch a fresh copy of the notice form over AJAX.

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long