diff options
author | John McLear <john@mclear.co.uk> | 2015-04-11 22:33:46 +0100 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2015-04-11 22:33:46 +0100 |
commit | e3f95d0c9cdf085b3038e4591aca779e2bea3b69 (patch) | |
tree | 6108915cd444c3c5669de5d407b4bf5d78e95b82 /src/node/utils | |
parent | 4a70837de91451db8a01a9f7c5d80de4d32bc75e (diff) | |
parent | fc0cac0cad9a3fee5fe1910dd5ee31f0bc05223c (diff) | |
download | etherpad-lite-e3f95d0c9cdf085b3038e4591aca779e2bea3b69.zip |
Merge pull request #2604 from ether/pad-options
session key is now ignored and also padOptions are available in settings
Diffstat (limited to 'src/node/utils')
-rw-r--r-- | src/node/utils/Settings.js | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index bd15a2df..b7d1f0bc 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -28,6 +28,7 @@ var jsonminify = require("jsonminify"); var log4js = require("log4js"); var randomString = require("./randomstring"); var suppressDisableMsg = " -- To suppress these warning messages change suppressErrorsInPadText to true in your settings.json\n"; +var _ = require("underscore"); /* Root path of the installation */ exports.root = path.normalize(path.join(npm.dir, "..")); @@ -85,6 +86,23 @@ exports.dbSettings = { "filename" : path.join(exports.root, "dirty.db") }; exports.defaultPadText = "Welcome to Etherpad!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad on Github: http:\/\/j.mp/ep-lite\n"; /** + * The default Pad Settings for a user (Can be overridden by changing the setting + */ +exports.padOptions = { + "noColors": false, + "showControls": true, + "showChat": true, + "showLineNumbers": true, + "useMonospaceFont": false, + "userName": false, + "userColor": false, + "rtl": false, + "alwaysShowChat": false, + "chatAndUsers": false, + "lang": "en-gb" +} + +/** * The toolbar buttons and order. */ exports.toolbar = { @@ -255,7 +273,11 @@ exports.reloadSettings = function reloadSettings() { //or it's a settings hash, specific to a plugin if(exports[i] !== undefined || i.indexOf('ep_')==0) { - exports[i] = settings[i]; + if (_.isObject(settings[i]) && !_.isArray(settings[i])) { + exports[i] = _.defaults(settings[i], exports[i]); + } else { + exports[i] = settings[i]; + } } //this setting is unkown, output a warning and throw it away else |