|
|
|
@ -226,8 +226,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onReplyClicked(button, tid) {
|
|
|
|
|
showStaleWarning(function(proceed) {
|
|
|
|
|
if (!proceed) {
|
|
|
|
|
showStaleWarning(function() {
|
|
|
|
|
var selectedText = getSelectedText(button);
|
|
|
|
|
|
|
|
|
|
var username = getUserName(button);
|
|
|
|
@ -255,12 +254,11 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
text: username ? username + ' ' : ''
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onQuoteClicked(button, tid) {
|
|
|
|
|
showStaleWarning(function(proceed) {
|
|
|
|
|
showStaleWarning(function() {
|
|
|
|
|
|
|
|
|
|
function quote(text) {
|
|
|
|
|
$(window).trigger('action:composer.addQuote', {
|
|
|
|
@ -274,7 +272,6 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!proceed) {
|
|
|
|
|
var username = getUserName(button);
|
|
|
|
|
var pid = getData(button, 'data-pid');
|
|
|
|
|
var selectedText = getSelectedText(button);
|
|
|
|
@ -288,7 +285,6 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
|
|
|
|
|
quote(post);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -498,7 +494,10 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showStaleWarning(callback) {
|
|
|
|
|
if (ajaxify.data.lastposttime < (Date.now() - (1000 * 60 * 60 * 24 * ajaxify.data.topicStaleDays))) {
|
|
|
|
|
if (ajaxify.data.lastposttime >= (Date.now() - (1000 * 60 * 60 * 24 * ajaxify.data.topicStaleDays))) {
|
|
|
|
|
return callback();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
translator.translate('[[topic:stale.warning]]', function(translated) {
|
|
|
|
|
var warning = bootbox.dialog({
|
|
|
|
|
title: '[[topic:stale.title]]',
|
|
|
|
@ -508,7 +507,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
label: '[[topic:stale.reply_anyway]]',
|
|
|
|
|
className: 'btn-link',
|
|
|
|
|
callback: function() {
|
|
|
|
|
callback(false);
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
create: {
|
|
|
|
@ -528,9 +527,6 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
|
|
|
|
|
|
|
|
|
|
warning.modal();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
callback(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return PostTools;
|
|
|
|
|