human readable text-field for qvitter's new deleted-notice activity

This commit is contained in:
Hannes Mannerheim 2015-07-02 15:00:57 +02:00
parent 871fab52b9
commit 0c79026f77
3 changed files with 236 additions and 226 deletions

View File

@ -726,12 +726,15 @@ class QvitterPlugin extends Plugin {
$profile->getBestName(), $profile->getBestName(),
$notice->getUrl(), $notice->getUrl(),
$notice->uri); $notice->uri);
$text = sprintf(_m('%1$s deleted notice {{%2$s}}.'),
$profile->getBestName(),
$notice->uri);
$uri = TagURI::mint('delete-notice:%d:%d:%s', $uri = TagURI::mint('delete-notice:%d:%d:%s',
$notice->profile_id, $notice->profile_id,
$notice->id, $notice->id,
common_date_iso8601(common_sql_now())); common_date_iso8601(common_sql_now()));
$notice = Notice::saveNew($notice->profile_id, $notice = Notice::saveNew($notice->profile_id,
$notice->uri, $text,
ActivityPlugin::SOURCE, ActivityPlugin::SOURCE,
array('rendered' => $rendered, array('rendered' => $rendered,
'urls' => array(), 'urls' => array(),

View File

@ -1673,6 +1673,16 @@ body.rtl .queet.rtl .expanded-content {
color:#999999; color:#999999;
} }
/* only show activity notices if they are conversation starters
we never need to see these, but sometimes someone replies to
an activity notice, and then it can be good to know what the
user is replying to... */
#feed-body > .stream-item.activity {
display:none;
}
.stream-item > .stream-item.activity:first-child {
display:block;
}
.queet .queet-thumbs { .queet .queet-thumbs {
-webkit-transition: max-height 0s linear; -webkit-transition: max-height 0s linear;

View File

@ -1769,8 +1769,10 @@ function addToFeed(feed, after, extraClasses, isReply) {
// if this is a special qvitter-delete-notice activity notice it means we try to hide // if this is a special qvitter-delete-notice activity notice it means we try to hide
// the deleted notice from our stream // the deleted notice from our stream
// the uri is in the obj.text var, between the double curly brackets
if(typeof obj.qvitter_delete_notice != 'undefined' && obj.qvitter_delete_notice == true) { if(typeof obj.qvitter_delete_notice != 'undefined' && obj.qvitter_delete_notice == true) {
var streamItemToHide = $('.stream-item[data-uri="' + obj.text + '"]'); var uriToHide = obj.text.substring(obj.text.indexOf('{{')+2,obj.text.indexOf('}}'));
var streamItemToHide = $('.stream-item[data-uri="' + uriToHide + '"]');
streamItemToHide.animate({opacity:'0.2'},1000,'linear',function(){ streamItemToHide.animate({opacity:'0.2'},1000,'linear',function(){
$(this).css('height',$(this).height() + 'px'); $(this).css('height',$(this).height() + 'px');
$(this).animate({height:'0px'},500,'linear',function(){ $(this).animate({height:'0px'},500,'linear',function(){
@ -1779,11 +1781,6 @@ function addToFeed(feed, after, extraClasses, isReply) {
}); });
} }
// don't show any notices with object_type "activity"
if(typeof obj.is_activity != 'undefined' && obj.is_activity === true) {
return true;
}
// only if not already exist // only if not already exist
if($('#q-' + obj.id).length == 0) { if($('#q-' + obj.id).length == 0) {