better handling of the small not-seen disc

This commit is contained in:
Hannes Mannerheim 2015-11-25 20:11:59 +01:00
parent 29b5b316f3
commit 10b5e76295
4 changed files with 28 additions and 9 deletions

View File

@ -614,7 +614,7 @@ class QvitterAction extends ApiAction
color:/*COLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*COLOREND*/;
}
#unseen-notifications,
.stream-item.notification .not-seen-disc,
.stream-item.notification.not-seen > .queet::before,
#top-compose,
#logo,
.queet-toolbar button,

View File

@ -1716,7 +1716,7 @@ body.rtl #footer-spinner-container {
background-color:#F6F6F6;
}
.stream-item.notification .not-seen-disc {
.stream-item.notification.not-seen > .queet::before {
position:absolute;
left:-5px;
top:50%;
@ -1725,6 +1725,7 @@ body.rtl #footer-spinner-container {
height:10px;
border-radius:6px;
z-index:10;
content:" ";
}
.stream-item.notification.follow .queet,
@ -1775,6 +1776,7 @@ background-repeat: no-repeat;
.stream-item.notification .small-grey-notice,
.stream-item.notification .small-grey-notice a {
color:#999;
word-break: break-all;
}
.stream-item.notification .small-grey-notice a:hover {
color:#333;

View File

@ -711,6 +711,9 @@ function setNewCurrentStream(streamObject,setLocation,fallbackId,actionOnSuccess
});
}
// if this is notidfications we have seen obviously seen them before
oldStreamState.children('.stream-item').removeClass('not-seen');
$('#feed-body').html(oldStreamState.html());
// set location bar from stream
@ -1537,10 +1540,8 @@ function addToFeed(feed, after, extraClasses) {
obj.from_profile.description = obj.from_profile.description || '';
var notificationTime = parseTwitterDate(obj.created_at);
var notSeenHtml = '';
if(obj.is_seen == '0') {
extraClassesThisRun += ' not-seen'
notSeenHtml = '<div class="not-seen-disc"></div>';
}
// external
@ -1554,7 +1555,6 @@ function addToFeed(feed, after, extraClasses) {
var noticeTime = parseTwitterDate(obj.notice.created_at);
var notificationHtml = '<div data-quitter-id-in-stream="' + obj.id + '" id="stream-item-n-' + obj.id + '" class="stream-item ' + extraClassesThisRun + ' notification like">\
<div class="queet">\
' + notSeenHtml + '\
<div class="dogear"></div>\
' + ostatusHtml + '\
<div class="queet-content">\
@ -1584,7 +1584,6 @@ function addToFeed(feed, after, extraClasses) {
var noticeTime = parseTwitterDate(obj.notice.created_at);
var notificationHtml = '<div data-quitter-id-in-stream="' + obj.id + '" id="stream-item-n-' + obj.id + '" class="stream-item ' + extraClassesThisRun + ' notification repeat">\
<div class="queet">\
' + notSeenHtml + '\
<div class="dogear"></div>\
' + ostatusHtml + '\
<div class="queet-content">\
@ -1617,7 +1616,25 @@ function addToFeed(feed, after, extraClasses) {
var notificationHtml = buildQueetHtml(obj.notice, obj.id, extraClassesThisRun + ' notification reply');
}
else if(obj.ntype == 'follow') {
var notificationHtml = '<div data-quitter-id-in-stream="' + obj.id + '" id="stream-item-n-' + obj.id + '" class="stream-item ' + extraClassesThisRun + ' notification follow"><div class="queet"><div class="queet-content">' + ostatusHtml + '<div class="stream-item-header"><a class="account-group" href="' + obj.from_profile.statusnet_profile_url + '"><img class="avatar" src="' + obj.from_profile.profile_image_url + '" /><strong class="name" data-user-id="' + obj.from_profile.id + '" title="@' + obj.from_profile.screen_name + '">' + obj.from_profile.name + '</strong></a> ' + window.sL.xStartedFollowingYou + '<small class="created-at" data-created-at="' + obj.created_at + '" title="' + obj.created_at + '">' + notificationTime + '</small></div></div></div></div>';
var notificationHtml = '<div data-quitter-id-in-stream="' + obj.id + '" id="stream-item-n-' + obj.id + '" class="stream-item ' + extraClassesThisRun + ' notification follow">\
<div class="queet">\
<div class="queet-content">\
' + ostatusHtml + '\
<div class="stream-item-header">\
<a class="account-group" href="' + obj.from_profile.statusnet_profile_url + '">\
<img class="avatar" src="' + obj.from_profile.profile_image_url + '" />\
<strong class="name" data-user-id="' + obj.from_profile.id + '" title="@' + obj.from_profile.screen_name + '">\
' + obj.from_profile.name + '\
</strong>\
</a> \
' + window.sL.xStartedFollowingYou + '\
<small class="created-at" data-created-at="' + obj.created_at + '" title="' + obj.created_at + '">\
' + notificationTime + '\
</small>\
</div>\
</div>\
</div>\
</div>';
}
if(after) {

View File

@ -810,7 +810,7 @@ function rememberStreamStateInLocalStorage() {
feed.find('.stream-item.conversation').remove();
feed.find('.expanded-content').remove();
feed.find('.inline-reply-queetbox').remove();
feed.find('.not-seen-disc').remove();
feed.children('.stream-item').removeClass('not-seen');
feed.find('.show-full-conversation').remove();
feed.find('.stream-item').removeClass('expanded').removeClass('next-expanded').removeClass('hidden').addClass('visible');
var feedHtml = feed.html();
@ -951,7 +951,7 @@ function markAllNotificationsAsSeen(arg,callback) {
}
else {
helloAPI(function(){
$('.not-seen-disc').remove();
$('.stream-item').removeClass('not-seen');
$('#new-queets-bar').trigger('click'); // show any hidden notifications (this will also remove the dropdown menu)
remove_spinner();
callback(true);