Node.js based forum software built for the modern web
added footer.build and page.load hooks
Julian Lama9ce8393e41f
diff --git a/app.js b/app.jsindex e3e8457545..374c198bf9 100644--- a/app.js+++ b/app.js@@ -113,7 +113,9 @@], customTemplates);- templates.ready(webserver.init);+ plugins.ready(function() {+ templates.ready(webserver.init);+ });Notifications.init();} else {diff --git a/public/src/ajaxify.js b/public/src/ajaxify.jsindex f233627fde..1052d03541 100644--- a/public/src/ajaxify.js+++ b/public/src/ajaxify.js@@ -80,7 +80,8 @@ var ajaxify = {};hook: 'page.load',args: {template: tpl_url,- url: '/' + url+ url: url,+ uid: app.uid}}});diff --git a/public/templates/footer.tpl b/public/templates/footer.tplindex 85343f1e32..de5c022e5b 100644--- a/public/templates/footer.tpl+++ b/public/templates/footer.tpl@@ -60,6 +60,7 @@<footer id="footer" class="container footer">+ {footerHTML}<div class="copyright">Copyright © 2013 <a target="_blank" href="http://www.nodebb.org">NodeBB</a> by <a target="_blank" href="https://github.com/psychobunny">psychobunny</a>, <a href="https://github.com/julianlam" target="_blank">julianlam</a>, <a href="https://github.com/barisusakli" target="_blank">barisusakli</a> from <a target="_blank" href="http://www.designcreateplay.com">designcreateplay</a></div></footer>diff --git a/src/plugins.js b/src/plugins.jsindex 97394884db..029a666183 100644--- a/src/plugins.js+++ b/src/plugins.js@@ -284,7 +284,7 @@ var fs = require('fs'),winston.warn("Plugin: " + file + " is corrupted or invalid. Please check plugin.json for errors.")return next(err, null);}-+_self.isActive(config.id, function(err, active) {if (err) next(new Error('no-active-state'));diff --git a/src/webserver.js b/src/webserver.jsindex cb0613b60d..c6ddb36d02 100644--- a/src/webserver.js+++ b/src/webserver.js@@ -309,7 +309,11 @@ var path = require('path'),// translate all static templates served by webserver here. ex. footer, logouttranslator.translate(templates.footer.toString(), function(parsedTemplate) {- templates.footer = parsedTemplate;+ plugins.fireHook('filter:footer.build', '', function(err, appendHTML) {+ templates.footer = templates.footer.parse({+ footerHTML: appendHTML+ });+ });});translator.translate(templates.logout.toString(), function(parsedTemplate) {templates.logout = parsedTemplate;