Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/javascript/mastodon/locales/ja.json`: Upstream change too close to a glitch-soc-specific string. The glitch-soc-specific string should not have been in this file, so it has been moved to `app/javascript/flavours/glitch/locales/ja.js`. - `app/javascript/packs/public.js`: Upstream refactored a part, that as usual is split and duplicated in various pack files. Updated those pack files accordingly. - `app/views/layouts/application.html.haml`: Upstream fixed custom.css path in a different way than we did, went with upstream's change.
This commit is contained in:
@ -8,6 +8,7 @@ const messages = {
|
||||
'layout.single': 'モバイル',
|
||||
'navigation_bar.app_settings': 'アプリ設定',
|
||||
'navigation_bar.featured_users': '紹介しているアカウント',
|
||||
'navigation_bar.misc': 'その他',
|
||||
'getting_started.onboarding': '解説を表示',
|
||||
'onboarding.page_one.federation': '{domain}はMastodonのインスタンスです。Mastodonとは、独立したサーバが連携して作るソーシャルネットワークです。これらのサーバーをインスタンスと呼びます。',
|
||||
'onboarding.page_one.welcome': '{domain}へようこそ!',
|
||||
|
@ -139,8 +139,31 @@ function main() {
|
||||
});
|
||||
});
|
||||
|
||||
const toggleSidebar = () => {
|
||||
const sidebar = document.querySelector('.sidebar ul');
|
||||
const toggleButton = document.querySelector('.sidebar__toggle__icon');
|
||||
|
||||
if (sidebar.classList.contains('visible')) {
|
||||
document.body.style.overflow = null;
|
||||
toggleButton.setAttribute('aria-expanded', false);
|
||||
} else {
|
||||
document.body.style.overflow = 'hidden';
|
||||
toggleButton.setAttribute('aria-expanded', true);
|
||||
}
|
||||
|
||||
toggleButton.classList.toggle('active');
|
||||
sidebar.classList.toggle('visible');
|
||||
};
|
||||
|
||||
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||
document.querySelector('.sidebar ul').classList.toggle('visible');
|
||||
toggleSidebar();
|
||||
});
|
||||
|
||||
delegate(document, '.sidebar__toggle__icon', 'keydown', e => {
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
toggleSidebar();
|
||||
}
|
||||
});
|
||||
|
||||
// Empty the honeypot fields in JS in case something like an extension
|
||||
|
@ -7,8 +7,31 @@ import 'cocoon-js-vanilla';
|
||||
function main() {
|
||||
const { delegate } = require('@rails/ujs');
|
||||
|
||||
const toggleSidebar = () => {
|
||||
const sidebar = document.querySelector('.sidebar ul');
|
||||
const toggleButton = document.querySelector('.sidebar__toggle__icon');
|
||||
|
||||
if (sidebar.classList.contains('visible')) {
|
||||
document.body.style.overflow = null;
|
||||
toggleButton.setAttribute('aria-expanded', false);
|
||||
} else {
|
||||
document.body.style.overflow = 'hidden';
|
||||
toggleButton.setAttribute('aria-expanded', true);
|
||||
}
|
||||
|
||||
toggleButton.classList.toggle('active');
|
||||
sidebar.classList.toggle('visible');
|
||||
};
|
||||
|
||||
delegate(document, '.sidebar__toggle__icon', 'click', () => {
|
||||
document.querySelector('.sidebar ul').classList.toggle('visible');
|
||||
toggleSidebar();
|
||||
});
|
||||
|
||||
delegate(document, '.sidebar__toggle__icon', 'keydown', e => {
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
toggleSidebar();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user