Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to latest nodebb #6

Merged
merged 4 commits into from Feb 15, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -10,13 +10,16 @@
_.mixin(_.str.exports()); // Mix in non-conflict functions to Underscore namespace
var Beep = {
banned_words: undefined,
init: function (app, middleware, controllers, callback) {
init: function (params, callback) {
var router = params.router;
var middleware = params.middleware;

function render(req, res, next) {
res.render('admin/plugins/beep', {});
}
app.get('/admin/plugins/beep', middleware.admin.buildHeader, render);
app.get('/api/admin/plugins/beep', render);
app.get('/api/plugins/beep', function (req, res) {
router.get('/admin/plugins/beep', middleware.admin.buildHeader, render);
router.get('/api/admin/plugins/beep', render);
router.get('/api/plugins/beep', function (req, res) {
if (Beep.banned_words) {
res.send(200, Beep.banned_words);
} else {
@@ -42,7 +45,11 @@
Beep.loadList();
}
},
parse: function (postContent, callback) {
parse: function (data, callback) {
if (!data || !data.postData || !data.postData.content) {
return callback(null, data);
}
var postContent = data.postData.content;
var badwords = Beep.banned_words.split(',');
badwords = _.map(badwords, function(word) { return _.trim(word); });
for (var w in badwords) {
@@ -55,10 +62,10 @@
if (postContent.match(re)) {
var match = postContent.match(re);
var hashword = match[0].replace(re2, hidesting);
postContent = postContent.replace(re, hashword);
data.postData.content = postContent.replace(re, hashword);
}
}
callback(null, postContent);
callback(null, data);
},
admin: {
menu: function (custom_header, callback) {
@@ -7,7 +7,7 @@
"templates":"public/templates",
"hooks": [
{ "hook": "static:app.load", "method": "init" },
{ "hook": "filter:post.parse", "method": "parse", "priority": 5 },
{ "hook": "filter:parse.post", "method": "parse", "priority": 5 },
{ "hook": "action:settings.set", "method": "onListChange" },
{ "hook": "filter:admin.header.build", "method": "admin.menu" }
],
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.