Created
September 19, 2013 15:24
-
-
Save derveloper/6625149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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