mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 23:30:36 +01:00
ESlint no-useless-concat, no-mixed-spaces-and-tabs
This commit is contained in:
@@ -63,8 +63,8 @@
|
||||
// "brace-style": "off",
|
||||
"max-statements-per-line": "off",
|
||||
"no-unused-vars": "off",
|
||||
"no-mixed-spaces-and-tabs": "off",
|
||||
"no-useless-concat": "off",
|
||||
// "no-mixed-spaces-and-tabs": "off",
|
||||
// "no-useless-concat": "off",
|
||||
// "require-jsdoc": "off",
|
||||
// "eqeqeq": "off",
|
||||
// "no-negated-condition": "off",
|
||||
|
||||
@@ -18,7 +18,7 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) {
|
||||
customCSS.on('change', function (event) {
|
||||
app.flags = app.flags || {};
|
||||
app.flags._unsaved = true;
|
||||
$('#customCSS-holder').val(customCSS.getValue());
|
||||
$('#customCSS-holder').val(customCSS.getValue());
|
||||
});
|
||||
|
||||
customHTML.setTheme('ace/theme/twilight');
|
||||
@@ -27,7 +27,7 @@ define('admin/appearance/customise', ['admin/settings'], function (Settings) {
|
||||
customHTML.on('change', function (event) {
|
||||
app.flags = app.flags || {};
|
||||
app.flags._unsaved = true;
|
||||
$('#customHTML-holder').val(customHTML.getValue());
|
||||
$('#customHTML-holder').val(customHTML.getValue());
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -43,7 +43,7 @@ define('admin/extend/rewards', ['translator'], function (translator) {
|
||||
var btn = $(this);
|
||||
var disabled = btn.hasClass('btn-success');
|
||||
var id = $(this).parents('[data-id]').attr('data-id');
|
||||
btn.toggleClass('btn-warning').toggleClass('btn-success').translateHtml('[[admin/extend/rewards:' + disabled ? 'disable' : 'enable' + ']]');
|
||||
btn.toggleClass('btn-warning').toggleClass('btn-success').translateHtml('[[admin/extend/rewards:' + (disabled ? 'disable' : 'enable') + ']]');
|
||||
// send disable api call
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -40,8 +40,8 @@ define('admin/general/navigation', ['translator', 'iconSelect', 'jqueryui'], fun
|
||||
$('#active-navigation').on('click', 'li', onSelect);
|
||||
|
||||
$('#enabled')
|
||||
.on('click', '.delete', remove)
|
||||
.on('click', '.toggle', toggle);
|
||||
.on('click', '.delete', remove)
|
||||
.on('click', '.toggle', toggle);
|
||||
|
||||
$('#save').on('click', save);
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ define('admin/manage/flags', [
|
||||
socket.emit('posts.dismissFlag', pid, function (err) {
|
||||
done(err, btn);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function handleDismissAll() {
|
||||
|
||||
@@ -8,7 +8,7 @@ define('admin/manage/ip-blacklist', ['translator'], function (translator) {
|
||||
var blacklist = $('#blacklist-rules');
|
||||
|
||||
blacklist.on('keyup', function () {
|
||||
$('#blacklist-rules-holder').val(blacklist.val());
|
||||
$('#blacklist-rules-holder').val(blacklist.val());
|
||||
});
|
||||
|
||||
$('[data-action="apply"]').on('click', function () {
|
||||
|
||||
@@ -321,7 +321,7 @@ $(document).ready(function () {
|
||||
callback(templates.cache[template]);
|
||||
} else {
|
||||
$.ajax({
|
||||
url: config.relative_path + '/assets/templates/' + template + '.tpl' + '?' + config['cache-buster'],
|
||||
url: config.relative_path + '/assets/templates/' + template + '.tpl?' + config['cache-buster'],
|
||||
type: 'GET',
|
||||
success: function (data) {
|
||||
callback(data.toString());
|
||||
|
||||
@@ -558,7 +558,7 @@ app.cacheBuster = null;
|
||||
|
||||
var scriptEl = document.createElement('script');
|
||||
scriptEl.type = 'text/javascript';
|
||||
scriptEl.src = config.relative_path + '/assets/vendor/jquery/js/jquery-ui.js' + '?' + config['cache-buster'];
|
||||
scriptEl.src = config.relative_path + '/assets/vendor/jquery/js/jquery-ui.js?' + config['cache-buster'];
|
||||
scriptEl.onload = callback;
|
||||
document.head.appendChild(scriptEl);
|
||||
};
|
||||
|
||||
@@ -322,7 +322,7 @@ define('forum/chats', [
|
||||
rooms: { roomId: data.roomId, lastUser: data.message.fromUser, usernames: data.message.fromUser.username, unread: true },
|
||||
}, function (html) {
|
||||
translator.translate(html, function (translated) {
|
||||
recentEl.prepend(translated);
|
||||
recentEl.prepend(translated);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator'], function
|
||||
var self = parseInt(message.fromuid, 10) === parseInt(app.user.uid, 10);
|
||||
message.self = self ? 1 : 0;
|
||||
messages.parseMessage(message, function (html) {
|
||||
var body = components.get('chat/message', message.messageId);
|
||||
var body = components.get('chat/message', message.messageId);
|
||||
if (body.length) {
|
||||
body.replaceWith(html);
|
||||
components.get('chat/message', message.messageId).find('.timeago').timeago();
|
||||
|
||||
@@ -114,7 +114,7 @@ define('chat', [
|
||||
}
|
||||
|
||||
var rooms = data.rooms.filter(function (room) {
|
||||
return room.teaser;
|
||||
return room.teaser;
|
||||
});
|
||||
|
||||
templates.parse('partials/chats/dropdown', {
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
exports = module.exports/* = SemVer*/;
|
||||
} else if (typeof define === 'function' && define.amd) {
|
||||
// Use the define() function if we're in AMD land
|
||||
define('helpers', exports);
|
||||
define('helpers', exports);
|
||||
} else if (typeof window === 'object') {
|
||||
window.helpers = exports;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
uploadModal = $(uploadModal);
|
||||
|
||||
uploadModal.modal('show');
|
||||
uploadModal.on('hidden.bs.modal', function () {
|
||||
uploadModal.on('hidden.bs.modal', function () {
|
||||
uploadModal.remove();
|
||||
});
|
||||
|
||||
@@ -74,15 +74,15 @@ define('pictureCropper', ['translator', 'cropper'], function (translator, croppe
|
||||
socketData.imageData = imageData;
|
||||
|
||||
socket.emit(data.socketMethod, socketData, function (err, imageData) {
|
||||
if (err) {
|
||||
cropperModal.find('#upload-progress-box').hide();
|
||||
cropperModal.find('.upload-btn').removeClass('disabled');
|
||||
cropperModal.find('.crop-btn').removeClass('disabled');
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
if (err) {
|
||||
cropperModal.find('#upload-progress-box').hide();
|
||||
cropperModal.find('.upload-btn').removeClass('disabled');
|
||||
cropperModal.find('.crop-btn').removeClass('disabled');
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
|
||||
callback(imageData.url);
|
||||
cropperModal.modal('hide');
|
||||
callback(imageData.url);
|
||||
cropperModal.modal('hide');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ define('uploader', ['translator'], function (translator) {
|
||||
uploadModal = $(uploadModal);
|
||||
|
||||
uploadModal.modal('show');
|
||||
uploadModal.on('hidden.bs.modal', function () {
|
||||
uploadModal.on('hidden.bs.modal', function () {
|
||||
uploadModal.remove();
|
||||
});
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
$.get(config.relative_path + '/api/widgets/render' + '?' + config['cache-buster'], {
|
||||
$.get(config.relative_path + '/api/widgets/render?' + config['cache-buster'], {
|
||||
locations: widgetLocations,
|
||||
template: template + '.tpl',
|
||||
url: url,
|
||||
|
||||
@@ -36,7 +36,7 @@ module.exports = function (Categories) {
|
||||
};
|
||||
|
||||
Categories.getTopicIds = function (cid, set, reverse, start, stop, callback) {
|
||||
var pinnedTids;
|
||||
var pinnedTids;
|
||||
var pinnedCount;
|
||||
var totalPinnedCount;
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ settingsController.get = function (req, res, callback) {
|
||||
}
|
||||
|
||||
userData.homePageRoutes.push({
|
||||
route: 'custom',
|
||||
name: 'Custom',
|
||||
selected: isCustom,
|
||||
route: 'custom',
|
||||
name: 'Custom',
|
||||
selected: isCustom,
|
||||
});
|
||||
|
||||
userData.bootswatchSkinOptions.forEach(function (skin) {
|
||||
|
||||
@@ -362,13 +362,13 @@ module.exports = function (db, module) {
|
||||
|
||||
var sets = {};
|
||||
data.forEach(function (set) {
|
||||
sets[set._key] = sets[set._key] || [];
|
||||
sets[set._key].push(set.value);
|
||||
sets[set._key] = sets[set._key] || [];
|
||||
sets[set._key].push(set.value);
|
||||
});
|
||||
|
||||
var returnData = new Array(keys.length);
|
||||
for (var i = 0; i < keys.length; i += 1) {
|
||||
returnData[i] = sets[keys[i]] || [];
|
||||
returnData[i] = sets[keys[i]] || [];
|
||||
}
|
||||
callback(null, returnData);
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ function getTranslationTree(callback) {
|
||||
// generate list of languages and namespaces
|
||||
function (plugins, next) {
|
||||
var languages = [];
|
||||
var namespaces = [];
|
||||
var namespaces = [];
|
||||
|
||||
// pull languages and namespaces from paths
|
||||
function extrude(languageDir, paths) {
|
||||
|
||||
@@ -50,5 +50,5 @@ module.exports = function (Posts) {
|
||||
next(null, uids);
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -422,10 +422,10 @@ function getChildrenCids(cids, uid, callback) {
|
||||
|
||||
childrenCategories.forEach(function (childrens) {
|
||||
categories.flattenCategories(allCategories, childrens);
|
||||
childrenCids = childrenCids.concat(allCategories.map(function (category) {
|
||||
return category && category.cid;
|
||||
}));
|
||||
});
|
||||
childrenCids = childrenCids.concat(allCategories.map(function (category) {
|
||||
return category && category.cid;
|
||||
}));
|
||||
});
|
||||
|
||||
callback(null, childrenCids);
|
||||
});
|
||||
|
||||
@@ -38,27 +38,27 @@
|
||||
'\n===========================================================\n' +
|
||||
'Please, add parameters for test database in config.json\n' +
|
||||
'For example (redis):\n' +
|
||||
'"test_database": {' + '\n' +
|
||||
' "host": "127.0.0.1",' + '\n' +
|
||||
' "port": "6379",' + '\n' +
|
||||
' "password": "",' + '\n' +
|
||||
' "database": "1"' + '\n' +
|
||||
'"test_database": {\n' +
|
||||
' "host": "127.0.0.1",\n' +
|
||||
' "port": "6379",\n' +
|
||||
' "password": "",\n' +
|
||||
' "database": "1"\n' +
|
||||
'}\n' +
|
||||
' or (mongo):\n' +
|
||||
'"test_database": {' + '\n' +
|
||||
' "host": "127.0.0.1",' + '\n' +
|
||||
' "port": "27017",' + '\n' +
|
||||
' "password": "",' + '\n' +
|
||||
' "database": "1"' + '\n' +
|
||||
'"test_database": {\n' +
|
||||
' "host": "127.0.0.1",\n' +
|
||||
' "port": "27017",\n' +
|
||||
' "password": "",\n' +
|
||||
' "database": "1\n' +
|
||||
'}\n' +
|
||||
' or (mongo) in a replicaset\n' +
|
||||
'"test_database": {\n' +
|
||||
' "host": "127.0.0.1,127.0.0.1,127.0.0.1",\n' +
|
||||
' "port": "27017,27018,27019",\n' +
|
||||
' "username": "",\n' +
|
||||
' "password": "",\n' +
|
||||
' "database": "nodebb_test"\n' +
|
||||
'}\n' +
|
||||
' or (mongo) in a replicaset' + '\n' +
|
||||
'"test_database": {' + '\n' +
|
||||
' "host": "127.0.0.1,127.0.0.1,127.0.0.1",' + '\n' +
|
||||
' "port": "27017,27018,27019",' + '\n' +
|
||||
' "username": "",' + '\n' +
|
||||
' "password": "",' + '\n' +
|
||||
' "database": "nodebb_test"' + '\n' +
|
||||
'}\n' +
|
||||
'==========================================================='
|
||||
);
|
||||
winston.error(errorText);
|
||||
|
||||
@@ -383,9 +383,9 @@ describe('User', function () {
|
||||
io.emit('user.updateProfile', data, function (err, result) {
|
||||
assert.ifError(err);
|
||||
|
||||
assert.equal(result.username, 'updatedUserName');
|
||||
assert.equal(result.userslug, 'updatedusername');
|
||||
assert.equal(result.email, 'updatedEmail@me.com');
|
||||
assert.equal(result.username, 'updatedUserName');
|
||||
assert.equal(result.userslug, 'updatedusername');
|
||||
assert.equal(result.email, 'updatedEmail@me.com');
|
||||
|
||||
db.getObject('user:' + uid, function (err, userData) {
|
||||
assert.ifError(err);
|
||||
|
||||
Reference in New Issue
Block a user