Compare commits

..

10 Commits

Author SHA1 Message Date
Misty Release Bot
0f6847a556 chore: incrementing version number - v3.6.4 2024-01-24 17:22:26 +00:00
Barış Soner Uşaklı
cf40d68176 fix: if there is no bookmarkThreshold dont init unread indicator 2024-01-24 12:11:17 -05:00
Barış Soner Uşaklı
cb21f28b56 feat: add success hook to quick reply 2024-01-24 12:00:27 -05:00
Barış Soner Uşaklı
20d88e6861 use template name instead of url
sometimes topic.tpl can be rendered on a different url
2024-01-24 11:27:07 -05:00
Barış Soner Uşaklı
d5f445f15e fix: remove leftover code from 2.x, closes #12301 2024-01-23 10:24:44 -05:00
Barış Soner Uşaklı
06269cdfe4 fix: copy single line code blocks, closes #12297 2024-01-22 12:55:44 -05:00
Barış Soner Uşaklı
4427ca4cab add itemprop="comment" 2024-01-18 18:05:38 -05:00
Barış Soner Uşaklı
e8befbcc6f test: add plugin id tests 2024-01-17 15:18:26 -05:00
Barış Soner Uşaklı
76f3efff8f fix: validate plugin id in toggleActive 2024-01-16 10:13:50 -05:00
Misty Release Bot
92ffc57cce chore: update changelog for v3.6.3 2024-01-12 16:06:06 +00:00
10 changed files with 71 additions and 11 deletions

View File

@@ -1,3 +1,48 @@
#### v3.6.3 (2024-01-12)
##### Chores
* incrementing version number - v3.6.2 (0f577a57)
* update changelog for v3.6.2 (82a936c3)
* incrementing version number - v3.6.1 (f1a69468)
* incrementing version number - v3.6.0 (4cdf85f8)
* incrementing version number - v3.5.3 (ed0e8783)
* incrementing version number - v3.5.2 (52fbb2da)
* incrementing version number - v3.5.1 (4c543488)
* incrementing version number - v3.5.0 (d06fb4f0)
* incrementing version number - v3.4.3 (5c984250)
* incrementing version number - v3.4.2 (3f0dac38)
* incrementing version number - v3.4.1 (01e69574)
* incrementing version number - v3.4.0 (fd9247c5)
* incrementing version number - v3.3.9 (5805e770)
* incrementing version number - v3.3.8 (a5603565)
* incrementing version number - v3.3.7 (b26f1744)
* incrementing version number - v3.3.6 (7fb38792)
* incrementing version number - v3.3.4 (a67f84ea)
* incrementing version number - v3.3.3 (f94d239b)
* incrementing version number - v3.3.2 (ec9dac97)
* incrementing version number - v3.3.1 (151cc68f)
* incrementing version number - v3.3.0 (fc1ad70f)
* incrementing version number - v3.2.3 (b06d3e63)
* incrementing version number - v3.2.2 (758ecfcd)
* incrementing version number - v3.2.1 (20145074)
* incrementing version number - v3.2.0 (9ecac38e)
* incrementing version number - v3.1.7 (0b4e81ab)
* incrementing version number - v3.1.6 (b3a3b130)
* incrementing version number - v3.1.5 (ec19343a)
* incrementing version number - v3.1.4 (2452783c)
* incrementing version number - v3.1.3 (3b4e9d3f)
* 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
* #12275, pin sharp to 0.32.6 (f3927ce7)
* topic event translations closes #12273 (5f91cc83)
#### v3.6.2 (2024-01-10)
##### Chores

View File

@@ -2,7 +2,7 @@
"name": "nodebb",
"license": "GPL-3.0",
"description": "NodeBB Forum",
"version": "3.6.3",
"version": "3.6.4",
"homepage": "https://www.nodebb.org",
"repository": {
"type": "git",

View File

@@ -255,6 +255,7 @@
"no-connection": "There seems to be a problem with your internet connection",
"socket-reconnect-failed": "Unable to reach the server at this time. Click here to try again, or try again later",
"invalid-plugin-id": "Invalid plugin ID",
"plugin-not-whitelisted": "Unable to install plugin – only plugins whitelisted by the NodeBB Package Manager can be installed via the ACP",
"plugins-set-in-configuration": "You are not allowed to change plugin state as they are defined at runtime (config.json, environmental variables or terminal arguments), please modify the configuration instead.",
"theme-not-set-in-configuration": "When defining active plugins in configuration, changing themes requires adding the new theme to the list of active plugins before updating it in the ACP",

View File

@@ -100,7 +100,6 @@ define('admin/settings/navigation', [
translator.translate(li, function (li) {
li = $(translator.unescape(li));
$('#enabled').append(li);
componentHandler.upgradeDom();
resolve();
});
});

View File

@@ -224,7 +224,7 @@ define('forum/topic', [
btn.find('i').removeClass('fa-copy').addClass('fa-check');
setTimeout(() => btn.find('i').removeClass('fa-check').addClass('fa-copy'), 2000);
const codeEl = btn.parent().find('code');
if (codeEl.attr('data-lines')) {
if (codeEl.attr('data-lines') && codeEl.find('.hljs-ln-code[data-line-number]').length) {
return codeEl.find('.hljs-ln-code[data-line-number]')
.map((i, e) => e.textContent).get().join('\n');
}

View File

@@ -353,7 +353,8 @@ define('navigator', [
}
async function updateUnreadIndicator(index) {
if (!paginationBlockUnreadEl.length || ajaxify.data.postcount <= ajaxify.data.bookmarkThreshold) {
const { bookmarkThreshold } = ajaxify.data;
if (!paginationBlockUnreadEl.length || ajaxify.data.postcount <= bookmarkThreshold || !bookmarkThreshold) {
return;
}
const currentBookmark = ajaxify.data.bookmark || storage.getItem('topic:' + ajaxify.data.tid + ':bookmark');
@@ -458,11 +459,9 @@ define('navigator', [
};
function toggle(flag) {
const path = ajaxify.removeRelativePath(window.location.pathname.slice(1));
if (flag && (!path.startsWith('topic') && !path.startsWith('category'))) {
if (flag && (!ajaxify.data.template.topic && !ajaxify.data.template.category)) {
return;
}
paginationBlockEl.toggleClass('ready', flag);
paginationBlockEl.toggleClass('noreplies', count <= 1);
}

View File

@@ -2,10 +2,10 @@
define('quickreply', [
'components', 'composer', 'composer/autocomplete', 'api',
'alerts', 'uploadHelpers', 'mousetrap', 'storage',
'alerts', 'uploadHelpers', 'mousetrap', 'storage', 'hooks',
], function (
components, composer, autocomplete, api,
alerts, uploadHelpers, mousetrap, storage
alerts, uploadHelpers, mousetrap, storage, hooks
) {
const QuickReply = {};
@@ -91,6 +91,7 @@ define('quickreply', [
components.get('topic/quickreply/text').val('');
storage.removeItem(qrDraftId);
autocomplete._active.core_qr.hide();
hooks.fire('action:quickreply.success', { data });
});
});

View File

@@ -12,7 +12,7 @@ const request = require('../request');
const db = require('../database');
const meta = require('../meta');
const pubsub = require('../pubsub');
const { paths } = require('../constants');
const { paths, pluginNamePattern } = require('../constants');
const pkgInstall = require('../cli/package-install');
const packageManager = pkgInstall.getPackageManager();
@@ -60,6 +60,9 @@ module.exports = function (Plugins) {
winston.error('Cannot activate plugins while plugin state is set in the configuration (config.json, environmental variables or terminal arguments), please modify the configuration instead');
throw new Error('[[error:plugins-set-in-configuration]]');
}
if (!pluginNamePattern.test(id)) {
throw new Error('[[error:invalid-plugin-id]]');
}
const isActive = await Plugins.isActive(id);
if (isActive) {
await db.sortedSetRemove('plugins:active', id);

View File

@@ -1 +1 @@
data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}"{{{ if posts.allowDupe }}} data-allow-dupe="1"{{{ end }}}{{{ if posts.navigatorIgnore }}} data-navigator-ignore="1"{{{ end }}} itemscope itemtype="http://schema.org/Comment"
data-index="{posts.index}" data-pid="{posts.pid}" data-uid="{posts.uid}" data-timestamp="{posts.timestamp}" data-username="{posts.user.username}" data-userslug="{posts.user.userslug}"{{{ if posts.allowDupe }}} data-allow-dupe="1"{{{ end }}}{{{ if posts.navigatorIgnore }}} data-navigator-ignore="1"{{{ end }}} itemprop="comment" itemtype="http://schema.org/Comment" itemscope

View File

@@ -262,6 +262,18 @@ describe('Plugins', () => {
});
});
it('should error if plugin id is invalid', async () => {
await assert.rejects(
plugins.toggleActive('\t\nnodebb-plugin'),
{ message: '[[error:invalid-plugin-id]]' }
);
await assert.rejects(
plugins.toggleActive('notaplugin'),
{ message: '[[error:invalid-plugin-id]]' }
);
});
it('should upgrade plugin', function (done) {
this.timeout(0);
plugins.upgrade(pluginName, 'latest', (err, isActive) => {