mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 07:20:27 +01:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b81e395a26 | ||
|
|
c12963593d | ||
|
|
294171b072 | ||
|
|
cccc64ef90 | ||
|
|
e9648daf7f | ||
|
|
fd80259768 | ||
|
|
fe7d4999c9 | ||
|
|
4d92ddf634 | ||
|
|
4eb7468dcd | ||
|
|
86180e29e6 | ||
|
|
e5188ee05b | ||
|
|
43ddf008ac | ||
|
|
9c9e49e2f6 | ||
|
|
497592965f | ||
|
|
44431f8410 | ||
|
|
bb88c82ffd | ||
|
|
3c607f2612 | ||
|
|
d654978508 | ||
|
|
3d0012d730 | ||
|
|
e556ae93ea | ||
|
|
b9b8f2320f | ||
|
|
c9f285a883 |
@@ -2,7 +2,7 @@
|
|||||||
"name": "nodebb",
|
"name": "nodebb",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"description": "NodeBB Forum",
|
"description": "NodeBB Forum",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"homepage": "http://www.nodebb.org",
|
"homepage": "http://www.nodebb.org",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -44,16 +44,16 @@
|
|||||||
"mongodb": "~2.1.3",
|
"mongodb": "~2.1.3",
|
||||||
"morgan": "^1.3.2",
|
"morgan": "^1.3.2",
|
||||||
"nconf": "~0.8.2",
|
"nconf": "~0.8.2",
|
||||||
"nodebb-plugin-composer-default": "3.0.10",
|
"nodebb-plugin-composer-default": "3.0.11",
|
||||||
"nodebb-plugin-dbsearch": "1.0.0",
|
"nodebb-plugin-dbsearch": "1.0.0",
|
||||||
"nodebb-plugin-emoji-extended": "1.0.3",
|
"nodebb-plugin-emoji-extended": "1.0.3",
|
||||||
"nodebb-plugin-markdown": "4.0.17",
|
"nodebb-plugin-markdown": "4.0.17",
|
||||||
"nodebb-plugin-mentions": "1.0.18",
|
"nodebb-plugin-mentions": "1.0.20",
|
||||||
"nodebb-plugin-soundpack-default": "0.1.6",
|
"nodebb-plugin-soundpack-default": "0.1.6",
|
||||||
"nodebb-plugin-spam-be-gone": "0.4.5",
|
"nodebb-plugin-spam-be-gone": "0.4.5",
|
||||||
"nodebb-rewards-essentials": "0.0.8",
|
"nodebb-rewards-essentials": "0.0.8",
|
||||||
"nodebb-theme-lavender": "3.0.9",
|
"nodebb-theme-lavender": "3.0.9",
|
||||||
"nodebb-theme-persona": "4.0.99",
|
"nodebb-theme-persona": "4.0.100",
|
||||||
"nodebb-theme-vanilla": "5.0.56",
|
"nodebb-theme-vanilla": "5.0.56",
|
||||||
"nodebb-widget-essentials": "2.0.8",
|
"nodebb-widget-essentials": "2.0.8",
|
||||||
"nodemailer": "2.0.0",
|
"nodemailer": "2.0.0",
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ define('admin/manage/group', [
|
|||||||
|
|
||||||
templates.parse('partials/groups/memberlist', 'members', {group: {isOwner: ajaxify.data.group.isOwner, members: [member]}}, function(html) {
|
templates.parse('partials/groups/memberlist', 'members', {group: {isOwner: ajaxify.data.group.isOwner, members: [member]}}, function(html) {
|
||||||
translator.translate(html, function(html) {
|
translator.translate(html, function(html) {
|
||||||
$('[component="groups/members"] tr').first().before(html);
|
$('[component="groups/members"] tbody').prepend(html);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,20 +26,18 @@ define('forum/topic/posts', [
|
|||||||
post.selfPost = !!app.user.uid && parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
post.selfPost = !!app.user.uid && parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
||||||
post.display_moderator_tools = post.selfPost || ajaxify.data.privileges.isAdminOrMod;
|
post.display_moderator_tools = post.selfPost || ajaxify.data.privileges.isAdminOrMod;
|
||||||
post.display_move_tools = ajaxify.data.privileges.isAdminOrMod;
|
post.display_move_tools = ajaxify.data.privileges.isAdminOrMod;
|
||||||
post.display_post_menu = post.selfPost || ajaxify.data.privileges.isAdminOrMod;
|
post.display_post_menu = post.selfPost || ajaxify.data.privileges.isAdminOrMod || !post.deleted;
|
||||||
});
|
});
|
||||||
|
|
||||||
updatePostCounts(data.posts);
|
updatePostCounts(data.posts);
|
||||||
ajaxify.data.postcount ++;
|
ajaxify.data.postcount ++;
|
||||||
postTools.updatePostCount(ajaxify.data.postcount);
|
postTools.updatePostCount(ajaxify.data.postcount);
|
||||||
|
|
||||||
if (ajaxify.data.scrollToMyPost) {
|
|
||||||
if (config.usePagination) {
|
if (config.usePagination) {
|
||||||
onNewPostPagination(data);
|
onNewPostPagination(data);
|
||||||
} else {
|
} else {
|
||||||
onNewPostInfiniteScroll(data);
|
onNewPostInfiniteScroll(data);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function updatePostCounts(posts) {
|
function updatePostCounts(posts) {
|
||||||
@@ -64,7 +62,7 @@ define('forum/topic/posts', [
|
|||||||
|
|
||||||
if (isPostVisible) {
|
if (isPostVisible) {
|
||||||
createNewPosts(data, components.get('post').not('[data-index=0]'), direction, scrollToPost);
|
createNewPosts(data, components.get('post').not('[data-index=0]'), direction, scrollToPost);
|
||||||
} else if (parseInt(posts[0].uid, 10) === parseInt(app.user.uid, 10)) {
|
} else if (config.scrollToMyPost && parseInt(posts[0].uid, 10) === parseInt(app.user.uid, 10)) {
|
||||||
pagination.loadPage(ajaxify.data.pagination.pageCount, scrollToPost);
|
pagination.loadPage(ajaxify.data.pagination.pageCount, scrollToPost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -81,6 +79,9 @@ define('forum/topic/posts', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
function scrollToPostIfSelf(post) {
|
function scrollToPostIfSelf(post) {
|
||||||
|
if (!config.scrollToMyPost) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var isSelfPost = parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
var isSelfPost = parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
||||||
if (isSelfPost) {
|
if (isSelfPost) {
|
||||||
navigator.scrollBottom(post.index);
|
navigator.scrollBottom(post.index);
|
||||||
|
|||||||
@@ -64,12 +64,14 @@ helpers.getUserDataByUserSlug = function(userslug, callerUID, callback) {
|
|||||||
userData.lastonlineISO = utils.toISOString(userData.lastonline || userData.joindate);
|
userData.lastonlineISO = utils.toISOString(userData.lastonline || userData.joindate);
|
||||||
userData.age = Math.max(0, userData.birthday ? Math.floor((new Date().getTime() - new Date(userData.birthday).getTime()) / 31536000000) : 0);
|
userData.age = Math.max(0, userData.birthday ? Math.floor((new Date().getTime() - new Date(userData.birthday).getTime()) / 31536000000) : 0);
|
||||||
|
|
||||||
|
userData.emailClass = 'hide';
|
||||||
|
|
||||||
if (!(isAdmin || isGlobalModerator || self || (userData.email && userSettings.showemail))) {
|
if (!(isAdmin || isGlobalModerator || self || (userData.email && userSettings.showemail))) {
|
||||||
userData.email = '';
|
userData.email = '';
|
||||||
|
} else if (!userSettings.showemail) {
|
||||||
|
userData.emailClass = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
userData.emailClass = (self && !userSettings.showemail) ? '' : 'hide';
|
|
||||||
|
|
||||||
if (!isAdmin && !isGlobalModerator && !self && !userSettings.showfullname) {
|
if (!isAdmin && !isGlobalModerator && !self && !userSettings.showfullname) {
|
||||||
userData.fullname = '';
|
userData.fullname = '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ helpers.redirect = function(res, url) {
|
|||||||
if (res.locals.isAPI) {
|
if (res.locals.isAPI) {
|
||||||
res.status(308).json(url);
|
res.status(308).json(url);
|
||||||
} else {
|
} else {
|
||||||
res.redirect(nconf.get('relative_path') + url);
|
res.redirect(nconf.get('relative_path') + encodeURI(url));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ module.exports = function(middleware) {
|
|||||||
req = this.req,
|
req = this.req,
|
||||||
defaultFn = function(err, str){
|
defaultFn = function(err, str){
|
||||||
if (err) {
|
if (err) {
|
||||||
return req.next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.send(str);
|
self.send(str);
|
||||||
|
|||||||
@@ -450,10 +450,13 @@ var async = require('async'),
|
|||||||
});
|
});
|
||||||
var numUsers = usernames.length;
|
var numUsers = usernames.length;
|
||||||
|
|
||||||
|
var title = S(notifications[modifyIndex].topicTitle).decodeHTMLEntities().s;
|
||||||
|
var titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
|
||||||
|
|
||||||
if (numUsers === 2) {
|
if (numUsers === 2) {
|
||||||
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + ', ' + notifications[modifyIndex].topicTitle + ']]';
|
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_dual, ' + usernames.join(', ') + ', ' + titleEscaped + ']]';
|
||||||
} else if (numUsers > 2) {
|
} else if (numUsers > 2) {
|
||||||
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + notifications[modifyIndex].topicTitle + ']]';
|
notifications[modifyIndex].bodyShort = '[[' + mergeId + '_multiple, ' + usernames[0] + ', ' + (numUsers-1) + ', ' + titleEscaped + ']]';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async'),
|
var async = require('async'),
|
||||||
|
validator = require('validator'),
|
||||||
|
|
||||||
db = require('../database'),
|
db = require('../database'),
|
||||||
user = require('../user'),
|
user = require('../user'),
|
||||||
@@ -69,6 +70,8 @@ module.exports = function(Posts) {
|
|||||||
userData.picture = userData.picture || '';
|
userData.picture = userData.picture || '';
|
||||||
userData.status = user.getStatus(userData);
|
userData.status = user.getStatus(userData);
|
||||||
userData.groupTitle = results.groupTitles[i].groupTitle;
|
userData.groupTitle = results.groupTitles[i].groupTitle;
|
||||||
|
userData.signature = validator.escape(userData.signature || '');
|
||||||
|
userData.fullname = validator.escape(userData.fullname || '');
|
||||||
});
|
});
|
||||||
|
|
||||||
async.map(userData, function(userData, next) {
|
async.map(userData, function(userData, next) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
var winston = require('winston');
|
var winston = require('winston');
|
||||||
|
var S = require('string');
|
||||||
var nconf = require('nconf');
|
var nconf = require('nconf');
|
||||||
|
|
||||||
var websockets = require('./index');
|
var websockets = require('./index');
|
||||||
@@ -62,8 +63,11 @@ SocketHelpers.sendNotificationToPostOwner = function(pid, fromuid, notification)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var title = S(results.topicTitle).decodeHTMLEntities().s;
|
||||||
|
var titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
|
||||||
|
|
||||||
notifications.create({
|
notifications.create({
|
||||||
bodyShort: '[[' + notification + ', ' + results.username + ', ' + results.topicTitle + ']]',
|
bodyShort: '[[' + notification + ', ' + results.username + ', ' + titleEscaped + ']]',
|
||||||
bodyLong: results.postObj.content,
|
bodyLong: results.postObj.content,
|
||||||
pid: pid,
|
pid: pid,
|
||||||
nid: 'post:' + pid + ':uid:' + fromuid,
|
nid: 'post:' + pid + ':uid:' + fromuid,
|
||||||
@@ -93,8 +97,11 @@ SocketHelpers.sendNotificationToTopicOwner = function(tid, fromuid, notification
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var title = S(results.topicData.title).decodeHTMLEntities().s;
|
||||||
|
var titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
|
||||||
|
|
||||||
notifications.create({
|
notifications.create({
|
||||||
bodyShort: '[[' + notification + ', ' + results.username + ', ' + results.topicData.title + ']]',
|
bodyShort: '[[' + notification + ', ' + results.username + ', ' + titleEscaped + ']]',
|
||||||
path: nconf.get('relative_path') + '/topic/' + results.topicData.slug,
|
path: nconf.get('relative_path') + '/topic/' + results.topicData.slug,
|
||||||
nid: 'tid:' + tid + ':uid:' + fromuid,
|
nid: 'tid:' + tid + ':uid:' + fromuid,
|
||||||
from: fromuid
|
from: fromuid
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
|
var S = require('string');
|
||||||
|
|
||||||
var user = require('../../user');
|
var user = require('../../user');
|
||||||
var groups = require('../../groups');
|
var groups = require('../../groups');
|
||||||
@@ -82,8 +83,11 @@ module.exports = function(SocketPosts) {
|
|||||||
}, next);
|
}, next);
|
||||||
},
|
},
|
||||||
function (results, next) {
|
function (results, next) {
|
||||||
|
var title = S(post.topic.title).decodeHTMLEntities().s;
|
||||||
|
var titleEscaped = title.replace(/%/g, '%').replace(/,/g, ',');
|
||||||
|
|
||||||
notifications.create({
|
notifications.create({
|
||||||
bodyShort: '[[notifications:user_flagged_post_in, ' + flaggingUser.username + ', ' + post.topic.title + ']]',
|
bodyShort: '[[notifications:user_flagged_post_in, ' + flaggingUser.username + ', ' + titleEscaped + ']]',
|
||||||
bodyLong: post.content,
|
bodyLong: post.content,
|
||||||
pid: data.pid,
|
pid: data.pid,
|
||||||
nid: 'post_flag:' + data.pid + ':uid:' + socket.uid,
|
nid: 'post_flag:' + data.pid + ':uid:' + socket.uid,
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input id="group-hidden" name="hidden" type="checkbox"<!-- IF group.hidden --> checked<!-- ENDIF group.hidden -->> <strong>[Hidden</strong>
|
<input id="group-hidden" name="hidden" type="checkbox"<!-- IF group.hidden --> checked<!-- ENDIF group.hidden -->> <strong>Hidden</strong>
|
||||||
<p class="help-block">
|
<p class="help-block">
|
||||||
If enabled, this group will not be found in the groups listing, and users will have to be invited manually
|
If enabled, this group will not be found in the groups listing, and users will have to be invited manually
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user