mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 05:50:25 +01:00
Compare commits
9 Commits
socket.io-
...
v3.1.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3eaf04827e | ||
|
|
1d1639d46f | ||
|
|
c5cd76e798 | ||
|
|
b73f307abe | ||
|
|
6aae88d5dd | ||
|
|
0c4870ec12 | ||
|
|
67f44a3212 | ||
|
|
3256fb30e7 | ||
|
|
24ebb1536b |
@@ -1,9 +1,9 @@
|
||||
# Welcome to your brand new NodeBB forum!
|
||||
### Welcome to your brand new NodeBB forum!
|
||||
|
||||
This is what a topic and post looks like. As an administrator, you can edit the post\'s title and content.
|
||||
To customise your forum, go to the [Administrator Control Panel](../../admin). You can modify all aspects of your forum there, including installation of third-party plugins.
|
||||
|
||||
## Additional Resources
|
||||
#### Additional Resources
|
||||
|
||||
* [NodeBB Documentation](https://docs.nodebb.org)
|
||||
* [Community Support Forum](https://community.nodebb.org)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "nodebb",
|
||||
"license": "GPL-3.0",
|
||||
"description": "NodeBB Forum",
|
||||
"version": "3.1.4",
|
||||
"version": "3.1.5",
|
||||
"homepage": "https://www.nodebb.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -142,19 +142,21 @@ define('forum/topic/events', [
|
||||
posts.addBlockquoteEllipses(editedPostEl.parent());
|
||||
editedPostEl.fadeIn(250);
|
||||
|
||||
const editData = {
|
||||
editor: data.editor,
|
||||
editedISO: utils.toISOString(data.post.edited),
|
||||
};
|
||||
if (data.post.edited) {
|
||||
const editData = {
|
||||
editor: data.editor,
|
||||
editedISO: utils.toISOString(data.post.edited),
|
||||
};
|
||||
|
||||
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
|
||||
editorEl.replaceWith(html);
|
||||
postContainer.find('[component="post/edit-indicator"]')
|
||||
.removeClass('hidden')
|
||||
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
|
||||
postContainer.find('[component="post/editor"] .timeago').timeago();
|
||||
hooks.fire('action:posts.edited', data);
|
||||
});
|
||||
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
|
||||
editorEl.replaceWith(html);
|
||||
postContainer.find('[component="post/edit-indicator"]')
|
||||
.removeClass('hidden')
|
||||
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
|
||||
postContainer.find('[component="post/editor"] .timeago').timeago();
|
||||
hooks.fire('action:posts.edited', data);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
hooks.fire('action:posts.edited', data);
|
||||
|
||||
@@ -26,8 +26,9 @@ define('forum/topic/images', [], function () {
|
||||
const srcExt = src.split('.').slice(1).pop();
|
||||
const altFilename = alt.split('/').pop();
|
||||
const altExt = altFilename.split('.').slice(1).pop();
|
||||
|
||||
imageEl.wrap('<a href="' + src + '" ' +
|
||||
(!srcExt && altExt ? ' download="' + altFilename + '" ' : '') +
|
||||
(!srcExt && altExt ? ' download="' + utils.escapeHTML(altFilename) + '" ' : '') +
|
||||
' target="_blank" rel="noopener">');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -440,7 +440,7 @@ define('forum/topic/posts', [
|
||||
blockquotes.each(function () {
|
||||
const $this = $(this);
|
||||
if ($this.find(':hidden:not(br)').length && !$this.find('.toggle').length) {
|
||||
$this.append('<i class="fa fa-angle-down pointer toggle"></i>');
|
||||
$this.append('<i class="d-inline-block fa fa-angle-down pointer toggle py-1 px-3 border text-bg-light"></i>');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -12,7 +12,9 @@ const {
|
||||
return req.headers['x-csrf-token'];
|
||||
} else if (req.body && req.body.csrf_token) {
|
||||
return req.body.csrf_token;
|
||||
} else if (req.query) {
|
||||
} else if (req.body && req.body._csrf) {
|
||||
return req.body._csrf;
|
||||
} else if (req.query && req.query._csrf) {
|
||||
return req.query._csrf;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -65,7 +65,7 @@ admin.get = async function () {
|
||||
}
|
||||
const ids = await db.getSortedSetRange('navigation:enabled', 0, -1);
|
||||
const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`));
|
||||
cache = data.map((item) => {
|
||||
cache = data.filter(Boolean).map((item) => {
|
||||
if (item.hasOwnProperty('groups')) {
|
||||
try {
|
||||
item.groups = JSON.parse(item.groups);
|
||||
|
||||
@@ -208,9 +208,6 @@ module.exports = function (User) {
|
||||
|
||||
async function deleteImages(uid) {
|
||||
const folder = path.join(nconf.get('upload_path'), 'profile');
|
||||
await Promise.all([
|
||||
rimraf(path.join(folder, `${uid}-profilecover*`), { glob: true }),
|
||||
rimraf(path.join(folder, `${uid}-profileavatar*`), { glob: true }),
|
||||
]);
|
||||
await rimraf(`${uid}-profile{avatar,cover}*`, { glob: { cwd: folder } });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -107,14 +107,6 @@ describe('socket.io', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should return error for invalid eventName type', (done) => {
|
||||
const eventName = ['topics.loadMoreTags'];
|
||||
io.emit(eventName, (err) => {
|
||||
assert.strictEqual(err.message, `[[error:invalid-event, object]]`);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should get installed themes', (done) => {
|
||||
const themes = ['nodebb-theme-persona'];
|
||||
io.emit('admin.themes.getInstalled', (err, data) => {
|
||||
|
||||
Reference in New Issue
Block a user