other bits required for read only

This commit is contained in:
John McLear 2015-05-19 16:57:53 +01:00
parent 41d24a8c8f
commit 818408cf49
2 changed files with 9 additions and 4 deletions

View File

@ -33,13 +33,18 @@ exports.expressCreateServer = function (hook_name, args, cb) {
//serve pad.html under /p
args.app.get('/p/:pad', function(req, res, next)
{
// The below might break for pads being rewritten
var isReadOnly = req.url.indexOf("/p/r.") === 0;
hooks.callAll("padInitToolbar", {
toolbar: toolbar
toolbar: toolbar,
isReadOnly: isReadOnly
});
res.send(eejs.require("ep_etherpad-lite/templates/pad.html", {
req: req,
toolbar: toolbar
toolbar: toolbar,
isReadOnly: isReadOnly
}));
});

View File

@ -63,12 +63,12 @@
<ul class="menu_left" role="toolbar">
<% e.begin_block("editbarMenuLeft"); %>
<%- toolbar.menu(settings.toolbar.left) %>
<%- toolbar.menu(settings.toolbar.left, isReadOnly) %>
<% e.end_block(); %>
</ul>
<ul class="menu_right" role="toolbar">
<% e.begin_block("editbarMenuRight"); %>
<%- toolbar.menu(settings.toolbar.right) %>
<%- toolbar.menu(settings.toolbar.right, isReadOnly) %>
<% e.end_block(); %>
</ul>
</div>