From 7198110b57ae54b188a17eb88bf87bd9ae1510b0 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 28 Nov 2013 11:16:52 -0500 Subject: [PATCH] closes #573 --- public/src/app.js | 9 +++++++++ public/src/forum/category.js | 4 ++-- public/src/forum/recent.js | 1 + public/src/forum/unread.js | 1 + public/templates/category.tpl | 4 ++-- public/templates/recent.tpl | 4 ++-- public/templates/topic.tpl | 4 ++-- public/templates/unread.tpl | 4 ++-- 8 files changed, 21 insertions(+), 10 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 8f6d8ed433..c29f24fa03 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -297,6 +297,13 @@ var socket, }); } + app.makeNumbersHumanReadable = function() { + $('.human-readable-number').each(function() { + var num = parseInt($(this).html(), 10); + $(this).html(utils.makeNumberHumanReadable(num)); + }); + } + app.processPage = function () { app.populateOnlineUsers(); @@ -305,6 +312,8 @@ var socket, $('span.timeago').timeago(); $('.post-content img').addClass('img-responsive'); + app.makeNumbersHumanReadable(); + app.createUserTooltips(); setTimeout(function () { diff --git a/public/src/forum/category.js b/public/src/forum/category.js index b4c5a227ba..c6f8d5da01 100644 --- a/public/src/forum/category.js +++ b/public/src/forum/category.js @@ -143,14 +143,14 @@ define(function () { container.append(html); $('#topics-container span.timeago').timeago(); + app.makeNumbersHumanReadable('#topics-container .human-readable-number'); } - Category.loadMoreTopics = function(cid) { if (loadingMoreTopics) { return; } - + loadingMoreTopics = true; socket.emit('api:category.loadMore', { cid: cid, diff --git a/public/src/forum/recent.js b/public/src/forum/recent.js index 934a3e248b..437eb538c2 100644 --- a/public/src/forum/recent.js +++ b/public/src/forum/recent.js @@ -91,6 +91,7 @@ define(function() { container.append(html); $('span.timeago').timeago(); + app.makeNumbersHumanReadable('#topics-container .human-readable-number'); } Recent.loadMoreTopics = function() { diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index a21a251f6c..ea332be0f9 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -81,6 +81,7 @@ define(function() { container.append(html); $('span.timeago').timeago(); + app.makeNumbersHumanReadable('#topics-container .human-readable-number'); } function loadMoreTopics() { diff --git a/public/templates/category.tpl b/public/templates/category.tpl index eb8f49821d..8fb455d77e 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -46,12 +46,12 @@ posts - {topics.postcount} + {topics.postcount} | views - {topics.viewcount} + {topics.viewcount} | diff --git a/public/templates/recent.tpl b/public/templates/recent.tpl index d799059c21..82d0009759 100644 --- a/public/templates/recent.tpl +++ b/public/templates/recent.tpl @@ -33,12 +33,12 @@ posts - {topics.postcount} + {topics.postcount} | views - {topics.viewcount} + {topics.viewcount} | diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 64ad635ab9..b7755ccee2 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -116,9 +116,9 @@
posts - {postcount} | + {postcount} | views - {viewcount} | + {viewcount} | browsing
diff --git a/public/templates/unread.tpl b/public/templates/unread.tpl index 29bb30eafe..512df36c3d 100644 --- a/public/templates/unread.tpl +++ b/public/templates/unread.tpl @@ -28,12 +28,12 @@ posts - {topics.postcount} + {topics.postcount} | views - {topics.viewcount} + {topics.viewcount} |