Merge remote-tracking branch 'origin/master' into develop

isekai-main
Julian Lam 2 years ago
commit a2fafc2b15

@ -5,10 +5,12 @@ on:
branches:
- master
- develop
- bootstrap5
pull_request:
branches:
- master
- develop
- bootstrap5
defaults:
run:

@ -87,13 +87,13 @@ define('search', ['translator', 'storage', 'hooks', 'alerts'], function (transla
const filterCategoryEl = quickSearchResults.find('.filter-category');
function updateCategoryFilterName() {
if (ajaxify.data.template.category) {
if (ajaxify.data.template.category && ajaxify.data.cid) {
translator.translate('[[search:search-in-category, ' + ajaxify.data.name + ']]', function (translated) {
const name = $('<div></div>').html(translated).text();
filterCategoryEl.find('.name').text(name);
});
}
filterCategoryEl.toggleClass('hidden', !ajaxify.data.template.category);
filterCategoryEl.toggleClass('hidden', !(ajaxify.data.template.category && ajaxify.data.cid));
}
function doSearch() {
@ -101,7 +101,7 @@ define('search', ['translator', 'storage', 'hooks', 'alerts'], function (transla
options.searchOptions.term = inputEl.val();
updateCategoryFilterName();
if (ajaxify.data.template.category) {
if (ajaxify.data.template.category && ajaxify.data.cid) {
if (filterCategoryEl.find('input[type="checkbox"]').is(':checked')) {
options.searchOptions.categories = [ajaxify.data.cid];
options.searchOptions.searchChildren = true;

@ -86,15 +86,16 @@ module.exports = function (middleware) {
}
return next();
}
if (parseInt(req.uid, 10) > 0 || !meta.config.autoDetectLang) {
return next();
}
const langs = await listCodes();
const lang = req.acceptsLanguages(langs);
if (!lang) {
return next();
if (meta.config.autoDetectLang && req.uid === 0) {
const langs = await listCodes();
const lang = req.acceptsLanguages(langs);
if (!lang) {
return next();
}
req.query.lang = lang;
}
req.query.lang = lang;
next();
});

@ -141,6 +141,7 @@
.notification-body img {
max-width: 100%;
height: auto;
}
</style>

Loading…
Cancel
Save