diff --git a/app.js b/app.js index 492faf9609..05ba01c22f 100644 --- a/app.js +++ b/app.js @@ -86,6 +86,7 @@ webserver = require('./src/webserver.js'), SocketIO = require('socket.io').listen(global.server, { log: false, transports: ['websocket', 'xhr-polling', 'jsonp-polling', 'flashsocket']}), websockets = require('./src/websockets.js'), + posts = require('./src/posts.js'), plugins = require('./src/plugins'); // Don't remove this - plugins initializes itself websockets.init(SocketIO); diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index 2887b4a301..01b438b7b0 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -176,7 +176,7 @@ var ajaxify = {}; var scripts = [], script, - children_nodes = $(body_el).children(), + children_nodes = $(body_el).find('script'), child, i; diff --git a/public/src/app.js b/public/src/app.js index 9681e293f3..9098cce749 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -136,6 +136,7 @@ var socket, var alert_id = 'alert_button_' + ((params.alert_id) ? params.alert_id : new Date().getTime()); var alert = $('#' + alert_id); + var title = params.title || ''; function startTimeout(div, timeout) { var timeoutId = setTimeout(function () { @@ -148,7 +149,7 @@ var socket, } if (alert.length > 0) { - alert.find('strong').html(params.title); + alert.find('strong').html(title); alert.find('p').html(params.message); alert.attr('class', "alert toaster-alert " + "alert-" + params.type); @@ -161,7 +162,7 @@ var socket, p = document.createElement('p'); p.innerHTML = params.message; - strong.innerHTML = params.title; + strong.innerHTML = title; div.className = "alert toaster-alert " + "alert-" + params.type; diff --git a/public/src/forum/admin/footer.js b/public/src/forum/admin/footer.js index 22990fcf7b..8a99da7a74 100644 --- a/public/src/forum/admin/footer.js +++ b/public/src/forum/admin/footer.js @@ -16,9 +16,7 @@ jQuery('document').ready(function() { }); socket.once('api:config.get', function(config) { - require(['forum/admin/settings'], function(Settings) { - Settings.config = config; - }); + app.config = config; }); socket.emit('api:config.get'); diff --git a/public/src/forum/admin/settings.js b/public/src/forum/admin/settings.js index 75f1a78c83..b6017af47e 100644 --- a/public/src/forum/admin/settings.js +++ b/public/src/forum/admin/settings.js @@ -1,18 +1,16 @@ define(function() { var Settings = {}; - Settings.config = {}; - Settings.init = function() { Settings.prepare(); }; Settings.prepare = function() { - // Come back in 500ms if the config isn't ready yet - if (Settings.config === undefined) { + // Come back in 125ms if the config isn't ready yet + if (!app.config) { setTimeout(function() { Settings.prepare(); - }, 500); + }, 125); return; } @@ -25,21 +23,21 @@ define(function() { key = fields[x].getAttribute('data-field'); inputType = fields[x].getAttribute('type'); if (fields[x].nodeName === 'INPUT') { - if (Settings.config[key]) { + if (app.config[key]) { switch (inputType) { case 'text': case 'textarea': case 'number': - fields[x].value = Settings.config[key]; + fields[x].value = app.config[key]; break; case 'checkbox': - fields[x].checked = Settings.config[key] === '1' ? true : false; + fields[x].checked = app.config[key] === '1' ? true : false; break; } } } else if (fields[x].nodeName === 'TEXTAREA') { - if (Settings.config[key]) fields[x].value = Settings.config[key]; + if (app.config[key]) fields[x].value = app.config[key]; } } diff --git a/public/templates/admin/header.tpl b/public/templates/admin/header.tpl index 4135e135b0..ba2cdf32c7 100644 --- a/public/templates/admin/header.tpl +++ b/public/templates/admin/header.tpl @@ -76,35 +76,52 @@ + + + diff --git a/public/templates/category.tpl b/public/templates/category.tpl index b1894b4b9a..c9c0a06c1c 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -90,6 +90,16 @@ + + + diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index 1488af1e3a..5db4ea3fd2 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -66,6 +66,9 @@
{main_posts.content}
{main_posts.signature}
+ + {main_posts.additional_profile_info} + posted | last edited by {main_posts.editorname} @@ -127,6 +130,9 @@
{posts.content}
{posts.signature}