mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 09:55:47 +01:00
closes #4911
This commit is contained in:
@@ -57,8 +57,8 @@
|
|||||||
"nodebb-plugin-spam-be-gone": "0.4.9",
|
"nodebb-plugin-spam-be-gone": "0.4.9",
|
||||||
"nodebb-rewards-essentials": "0.0.9",
|
"nodebb-rewards-essentials": "0.0.9",
|
||||||
"nodebb-theme-lavender": "3.0.13",
|
"nodebb-theme-lavender": "3.0.13",
|
||||||
"nodebb-theme-persona": "4.1.13",
|
"nodebb-theme-persona": "4.1.14",
|
||||||
"nodebb-theme-vanilla": "5.1.4",
|
"nodebb-theme-vanilla": "5.1.5",
|
||||||
"nodebb-widget-essentials": "2.0.10",
|
"nodebb-widget-essentials": "2.0.10",
|
||||||
"nodemailer": "2.0.0",
|
"nodemailer": "2.0.0",
|
||||||
"nodemailer-sendmail-transport": "1.0.0",
|
"nodemailer-sendmail-transport": "1.0.0",
|
||||||
|
|||||||
@@ -101,6 +101,7 @@
|
|||||||
"topic_will_be_moved_to": "This topic will be moved to the category",
|
"topic_will_be_moved_to": "This topic will be moved to the category",
|
||||||
"fork_topic_instruction": "Click the posts you want to fork",
|
"fork_topic_instruction": "Click the posts you want to fork",
|
||||||
"fork_no_pids": "No posts selected!",
|
"fork_no_pids": "No posts selected!",
|
||||||
|
"fork_pid_count": "%1 post(s) selected",
|
||||||
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
||||||
"delete_posts_instruction": "Click the posts you want to delete/purge",
|
"delete_posts_instruction": "Click the posts you want to delete/purge",
|
||||||
|
|
||||||
|
|||||||
@@ -16,16 +16,12 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
|||||||
parseModal(function(html) {
|
parseModal(function(html) {
|
||||||
forkModal = $(html);
|
forkModal = $(html);
|
||||||
|
|
||||||
forkModal.on('hidden.bs.modal', function() {
|
|
||||||
forkModal.remove();
|
|
||||||
});
|
|
||||||
|
|
||||||
forkCommit = forkModal.find('#fork_thread_commit');
|
forkCommit = forkModal.find('#fork_thread_commit');
|
||||||
|
|
||||||
showForkModal();
|
$(document.body).append(forkModal);
|
||||||
|
|
||||||
forkModal.find('.close,#fork_thread_cancel').on('click', closeForkModal);
|
forkModal.find('.close,#fork_thread_cancel').on('click', closeForkModal);
|
||||||
forkModal.find('#fork-title').on('change', checkForkButtonEnable);
|
forkModal.find('#fork-title').on('keyup', checkForkButtonEnable);
|
||||||
|
|
||||||
postSelect.init(function() {
|
postSelect.init(function() {
|
||||||
checkForkButtonEnable();
|
checkForkButtonEnable();
|
||||||
@@ -43,14 +39,6 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function showForkModal() {
|
|
||||||
forkModal.modal({backdrop: false, show: true})
|
|
||||||
.css('position', 'fixed')
|
|
||||||
.css('left', Math.max(0, (($(window).width() - forkModal.outerWidth()) / 2) + $(window).scrollLeft()) + 'px')
|
|
||||||
.css('top', '0px')
|
|
||||||
.css('z-index', '2000');
|
|
||||||
}
|
|
||||||
|
|
||||||
function createTopicFromPosts() {
|
function createTopicFromPosts() {
|
||||||
forkCommit.attr('disabled', true);
|
forkCommit.attr('disabled', true);
|
||||||
socket.emit('topics.createTopicFromPosts', {
|
socket.emit('topics.createTopicFromPosts', {
|
||||||
@@ -88,14 +76,14 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
|||||||
|
|
||||||
function showPostsSelected() {
|
function showPostsSelected() {
|
||||||
if (postSelect.pids.length) {
|
if (postSelect.pids.length) {
|
||||||
forkModal.find('#fork-pids').text(postSelect.pids.join(', '));
|
forkModal.find('#fork-pids').translateHtml('[[topic:fork_pid_count, ' + postSelect.pids.length + ']]');
|
||||||
} else {
|
} else {
|
||||||
forkModal.find('#fork-pids').translateHtml('[[topic:fork_no_pids]]');
|
forkModal.find('#fork-pids').translateHtml('[[topic:fork_no_pids]]');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkForkButtonEnable() {
|
function checkForkButtonEnable() {
|
||||||
if (forkModal.find('#fork-title').length && postSelect.pids.length) {
|
if (forkModal.find('#fork-title').val().length && postSelect.pids.length) {
|
||||||
forkCommit.removeAttr('disabled');
|
forkCommit.removeAttr('disabled');
|
||||||
} else {
|
} else {
|
||||||
forkCommit.attr('disabled', true);
|
forkCommit.attr('disabled', true);
|
||||||
@@ -104,10 +92,10 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
|||||||
|
|
||||||
function closeForkModal() {
|
function closeForkModal() {
|
||||||
postSelect.pids.forEach(function(pid) {
|
postSelect.pids.forEach(function(pid) {
|
||||||
components.get('post', 'pid', pid).css('opacity', 1);
|
components.get('post', 'pid', pid).toggleClass('bg-success', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
forkModal.modal('hide');
|
forkModal.remove();
|
||||||
|
|
||||||
components.get('topic').off('click', '[data-pid]');
|
components.get('topic').off('click', '[data-pid]');
|
||||||
postSelect.enableClicksOnPosts();
|
postSelect.enableClicksOnPosts();
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ define('postSelect', ['components'], function(components) {
|
|||||||
var index = PostSelect.pids.indexOf(newPid);
|
var index = PostSelect.pids.indexOf(newPid);
|
||||||
if(index === -1) {
|
if(index === -1) {
|
||||||
PostSelect.pids.push(newPid);
|
PostSelect.pids.push(newPid);
|
||||||
post.css('opacity', '0.5');
|
post.toggleClass('bg-success', true);
|
||||||
} else {
|
} else {
|
||||||
PostSelect.pids.splice(index, 1);
|
PostSelect.pids.splice(index, 1);
|
||||||
post.css('opacity', '1.0');
|
post.toggleClass('bg-success', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PostSelect.pids.length) {
|
if (PostSelect.pids.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user