diff options
Diffstat (limited to 'plugins/Realtime')
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 5 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.css | 37 | ||||
-rw-r--r-- | plugins/Realtime/realtimeupdate.js | 32 |
3 files changed, 46 insertions, 28 deletions
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index b737e442a..cbfa6bae0 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -220,8 +220,9 @@ class RealtimePlugin extends Plugin $action->elementStart('body', (common_current_user()) ? array('id' => $action->trimmed('action'), - 'class' => 'user_in') - : array('id' => $action->trimmed('action'))); + 'class' => 'user_in realtime-popup') + : array('id' => $action->trimmed('action'), + 'class'=> 'realtime-popup')); // XXX hack to deal with JS that tries to get the // root url from page output diff --git a/plugins/Realtime/realtimeupdate.css b/plugins/Realtime/realtimeupdate.css index 0ab5dd32b..56f869354 100644 --- a/plugins/Realtime/realtimeupdate.css +++ b/plugins/Realtime/realtimeupdate.css @@ -1,3 +1,40 @@ +.realtime-popup address { +display:none; +} + +.realtime-popup #content { +width:93.5%; +} + +.realtime-popup #form_notice { +margin:18px 0 18px 1.795%; +width:93%; +max-width:451px; +} + +.realtime-popup #form_notice label[for=notice_data-text], +.realtime-popup h1 { +display:none; +} + +.realtime-popup #form_notice label[for=notice_data-attach], +.realtime-popup #form_notice #notice_data-attach { +top:0; +} + +.realtime-popup #form_notice #notice_data-attach { +left:auto; +right:0; +} + +.realtime-popup .entity_profile { +width:70%; +} +.realtime-popup .entity_actions { +margin-left:1%; +} + + #notices_primary { position:relative; } diff --git a/plugins/Realtime/realtimeupdate.js b/plugins/Realtime/realtimeupdate.js index f383dc3fb..ce0297339 100644 --- a/plugins/Realtime/realtimeupdate.js +++ b/plugins/Realtime/realtimeupdate.js @@ -87,19 +87,19 @@ RealtimeUpdate = { } var noticeItem = RealtimeUpdate.makeNoticeItem(data); + var noticeItemID = $(noticeItem).attr('id'); + $("#notices_primary .notices").prepend(noticeItem); $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(1000); - SN.U.NoticeReply(); - SN.U.NoticeFavor(); + SN.U.FormXHR($('#'+noticeItemID+' .form_favor')); + SN.U.NoticeReplyTo($('#'+noticeItemID)); + SN.U.NoticeWithAttachment($('#'+noticeItemID)); }, purgeLastNoticeItem: function() { if ($('#notices_primary .notice').length > RealtimeUpdate._maxnotices) { - $("#notices_primary .notice:last .form_disfavor").unbind('submit'); - $("#notices_primary .notice:last .form_favor").unbind('submit'); - $("#notices_primary .notice:last .notice_reply").unbind('click'); $("#notices_primary .notice:last").remove(); } }, @@ -268,7 +268,7 @@ RealtimeUpdate = { PP.bind('click', function() { window.open(url, '', - 'toolbar=no,resizable=yes,scrollbars=yes,status=yes,width=500,height=550'); + 'toolbar=no,resizable=yes,scrollbars=yes,status=no,menubar=no,personalbar=no,location=no,width=500,height=550'); return false; }); @@ -276,26 +276,6 @@ RealtimeUpdate = { initPopupWindow: function() { - $('address').hide(); - $('#content').css({'width':'93.5%'}); - - $('#form_notice').css({ - 'margin':'18px 0 18px 1.795%', - 'width':'93%', - 'max-width':'451px' - }); - - $('#form_notice label[for=notice_data-text], h1').css({'display': 'none'}); - - $('.notices li:first-child').css({'border-top-color':'transparent'}); - - $('#form_notice label[for="notice_data-attach"], #form_notice #notice_data-attach').css({'top':'0'}); - - $('#form_notice #notice_data-attach').css({ - 'left':'auto', - 'right':'0' - }); - $('.notices .entry-title a, .notices .entry-content a').bind('click', function() { window.open(this.href, ''); |