Skip to content

Instantly share code, notes, and snippets.

@derveloper
Created September 19, 2013 15:24
Show Gist options
  • Save derveloper/6625149 to your computer and use it in GitHub Desktop.
Save derveloper/6625149 to your computer and use it in GitHub Desktop.
exports.eejsBlock_embedPopup = function(hook_name, args, cb) {
var Pad = require('ep_etherpad-lite/node/db/Pad.js').Pad;
var padID = args.renderContext.req.url.split('/')[2];
var pad = new Pad(padID);
var isPublic = false;
pad.init(null, function() {
isPublic = pad.getPublicStatus();
console.log('requested pad is '+isPublic);
if(isPublic) {
args.content = args.content + eejs.require('ep_make_public/templates/embedPopup_public.html', {}, module);
} else {
args.content = args.content + eejs.require('ep_make_public/templates/embedPopup.html', {}, module);
}
return cb();
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment