If an XHR notice is sent form a page that has no timeline, show a

message like 'Notice sent'

Conflicts:

	js/util.js
This commit is contained in:
Zach Copley 2009-12-02 15:32:26 -08:00
parent 0c0f928459
commit 987d59c242

View File

@ -218,7 +218,9 @@ var SN = { // StatusNet
alert(result.textContent || result.innerHTML); alert(result.textContent || result.innerHTML);
} }
else { else {
notice = document._importNode($('li', data)[0], true); var notices = $('#notices_primary .notices');
if (notices.length > 0) {
var notice = document._importNode($('li', data)[0], true);
if ($('#'+notice.id).length === 0) { if ($('#'+notice.id).length === 0) {
var notice_irt_value = $('#'+SN.C.S.NoticeInReplyTo).val(); var notice_irt_value = $('#'+SN.C.S.NoticeInReplyTo).val();
var notice_irt = '#notices_primary #notice-'+notice_irt_value; var notice_irt = '#notices_primary #notice-'+notice_irt_value;
@ -229,15 +231,21 @@ var SN = { // StatusNet
$($(notice_irt+' .notices')[0]).append(notice); $($(notice_irt+' .notices')[0]).append(notice);
} }
else { else {
$("#notices_primary .notices").prepend(notice); notices.prepend(notice);
} }
$('#'+notice.id).css({display:'none'}); $('#'+notice.id).css({display:'none'});
$('#'+notice.id).fadeIn(2500); $('#'+notice.id).fadeIn(2500);
SN.U.NoticeAttachments(); SN.U.NoticeWithAttachment($('#'+notice.id));
SN.U.NoticeReplyTo($('#'+notice.id)); SN.U.NoticeReplyTo($('#'+notice.id));
SN.U.FormXHR($('#'+notice.id+' .form_favor')); SN.U.FormXHR($('#'+notice.id+' .form_favor'));
} }
} }
else {
result = document._importNode($('title', data)[0], true);
result_title = result.textContent || result.innerHTML;
form.append('<p class="success">'+result_title+'</p>');
}
}
$('#'+form_id+' #'+SN.C.S.NoticeDataText).val(''); $('#'+form_id+' #'+SN.C.S.NoticeDataText).val('');
$('#'+form_id+' #'+SN.C.S.NoticeDataAttach).val(''); $('#'+form_id+' #'+SN.C.S.NoticeDataAttach).val('');
$('#'+form_id+' #'+SN.C.S.NoticeInReplyTo).val(''); $('#'+form_id+' #'+SN.C.S.NoticeInReplyTo).val('');