diff --git a/server.js b/server.js index 1d5041549..c0fd4c194 100644 --- a/server.js +++ b/server.js @@ -217,6 +217,7 @@ app.get('/api/config', function(req, res){ httpUnsafeOrigin: config.httpUnsafeOrigin, adminEmail: config.adminEmail, adminKeys: admins, + inactiveTime: config.inactiveTime, supportMailbox: config.supportMailboxPublicKey }, null, '\t'), 'obj.httpSafeOrigin = ' + (function () { diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index bb325af59..224f7eeb6 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -732,13 +732,20 @@ MessengerUI, Messages) { $('.cp-pad-not-pinned').remove(); return; } + + if (typeof(ApiConfig.inactiveTime) !== 'number') { + $('.cp-pad-not-pinned').remove(); + return; + } + if ($('.cp-pad-not-pinned').length) { return; } - var pnpTitle = Messages._getKey('padNotPinned', ['','','','']); - var pnpMsg = Messages._getKey('padNotPinned', [ + var pnpTitle = Messages._getKey('padNotPinnedVariable', ['','','','', ApiConfig.inactiveTime]); + var pnpMsg = Messages._getKey('padNotPinnedVariable', [ '', '', '', - '' + '', + ApiConfig.inactiveTime ]); var $msg = $('', { 'class': 'cp-pad-not-pinned' diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index be4b4942d..a021962f9 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -27,6 +27,7 @@ "onLogout": "You are logged out, {0}click here{1} to log in
or press Escape to access your pad in read-only mode.", "wrongApp": "Unable to display the content of that realtime session in your browser. Please try to reload that page.", "padNotPinned": "This pad will expire after 3 months of inactivity, {0}login{1} or {2}register{3} to preserve it.", + "padNotPinnedVariable": "This pad will expire after {4} days of inactivity, {0}login{1} or {2}register{3} to preserve it.", "anonymousStoreDisabled": "The webmaster of this CryptPad instance has disabled the store for anonymous users. You have to log in to be able to use CryptDrive.", "expiredError": "This pad has reached its expiration time and is no longer available.", "deletedError": "This pad has been deleted by its owner and is no longer available.",