Updated modal to not be .confirm() but .dialog()

Also updated composer code to actually send a link back
to the other topic...

Closes #3693
v1.18.x
Julian Lam 9 years ago
parent 8514b6e175
commit 65396000d2

@ -116,7 +116,11 @@
"most_votes": "Most votes",
"most_posts": "Most posts",
"stale_topic_warning": "The topic you are replying to is quite old. Would you like to create a new topic instead, and reference this one in your reply?",
"stale.title": "Create new topic instead?",
"stale.warning": "The topic you are replying to is quite old. Would you like to create a new topic instead, and reference this one in your reply?",
"stale.create": "Create a new topic",
"stale.reply_anyway": "Reply to this topic anyway",
"stale.link_back": "Re: [%1](%2)\n\n",
"spam": "Spam",
"offensive": "Offensive",

@ -408,18 +408,44 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator
function showStaleWarning(callback) {
if (ajaxify.data.lastposttime < (Date.now() - (1000*60*60*24*config.topicStaleDays))) {
translator.translate('[[topic:stale_topic_warning]]', function(translated) {
bootbox.confirm(translated, function(create) {
if (create) {
translator.translate('[[topic:stale.warning]]', function(translated) {
var warning = bootbox.dialog({
title: '[[topic:stale.title]]',
message: translated,
buttons: {
reply: {
label: '[[topic:stale.reply_anyway]]',
className: 'btn-link',
callback: function() {
callback(false);
}
},
create: {
label: '[[topic:stale.create]]',
className: 'btn-primary',
callback: function() {
translator.translate('[[topic:stale.link_back, ' + ajaxify.data.title + ', ' + config.relative_path + '/topic/' + ajaxify.data.slug + ']]', function(body) {
$(window).trigger('action:composer.topic.new', {
cid: ajaxify.data.cid
cid: ajaxify.data.cid,
body: body
});
});
}
callback(create);
}
}
});
warning.modal();
});
// bootbox.confirm(translated, function(create) {
// if (create) {
// }
// callback(create);
// });
// });
} else {
callback(false);
}

Loading…
Cancel
Save