From 5ac02a59ac5600917017e3982d6ffdee072ad028 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 10 Feb 2016 12:12:13 +0200 Subject: [PATCH] remove some more config from api/config --- public/src/client/topic/postTools.js | 2 +- src/controllers/api.js | 3 +-- src/controllers/topics.js | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/src/client/topic/postTools.js b/public/src/client/topic/postTools.js index 8f53ab7e9b..cf594041b6 100644 --- a/public/src/client/topic/postTools.js +++ b/public/src/client/topic/postTools.js @@ -420,7 +420,7 @@ define('forum/topic/postTools', ['share', 'navigator', 'components', 'translator } function showStaleWarning(callback) { - if (ajaxify.data.lastposttime < (Date.now() - (1000*60*60*24*config.topicStaleDays))) { + if (ajaxify.data.lastposttime < (Date.now() - (1000 * 60 * 60 * 24 * ajaxify.data.topicStaleDays))) { translator.translate('[[topic:stale.warning]]', function(translated) { var warning = bootbox.dialog({ title: '[[topic:stale.title]]', diff --git a/src/controllers/api.js b/src/controllers/api.js index 75fee72ebe..c00d2370c1 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -36,12 +36,11 @@ apiController.getConfig = function(req, res, next) { config.browserTitle = validator.escape(meta.config.browserTitle || meta.config.title || 'NodeBB'); config.titleLayout = (meta.config.titleLayout || '{pageTitle} | {browserTitle}').replace(/{/g, '{').replace(/}/g, '}'); config.showSiteTitle = parseInt(meta.config.showSiteTitle, 10) === 1; - config.postDelay = meta.config.postDelay; config.minimumTitleLength = meta.config.minimumTitleLength; config.maximumTitleLength = meta.config.maximumTitleLength; config.minimumPostLength = meta.config.minimumPostLength; config.maximumPostLength = meta.config.maximumPostLength; - config.topicStaleDays = parseInt(meta.config.topicStaleDays, 10) || 60; + config.hasImageUploadPlugin = plugins.hasListeners('filter:uploadImage'); config.maximumProfileImageSize = meta.config.maximumProfileImageSize; config.minimumUsernameLength = meta.config.minimumUsernameLength; diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 8ab9f470c4..018d1e83eb 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -249,6 +249,7 @@ topicsController.get = function(req, res, callback) { } data.privileges = userPrivileges; + data.topicStaleDays = parseInt(meta.config.topicStaleDays, 10) || 60; data['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1; data['downvote:disabled'] = parseInt(meta.config['downvote:disabled'], 10) === 1; data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;