diff --git a/src/node/hooks/express/specialpages.js b/src/node/hooks/express/specialpages.js index 440024614..0295e87be 100644 --- a/src/node/hooks/express/specialpages.js +++ b/src/node/hooks/express/specialpages.js @@ -1,5 +1,7 @@ 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) { @@ -26,8 +28,15 @@ 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 @@ -52,4 +61,4 @@ exports.expressCreateServer = function (hook_name, args, cb) { }); -} \ No newline at end of file +} diff --git a/src/node/utils/toolbar.js b/src/node/utils/toolbar.js index 270c4aac5..aa3c85f1c 100644 --- a/src/node/utils/toolbar.js +++ b/src/node/utils/toolbar.js @@ -1,7 +1,6 @@ /** * The Toolbar Module creates and renders the toolbars and buttons */ - var _ = require("underscore") , tagAttributes , tag diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 31273d71b..9fea7233c 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -131,6 +131,9 @@ var padeditbar = (function() if (this.commands[cmd]) { this.commands[cmd](cmd, padeditor.ace); } + else { + console.log("Command doesn't exist", cmd); + } } if(padeditor.ace) padeditor.ace.focus(); }, diff --git a/src/templates/pad.html b/src/templates/pad.html index 6afc1be1b..99a275f76 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -2,11 +2,7 @@ var settings = require("ep_etherpad-lite/node/utils/Settings") , hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks') , langs = require("ep_etherpad-lite/node/hooks/i18n").availableLangs - , toolbar = require("ep_etherpad-lite/node/utils/toolbar"); - - hooks.callAll("padInitToolbar", { - toolbar: toolbar - }); + ; %> <% e.begin_block("htmlHead"); %>