X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=js%2Futil.js;h=1372c9f6965db105e9adee570ba36a66d940c4ac;hb=02c5d68bed794b888e7d4a41f2c08d688a67ba6d;hp=5c12ab111db536d221a22d841c2db013f4e0e346;hpb=76ea9384a3c6185a27d690e4247efe3a755be7b2;p=quix0rs-gnu-social.git diff --git a/js/util.js b/js/util.js index 5c12ab111d..1372c9f696 100644 --- a/js/util.js +++ b/js/util.js @@ -273,7 +273,7 @@ var SN = { // StatusNet }, success: function(data, textStatus) { if (typeof($('form', data)[0]) != 'undefined') { - form_new = document._importNode($('form', data)[0], true); + var form_new = document._importNode($('form', data)[0], true); form.replaceWith(form_new); if (onSuccess) { onSuccess(); @@ -693,7 +693,7 @@ var SN = { // StatusNet nextStep(); } else { // Hide the placeholder... - var placeholder = list.find('li.notice-reply-placeholder').hide(); + placeholder = list.find('li.notice-reply-placeholder').hide(); // Create the reply form entry at the end var replyItem = $('li.notice-reply', list); @@ -701,11 +701,10 @@ var SN = { // StatusNet replyItem = $('
  • '); var intermediateStep = function(formMaster) { - var formEl = document._importNode(formMaster, true); - replyItem.append(formEl); + replyItem.append(formMaster); list.append(replyItem); // *after* the placeholder - var form = replyForm = $(formEl); + var form = replyForm = formMaster; SN.Init.NoticeFormSetup(form); nextStep(); @@ -720,8 +719,8 @@ var SN = { // StatusNet // @fixme this fallback may or may not work var url = $('#form_notice').attr('action'); $.get(url, {ajax: 1}, function(data, textStatus, xhr) { - intermediateStep($('form', data)[0]); - }); + intermediateStep($('form', $(data).children())); + }, 'xml'); } } } @@ -760,11 +759,11 @@ var SN = { // StatusNet var url = $(this).attr('href'); var area = $(this).closest('.threaded-replies'); $.get(url, {ajax: 1}, function(data, textStatus, xhr) { - var replies = $('.threaded-replies', data); + var replies = $('.threaded-replies', $(data).children()); if (replies.length) { - area.replaceWith(document._importNode(replies[0], true)); + area.replaceWith(replies); } - }); + }, 'xml'); return false; }); }, @@ -1267,7 +1266,7 @@ var SN = { // StatusNet if (NDMF.length === 0) { $(this).addClass(SN.C.S.Processing); $.get(NDM.attr('href'), null, function(data) { - $('.entity_send-a-message').append(document._importNode($('form', data)[0], true)); + $('.entity_send-a-message').append($('form', $(data).children())); NDMF = $('.entity_send-a-message .form_notice'); SN.U.FormNoticeXHR(NDMF); SN.U.FormNoticeEnhancements(NDMF); @@ -1277,7 +1276,7 @@ var SN = { // StatusNet return false; }); NDM.removeClass(SN.C.S.Processing); - }); + }, 'xml'); } else { NDMF.show(); @@ -1514,7 +1513,7 @@ var SN = { // StatusNet if ($('body.user_in').length > 0) { var masterForm = $('.form_notice:first'); if (masterForm.length > 0) { - SN.C.I.NoticeFormMaster = document._importNode(masterForm[0], true); + SN.C.I.NoticeFormMaster = masterForm; } SN.U.NoticeRepeat(); SN.U.NoticeReply();