forked from GNUsocial/gnu-social
Remove billions of debugging statements and extra space
This commit is contained in:
parent
ee799927e6
commit
76ea9384a3
@ -95,7 +95,6 @@ var SN = { // StatusNet
|
|||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
FormNoticeEnhancements: function(form) {
|
FormNoticeEnhancements: function(form) {
|
||||||
console.log("FormNoticeEnhancements - begin");
|
|
||||||
if (jQuery.data(form[0], 'ElementData') === undefined) {
|
if (jQuery.data(form[0], 'ElementData') === undefined) {
|
||||||
MaxLength = form.find('.count').text();
|
MaxLength = form.find('.count').text();
|
||||||
if (typeof(MaxLength) == 'undefined') {
|
if (typeof(MaxLength) == 'undefined') {
|
||||||
@ -321,7 +320,6 @@ var SN = { // StatusNet
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
FormNoticeXHR: function(form) {
|
FormNoticeXHR: function(form) {
|
||||||
console.log("FormNoticeXHR - begin");
|
|
||||||
SN.C.I.NoticeDataGeo = {};
|
SN.C.I.NoticeDataGeo = {};
|
||||||
form.append('<input type="hidden" name="ajax" value="1"/>');
|
form.append('<input type="hidden" name="ajax" value="1"/>');
|
||||||
|
|
||||||
@ -428,7 +426,6 @@ var SN = { // StatusNet
|
|||||||
|
|
||||||
var id = $(notice).attr('id');
|
var id = $(notice).attr('id');
|
||||||
if ($("#"+id).length == 0) {
|
if ($("#"+id).length == 0) {
|
||||||
console.log("inserting before placeholder");
|
|
||||||
$(notice).insertBefore(placeholder);
|
$(notice).insertBefore(placeholder);
|
||||||
} else {
|
} else {
|
||||||
// Realtime came through before us...
|
// Realtime came through before us...
|
||||||
@ -639,7 +636,6 @@ var SN = { // StatusNet
|
|||||||
*/
|
*/
|
||||||
NoticeInlineReplyTrigger: function(notice, initialText) {
|
NoticeInlineReplyTrigger: function(notice, initialText) {
|
||||||
// Find the notice we're replying to...
|
// Find the notice we're replying to...
|
||||||
console.log('NoticeInlineReplyTrigger');
|
|
||||||
var id = $($('.notice_id', notice)[0]).text();
|
var id = $($('.notice_id', notice)[0]).text();
|
||||||
var parentNotice = notice;
|
var parentNotice = notice;
|
||||||
|
|
||||||
@ -654,7 +650,6 @@ var SN = { // StatusNet
|
|||||||
// and we'll add on the end of it. Will add if needed.
|
// and we'll add on the end of it. Will add if needed.
|
||||||
list = $('ul.threaded-replies', notice);
|
list = $('ul.threaded-replies', notice);
|
||||||
if (list.length == 0) {
|
if (list.length == 0) {
|
||||||
console.log("list = 0");
|
|
||||||
SN.U.NoticeInlineReplyPlaceholder(notice);
|
SN.U.NoticeInlineReplyPlaceholder(notice);
|
||||||
list = $('ul.threaded-replies', notice);
|
list = $('ul.threaded-replies', notice);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,19 +1,14 @@
|
|||||||
|
|
||||||
var QnA = {
|
var QnA = {
|
||||||
|
|
||||||
// @fixme: Should use ID
|
// @fixme: Should use ID
|
||||||
close: function(form, best) {
|
close: function(form, best) {
|
||||||
var notice = $(form).closest('li.hentry.notice.question');
|
var notice = $(form).closest('li.hentry.notice.question');
|
||||||
|
|
||||||
console.log("close");
|
|
||||||
|
|
||||||
notice.find('input#qna-best-answer,#qna-question-close').hide();
|
notice.find('input#qna-best-answer,#qna-question-close').hide();
|
||||||
notice.find('textarea').hide();
|
notice.find('textarea').hide();
|
||||||
|
|
||||||
var list = notice.find('ul');
|
var list = notice.find('ul');
|
||||||
|
|
||||||
console.log("found this many uls: " + list.length);
|
|
||||||
|
|
||||||
notice.find('ul > li.notice-answer-placeholder').remove();
|
notice.find('ul > li.notice-answer-placeholder').remove();
|
||||||
notice.find('ul > li.notice-answer').remove();
|
notice.find('ul > li.notice-answer').remove();
|
||||||
|
|
||||||
@ -23,13 +18,9 @@ var QnA = {
|
|||||||
p.append($('<span class="question-closed">This question is closed.</span>'));
|
p.append($('<span class="question-closed">This question is closed.</span>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
init: function() {
|
init: function() {
|
||||||
|
|
||||||
QnA.NoticeInlineAnswerSetup();
|
QnA.NoticeInlineAnswerSetup();
|
||||||
|
|
||||||
$('form.form_question_show').live('submit', function() {
|
$('form.form_question_show').live('submit', function() {
|
||||||
@ -38,7 +29,6 @@ var QnA = {
|
|||||||
$('form.form_answer_show').live('submit', function() {
|
$('form.form_answer_show').live('submit', function() {
|
||||||
QnA.close(this, true);
|
QnA.close(this, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,25 +39,18 @@ var QnA = {
|
|||||||
NoticeInlineAnswerTrigger: function(notice) {
|
NoticeInlineAnswerTrigger: function(notice) {
|
||||||
// Find the notice we're replying to...
|
// Find the notice we're replying to...
|
||||||
var id = $($('.notice_id', notice)[0]).text();
|
var id = $($('.notice_id', notice)[0]).text();
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger - answering notice " + id);
|
|
||||||
|
|
||||||
var parentNotice = notice;
|
var parentNotice = notice;
|
||||||
|
|
||||||
// Find the threaded replies view we'll be adding to...
|
// Find the threaded replies view we'll be adding to...
|
||||||
var list = notice.closest('.notices');
|
var list = notice.closest('.notices');
|
||||||
|
|
||||||
if (list.hasClass('threaded-replies')) {
|
if (list.hasClass('threaded-replies')) {
|
||||||
console.log("NoticeInlineAnswerTrigger - there's already a threaded-replies ul above me");
|
|
||||||
// We're replying to a reply; use reply form on the end of this list.
|
// We're replying to a reply; use reply form on the end of this list.
|
||||||
// We'll add our form at the end of this; grab the root notice.
|
// We'll add our form at the end of this; grab the root notice.
|
||||||
parentNotice = list.closest('.notice');
|
parentNotice = list.closest('.notice');
|
||||||
console.log("NoticeInlineAnswerTrigger - trying to find the closest .notice above me");
|
|
||||||
if (parentNotice.length > 0) {
|
|
||||||
console.log("NoticeInlineAnswerTrigger - found that closest .notice - length = " + parentNotice.length);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.log("NoticeInlineAnswerTrigger - this notice does not have a threaded-reples ul");
|
|
||||||
// We're replying to a parent notice; pull its threaded list
|
// We're replying to a parent notice; pull its threaded list
|
||||||
// and we'll add on the end of it. Will add if needed.
|
// and we'll add on the end of it. Will add if needed.
|
||||||
list = $('ul.threaded-replies', notice);
|
list = $('ul.threaded-replies', notice);
|
||||||
@ -84,15 +67,11 @@ var QnA = {
|
|||||||
// really wants to.
|
// really wants to.
|
||||||
var dummyAnswer = $('ul.qna-dummy', notice);
|
var dummyAnswer = $('ul.qna-dummy', notice);
|
||||||
if (dummyAnswer.length > 0) {
|
if (dummyAnswer.length > 0) {
|
||||||
console.log("hiding any reply placeholders");
|
|
||||||
notice.find('li.notice-reply-placeholder').hide();
|
notice.find('li.notice-reply-placeholder').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var nextStep = function() {
|
var nextStep = function() {
|
||||||
console.log("NoticeInlineAnswerTrigger (nextStep) - begin");
|
|
||||||
|
|
||||||
var dummyAnswer = $('ul.qna-dummy', notice);
|
var dummyAnswer = $('ul.qna-dummy', notice);
|
||||||
dummyAnswer.hide();
|
dummyAnswer.hide();
|
||||||
|
|
||||||
@ -105,24 +84,19 @@ var QnA = {
|
|||||||
|
|
||||||
text.focus();
|
text.focus();
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger (nextStep) - setting up body click handler to hide open form when clicking away");
|
|
||||||
$('body').click(function(e) {
|
$('body').click(function(e) {
|
||||||
console.log("body click handler - got click");
|
|
||||||
|
|
||||||
var dummyAnswer = $('ul.qna-dummy', notice);
|
var dummyAnswer = $('ul.qna-dummy', notice);
|
||||||
|
|
||||||
var style = dummyAnswer.attr('style');
|
var style = dummyAnswer.attr('style');
|
||||||
if (style !== 'display: none;') {
|
var ans = $(notice).find('li.hentry.notice.anwer', notice)
|
||||||
|
if (ans > 0) {
|
||||||
hideReplyPlaceholders(notice);
|
hideReplyPlaceholders(notice);
|
||||||
}
|
}
|
||||||
|
|
||||||
var openAnswers = $('li.notice-answer');
|
var openAnswers = $('li.notice-answer');
|
||||||
if (openAnswers.length > 0) {
|
if (openAnswers.length > 0) {
|
||||||
console.log("body click handler - Found one or more open answer forms to close");
|
|
||||||
var target = $(e.target);
|
var target = $(e.target);
|
||||||
|
|
||||||
openAnswers.each(function() {
|
openAnswers.each(function() {
|
||||||
console.log("body click handler - found an open answer form");
|
|
||||||
// Did we click outside this one?
|
// Did we click outside this one?
|
||||||
var answerItem = $(this);
|
var answerItem = $(this);
|
||||||
var parentNotice = answerItem.closest('li.notice');
|
var parentNotice = answerItem.closest('li.notice');
|
||||||
@ -132,92 +106,51 @@ var QnA = {
|
|||||||
var cur = $.trim(textarea.val());
|
var cur = $.trim(textarea.val());
|
||||||
// Only close if there's been no edit.
|
// Only close if there's been no edit.
|
||||||
if (cur == '' || cur == textarea.data('initialText')) {
|
if (cur == '' || cur == textarea.data('initialText')) {
|
||||||
console.log("body click handler - no text in answer form, closing it");
|
|
||||||
answerItem.remove();
|
answerItem.remove();
|
||||||
console.log("body click handler - showing dummy placeholder");
|
|
||||||
dummyAnswer.show();
|
dummyAnswer.show();
|
||||||
|
|
||||||
} else {
|
|
||||||
console.log("body click handler - there is text in the answer form, wont close it");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('body click handler - exit');
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// See if the form's already open...
|
// See if the form's already open...
|
||||||
|
|
||||||
if (answerForm.length > 0 ) {
|
if (answerForm.length > 0 ) {
|
||||||
console.log("NoticeInlineAnswerTrigger - found an open .notice-answer-form - doing nextStep()");
|
|
||||||
nextStep();
|
nextStep();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger - hiding the dummy placeholder");
|
|
||||||
var placeholder = list.find('li.qna-dummy-placeholder').hide();
|
var placeholder = list.find('li.qna-dummy-placeholder').hide();
|
||||||
|
|
||||||
// Create the answer form entry at the end
|
// Create the answer form entry at the end
|
||||||
|
|
||||||
var answerItem = $('li.notice-answer', list);
|
var answerItem = $('li.notice-answer', list);
|
||||||
|
|
||||||
if (answerItem.length > 0) {
|
|
||||||
console.log("NoticeInlineAnswerTrigger - Found " + answerItem.length + " answer items (notice-answer li)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (answerItem.length == 0) {
|
if (answerItem.length == 0) {
|
||||||
console.log("NoticeInlineAnswerTrigger - no answer item (notice-answer li)");
|
|
||||||
answerItem = $('<li class="notice-answer"></li>');
|
answerItem = $('<li class="notice-answer"></li>');
|
||||||
|
|
||||||
var intermediateStep = function(formMaster) {
|
var intermediateStep = function(formMaster) {
|
||||||
|
// @todo cache the form if we can (worth it?)
|
||||||
// cache it
|
|
||||||
//if (!QnA.AnswerFormMaster) {
|
|
||||||
// QnA.AnswerFormMaster = formMaster;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger - (intermediate) step begin");
|
|
||||||
var formEl = document._importNode(formMaster, true);
|
var formEl = document._importNode(formMaster, true);
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger - (intermediate step) appending answer form to answer item");
|
|
||||||
$(formEl).data('NoticeFormSetup', true);
|
$(formEl).data('NoticeFormSetup', true);
|
||||||
|
|
||||||
answerItem.append(formEl);
|
answerItem.append(formEl);
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger - (intermediate step) appending answer to replies list, after placeholder");
|
|
||||||
list.prepend(answerItem); // *before* the placeholder
|
list.prepend(answerItem); // *before* the placeholder
|
||||||
var form = answerForm = $(formEl);
|
var form = answerForm = $(formEl);
|
||||||
console.log("NoticeInlineAnswerTrigger - (intermediate step) calling QnA.AnswerFormSetup on the form")
|
|
||||||
QnA.AnswerFormSetup(form);
|
QnA.AnswerFormSetup(form);
|
||||||
console.log("NoticeInlineAnswerTrigger - (intermediate step) calling nextstep()");
|
|
||||||
nextStep();
|
nextStep();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (QnA.AnswerFormMaster) {
|
if (QnA.AnswerFormMaster) {
|
||||||
console.log("NoticeInlineAnswerTrigger - found a cached copy of the answer form");
|
// @todo if we had a cached for here's where we'd use it'
|
||||||
// We've already saved a master copy of the form.
|
|
||||||
// Clone it in!
|
|
||||||
console.log("NoticeInlineAnswerTrigger - calling intermediateStep with cached form");
|
|
||||||
intermediateStep(QnA.AnswerFormMaster);
|
intermediateStep(QnA.AnswerFormMaster);
|
||||||
} else {
|
} else {
|
||||||
// Fetch a fresh copy of the answer form over AJAX.
|
// Fetch a fresh copy of the answer form over AJAX.
|
||||||
// Warning: this can have a delay, which looks bad.
|
// Warning: this can have a delay, which looks bad.
|
||||||
// @fixme this fallback may or may not work
|
// @fixme this fallback may or may not work
|
||||||
var url = $('#answer-action').attr('value');
|
var url = $('#answer-action').attr('value');
|
||||||
|
|
||||||
console.log("NoticeInlineAnswerTrigger - fetching new form via HXR");
|
|
||||||
|
|
||||||
$.get(url, {ajax: 1}, function(data, textStatus, xhr) {
|
$.get(url, {ajax: 1}, function(data, textStatus, xhr) {
|
||||||
console.log("NoticeInlineAnswerTrigger - got a new form via HXR, calling intermediateStep");
|
|
||||||
intermediateStep($('form', data)[0]);
|
intermediateStep($('form', data)[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('NoticeInlineAnswerTrigger - exit');
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -227,18 +160,18 @@ var QnA = {
|
|||||||
* Uses 'live' rather than 'bind', so applies to future as well as present items.
|
* Uses 'live' rather than 'bind', so applies to future as well as present items.
|
||||||
*/
|
*/
|
||||||
NoticeInlineAnswerSetup: function() {
|
NoticeInlineAnswerSetup: function() {
|
||||||
console.log("NoticeInlineAnswerSetup - begin");
|
|
||||||
$('li.qna-dummy-placeholder input.placeholder')
|
$('li.qna-dummy-placeholder input.placeholder')
|
||||||
.live('focus', function() {
|
.live('focus', function() {
|
||||||
var notice = $(this).closest('li.notice');
|
var notice = $(this).closest('li.notice');
|
||||||
QnA.NoticeInlineAnswerTrigger(notice);
|
QnA.NoticeInlineAnswerTrigger(notice);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
console.log("NoticeInlineAnswerSetup - exit");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
AnswerFormSetup: function(form) {
|
AnswerFormSetup: function(form) {
|
||||||
console.log("AnswerFormSetup");
|
|
||||||
form.find('textarea').focus();
|
form.find('textarea').focus();
|
||||||
|
|
||||||
if (!form.data('NoticeFormSetup')) {
|
if (!form.data('NoticeFormSetup')) {
|
||||||
@ -268,14 +201,12 @@ var QnA = {
|
|||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
FormAnswerXHR: function(form) {
|
FormAnswerXHR: function(form) {
|
||||||
console.log("FormAanwerXHR - begin");
|
|
||||||
//SN.C.I.NoticeDataGeo = {};
|
//SN.C.I.NoticeDataGeo = {};
|
||||||
form.append('<input type="hidden" name="ajax" value="1"/>');
|
form.append('<input type="hidden" name="ajax" value="1"/>');
|
||||||
console.log("FormAnswerXHR - appended ajax flag to form");
|
|
||||||
|
|
||||||
// Make sure we don't have a mixed HTTP/HTTPS submission...
|
// Make sure we don't have a mixed HTTP/HTTPS submission...
|
||||||
form.attr('action', SN.U.RewriteAjaxAction(form.attr('action')));
|
form.attr('action', SN.U.RewriteAjaxAction(form.attr('action')));
|
||||||
console.log("FormAnswerXHR rewrote action so we don't have a mixed HTTP/HTTPS submission");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a response feedback bit under the new-notice dialog.
|
* Show a response feedback bit under the new-notice dialog.
|
||||||
@ -299,14 +230,12 @@ var QnA = {
|
|||||||
form.find('.form_response').remove();
|
form.find('.form_response').remove();
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log("FormAnswerXHR - doing ajaxForm call");
|
|
||||||
|
|
||||||
form.ajaxForm({
|
form.ajaxForm({
|
||||||
dataType: 'xml',
|
dataType: 'xml',
|
||||||
timeout: '60000',
|
timeout: '60000',
|
||||||
|
|
||||||
beforeSend: function(formData) {
|
beforeSend: function(formData) {
|
||||||
console.log("FormAnswerXHR - beforeSend");
|
|
||||||
if (form.find('.notice_data-text:first').val() == '') {
|
if (form.find('.notice_data-text:first').val() == '') {
|
||||||
form.addClass(SN.C.S.Warning);
|
form.addClass(SN.C.S.Warning);
|
||||||
return false;
|
return false;
|
||||||
@ -349,7 +278,7 @@ var QnA = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
success: function(data, textStatus) {
|
success: function(data, textStatus) {
|
||||||
console.log("FormAnswerHXR - success");
|
|
||||||
removeFeedback();
|
removeFeedback();
|
||||||
var errorResult = $('#'+SN.C.S.Error, data);
|
var errorResult = $('#'+SN.C.S.Error, data);
|
||||||
if (errorResult.length > 0) {
|
if (errorResult.length > 0) {
|
||||||
@ -359,58 +288,44 @@ var QnA = {
|
|||||||
|
|
||||||
// New notice post was successful. If on our timeline, show it!
|
// New notice post was successful. If on our timeline, show it!
|
||||||
var notice = document._importNode($('li', data)[0], true);
|
var notice = document._importNode($('li', data)[0], true);
|
||||||
console.log("FormAnswerXHR - loaded the notice, now trying to insert it somewhere");
|
|
||||||
|
|
||||||
var notices = $('#notices_primary .notices:first');
|
var notices = $('#notices_primary .notices:first');
|
||||||
|
|
||||||
console.log("FormAnswerXHR - looking for the closest notice with a notice-answer li");
|
|
||||||
|
|
||||||
var answerItem = form.closest('li.notice-answer');
|
var answerItem = form.closest('li.notice-answer');
|
||||||
var questionItem = form.closest('li.question');
|
var questionItem = form.closest('li.question');
|
||||||
|
|
||||||
var dummyAnswer = form.find('ul.qna-dummy', questionItem).remove();
|
var dummyAnswer = form.find('ul.qna-dummy', questionItem).remove();
|
||||||
|
|
||||||
if (answerItem.length > 0) {
|
if (answerItem.length > 0) {
|
||||||
console.log("FormAnswerXHR - I found the answer li to append to");
|
|
||||||
// If this is an inline reply, remove the form...
|
|
||||||
console.log("FormAnswerXHR - looking for the closest .threaded-replies ul")
|
|
||||||
var list = form.closest('.threaded-replies');
|
|
||||||
console.log("FormAnswerXHR - search list for the answer placeholder")
|
|
||||||
|
|
||||||
|
// If this is an inline answer, remove the form...
|
||||||
|
var list = form.closest('.threaded-replies');
|
||||||
|
|
||||||
|
// if the inserted notice's parent question needs it give it a placeholder
|
||||||
|
var ans = questionItem.find('ul > li.hentry.notice.answer');
|
||||||
|
if (ans.length == 0) {
|
||||||
|
SN.U.NoticeInlineReplyPlaceholder(questionItem);
|
||||||
|
}
|
||||||
|
|
||||||
var id = $(notice).attr('id');
|
var id = $(notice).attr('id');
|
||||||
console.log("FormAnswerXHR - the new notice id is: " + id);
|
|
||||||
|
|
||||||
if ($("#"+id).length == 0) {
|
if ($("#"+id).length == 0) {
|
||||||
console.log("FormAnswerXHR - the notice is not there already so realtime hasn't inserted it before us");
|
|
||||||
console.log("FormAnswerXHR - inserting new notice before placeholder");
|
|
||||||
$(notice).insertBefore(answerItem);
|
$(notice).insertBefore(answerItem);
|
||||||
answerItem.remove();
|
answerItem.remove();
|
||||||
|
|
||||||
SN.U.NoticeInlineReplyPlaceholder(questionItem);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
// NOP
|
||||||
// Realtime came through before us...
|
// Realtime came through before us...
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
|
} else if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
|
||||||
console.log('FormAnswerXHR - there is at least one notice on the timeline and the new notice should be added to the list');
|
|
||||||
// Not a reply. If on our timeline, show it at the
|
// Not a reply. If on our timeline, show it at the
|
||||||
if ($('#'+notice.id).length === 0) {
|
if ($('#'+notice.id).length === 0) {
|
||||||
console.log("FormAnswerXHR - The notice is not yet on the timeline.")
|
|
||||||
var notice_irt_value = form.find('#inreplyto').val();
|
var notice_irt_value = form.find('#inreplyto').val();
|
||||||
console.log("FormAnswerXHR - getting value from #inreplyto inside the form: " + notice_irt_value);
|
|
||||||
var notice_irt = '#notices_primary #notice-'+notice_irt_value;
|
var notice_irt = '#notices_primary #notice-'+notice_irt_value;
|
||||||
console.log("notice_irt selector = " + notice_irt_value);
|
|
||||||
if($('body')[0].id == 'conversation') {
|
if($('body')[0].id == 'conversation') {
|
||||||
console.log("FormAnswerXHR - we're on a conversation page");
|
|
||||||
if(notice_irt_value.length > 0 && $(notice_irt+' .notices').length < 1) {
|
if(notice_irt_value.length > 0 && $(notice_irt+' .notices').length < 1) {
|
||||||
$(notice_irt).append('<ul class="notices"></ul>');
|
$(notice_irt).append('<ul class="notices"></ul>');
|
||||||
}
|
}
|
||||||
console.log("FormAnswerXHR - appending notice after notice_irt selector");
|
|
||||||
$($(notice_irt+' .notices')[0]).append(notice);
|
$($(notice_irt+' .notices')[0]).append(notice);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log("FormAnswerXHR prepending notice to top of the notice list");
|
|
||||||
notices.prepend(notice);
|
notices.prepend(notice);
|
||||||
}
|
}
|
||||||
$('#'+notice.id)
|
$('#'+notice.id)
|
||||||
@ -426,9 +341,6 @@ var QnA = {
|
|||||||
// @fixme inline
|
// @fixme inline
|
||||||
showFeedback('success', $('title', data).text());
|
showFeedback('success', $('title', data).text());
|
||||||
}
|
}
|
||||||
|
|
||||||
//form.resetForm();
|
|
||||||
//SN.U.FormNoticeEnhancements(form);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete: function(xhr, textStatus) {
|
complete: function(xhr, textStatus) {
|
||||||
@ -440,7 +352,6 @@ var QnA = {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user