Merge commit '1d1639d46f15c5a9c84d3ccfc7a334244c28039a' into v3.x

isekai-main
Misty Release Bot 2 years ago
commit 40c7407c76

@ -1,3 +1,32 @@
#### v3.1.4 (2023-05-18)
##### Chores
* up markdown (51bf5e95)
* incrementing version number - v3.1.3 (3b4e9d3f)
* update changelog for v3.1.3 (9924fde6)
* incrementing version number - v3.1.2 (40fa3489)
* incrementing version number - v3.1.1 (40250733)
* incrementing version number - v3.1.0 (0cb386bd)
* incrementing version number - v3.0.1 (26f6ea49)
* incrementing version number - v3.0.0 (224e08cd)
##### Bug Fixes
* textarea on error (469aa551)
* closes #11613, closes #11614 (d8d486a6)
* closes #11612 (8f6a68ca)
* #11572 (2910cb2b)
##### Other Changes
* //github.com/NodeBB/NodeBB/issues/11612 (24bd9d4e)
##### Refactors
* remove unused require (05b58c70)
* remove log (ca2be0e8)
#### v3.1.3 (2023-05-15) #### v3.1.3 (2023-05-15)
##### Chores ##### Chores

@ -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. 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. 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) * [NodeBB Documentation](https://docs.nodebb.org)
* [Community Support Forum](https://community.nodebb.org) * [Community Support Forum](https://community.nodebb.org)

@ -102,8 +102,8 @@
"nodebb-rewards-essentials": "0.2.3", "nodebb-rewards-essentials": "0.2.3",
"nodebb-theme-harmony": "1.0.24", "nodebb-theme-harmony": "1.0.24",
"nodebb-theme-lavender": "7.0.9", "nodebb-theme-lavender": "7.0.9",
"nodebb-theme-peace": "2.0.22", "nodebb-theme-peace": "2.0.25",
"nodebb-theme-persona": "13.0.65", "nodebb-theme-persona": "13.0.67",
"nodebb-widget-essentials": "7.0.12", "nodebb-widget-essentials": "7.0.12",
"nodemailer": "6.9.1", "nodemailer": "6.9.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",

@ -226,7 +226,14 @@ define('forum/topic', [
const btn = $(trigger); const btn = $(trigger);
btn.find('i').removeClass('fa-copy').addClass('fa-check'); btn.find('i').removeClass('fa-copy').addClass('fa-check');
setTimeout(() => btn.find('i').removeClass('fa-check').addClass('fa-copy'), 2000); setTimeout(() => btn.find('i').removeClass('fa-check').addClass('fa-copy'), 2000);
return btn.parent().find('code').text(); const codeEl = btn.parent().find('code');
if (codeEl.attr('data-lines')) {
let codeText = '';
codeEl.find('.hljs-ln-code[data-line-number]')
.each((index, el) => { codeText += $(el).text() + '\n'; });
return codeText;
}
return codeEl.text();
}, },
}); });

@ -142,19 +142,21 @@ define('forum/topic/events', [
posts.addBlockquoteEllipses(editedPostEl.parent()); posts.addBlockquoteEllipses(editedPostEl.parent());
editedPostEl.fadeIn(250); editedPostEl.fadeIn(250);
const editData = { if (data.post.edited) {
editor: data.editor, const editData = {
editedISO: utils.toISOString(data.post.edited), editor: data.editor,
}; editedISO: utils.toISOString(data.post.edited),
};
app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
editorEl.replaceWith(html); app.parseAndTranslate('partials/topic/post-editor', editData, function (html) {
postContainer.find('[component="post/edit-indicator"]') editorEl.replaceWith(html);
.removeClass('hidden') postContainer.find('[component="post/edit-indicator"]')
.translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`); .removeClass('hidden')
postContainer.find('[component="post/editor"] .timeago').timeago(); .translateAttr('title', `[[global:edited-timestamp, ${editData.editedISO}]]`);
hooks.fire('action:posts.edited', data); postContainer.find('[component="post/editor"] .timeago').timeago();
}); hooks.fire('action:posts.edited', data);
});
}
}); });
} else { } else {
hooks.fire('action:posts.edited', data); hooks.fire('action:posts.edited', data);

@ -26,8 +26,9 @@ define('forum/topic/images', [], function () {
const srcExt = src.split('.').slice(1).pop(); const srcExt = src.split('.').slice(1).pop();
const altFilename = alt.split('/').pop(); const altFilename = alt.split('/').pop();
const altExt = altFilename.split('.').slice(1).pop(); const altExt = altFilename.split('.').slice(1).pop();
imageEl.wrap('<a href="' + src + '" ' + imageEl.wrap('<a href="' + src + '" ' +
(!srcExt && altExt ? ' download="' + altFilename + '" ' : '') + (!srcExt && altExt ? ' download="' + utils.escapeHTML(altFilename) + '" ' : '') +
' target="_blank" rel="noopener">'); ' target="_blank" rel="noopener">');
} }
}; };

@ -440,7 +440,7 @@ define('forum/topic/posts', [
blockquotes.each(function () { blockquotes.each(function () {
const $this = $(this); const $this = $(this);
if ($this.find(':hidden:not(br)').length && !$this.find('.toggle').length) { 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']; return req.headers['x-csrf-token'];
} else if (req.body && req.body.csrf_token) { } else if (req.body && req.body.csrf_token) {
return 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; return req.query._csrf;
} }
}, },

@ -65,7 +65,7 @@ admin.get = async function () {
} }
const ids = await db.getSortedSetRange('navigation:enabled', 0, -1); const ids = await db.getSortedSetRange('navigation:enabled', 0, -1);
const data = await db.getObjects(ids.map(id => `navigation:enabled:${id}`)); 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')) { if (item.hasOwnProperty('groups')) {
try { try {
item.groups = JSON.parse(item.groups); item.groups = JSON.parse(item.groups);

@ -208,9 +208,6 @@ module.exports = function (User) {
async function deleteImages(uid) { async function deleteImages(uid) {
const folder = path.join(nconf.get('upload_path'), 'profile'); const folder = path.join(nconf.get('upload_path'), 'profile');
await Promise.all([ await rimraf(`${uid}-profile{avatar,cover}*`, { glob: { cwd: folder } });
rimraf(path.join(folder, `${uid}-profilecover*`), { glob: true }),
rimraf(path.join(folder, `${uid}-profileavatar*`), { glob: true }),
]);
} }
}; };

@ -22,8 +22,9 @@
{{{ end }}} {{{ end }}}
{{{ each sessions }}} {{{ each sessions }}}
<tr> <tr>
<td> <td class="d-flex gap-2 align-items-center">
<a href="{config.relative_path}/uid/{./user.uid}">{buildAvatar(./user, "sm", true)} {../username}</a> <a href="{config.relative_path}/uid/{./user.uid}">{buildAvatar(./user, "18px", true)}</a>
<a href="{config.relative_path}/uid/{./user.uid}">{./user.username}</a>
{function.userAgentIcons} {../browser} {../version} on {../platform} {function.userAgentIcons} {../browser} {../version} on {../platform}
</td> </td>
<td><span class="timeago" title="{./datetimeISO}"></span></td> <td><span class="timeago" title="{./datetimeISO}"></span></td>

@ -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) => { it('should get installed themes', (done) => {
const themes = ['nodebb-theme-persona']; const themes = ['nodebb-theme-persona'];
io.emit('admin.themes.getInstalled', (err, data) => { io.emit('admin.themes.getInstalled', (err, data) => {

Loading…
Cancel
Save