fixed topic reply if title was 255, better notif text in unread and recent,removed console.log

This commit is contained in:
Baris Soner Usakli
2014-01-22 17:23:20 -05:00
parent 79803d2b3d
commit 46fb6377ee
5 changed files with 35 additions and 28 deletions

View File

@@ -19,16 +19,25 @@ define(function() {
});
socket.on('event:new_topic', function(data) {
++newTopicCount;
updateAlertText();
});
function updateAlertText() {
var text = '';
var text = 'There';
if (newTopicCount > 1)
if (newTopicCount > 1) {
text += ' are ' + newTopicCount + ' new topics';
} else if (newTopicCount === 1) {
text += ' is a new topic';
}
if (newPostCount > 1) {
text += (newTopicCount?' and ':' are ') + newPostCount + ' new posts';
} else if(newPostCount === 1) {
text += (newTopicCount?' and ':' is ') + ' a new post';
}
/*if (newTopicCount > 1)
text = 'There are ' + newTopicCount + ' new topics';
else if (newTopicCount === 1)
text = 'There is 1 new topic';
@@ -40,9 +49,9 @@ define(function() {
else if (newPostCount === 1)
text += ' and 1 new post.';
else
text += ' and no new posts.';
text += ' and no new posts.';*/
text += ' Click here to reload.';
text += '. Click here to reload.';
$('#new-topics-alert').html(text).removeClass('hide').fadeIn('slow');
$('#category-no-topics').addClass('hidden');