some minor linting elsewhere

v1.18.x
psychobunny 11 years ago
parent 31b2faf2c5
commit 2a2490541f

@ -1,5 +1,5 @@
"use strict"; "use strict";
/*global ajaxify, templates*/ /*global ajaxify, templates, config, RELATIVE_PATH*/
(function(ajaxify) { (function(ajaxify) {
ajaxify.widgets = {}; ajaxify.widgets = {};

@ -53,7 +53,9 @@ var async = require('async'),
emitter.emit('nodebb:ready'); emitter.emit('nodebb:ready');
} }
if (callback) callback.apply(null, arguments); if (callback) {
callback.apply(null, arguments);
}
}); });
}; };

@ -98,7 +98,7 @@ module.exports = function(Meta) {
process.exit(0); process.exit(0);
} }
}); });
} };
function minify(source, paths, destination, callback) { function minify(source, paths, destination, callback) {
var parser = new (less.Parser)({ var parser = new (less.Parser)({
@ -114,8 +114,10 @@ module.exports = function(Meta) {
return; return;
} }
var css;
try { try {
var css = tree.toCSS({ css = tree.toCSS({
cleancss: true cleancss: true
}); });
} catch (err) { } catch (err) {

@ -113,7 +113,9 @@ module.exports = function(Meta) {
}, next); }, next);
} }
], function(err) { ], function(err) {
if (err) return callback(err); if (err) {
return callback(err);
}
// Convert all scripts to paths relative to the NodeBB base directory // Convert all scripts to paths relative to the NodeBB base directory
var basePath = path.resolve(__dirname, '../..'); var basePath = path.resolve(__dirname, '../..');
@ -237,7 +239,9 @@ module.exports = function(Meta) {
function getPluginScripts(callback) { function getPluginScripts(callback) {
plugins.fireHook('filter:scripts.get', [], function(err, scripts) { plugins.fireHook('filter:scripts.get', [], function(err, scripts) {
if (err) callback(err, []); if (err) {
callback(err, []);
}
var jsPaths = scripts.map(function (jsPath) { var jsPaths = scripts.map(function (jsPath) {
jsPath = path.normalize(jsPath); jsPath = path.normalize(jsPath);
@ -264,5 +268,5 @@ module.exports = function(Meta) {
Meta.js.scripts.plugin = jsPaths.filter(Boolean); Meta.js.scripts.plugin = jsPaths.filter(Boolean);
callback(); callback();
}); });
}; }
}; };

@ -113,7 +113,7 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
scores[length] = [tid[1]]; scores[length] = [tid[1]];
} }
} else if (room.match(/^\/category/)) { } else if (room.match(/^\/category/)) {
socketData.users.category += rooms[room].length socketData.users.category += rooms[room].length;
} }
} }
} }
@ -132,7 +132,7 @@ SocketMeta.rooms.getAll = function(socket, data, callback) {
socketData.topics[tid] = { socketData.topics[tid] = {
value: rooms['/topic_' + tid].length, value: rooms['/topic_' + tid].length,
title: validator.escape(titles[id].title) title: validator.escape(titles[id].title)
} };
}); });
callback(null, socketData); callback(null, socketData);

Loading…
Cancel
Save