' +
'
' +
' ' +
- '' +
'
' +
'
' + theme.name + '
' +
'
' + theme.description + '
' +
diff --git a/public/src/forum/category.js b/public/src/forum/category.js
index e3a8688472..a1b5338eda 100644
--- a/public/src/forum/category.js
+++ b/public/src/forum/category.js
@@ -153,13 +153,14 @@ define(['composer'], function(composer) {
var replies = '';
for (var i = 0, numPosts = posts.length; i < numPosts; ++i) {
- replies += '
' +
+ replies += '' +
'
' +
- '' +
- ''+ posts[i].username + '' +
- '' + posts[i].content + '
' +
- '' +
- '' +
+ ''+ posts[i].username + '' +
+ '' + posts[i].content + '
' +
+ ''+
+ 'posted '+
+ '' +
+ ''+
'';
}
diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js
index 1bcdac57bf..d5eac0bf4f 100644
--- a/public/src/forum/footer.js
+++ b/public/src/forum/footer.js
@@ -8,11 +8,17 @@ define(['notifications', 'chat'], function(Notifications, Chat) {
Chat.prepareDOM();
translator.prepareDOM();
- function updateUnreadCount(err, count) {
+ function updateUnreadCount(err, tids) {
+ var count = 0;
+ if(tids && tids.length) {
+ count = tids.length;
+ }
+
$('#unread-count').toggleClass('unread-count', count > 0);
$('#unread-count').attr('data-content', count > 20 ? '20+' : count);
}
+
socket.on('event:unread.updateCount', updateUnreadCount);
socket.emit('user.getUnreadCount', updateUnreadCount);
});
\ No newline at end of file
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 90e5ea0cb0..e0aa241e2b 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -522,8 +522,10 @@ define(['composer'], function(composer) {
$('#post-container').on('click', '.chat', function(e) {
- var username = $(this).parents('li.row').attr('data-username');
- var touid = $(this).parents('li.row').attr('data-uid');
+ var post = $(this).parents('li.post-row'),
+ username = post.attr('data-username'),
+ touid = post.attr('data-uid');
+
app.openChat(username, touid);
$(this).parents('.btn-group').find('.dropdown-toggle').click();
return false;
@@ -537,7 +539,6 @@ define(['composer'], function(composer) {
'posts.favourite'
]);
-
socket.on('get_users_in_room', function(data) {
if(data && data.room.indexOf('topic') !== -1) {
@@ -641,6 +642,8 @@ define(['composer'], function(composer) {
}
}
+ socket.emit('topics.markAsRead', {tid: tid, uid: app.uid});
+
createNewPosts(data);
});
diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js
index a930cd509c..966afa6ae0 100644
--- a/public/src/modules/composer.js
+++ b/public/src/modules/composer.js
@@ -264,6 +264,7 @@ define(['taskbar'], function(taskbar) {
newHeight = $(window).height() - $('#header-menu').height() - 20;
}
postContainer.css('height', newHeight);
+ $('body').css({'margin-bottom': newHeight});
resizeSavePosition(newHeight);
}
e.preventDefault();
@@ -353,6 +354,7 @@ define(['taskbar'], function(taskbar) {
postContainer.css('visibility', 'visible')
.css('z-index', 1);
+ $('body').css({'margin-bottom': postContainer.css('height')});
composer.focusElements(post_uuid);
}
@@ -436,6 +438,7 @@ define(['taskbar'], function(taskbar) {
delete composer.posts[post_uuid];
composer.active = undefined;
taskbar.discard('composer', post_uuid);
+ $('body').css({'margin-bottom': 0});
}
}
diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js
index 8994ba008a..2fff715165 100644
--- a/public/src/modules/notifications.js
+++ b/public/src/modules/notifications.js
@@ -21,7 +21,7 @@ define(function() {
if (!err && (data.read.length + data.unread.length) > 0) {
for (x = 0; x < numUnread; x++) {
notifEl.setAttribute('data-nid', data.unread[x].nid);
- notifEl.className = 'unread';
+ notifEl.className = data.unread[x].readClass;
notifEl.innerHTML = '
' + utils.relativeTime(data.unread[x].datetime, true) + '' + data.unread[x].text + '';
notifFrag.appendChild(notifEl.cloneNode(true));
}
diff --git a/public/src/utils.js b/public/src/utils.js
index 9f987b5ef0..bc97257382 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -99,17 +99,27 @@
return difference + (min ? 'y' : ' year') + (difference !== 1 && !min ? 's' : '');
},
+ invalidUnicodeChars : XRegExp('[^\\p{L}\\s\\d\\-_]', 'g'),
+ invalidLatinChars : /[^\w\s\d\-_]/g,
+
+ trimRegex : /^\s+|\s+$/g,
+ collapseWhitespace : /\s+/g,
+ collapseDash : /-+/g,
+ trimTrailingDash : /-$/g,
+ isLatin : /^[\w]+$/,
+
//http://dense13.com/blog/2009/05/03/converting-string-to-slug-javascript/
slugify: function(str) {
- var invalidChars = XRegExp('[^\\p{L}\\s\\d\\-_]', 'g');
-
- str = str.replace(/^\s+|\s+$/g, ''); // trim
+ str = str.replace(utils.trimRegex, '');
str = str.toLowerCase();
- str = XRegExp.replace(str, invalidChars, '-');
- str = str.replace(/\s+/g, '-') // collapse whitespace and replace by -
- str = str.replace(/-+/g, '-'); // collapse dashes
- str = str.replace(/-$/g, '');
-
+ if(utils.isLatin.test(str)) {
+ str = str.replace(utils.invalidLatinChars, '-');
+ } else {
+ str = XRegExp.replace(str, utils.invalidUnicodeChars, '-');
+ }
+ str = str.replace(utils.collapseWhitespace, '-')
+ str = str.replace(utils.collapseDash, '-');
+ str = str.replace(utils.trimTrailingDash, '');
return str;
},
@@ -202,7 +212,7 @@
if (!String.prototype.trim) {
String.prototype.trim = function() {
- return this.replace(/^\s+|\s+$/g, '');
+ return this.replace(utils.trimRegex, '');
};
}
diff --git a/public/templates/account.tpl b/public/templates/account.tpl
index 9b5eae3519..98cab8d066 100644
--- a/public/templates/account.tpl
+++ b/public/templates/account.tpl
@@ -108,12 +108,30 @@
diff --git a/public/templates/category.tpl b/public/templates/category.tpl
index 849c042d9a..8dd78f12ed 100644
--- a/public/templates/category.tpl
+++ b/public/templates/category.tpl
@@ -30,59 +30,60 @@