mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 08:25:00 -04:00
Add loadSettings hook.
This commit is contained in:
parent
9aed433ad5
commit
27eb866602
1 changed files with 8 additions and 0 deletions
|
@ -25,6 +25,8 @@ var path = require('path');
|
|||
var argv = require('./Cli').argv;
|
||||
var npm = require("npm/lib/npm.js");
|
||||
var vm = require('vm');
|
||||
var plugins = require("ep_etherpad-lite/static/js/pluginfw/plugins");
|
||||
var hooks = require("ep_etherpad-lite/static/js/pluginfw/hooks");
|
||||
|
||||
/* Root path of the installation */
|
||||
exports.root = path.normalize(path.join(npm.dir, ".."));
|
||||
|
@ -149,3 +151,9 @@ for(var i in settings)
|
|||
if(exports.dbType === "dirty"){
|
||||
console.warn("DirtyDB is used. This is fine for testing but not recommended for production.")
|
||||
}
|
||||
|
||||
// Call loadSettings hook with an immutable settings object
|
||||
plugins.ensure(function() {
|
||||
var immutableSettings = Object.freeze(Object.create(exports));
|
||||
hooks.aCallAll("loadSettings", { settings: immutableSettings });
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue