diff --git a/docs/installing/os/windows8.rst b/docs/installing/os/windows8.rst index b9e54d90fb..ad67754233 100644 --- a/docs/installing/os/windows8.rst +++ b/docs/installing/os/windows8.rst @@ -9,7 +9,7 @@ First, install the following programs: * https://windows.github.com/ * http://nodejs.org/ * http://sourceforge.net/projects/redis/files/redis-2.6.10/ -* http://http://imagemagick.org/script/binary-releases.php#windows/ +* http://imagemagick.org/script/binary-releases.php#windows/ You may have to restart your computer. diff --git a/minifier.js b/minifier.js index a56578898d..3bd306a07c 100644 --- a/minifier.js +++ b/minifier.js @@ -24,7 +24,7 @@ Minifier.js.minify = function (scripts, minify, callback) { options.outSourceMap = 'nodebb.min.js.map'; options.mangle = false; options.compress = false; - options.prefix = __dirname.split(path.sep).length; + options.prefix = 1; } try { diff --git a/package.json b/package.json index 6fd50278c1..b185dc0af9 100644 --- a/package.json +++ b/package.json @@ -38,8 +38,8 @@ "nodebb-plugin-markdown": "~0.5.0", "nodebb-plugin-mentions": "~0.5.0", "nodebb-plugin-soundpack-default": "~0.1.1", - "nodebb-theme-lavender": "~0.0.26", - "nodebb-theme-vanilla": "~0.0.21", + "nodebb-theme-lavender": "~0.0.74", + "nodebb-theme-vanilla": "~0.0.111", "nodebb-widget-essentials": "~0.1.0", "npm": "^1.4.6", "passport": "~0.2.0", diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js index 4f8d57895b..9467971332 100644 --- a/public/src/modules/navigator.js +++ b/public/src/modules/navigator.js @@ -191,7 +191,7 @@ define('navigator', ['forum/topic/pagination'], function(pagination) { scrollTo.parent().find('.topic-item').addClass('highlight'); setTimeout(function() { scrollTo.parent().find('.topic-item').removeClass('highlight'); - }, 5000); + }, 3000); } } diff --git a/src/controllers/api.js b/src/controllers/api.js index 0945ee2c55..f8522dadf1 100644 --- a/src/controllers/api.js +++ b/src/controllers/api.js @@ -15,6 +15,7 @@ apiController.getConfig = function(req, res, next) { config.relative_path = serverConfig.relative_path; config.version = pkg.version; config.siteTitle = meta.config.title || meta.config.browserTitle || 'NodeBB'; + config.showSiteTitle = meta.config.showSiteTitle === '1'; config.postDelay = meta.config.postDelay; config.minimumTitleLength = meta.config.minimumTitleLength; config.maximumTitleLength = meta.config.maximumTitleLength; diff --git a/src/meta/js.js b/src/meta/js.js index b772f0ac05..3476f891da 100644 --- a/src/meta/js.js +++ b/src/meta/js.js @@ -5,6 +5,7 @@ var winston = require('winston'), path = require('path'), async = require('async'), _ = require('underscore'), + os = require('os'), plugins = require('../plugins'), emitter = require('../emitter'), @@ -74,30 +75,30 @@ module.exports = function(Meta) { Meta.js.prepare = function (callback) { plugins.fireHook('filter:scripts.get', Meta.js.scripts, function(err, scripts) { var jsPaths = scripts.map(function (jsPath) { - jsPath = path.normalize(jsPath); - - if (jsPath.substring(0, 7) === 'plugins') { - var matches = _.map(plugins.staticDirs, function(realPath, mappedPath) { - if (jsPath.match(mappedPath)) { - return mappedPath; + jsPath = path.normalize(jsPath); + + if (jsPath.substring(0, 7) === 'plugins') { + var matches = _.map(plugins.staticDirs, function(realPath, mappedPath) { + if (jsPath.match(mappedPath)) { + return mappedPath; + } else { + return null; + } + }).filter(function(a) { return a; }); + + if (matches.length) { + var relPath = jsPath.slice(('plugins/' + matches[0]).length), + pluginId = matches[0].split(path.sep)[0]; + + return plugins.staticDirs[matches[0]] + relPath; } else { + winston.warn('[meta.scripts.get] Could not resolve mapped path: ' + jsPath + '. Are you sure it is defined by a plugin?'); return null; } - }).filter(function(a) { return a; }); - - if (matches.length) { - var relPath = jsPath.slice(('plugins/' + matches[0]).length), - pluginId = matches[0].split(path.sep)[0]; - - return plugins.staticDirs[matches[0]] + relPath; } else { - winston.warn('[meta.scripts.get] Could not resolve mapped path: ' + jsPath + '. Are you sure it is defined by a plugin?'); - return null; + return path.join(__dirname, '../..', '/public', jsPath); } - } else { - return path.join(__dirname, '../..', '/public', jsPath); - } - }); + }); Meta.js.scripts = jsPaths.filter(function(path) { return path !== null; @@ -123,6 +124,11 @@ module.exports = function(Meta) { next(err); }); }, function(err) { + // Translate into relative paths + Meta.js.scripts = Meta.js.scripts.map(function(script) { + return path.relative(path.resolve(__dirname, '../..'), script).replace(/\\/g, '/'); + }); + Meta.js.prepared = true; callback(err); }); @@ -163,4 +169,11 @@ module.exports = function(Meta) { Meta.js.minifierProc.kill('SIGTERM'); } }; + + // OS detection and handling + // if (os.platform() === 'win32') { + // Meta.js.scripts = Meta.js.scripts.map(function(script) { + // return script.replace(/\//g, '\\'); + // }); + // } }; \ No newline at end of file diff --git a/src/user/create.js b/src/user/create.js index 0f01cf22d0..e4c1227266 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -27,34 +27,38 @@ module.exports = function(User) { var password = userData.password; userData.password = null; - async.parallel([ - function(next) { + async.parallel({ + emailValid: function(next) { if (userData.email) { next(!utils.isEmailValid(userData.email) ? new Error('[[error:invalid-email]]') : null); } else { next(); } }, - function(next) { + userNameValid: function(next) { next((!utils.isUserNameValid(userData.username) || !userData.userslug) ? new Error('[[error:invalid-username]]') : null); }, - function(next) { + passwordValid: function(next) { if (password) { next(!utils.isPasswordValid(password) ? new Error('[[error:invalid-password]]') : null); } else { next(); } }, - function(next) { + renamedUsername: function(next) { meta.userOrGroupExists(userData.userslug, function(err, exists) { if (err) { return next(err); } if (exists) { + var newUsername = ''; async.forever(function(next) { - var newUsername = userData.username + (Math.floor(Math.random() * 255) + 1); + newUsername = userData.username + (Math.floor(Math.random() * 255) + 1); User.exists(newUsername, function(err, exists) { + if (err) { + return callback(err); + } if (!exists) { next(newUsername); } else { @@ -69,7 +73,7 @@ module.exports = function(User) { } }); }, - function(next) { + emailAvailable: function(next) { if (userData.email) { User.email.available(userData.email, function(err, available) { if (err) { @@ -81,28 +85,34 @@ module.exports = function(User) { next(); } }, - function(next) { + customFields: function(next) { plugins.fireHook('filter:user.custom_fields', userData, function(err, fields) { + if (err) { + return next(err); + } + delete fields.username; + delete fields.userslug; customFields = fields; next(err); }); }, - function(next) { + userData: function(next) { plugins.fireHook('filter:user.create', userData, function(err, filteredUserData){ next(err, utils.merge(userData, filteredUserData)); }); } - ], function(err, results) { + }, function(err, results) { if (err) { return callback(err); } - userData = results[results.length - 1]; - var userNameChanged = !!results[3]; + userData = results.userData; + var userNameChanged = !!results.renamedUsername; + // If a new username was picked... if (userNameChanged) { - userData.username = results[3]; - userData.userslug = utils.slugify(results[3]); + userData.username = results.renamedUsername; + userData.userslug = utils.slugify(results.renamedUsername); } db.incrObjectField('global', 'nextUid', function(err, uid) {