mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
@@ -4,17 +4,14 @@
|
||||
|
||||
define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator'], function(share, navigator, components, translator) {
|
||||
|
||||
var PostTools = {},
|
||||
topicName;
|
||||
var PostTools = {};
|
||||
|
||||
PostTools.init = function(tid) {
|
||||
topicName = ajaxify.data.title;
|
||||
|
||||
renderMenu();
|
||||
|
||||
addPostHandlers(tid);
|
||||
|
||||
share.addShareHandlers(topicName);
|
||||
share.addShareHandlers(ajaxify.data.title);
|
||||
|
||||
addVoteHandler();
|
||||
|
||||
@@ -106,15 +103,15 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
var postContainer = components.get('topic');
|
||||
|
||||
postContainer.on('click', '[component="post/quote"]', function() {
|
||||
onQuoteClicked($(this), tid, topicName);
|
||||
onQuoteClicked($(this), tid);
|
||||
});
|
||||
|
||||
postContainer.on('click', '[component="post/reply"]', function() {
|
||||
onReplyClicked($(this), tid, topicName);
|
||||
onReplyClicked($(this), tid);
|
||||
});
|
||||
|
||||
$('.topic').on('click', '[component="topic/reply"]', function() {
|
||||
onReplyClicked($(this), tid, topicName);
|
||||
onReplyClicked($(this), tid);
|
||||
});
|
||||
|
||||
$('.topic').on('click', '[component="topic/reply-as-topic"]', function() {
|
||||
@@ -174,7 +171,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
});
|
||||
}
|
||||
|
||||
function onReplyClicked(button, tid, topicName) {
|
||||
function onReplyClicked(button, tid) {
|
||||
showStaleWarning(function(proceed) {
|
||||
if (!proceed) {
|
||||
var selectionText = '',
|
||||
@@ -197,7 +194,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
slug: ajaxify.data.slug,
|
||||
index: getData(button, 'data-index'),
|
||||
pid: toPid,
|
||||
topicName: topicName,
|
||||
topicName: ajaxify.data.title,
|
||||
username: username,
|
||||
text: selectionText
|
||||
});
|
||||
@@ -205,7 +202,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
$(window).trigger('action:composer.post.new', {
|
||||
tid: tid,
|
||||
pid: toPid,
|
||||
topicName: topicName,
|
||||
topicName: ajaxify.data.title,
|
||||
text: username ? username + ' ' : ''
|
||||
});
|
||||
}
|
||||
@@ -213,7 +210,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
});
|
||||
}
|
||||
|
||||
function onQuoteClicked(button, tid, topicName) {
|
||||
function onQuoteClicked(button, tid) {
|
||||
showStaleWarning(function(proceed) {
|
||||
if (!proceed) {
|
||||
var username = getUserName(button),
|
||||
@@ -230,7 +227,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
index: getData(button, 'data-index'),
|
||||
pid: pid,
|
||||
username: username,
|
||||
topicName: topicName,
|
||||
topicName: ajaxify.data.title,
|
||||
text: post
|
||||
});
|
||||
});
|
||||
@@ -368,7 +365,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
||||
});
|
||||
|
||||
topicId.on('keyup change', function() {
|
||||
moveBtn.attr('disabled', !topicId.val())
|
||||
moveBtn.attr('disabled', !topicId.val());
|
||||
});
|
||||
|
||||
moveBtn.on('click', function() {
|
||||
|
||||
Reference in New Issue
Block a user