mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
This commit is contained in:
@@ -436,12 +436,9 @@ define('admin/dashboard', [
|
||||
} else {
|
||||
graphs.traffic.data.xLabels = utils.getHoursArray();
|
||||
|
||||
$('#pageViewsThirty').html(data.summary.thirty);
|
||||
$('#pageViewsSeven').html(data.summary.seven);
|
||||
$('#pageViewsPastDay').html(data.pastDay);
|
||||
utils.addCommasToNumbers($('#pageViewsThirty'));
|
||||
utils.addCommasToNumbers($('#pageViewsSeven'));
|
||||
utils.addCommasToNumbers($('#pageViewsPastDay'));
|
||||
$('#pageViewsThirty').html(helpers.formattedNumber(data.summary.thirty));
|
||||
$('#pageViewsSeven').html(helpers.formattedNumber(data.summary.seven));
|
||||
$('#pageViewsPastDay').html(helpers.formattedNumber(data.pastDay));
|
||||
}
|
||||
|
||||
graphs.traffic.data.datasets[0].data = data.pageviews;
|
||||
|
||||
@@ -59,7 +59,6 @@ define('admin/manage/tags', [
|
||||
tags: tags,
|
||||
}, function (html) {
|
||||
$('.tag-list').html(html);
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
selectable.enable('.tag-management', '.tag-row');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -253,8 +253,6 @@ if (document.readyState === 'loading') {
|
||||
highlightNavigationLink();
|
||||
overrides.overrideTimeagoCutoff();
|
||||
$('.timeago').timeago();
|
||||
utils.makeNumbersHumanReadable($('.human-readable-number'));
|
||||
utils.addCommasToNumbers($('.formatted-number'));
|
||||
app.createUserTooltips($('#content'));
|
||||
app.createStatusTooltips();
|
||||
};
|
||||
|
||||
@@ -45,7 +45,6 @@ define('forum/account/posts', ['forum/account/header', 'forum/infinitescroll', '
|
||||
$('[component="posts"]').append(html);
|
||||
html.find('img:not(.not-responsive)').addClass('img-fluid');
|
||||
html.find('.timeago').timeago();
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
hooks.fire('action:posts.loaded', { posts: posts });
|
||||
callback();
|
||||
});
|
||||
|
||||
@@ -46,7 +46,6 @@ define('forum/account/topics', [
|
||||
app.parseAndTranslate(template, 'topics', { topics: topics }, function (html) {
|
||||
$('[component="category"]').append(html);
|
||||
html.find('.timeago').timeago();
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
hooks.fire('action:topics.loaded', { topics: topics });
|
||||
callback();
|
||||
});
|
||||
|
||||
@@ -104,7 +104,6 @@ define('forum/category', [
|
||||
app.parseAndTranslate('category', 'children', { children: data }, function (html) {
|
||||
html.find('.timeago').timeago();
|
||||
$('[component="category/subcategory/container"]').append(html);
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
ajaxify.data.nextSubCategoryStart += ajaxify.data.subCategoriesPerPage;
|
||||
ajaxify.data.subCategoriesLeft -= data.length;
|
||||
btn.toggleClass('hidden', ajaxify.data.subCategoriesLeft <= 0)
|
||||
|
||||
@@ -54,7 +54,6 @@ define('forum/tags', ['forum/infinitescroll', 'alerts'], function (infinitescrol
|
||||
callback = callback || function () {};
|
||||
app.parseAndTranslate('tags', 'tags', { tags: tags }, function (html) {
|
||||
$('.tag-list')[replace ? 'html' : 'append'](html);
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@ define('forum/topic/postTools', [
|
||||
'bootbox',
|
||||
'alerts',
|
||||
'hooks',
|
||||
], function (share, navigator, components, translator, votes, api, bootbox, alerts, hooks) {
|
||||
'helpers',
|
||||
], function (share, navigator, components, translator, votes, api, bootbox, alerts, hooks, helpers) {
|
||||
const PostTools = {};
|
||||
|
||||
let staleReplyAnyway = false;
|
||||
@@ -85,8 +86,8 @@ define('forum/topic/postTools', [
|
||||
|
||||
PostTools.updatePostCount = function (postCount) {
|
||||
const postCountEl = components.get('topic/post-count');
|
||||
postCountEl.html(postCount).attr('title', postCount);
|
||||
utils.makeNumbersHumanReadable(postCountEl);
|
||||
postCountEl.attr('title', postCount)
|
||||
.html(helpers.humanReadableNumber(postCount));
|
||||
navigator.setCount(postCount);
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@ define('forum/topic/posts', [
|
||||
'components',
|
||||
'translator',
|
||||
'hooks',
|
||||
], function (pagination, infinitescroll, postTools, images, navigator, components, translator, hooks) {
|
||||
'helpers',
|
||||
], function (pagination, infinitescroll, postTools, images, navigator, components, translator, hooks, helpers) {
|
||||
const Posts = { };
|
||||
|
||||
Posts.signaturesShown = {};
|
||||
@@ -76,8 +77,7 @@ define('forum/topic/posts', [
|
||||
function updatePostCounts(posts) {
|
||||
for (let i = 0; i < posts.length; i += 1) {
|
||||
const cmp = components.get('user/postcount', posts[i].uid);
|
||||
cmp.html(parseInt(cmp.attr('data-postcount'), 10) + 1);
|
||||
utils.addCommasToNumbers(cmp);
|
||||
cmp.html(helpers.formattedNumber(parseInt(cmp.attr('data-postcount'), 10) + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,8 +410,6 @@ define('forum/topic/posts', [
|
||||
|
||||
Posts.onNewPostsAddedToDom = async function (posts) {
|
||||
await Posts.onTopicPageLoad(posts);
|
||||
utils.addCommasToNumbers(posts.find('.formatted-number'));
|
||||
utils.makeNumbersHumanReadable(posts.find('.human-readable-number'));
|
||||
posts.find('.timeago').timeago();
|
||||
};
|
||||
|
||||
|
||||
@@ -242,7 +242,6 @@ define('topicList', [
|
||||
}
|
||||
|
||||
html.find('.timeago').timeago();
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
hooks.fire('action:topics.loaded', { topics: topics, template: templateName });
|
||||
callback();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user