Revert "Revert back to using document._importNode() for ajax posting"
This reverts commit b6ed694995
.
This commit is contained in:
parent
3187d6184f
commit
6af7f8cd64
16
js/util.js
16
js/util.js
@ -273,14 +273,15 @@ var SN = { // StatusNet
|
|||||||
},
|
},
|
||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
if (typeof($('form', data)[0]) != 'undefined') {
|
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);
|
form.replaceWith(form_new);
|
||||||
if (onSuccess) {
|
if (onSuccess) {
|
||||||
onSuccess();
|
onSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (typeof($('p', data)[0]) != 'undefined') {
|
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) {
|
if (onSuccess) {
|
||||||
onSuccess();
|
onSuccess();
|
||||||
}
|
}
|
||||||
@ -502,11 +503,11 @@ var SN = { // StatusNet
|
|||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
var results_placeholder = $('#profile_search_results');
|
var results_placeholder = $('#profile_search_results');
|
||||||
if (typeof($('ul', data)[0]) != 'undefined') {
|
if (typeof($('ul', data)[0]) != 'undefined') {
|
||||||
var list = document._importNode($('ul', data)[0], true);
|
var list = $('ul', $(data).children());
|
||||||
results_placeholder.replaceWith(list);
|
results_placeholder.replaceWith(list);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var _error = $('<li/>').append(document._importNode($('p', data)[0], true));
|
var _error = $('<li/>').append($('p', $(data).children()));
|
||||||
results_placeholder.html(_error);
|
results_placeholder.html(_error);
|
||||||
}
|
}
|
||||||
form
|
form
|
||||||
@ -536,12 +537,12 @@ var SN = { // StatusNet
|
|||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
var results_placeholder = form.parents('.entity_tags');
|
var results_placeholder = form.parents('.entity_tags');
|
||||||
if (typeof($('.entity_tags', data)[0]) != 'undefined') {
|
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"/>'));
|
$(tags).find('.editable').append($('<button class="peopletags_edit_button"/>'));
|
||||||
results_placeholder.replaceWith(tags);
|
results_placeholder.replaceWith(tags);
|
||||||
} else {
|
} else {
|
||||||
results_placeholder.find('p').remove();
|
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)
|
form.removeClass(SN.C.S.Processing)
|
||||||
.find('.submit')
|
.find('.submit')
|
||||||
.removeClass(SN.C.S.Disabled)
|
.removeClass(SN.C.S.Disabled)
|
||||||
@ -693,7 +694,7 @@ var SN = { // StatusNet
|
|||||||
nextStep();
|
nextStep();
|
||||||
} else {
|
} else {
|
||||||
// Hide the placeholder...
|
// 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
|
// Create the reply form entry at the end
|
||||||
var replyItem = $('li.notice-reply', list);
|
var replyItem = $('li.notice-reply', list);
|
||||||
@ -712,7 +713,6 @@ var SN = { // StatusNet
|
|||||||
if (SN.C.I.NoticeFormMaster) {
|
if (SN.C.I.NoticeFormMaster) {
|
||||||
// We've already saved a master copy of the form.
|
// We've already saved a master copy of the form.
|
||||||
// Clone it in!
|
// Clone it in!
|
||||||
console.debug("we have a saved for, using it");
|
|
||||||
intermediateStep(SN.C.I.NoticeFormMaster);
|
intermediateStep(SN.C.I.NoticeFormMaster);
|
||||||
} else {
|
} else {
|
||||||
// Fetch a fresh copy of the notice form over AJAX.
|
// Fetch a fresh copy of the notice form over AJAX.
|
||||||
|
2
js/util.min.js
vendored
2
js/util.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user