Node.js based forum software built for the modern web
Updated modal to not be .confirm() but .dialog()
Julian Lam65396000d210
diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.jsonindex c26d0c05f8..dcc651fc24 100644--- a/public/language/en_GB/topic.json+++ b/public/language/en_GB/topic.json@@ -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",diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.jsindex 0232932d6e..c07cb2417c 100644--- a/public/src/client/topic/postTools.js+++ b/public/src/client/topic/postTools.js@@ -408,18 +408,44 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translatorfunction 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) {- $(window).trigger('action:composer.topic.new', {- cid: ajaxify.data.cid- });-- }+ 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,+ body: body+ });+ });+ }+ }+ }+ });- callback(create);- });+ warning.modal();});+ // bootbox.confirm(translated, function(create) {+ // if (create) {+++ // }++ // callback(create);+ // });+ // });} else {callback(false);}