diff options
Diffstat (limited to 'src/node/hooks/express/specialpages.js')
-rw-r--r-- | src/node/hooks/express/specialpages.js | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index 44002461..063328fb 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -1,7 +1,13 @@ var path = require('path'); var eejs = require('ep_etherpad-lite/node/eejs'); +var toolbar = require("ep_etherpad-lite/node/utils/toolbar"); +var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks'); exports.expressCreateServer = function (hook_name, args, cb) { + // expose current stats + args.app.get('/stats', function(req, res) { + res.json(require('ep_etherpad-lite/node/stats').toJSON()) + }) //serve index.html under / args.app.get('/', function(req, res) @@ -26,14 +32,28 @@ exports.expressCreateServer = function (hook_name, args, cb) { //serve pad.html under /p args.app.get('/p/:pad', function(req, res, next) - { - res.send(eejs.require("ep_etherpad-lite/templates/pad.html", {req: req})); + { + hooks.callAll("padInitToolbar", { + toolbar: toolbar + }); + + res.send(eejs.require("ep_etherpad-lite/templates/pad.html", { + req: req, + toolbar: toolbar + })); }); //serve timeslider.html under /p/$padname/timeslider args.app.get('/p/:pad/timeslider', function(req, res, next) { - res.send(eejs.require("ep_etherpad-lite/templates/timeslider.html", {req: req})); + hooks.callAll("padInitToolbar", { + toolbar: toolbar + }); + + res.send(eejs.require("ep_etherpad-lite/templates/timeslider.html", { + req: req, + toolbar: toolbar + })); }); //serve favicon.ico from all path levels except as a pad name @@ -45,11 +65,11 @@ exports.expressCreateServer = function (hook_name, args, cb) { //there is no custom favicon, send the default favicon if(err) { - filePath = path.normalize(__dirname + "/../../../static/favicon.ico"); - res.sendfile(filePath); + filePath = path.normalize(__dirname + "/../../../static/favicon.ico"); + res.sendfile(filePath); } }); }); -}
\ No newline at end of file +} |