mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 12:01:17 +01:00
closes #6146
This commit is contained in:
@@ -163,5 +163,7 @@
|
||||
"invalid-home-page-route": "Invalid home page route",
|
||||
|
||||
"invalid-session": "Session Mismatch",
|
||||
"invalid-session-text": "It looks like your login session is no longer active, or no longer matches with the server. Please refresh this page."
|
||||
"invalid-session-text": "It looks like your login session is no longer active, or no longer matches with the server. Please refresh this page.",
|
||||
|
||||
"no-topics-selected": "No topics selected!"
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
"no_topics_found": "No topics found!",
|
||||
"no_posts_found": "No posts found!",
|
||||
|
||||
"no_topics_selected": "No topics selected!",
|
||||
|
||||
"post_is_deleted": "This post is deleted!",
|
||||
"topic_is_deleted": "This topic is deleted!",
|
||||
|
||||
|
||||
@@ -35,60 +35,65 @@ define('forum/category/tools', [
|
||||
|
||||
components.get('topic/lock').on('click', function () {
|
||||
var tids = topicSelect.getSelectedTids();
|
||||
if (tids.length) {
|
||||
socket.emit('topics.lock', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
if (!tids.length) {
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
socket.emit('topics.lock', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
return false;
|
||||
});
|
||||
|
||||
components.get('topic/unlock').on('click', function () {
|
||||
var tids = topicSelect.getSelectedTids();
|
||||
if (tids.length) {
|
||||
socket.emit('topics.unlock', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
if (!tids.length) {
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
socket.emit('topics.unlock', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
return false;
|
||||
});
|
||||
|
||||
components.get('topic/pin').on('click', function () {
|
||||
var tids = topicSelect.getSelectedTids();
|
||||
if (tids.length) {
|
||||
socket.emit('topics.pin', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
if (!tids.length) {
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
socket.emit('topics.pin', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
return false;
|
||||
});
|
||||
|
||||
components.get('topic/unpin').on('click', function () {
|
||||
var tids = topicSelect.getSelectedTids();
|
||||
if (tids.length) {
|
||||
socket.emit('topics.unpin', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
if (!tids.length) {
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
socket.emit('topics.unpin', { tids: tids, cid: CategoryTools.cid }, onCommandComplete);
|
||||
return false;
|
||||
});
|
||||
|
||||
components.get('topic/mark-unread-for-all').on('click', function () {
|
||||
var tids = topicSelect.getSelectedTids();
|
||||
if (tids.length) {
|
||||
socket.emit('topics.markAsUnreadForAll', tids, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
app.alertSuccess('[[topic:markAsUnreadForAll.success]]');
|
||||
tids.forEach(function (tid) {
|
||||
$('[component="category/topic"][data-tid="' + tid + '"]').addClass('unread');
|
||||
});
|
||||
onCommandComplete();
|
||||
});
|
||||
if (!tids.length) {
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
|
||||
socket.emit('topics.markAsUnreadForAll', tids, function (err) {
|
||||
if (err) {
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
app.alertSuccess('[[topic:markAsUnreadForAll.success]]');
|
||||
tids.forEach(function (tid) {
|
||||
$('[component="category/topic"][data-tid="' + tid + '"]').addClass('unread');
|
||||
});
|
||||
onCommandComplete();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
components.get('topic/move').on('click', function () {
|
||||
var tids = topicSelect.getSelectedTids();
|
||||
|
||||
if (tids.length) {
|
||||
move.init(tids, cid, onCommandComplete);
|
||||
if (!tids.length) {
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
move.init(tids, cid, onCommandComplete);
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -117,7 +122,7 @@ define('forum/category/tools', [
|
||||
|
||||
function categoryCommand(command, tids) {
|
||||
if (!tids.length) {
|
||||
return;
|
||||
return app.alertError('[[error:no-topics-selected]]');
|
||||
}
|
||||
|
||||
translator.translate('[[topic:thread_tools.' + command + '_confirm]]', function (msg) {
|
||||
|
||||
@@ -82,7 +82,7 @@ define('forum/topic/merge', function () {
|
||||
modal.find('.topics-section').html(html);
|
||||
});
|
||||
} else {
|
||||
modal.find('.topics-section').translateHtml('[[topic:no_topics_selected]]');
|
||||
modal.find('.topics-section').translateHtml('[[error:no-topics-selected]]');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user