diff --git a/public/src/admin/appearance/skins.js b/public/src/admin/appearance/skins.js index b67842b1b5..374b88a7b4 100644 --- a/public/src/admin/appearance/skins.js +++ b/public/src/admin/appearance/skins.js @@ -32,12 +32,9 @@ define('admin/appearance/skins', function() { app.alert({ alert_id: 'admin:theme', type: 'info', - title: 'Theme Changed', - message: 'Please restart your NodeBB to fully activate this theme', - timeout: 5000, - clickfn: function() { - socket.emit('admin.restart'); - } + title: 'Skin Updated', + message: themeId + ' skin was successfully applied', + timeout: 5000 }); }); } diff --git a/public/src/client/topic/threadTools.js b/public/src/client/topic/threadTools.js index 0d10cd844c..fe8bc1fcfb 100644 --- a/public/src/client/topic/threadTools.js +++ b/public/src/client/topic/threadTools.js @@ -60,7 +60,10 @@ define('forum/topic/threadTools', ['forum/topic/fork', 'forum/topic/move'], func fork.init(); - components.get('topic').on('click', '[component="topic/follow"]', function() { + components.get('topic').on('click', '[component="topic/follow"]', follow); + components.get('topic/follow').off('click').on('click', follow); + + function follow() { socket.emit('topics.toggleFollow', tid, function(err, state) { if(err) { return app.alert({ @@ -83,7 +86,7 @@ define('forum/topic/threadTools', ['forum/topic/fork', 'forum/topic/move'], func }); return false; - }); + } }; function topicCommand(command, tid) { diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 52e4c42c8c..43ba05ed1b 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -48,7 +48,7 @@ define('notifications', ['sounds'], function(sound) { }); }); - notifList.on('click', '.mark-all-read', function() { + notifContainer.on('click', '.mark-all-read', function() { socket.emit('notifications.markAllRead', function(err) { if (err) { app.alertError(err.message); diff --git a/public/src/utils.js b/public/src/utils.js index 0c58817411..930e03501f 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -367,6 +367,20 @@ }; } + if (typeof String.prototype.endsWith != 'function') { + String.prototype.endsWith = function(suffix) { + if (this.length < suffix.length) { + return false; + } + var len = this.length; + var suffixLen = suffix.length; + for (var i=1; (i <= suffixLen && this[len - i] === suffix[suffixLen - i]); ++i) { + continue; + } + return i > suffixLen; + }; + } + if ('undefined' !== typeof window) { window.utils = module.exports; } diff --git a/src/database/mongo.js b/src/database/mongo.js index 522f9fffdc..e420f003b9 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -59,6 +59,17 @@ usernamePassword = nconf.get('mongo:username') + ':' + nconf.get('mongo:password') + '@'; } + // Sensible defaults for Mongo, if not set + if (!nconf.get('mongo:host')) { + nconf.set('mongo:host', '127.0.0.1'); + } + if (!nconf.get('mongo:port')) { + nconf.set('mongo:port', 27017); + } + if (!nconf.get('mongo:database')) { + nconf.set('mongo:database', '0'); + } + var connString = 'mongodb://' + usernamePassword + nconf.get('mongo:host') + ':' + nconf.get('mongo:port') + '/' + nconf.get('mongo:database'); var connOptions = { server: { diff --git a/src/meta/css.js b/src/meta/css.js index d45b61f280..a8682b1038 100644 --- a/src/meta/css.js +++ b/src/meta/css.js @@ -10,7 +10,8 @@ var winston = require('winston'), plugins = require('../plugins'), emitter = require('../emitter'), - db = require('../database'); + db = require('../database'), + utils = require('../../public/src/utils'); module.exports = function(Meta) { @@ -21,30 +22,46 @@ module.exports = function(Meta) { Meta.css.defaultBranding = {}; Meta.css.minify = function(callback) { - if (nconf.get('isPrimary') === 'true') { - winston.verbose('[meta/css] Minifying LESS/CSS'); - db.getObjectFields('config', ['theme:type', 'theme:id'], function(err, themeData) { - var themeId = (themeData['theme:id'] || 'nodebb-theme-vanilla'), - baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')), - paths = [ - baseThemePath, - path.join(__dirname, '../../node_modules'), - path.join(__dirname, '../../public/vendor/fontawesome/less'), - path.join(__dirname, '../../public/vendor/bootstrap/less') - ], - source = '@import "font-awesome";', - acpSource, - x; - - - plugins.lessFiles = filterMissingFiles(plugins.lessFiles); - for(x=0; x
#{events.eid} {events.type} - {events.user.username} (uid {events.user.uid}) (IP {events.ip}) + {events.user.username} (uid {events.user.uid}) (IP {events.ip}) {events.timestampISO}

{events.jsonString}