v1.18.x
Baris Usakli 11 years ago
parent 78b65c0b12
commit 7198110b57

@ -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.processPage = function () {
app.populateOnlineUsers(); app.populateOnlineUsers();
@ -305,6 +312,8 @@ var socket,
$('span.timeago').timeago(); $('span.timeago').timeago();
$('.post-content img').addClass('img-responsive'); $('.post-content img').addClass('img-responsive');
app.makeNumbersHumanReadable();
app.createUserTooltips(); app.createUserTooltips();
setTimeout(function () { setTimeout(function () {

@ -143,14 +143,14 @@ define(function () {
container.append(html); container.append(html);
$('#topics-container span.timeago').timeago(); $('#topics-container span.timeago').timeago();
app.makeNumbersHumanReadable('#topics-container .human-readable-number');
} }
Category.loadMoreTopics = function(cid) { Category.loadMoreTopics = function(cid) {
if (loadingMoreTopics) { if (loadingMoreTopics) {
return; return;
} }
loadingMoreTopics = true; loadingMoreTopics = true;
socket.emit('api:category.loadMore', { socket.emit('api:category.loadMore', {
cid: cid, cid: cid,

@ -91,6 +91,7 @@ define(function() {
container.append(html); container.append(html);
$('span.timeago').timeago(); $('span.timeago').timeago();
app.makeNumbersHumanReadable('#topics-container .human-readable-number');
} }
Recent.loadMoreTopics = function() { Recent.loadMoreTopics = function() {

@ -81,6 +81,7 @@ define(function() {
container.append(html); container.append(html);
$('span.timeago').timeago(); $('span.timeago').timeago();
app.makeNumbersHumanReadable('#topics-container .human-readable-number');
} }
function loadMoreTopics() { function loadMoreTopics() {

@ -46,12 +46,12 @@
<small> <small>
<span class="topic-stats"> <span class="topic-stats">
posts posts
<strong>{topics.postcount}</strong> <strong class="human-readable-number" title="{topics.postcount}">{topics.postcount}</strong>
</span> </span>
| |
<span class="topic-stats"> <span class="topic-stats">
views views
<strong>{topics.viewcount}</strong> <strong class="human-readable-number" title="{topics.viewcount}">{topics.viewcount}</strong>
</span> </span>
| |
<span> <span>

@ -33,12 +33,12 @@
<small> <small>
<span class="topic-stats"> <span class="topic-stats">
posts posts
<strong>{topics.postcount}</strong> <strong class="human-readable-number" title="{topics.postcount}">{topics.postcount}</strong>
</span> </span>
| |
<span class="topic-stats"> <span class="topic-stats">
views views
<strong>{topics.viewcount}</strong> <strong class="human-readable-number" title="{topics.viewcount}">{topics.viewcount}</strong>
</span> </span>
| |
<span> <span>

@ -116,9 +116,9 @@
<div class="inline-block"> <div class="inline-block">
<small class="topic-stats"> <small class="topic-stats">
<span>posts</span> <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> <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> <span>browsing</span>
</small> </small>
<div class="thread_active_users active-users inline-block"></div> <div class="thread_active_users active-users inline-block"></div>

@ -28,12 +28,12 @@
<small> <small>
<span class="topic-stats"> <span class="topic-stats">
posts posts
<strong>{topics.postcount}</strong> <strong class="human-readable-number" title="{topics.postcount}">{topics.postcount}</strong>
</span> </span>
| |
<span class="topic-stats"> <span class="topic-stats">
views views
<strong>{topics.viewcount}</strong> <strong class="human-readable-number" title="{topics.viewcount}">{topics.viewcount}</strong>
</span> </span>
| |
<span> <span>

Loading…
Cancel
Save