Skip to content

Node.js based forum software built for the modern web

closes #573

Baris Usakli7198110b57ae
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 @@
<small>
<span class="topic-stats">
posts
- <strong>{topics.postcount}</strong>
+ <strong class="human-readable-number" title="{topics.postcount}">{topics.postcount}</strong>
</span>
|
<span class="topic-stats">
views
- <strong>{topics.viewcount}</strong>
+ <strong class="human-readable-number" title="{topics.viewcount}">{topics.viewcount}</strong>
</span>
|
<span>
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 @@
<small>
<span class="topic-stats">
posts
- <strong>{topics.postcount}</strong>
+ <strong class="human-readable-number" title="{topics.postcount}">{topics.postcount}</strong>
</span>
|
<span class="topic-stats">
views
- <strong>{topics.viewcount}</strong>
+ <strong class="human-readable-number" title="{topics.viewcount}">{topics.viewcount}</strong>
</span>
|
<span>
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 @@
<div class="inline-block">
<small class="topic-stats">
<span>posts</span>
- <strong><span id="topic-post-count" class="formatted-number">{postcount}</span></strong> |
+ <strong><span id="topic-post-count" class="human-readable-number" title="{postcount}">{postcount}</span></strong> |
<span>views</span>
- <strong><span class="formatted-number">{viewcount}</span></strong> |
+ <strong><span class="human-readable-number" title="{viewcount}">{viewcount}</span></strong> |
<span>browsing</span>
</small>
<div class="thread_active_users active-users inline-block"></div>
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 @@
<small>
<span class="topic-stats">
posts
- <strong>{topics.postcount}</strong>
+ <strong class="human-readable-number" title="{topics.postcount}">{topics.postcount}</strong>
</span>
|
<span class="topic-stats">
views
- <strong>{topics.viewcount}</strong>
+ <strong class="human-readable-number" title="{topics.viewcount}">{topics.viewcount}</strong>
</span>
|
<span>