Merge remote-tracking branch 'origin/master'

# Conflicts:
#	public/src/admin/manage/category.js
v1.18.x
Baris Usakli 8 years ago
commit 1fa52267d4

2
.gitignore vendored

@ -60,3 +60,5 @@ coverage
build
*.log
test/files/normalise.jpg.png
test/files/normalise-resized.jpg

@ -45,6 +45,7 @@
"jquery": "^3.1.0",
"json-2-csv": "^2.0.22",
"less": "^2.0.0",
"lodash": "^4.17.4",
"lodash.padstart": "^4.6.1",
"logrotate-stream": "^0.2.3",
"lru-cache": "4.0.2",
@ -93,8 +94,6 @@
"templates.js": "0.3.11",
"toobusy-js": "^0.5.1",
"uglify-js": "^3.0.11",
"underscore": "^1.8.3",
"underscore.deep": "^0.5.1",
"validator": "7.0.0",
"winston": "^2.1.0",
"xml": "^1.0.1",

@ -12,19 +12,6 @@ define('admin/manage/category', [
var modified_categories = {};
Category.init = function () {
var modified_categories = {};
function modified(el) {
var cid = $(el).parents('form').attr('data-cid');
if (cid) {
modified_categories[cid] = modified_categories[cid] || {};
modified_categories[cid][$(el).attr('data-name')] = $(el).val();
app.flags = app.flags || {};
app.flags._unsaved = true;
}
}
$('#category-settings select').each(function () {
var $this = $(this);

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var db = require('../database');
var posts = require('../posts');

@ -5,7 +5,7 @@ var winston = require('winston');
var passport = require('passport');
var nconf = require('nconf');
var validator = require('validator');
var _ = require('underscore');
var _ = require('lodash');
var db = require('../database');
var meta = require('../meta');

@ -6,12 +6,10 @@ var winston = require('winston');
var async = require('async');
var nconf = require('nconf');
var session = require('express-session');
var _ = require('underscore');
var _ = require('lodash');
var semver = require('semver');
var db;
_.mixin(require('underscore.deep'));
var mongoModule = module.exports;
mongoModule.questions = [
@ -87,7 +85,7 @@ mongoModule.init = function (callback) {
autoReconnect: true,
};
connOptions = _.deepExtend(connOptions, nconf.get('mongo:options') || {});
connOptions = _.merge(connOptions, nconf.get('mongo:options') || {});
mongoClient.connect(connString, connOptions, function (err, _db) {
if (err) {

@ -1,6 +1,6 @@
'use strict';
var _ = require('underscore');
var _ = require('lodash');
var async = require('async');
var winston = require('winston');
var nconf = require('nconf');
@ -9,8 +9,6 @@ var session = require('express-session');
var redis = require('redis');
var redisClient;
_.mixin(require('underscore.deep'));
var redisModule = module.exports;
redisModule.questions = [
@ -78,7 +76,7 @@ redisModule.connect = function (options) {
options.auth_pass = nconf.get('redis:password');
}
options = _.deepExtend(options, nconf.get('redis:options') || {});
options = _.merge(options, nconf.get('redis:options') || {});
if (redis_socket_or_host && redis_socket_or_host.indexOf('/') >= 0) {
/* If redis.host contains a path name character, use the unix dom sock connection. ie, /tmp/redis.sock */

@ -1,6 +1,9 @@
'use strict';
var async = require('async');
var _ = require('lodash');
var S = require('string');
var db = require('./database');
var user = require('./user');
var groups = require('./groups');
@ -12,8 +15,6 @@ var posts = require('./posts');
var privileges = require('./privileges');
var plugins = require('./plugins');
var utils = require('../public/src/utils');
var _ = require('underscore');
var S = require('string');
var Flags = module.exports;

@ -2,7 +2,7 @@
var async = require('async');
var winston = require('winston');
var _ = require('underscore');
var _ = require('lodash');
var user = require('../user');
var utils = require('../utils');
@ -458,7 +458,7 @@ module.exports = function (Groups) {
},
function (_members, next) {
members = _members;
uniqueGroups = _.unique(_.flatten(members));
uniqueGroups = _.uniq(_.flatten(members));
uniqueGroups = Groups.removeEphemeralGroups(uniqueGroups);
Groups.isMemberOfGroups(uid, uniqueGroups, next);

@ -6,7 +6,7 @@ var async = require('async');
var fs = require('fs');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
var _ = require('underscore');
var _ = require('lodash');
var file = require('../file');
var Plugins = require('../plugins');

@ -5,7 +5,7 @@ var winston = require('winston');
var cron = require('cron').CronJob;
var nconf = require('nconf');
var S = require('string');
var _ = require('underscore');
var _ = require('lodash');
var db = require('./database');
var User = require('./user');
@ -247,7 +247,7 @@ Notifications.pushGroups = function (notification, groupNames, callback) {
groups.getMembersOfGroups(groupNames, next);
},
function (groupMembers, next) {
var members = _.unique(_.flatten(groupMembers));
var members = _.uniq(_.flatten(groupMembers));
Notifications.push(notification, members, next);
},
], callback);

@ -1,7 +1,7 @@
'use strict';
var qs = require('querystring');
var _ = require('underscore');
var _ = require('lodash');
var pagination = {};

@ -5,7 +5,7 @@ var semver = require('semver');
var async = require('async');
var winston = require('winston');
var nconf = require('nconf');
var _ = require('underscore');
var _ = require('lodash');
var meta = require('../meta');

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var db = require('./database');
var utils = require('./utils');

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var db = require('../database');
var topics = require('../topics');

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var meta = require('../meta');
var db = require('../database');

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var db = require('../database');
var topics = require('../topics');

@ -2,7 +2,7 @@
var async = require('async');
var validator = require('validator');
var _ = require('underscore');
var _ = require('lodash');
var db = require('../database');
var topics = require('../topics');

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var categories = require('../categories');
var user = require('../user');
@ -58,7 +58,7 @@ module.exports = function (privileges) {
});
});
var members = _.unique(_.flatten(memberSets));
var members = _.uniq(_.flatten(memberSets));
user.getUsersFields(members, ['picture', 'username'], next);
},
@ -93,7 +93,7 @@ module.exports = function (privileges) {
},
function (results, next) {
var memberSets = results.memberSets;
var uniqueGroups = _.unique(_.flatten(memberSets));
var uniqueGroups = _.uniq(_.flatten(memberSets));
var groupNames = results.groupNames.filter(function (groupName) {
return groupName.indexOf(':privileges:') === -1 && uniqueGroups.indexOf(groupName) !== -1;
@ -171,7 +171,7 @@ module.exports = function (privileges) {
}, next);
},
function (results, next) {
var privData = _.object(privs, results.privileges);
var privData = _.zipObject(privs, results.privileges);
var isAdminOrMod = results.isAdministrator || results.isModerator;
plugins.fireHook('filter:privileges.categories.get', {

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var meta = require('../meta');
var topics = require('../topics');
@ -29,7 +29,7 @@ module.exports = function (privileges) {
}, next);
},
function (results, next) {
var privData = _.object(privs, results.privileges);
var privData = _.zipObject(privs, results.privileges);
var disabled = parseInt(results.disabled, 10) === 1;
var locked = parseInt(topic.locked, 10) === 1;
var deleted = parseInt(topic.deleted, 10) === 1;

@ -2,7 +2,7 @@
var async = require('async');
var validator = require('validator');
var _ = require('underscore');
var _ = require('lodash');
var S = require('string');
var posts = require('../../posts');
@ -69,7 +69,7 @@ module.exports = function (SocketPosts) {
], next);
},
function (results, next) {
var uids = _.unique(_.flatten(results).concat(socket.uid.toString()));
var uids = _.uniq(_.flatten(results).concat(socket.uid.toString()));
uids.forEach(function (uid) {
websockets.in('uid_' + uid).emit('event:post_edited', editResult);
});

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var db = require('./database');
var posts = require('./posts');
@ -135,8 +135,8 @@ Topics.getTopicsByTids = function (tids, uid, callback) {
}, next);
},
function (results, next) {
var users = _.object(uids, results.users);
var categories = _.object(cids, results.categories);
var users = _.zipObject(uids, results.users);
var categories = _.zipObject(cids, results.categories);
for (var i = 0; i < topics.length; i += 1) {
if (topics[i]) {

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var validator = require('validator');
var S = require('string');
var db = require('../database');

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var validator = require('validator');
var db = require('../database');

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var categories = require('../categories');
var search = require('../search');
@ -51,7 +51,7 @@ module.exports = function (Topics) {
}, next);
},
function (data, next) {
next(null, _.unique(_.flatten(data)));
next(null, _.uniq(_.flatten(data)));
},
], callback);
}

@ -5,7 +5,7 @@ var async = require('async');
var db = require('../database');
var meta = require('../meta');
var _ = require('underscore');
var _ = require('lodash');
var plugins = require('../plugins');
var utils = require('../utils');
@ -247,7 +247,7 @@ module.exports = function (Topics) {
tag.score = results.counts[index] ? results.counts[index] : 0;
});
var tagData = _.object(uniqueTopicTags, results.tagData);
var tagData = _.zipObject(uniqueTopicTags, results.tagData);
topicTags.forEach(function (tags, index) {
if (Array.isArray(tags)) {
@ -444,7 +444,7 @@ module.exports = function (Topics) {
}, next);
},
function (tids, next) {
tids = _.shuffle(_.unique(_.flatten(tids))).slice(0, maximumTopics);
tids = _.shuffle(_.uniq(_.flatten(tids))).slice(0, maximumTopics);
Topics.getTopics(tids, uid, next);
},
function (topics, next) {

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var db = require('../database');
var categories = require('../categories');
@ -210,7 +210,7 @@ module.exports = function (Topics) {
Topics.getTopicsFields(tids, ['cid'], next);
},
function (topicData, next) {
var uniqueCids = _.unique(topicData.map(function (topicData) {
var uniqueCids = _.uniq(topicData.map(function (topicData) {
return topicData && parseInt(topicData.cid, 10);
}));

@ -1,21 +1,22 @@
'use strict';
var db = require('../../database');
var async = require('async');
var db = require('../../database');
var batch = require('../../batch');
module.exports = {
name: 'Delete accidentally long-lived sessions',
timestamp: Date.UTC(2017, 3, 16),
method: function (callback) {
var configJSON = require.main.require('./config.json');
var configJSON = require('../../../config.json');
var isRedisSessionStore = configJSON.hasOwnProperty('redis');
var progress = this.progress;
async.waterfall([
function (next) {
if (isRedisSessionStore) {
var rdb = require.main.require('./src/database/redis');
var batch = require.main.require('./src/batch');
var rdb = require('../../database/redis');
var client = rdb.connect();
async.waterfall([
function (next) {

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var groups = require('./groups');
var plugins = require('./plugins');

@ -154,7 +154,7 @@ module.exports = function (User) {
};
User.auth.deleteAllSessions = function (callback) {
var _ = require('underscore');
var _ = require('lodash');
batch.processSortedSet('users:joindate', function (uids, next) {
var sessionKeys = uids.map(function (uid) {
return 'uid:' + uid + ':sessions';

@ -1,7 +1,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var validator = require('validator');
var db = require('../database');

@ -2,7 +2,7 @@
'use strict';
var async = require('async');
var _ = require('underscore');
var _ = require('lodash');
var meta = require('../meta');
var db = require('../database');

Loading…
Cancel
Save