diff --git a/public/language/en_GB/global.json b/public/language/en_GB/global.json index b8cadf0bc6..66ea4af420 100644 --- a/public/language/en_GB/global.json +++ b/public/language/en_GB/global.json @@ -120,5 +120,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", - "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?" + "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." } diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js index bec556c07a..8237a9961b 100644 --- a/public/src/ajaxify.js +++ b/public/src/ajaxify.js @@ -375,7 +375,8 @@ $(document).ready(function() { app.load(); $('[data-template]').each(function() { - templates.cache[$(this).attr('data-template')] = $(this).html(); + templates.cache[$(this).attr('data-template')] = $('
').html($(this).html()).text(); + $(this).parent().remove(); }); }); \ No newline at end of file diff --git a/public/src/sockets.js b/public/src/sockets.js index f2a9bfd346..15eee26b5e 100644 --- a/public/src/sockets.js +++ b/public/src/sockets.js @@ -48,9 +48,11 @@ app.isConnected = false; if (reconnecting) { var reconnectEl = $('#reconnect'); + var reconnectAlert = $('#reconnect-alert'); reconnectEl.tooltip('destroy'); reconnectEl.html(''); + reconnectAlert.fadeOut(500); reconnecting = false; reJoinCurrentRoom(); @@ -102,12 +104,14 @@ app.isConnected = false; function onReconnecting() { reconnecting = true; var reconnectEl = $('#reconnect'); + var reconnectAlert = $('#reconnect-alert'); if (!reconnectEl.hasClass('active')) { reconnectEl.html(''); + reconnectAlert.fadeIn(500).removeClass('hide'); } - reconnectEl.addClass('active').removeClass("hide").tooltip({ + reconnectEl.addClass('active').removeClass('hide').tooltip({ placement: 'bottom' }); } diff --git a/src/middleware/header.js b/src/middleware/header.js index 4f25a55ca5..6425c17d74 100644 --- a/src/middleware/header.js +++ b/src/middleware/header.js @@ -2,6 +2,7 @@ var async = require('async'); var nconf = require('nconf'); +var validator = require('validator'); var db = require('../database'); var user = require('../user'); @@ -27,7 +28,10 @@ module.exports = function(app, middleware) { controllers.api.getConfig(req, res, next); }, footer: function(next) { - app.render('footer', {loggedIn: (req.user ? parseInt(req.user.uid, 10) !== 0 : false)}, next); + app.render('footer', { + loggedIn: !!req.uid, + title: validator.escape(meta.config.title || meta.config.browserTitle || 'NodeBB') + }, next); }, plugins: function(next) { plugins.fireHook('filter:middleware.buildHeader', {req: req, locals: res.locals}, next); diff --git a/src/views/500-embed.tpl b/src/views/500-embed.tpl index 537cbac136..4d4dd6fc34 100644 --- a/src/views/500-embed.tpl +++ b/src/views/500-embed.tpl @@ -2,8 +2,7 @@[[global:500.message]]
-{path}
-{error}
- +{path}
+ <!-- IF error -->{error}
<!-- ENDIF error -->