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