This commit is contained in:
Julian Lam
2015-10-06 05:28:05 -04:00
parent ce58187258
commit 95129a1b40
4 changed files with 50 additions and 19 deletions

View File

@@ -135,6 +135,10 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
}
function onReplyClicked(button, tid, topicName) {
if (ajaxify.data.lastposttime < (Date.now() - (1000*60*60*24*config.topicStaleDays))) {
return showStaleWarning();
}
var selectionText = '',
selection = window.getSelection ? window.getSelection() : document.selection.createRange();
@@ -170,6 +174,10 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
}
function onQuoteClicked(button, tid, topicName) {
if (ajaxify.data.lastposttime < (Date.now() - (1000*60*60*24*config.topicStaleDays))) {
return showStaleWarning();
}
var username = getUserName(button),
pid = getData(button, 'data-pid');
@@ -379,5 +387,17 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
return false;
}
function showStaleWarning() {
translator.translate('[[topic:stale_topic_warning]]', function(translated) {
bootbox.confirm(translated, function(create) {
if (create) {
$(window).trigger('action:composer.topic.new', {
cid: ajaxify.data.cid
});
}
});
});
}
return PostTools;
});