Skip to content

Commit

Permalink
Providing server-side setting to control if comments will be displaye…
Browse files Browse the repository at this point in the history
…d as icons or boxes
  • Loading branch information
Luiza Pagliari committed Jun 9, 2015
1 parent 10c54c9 commit 1712fca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions ep.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"eejsBlock_scripts": "ep_comments_page/index",
"eejsBlock_mySettings": "ep_comments_page/index",
"eejsBlock_styles": "ep_comments_page/index",
"clientVars": "ep_comments_page/index",
"handleMessageSecurity": "ep_comments_page/index"
}
}
Expand Down
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var eejs = require('ep_etherpad-lite/node/eejs/');
var settings = require('ep_etherpad-lite/node/utils/Settings');
var formidable = require('formidable');
var clientIO = require('socket.io-client');
var commentManager = require('./commentManager');
Expand Down Expand Up @@ -118,6 +119,11 @@ exports.eejsBlock_styles = function (hook_name, args, cb) {
return cb();
};

exports.clientVars = function (hook, context, cb) {
var displayCommentAsIcon = settings.ep_comments_page ? settings.ep_comments_page.displayCommentAsIcon : false;
return cb({ "displayCommentAsIcon": displayCommentAsIcon });
};

exports.expressCreateServer = function (hook_name, args, callback) {
args.app.post('/p/:pad/:rev?/comments', function(req, res) {
new formidable.IncomingForm().parse(req, function (err, fields, files) {
Expand Down

0 comments on commit 1712fca

Please sign in to comment.