forked from GNUsocial/gnu-social
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
This commit is contained in:
commit
df6c22c4cb
14
js/util.js
14
js/util.js
@ -188,11 +188,15 @@ $(document).ready(function(){
|
|||||||
alert(result);
|
alert(result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
|
li = $("li", xml).get(0);
|
||||||
$("#notices_primary .notice:first").css({display:"none"});
|
id = li.id;
|
||||||
$("#notices_primary .notice:first").fadeIn(2500);
|
if ($("#"+li.id).length == 0) {
|
||||||
NoticeHover();
|
$("#notices_primary .notices").prepend(document._importNode(li, true));
|
||||||
NoticeReply();
|
$("#notices_primary .notice:first").css({display:"none"});
|
||||||
|
$("#notices_primary .notice:first").fadeIn(2500);
|
||||||
|
NoticeHover();
|
||||||
|
NoticeReply();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$("#notice_data-text").val("");
|
$("#notice_data-text").val("");
|
||||||
counter();
|
counter();
|
||||||
|
@ -62,6 +62,14 @@ class CometPlugin extends Plugin
|
|||||||
case 'public':
|
case 'public':
|
||||||
$timeline = '/timelines/public';
|
$timeline = '/timelines/public';
|
||||||
break;
|
break;
|
||||||
|
case 'tag':
|
||||||
|
$tag = $action->trimmed('tag');
|
||||||
|
if (!empty($tag)) {
|
||||||
|
$timeline = '/timelines/tag/'.$tag;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -94,6 +102,14 @@ class CometPlugin extends Plugin
|
|||||||
$timelines[] = '/timelines/public';
|
$timelines[] = '/timelines/public';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tags = $this->getNoticeTags($notice);
|
||||||
|
|
||||||
|
if (!empty($tags)) {
|
||||||
|
foreach ($tags as $tag) {
|
||||||
|
$timelines[] = '/timelines/tag/' . $tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (count($timelines) > 0) {
|
if (count($timelines) > 0) {
|
||||||
// Require this, since we need it
|
// Require this, since we need it
|
||||||
require_once(INSTALLDIR.'/plugins/Comet/bayeux.class.inc.php');
|
require_once(INSTALLDIR.'/plugins/Comet/bayeux.class.inc.php');
|
||||||
@ -127,6 +143,7 @@ class CometPlugin extends Plugin
|
|||||||
|
|
||||||
$arr = $act->twitter_status_array($notice, true);
|
$arr = $act->twitter_status_array($notice, true);
|
||||||
$arr['url'] = $notice->bestUrl();
|
$arr['url'] = $notice->bestUrl();
|
||||||
|
$arr['html'] = htmlspecialchars($notice->rendered);
|
||||||
|
|
||||||
$profile = $notice->getProfile();
|
$profile = $notice->getProfile();
|
||||||
$arr['user']['profile_url'] = $profile->profileurl;
|
$arr['user']['profile_url'] = $profile->profileurl;
|
||||||
@ -134,6 +151,26 @@ class CometPlugin extends Plugin
|
|||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNoticeTags($notice)
|
||||||
|
{
|
||||||
|
$tags = null;
|
||||||
|
|
||||||
|
$nt = new Notice_tag();
|
||||||
|
$nt->notice_id = $notice->id;
|
||||||
|
|
||||||
|
if ($nt->find()) {
|
||||||
|
$tags = array();
|
||||||
|
while ($nt->fetch()) {
|
||||||
|
$tags[] = $nt->tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$nt->free();
|
||||||
|
$nt = null;
|
||||||
|
|
||||||
|
return $tags;
|
||||||
|
}
|
||||||
|
|
||||||
// Push this up to Plugin
|
// Push this up to Plugin
|
||||||
|
|
||||||
function log($level, $msg)
|
function log($level, $msg)
|
||||||
|
@ -23,6 +23,14 @@ var updater = function()
|
|||||||
|
|
||||||
function receive(message)
|
function receive(message)
|
||||||
{
|
{
|
||||||
|
id = message.data.id;
|
||||||
|
|
||||||
|
// Don't add it if it already exists
|
||||||
|
|
||||||
|
if ($("#notice-"+id).length > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var noticeItem = makeNoticeItem(message.data);
|
var noticeItem = makeNoticeItem(message.data);
|
||||||
$("#notices_primary .notices").prepend(noticeItem, true);
|
$("#notices_primary .notices").prepend(noticeItem, true);
|
||||||
$("#notices_primary .notice:first").css({display:"none"});
|
$("#notices_primary .notice:first").css({display:"none"});
|
||||||
@ -34,6 +42,8 @@ var updater = function()
|
|||||||
function makeNoticeItem(data)
|
function makeNoticeItem(data)
|
||||||
{
|
{
|
||||||
user = data['user'];
|
user = data['user'];
|
||||||
|
html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
||||||
|
|
||||||
ni = "<li class=\"hentry notice\" id=\"notice-"+data['id']+"\">"+
|
ni = "<li class=\"hentry notice\" id=\"notice-"+data['id']+"\">"+
|
||||||
"<div class=\"entry-title\">"+
|
"<div class=\"entry-title\">"+
|
||||||
"<span class=\"vcard author\">"+
|
"<span class=\"vcard author\">"+
|
||||||
@ -42,7 +52,7 @@ var updater = function()
|
|||||||
"<span class=\"nickname fn\">"+user['screen_name']+"</span>"+
|
"<span class=\"nickname fn\">"+user['screen_name']+"</span>"+
|
||||||
"</a>"+
|
"</a>"+
|
||||||
"</span>"+
|
"</span>"+
|
||||||
"<p class=\"entry-content\">"+data['text']+"</p>"+
|
"<p class=\"entry-content\">"+html+"</p>"+
|
||||||
"</div>"+
|
"</div>"+
|
||||||
"<div class=\"entry-content\">"+
|
"<div class=\"entry-content\">"+
|
||||||
"<dl class=\"timestamp\">"+
|
"<dl class=\"timestamp\">"+
|
||||||
|
Loading…
Reference in New Issue
Block a user