Revert "Kill off all document._importNode() calls except the ones used with the JQuery Form plugin (fixes an IE7 issue)"

This reverts commit 997d160002756050814241ad444d9cc74774cf83.

Conflicts:

	js/util.min.js
This commit is contained in:
Zach Copley 2011-05-02 11:57:25 -07:00
parent dab27ac9fd
commit c05b3b5bd2
2 changed files with 18 additions and 17 deletions

View File

@ -273,14 +273,14 @@ var SN = { // StatusNet
}, },
success: function(data, textStatus) { success: function(data, textStatus) {
if (typeof($('form', data)[0]) != 'undefined') { if (typeof($('form', data)[0]) != 'undefined') {
form_new = $('form', $(data).children()); form_new = document._importNode($('form', data)[0], true);
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$('form', $(data).children()); form.replaceWith(document._importNode($('p', data)[0], true));
if (onSuccess) { if (onSuccess) {
onSuccess(); onSuccess();
} }
@ -502,11 +502,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 = $('ul', $(data).children()); var list = document._importNode($('ul', data)[0], true);
results_placeholder.replaceWith(list); results_placeholder.replaceWith(list);
} }
else { else {
var _error = $('<li/>').append($('p', $(data).children())); var _error = $('<li/>').append(document._importNode($('p', data)[0], true));
results_placeholder.html(_error); results_placeholder.html(_error);
} }
form form
@ -536,12 +536,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 = $('.entity_tags', $(data).children()); var tags = document._importNode($('.entity_tags', data)[0], true);
$(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($('p', $(data).children())); results_placeholder.append(document._importNode($('p', data)[0], true));
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)
@ -701,10 +701,11 @@ var SN = { // StatusNet
replyItem = $('<li class="notice-reply"></li>'); replyItem = $('<li class="notice-reply"></li>');
var intermediateStep = function(formMaster) { var intermediateStep = function(formMaster) {
replyItem.append(formMaster); var formEl = document._importNode(formMaster, true);
replyItem.append(formEl);
list.append(replyItem); // *after* the placeholder list.append(replyItem); // *after* the placeholder
var form = replyForm = formMaster; var form = replyForm = $(formEl);
SN.Init.NoticeFormSetup(form); SN.Init.NoticeFormSetup(form);
nextStep(); nextStep();
@ -719,8 +720,8 @@ var SN = { // StatusNet
// @fixme this fallback may or may not work // @fixme this fallback may or may not work
var url = $('#form_notice').attr('action'); var url = $('#form_notice').attr('action');
$.get(url, {ajax: 1}, function(data, textStatus, xhr) { $.get(url, {ajax: 1}, function(data, textStatus, xhr) {
intermediateStep($('form', $(data).children())); intermediateStep($('form', data)[0]);
}, 'xml'); });
} }
} }
} }
@ -759,11 +760,11 @@ var SN = { // StatusNet
var url = $(this).attr('href'); var url = $(this).attr('href');
var area = $(this).closest('.threaded-replies'); var area = $(this).closest('.threaded-replies');
$.get(url, {ajax: 1}, function(data, textStatus, xhr) { $.get(url, {ajax: 1}, function(data, textStatus, xhr) {
var replies = $('.threaded-replies', $(data).children()); var replies = $('.threaded-replies', data);
if (replies.length) { if (replies.length) {
area.replaceWith(replies); area.replaceWith(document._importNode(replies[0], true));
} }
}, 'xml'); });
return false; return false;
}); });
}, },
@ -1266,7 +1267,7 @@ var SN = { // StatusNet
if (NDMF.length === 0) { if (NDMF.length === 0) {
$(this).addClass(SN.C.S.Processing); $(this).addClass(SN.C.S.Processing);
$.get(NDM.attr('href'), null, function(data) { $.get(NDM.attr('href'), null, function(data) {
$('.entity_send-a-message').append($('form', $(data).children())); $('.entity_send-a-message').append(document._importNode($('form', data)[0], true));
NDMF = $('.entity_send-a-message .form_notice'); NDMF = $('.entity_send-a-message .form_notice');
SN.U.FormNoticeXHR(NDMF); SN.U.FormNoticeXHR(NDMF);
SN.U.FormNoticeEnhancements(NDMF); SN.U.FormNoticeEnhancements(NDMF);
@ -1276,7 +1277,7 @@ var SN = { // StatusNet
return false; return false;
}); });
NDM.removeClass(SN.C.S.Processing); NDM.removeClass(SN.C.S.Processing);
}, 'xml'); });
} }
else { else {
NDMF.show(); NDMF.show();
@ -1513,7 +1514,7 @@ var SN = { // StatusNet
if ($('body.user_in').length > 0) { if ($('body.user_in').length > 0) {
var masterForm = $('.form_notice:first'); var masterForm = $('.form_notice:first');
if (masterForm.length > 0) { if (masterForm.length > 0) {
SN.C.I.NoticeFormMaster = masterForm; SN.C.I.NoticeFormMaster = document._importNode(masterForm[0], true);
} }
SN.U.NoticeRepeat(); SN.U.NoticeRepeat();
SN.U.NoticeReply(); SN.U.NoticeReply();

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long