From 9891ff80f9679ed3dfdd6e8352abfb661f321a00 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Wed, 26 Jul 2017 04:31:56 +0900 Subject: Adjust mobile landing page (#4366) * Adjust mobile landing page Change mobile viewport threshold to 840px in consideration of padding. Fix loss of "container hero" padding in about/more under 675px. * Fix indent --- app/javascript/styles/about.scss | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 8aa5d8eb4..5a4bcef61 100644 --- a/app/javascript/styles/about.scss +++ b/app/javascript/styles/about.scss @@ -646,7 +646,7 @@ } } - @media screen and (max-width: 800px) { + @media screen and (max-width: 840px) { .container { padding: 0 20px; } @@ -688,6 +688,10 @@ @media screen and (max-width: 675px) { .header-wrapper { padding-top: 0; + + &.compact .hero .heading { + padding-bottom: 20px; + } } .header .container, @@ -701,15 +705,9 @@ } .header { - padding-top: 0; .hero { margin-top: 30px; - padding: 0; - - .heading { - padding-bottom: 20px; - } } .floats { -- cgit From 7062cb764fe450981b4a8b482b01f85fed1914a0 Mon Sep 17 00:00:00 2001 From: m4sk1n Date: Tue, 25 Jul 2017 23:56:04 +0200 Subject: i18n: Update Polish translation (#4367) --- app/javascript/mastodon/locales/pl.json | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index af069b6d7..29e6ca471 100644 --- a/app/javascript/mastodon/locales/pl.json +++ b/app/javascript/mastodon/locales/pl.json @@ -168,6 +168,7 @@ "status.report": "Zgłoś @{name}", "status.sensitive_toggle": "Naciśnij aby wyświetlić", "status.sensitive_warning": "Wrażliwa zawartość", + "status.share": "Udostępnij", "status.show_less": "Pokaż mniej", "status.show_more": "Pokaż więcej", "status.unmute_conversation": "Cofnij wyciezenie konwersacji", -- cgit From 2f8bfb3d387e1c187f90c9dbbaaa011447269213 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 02:01:27 +0200 Subject: Improve accessibility (#4369) * fix(compose): Use nav and remove redundant aria-label * fix(tabs_tab): Use nav and add aria-label * fix(app): Add aria-label for settings toggle button * chore: Run yarn manage:translations --- .../mastodon/components/column_header.js | 13 +++++++--- app/javascript/mastodon/features/compose/index.js | 18 +++++++------- .../mastodon/features/ui/components/tabs_bar.js | 28 ++++++++++++++-------- app/javascript/mastodon/locales/ar.json | 3 +++ app/javascript/mastodon/locales/bg.json | 3 +++ app/javascript/mastodon/locales/ca.json | 3 +++ app/javascript/mastodon/locales/de.json | 3 +++ .../mastodon/locales/defaultMessages.json | 12 ++++++++++ app/javascript/mastodon/locales/en.json | 3 +++ app/javascript/mastodon/locales/eo.json | 3 +++ app/javascript/mastodon/locales/es.json | 3 +++ app/javascript/mastodon/locales/fa.json | 3 +++ app/javascript/mastodon/locales/fi.json | 3 +++ app/javascript/mastodon/locales/fr.json | 5 +++- app/javascript/mastodon/locales/he.json | 3 +++ app/javascript/mastodon/locales/hr.json | 3 +++ app/javascript/mastodon/locales/hu.json | 3 +++ app/javascript/mastodon/locales/id.json | 3 +++ app/javascript/mastodon/locales/io.json | 3 +++ app/javascript/mastodon/locales/it.json | 3 +++ app/javascript/mastodon/locales/ja.json | 3 +++ app/javascript/mastodon/locales/ko.json | 3 +++ app/javascript/mastodon/locales/nl.json | 7 ++++-- app/javascript/mastodon/locales/no.json | 3 +++ app/javascript/mastodon/locales/oc.json | 3 +++ app/javascript/mastodon/locales/pl.json | 2 ++ app/javascript/mastodon/locales/pt-BR.json | 3 +++ app/javascript/mastodon/locales/pt.json | 3 +++ app/javascript/mastodon/locales/ru.json | 3 +++ app/javascript/mastodon/locales/th.json | 3 +++ app/javascript/mastodon/locales/tr.json | 3 +++ app/javascript/mastodon/locales/uk.json | 3 +++ app/javascript/mastodon/locales/zh-CN.json | 3 +++ app/javascript/mastodon/locales/zh-HK.json | 3 +++ app/javascript/mastodon/locales/zh-TW.json | 3 +++ 35 files changed, 144 insertions(+), 25 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 5b2a4d84c..89e2f9189 100644 --- a/app/javascript/mastodon/components/column_header.js +++ b/app/javascript/mastodon/components/column_header.js @@ -1,8 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, injectIntl, defineMessages } from 'react-intl'; +const messages = defineMessages({ + show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' }, + hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' }, +}); + +@injectIntl export default class ColumnHeader extends React.PureComponent { static contextTypes = { @@ -10,6 +16,7 @@ export default class ColumnHeader extends React.PureComponent { }; static propTypes = { + intl: PropTypes.object.isRequired, title: PropTypes.node.isRequired, icon: PropTypes.string.isRequired, active: PropTypes.bool, @@ -54,7 +61,7 @@ export default class ColumnHeader extends React.PureComponent { } render () { - const { title, icon, active, children, pinned, onPin, multiColumn, showBackButton } = this.props; + const { title, icon, active, children, pinned, onPin, multiColumn, showBackButton, intl: { formatMessage } } = this.props; const { collapsed, animating } = this.state; const wrapperClassName = classNames('column-header__wrapper', { @@ -116,7 +123,7 @@ export default class ColumnHeader extends React.PureComponent { } if (children || multiColumn) { - collapseButton = ; + collapseButton = ; } return ( diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index e3cf2d33b..b3f410f3b 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -64,23 +64,23 @@ export default class Compose extends React.PureComponent { if (multiColumn) { const { columns } = this.props; header = ( -
- +
+ + + ); } diff --git a/app/javascript/mastodon/features/ui/components/tabs_bar.js b/app/javascript/mastodon/features/ui/components/tabs_bar.js index baec86d0d..4d488f82d 100644 --- a/app/javascript/mastodon/features/ui/components/tabs_bar.js +++ b/app/javascript/mastodon/features/ui/components/tabs_bar.js @@ -1,16 +1,17 @@ import React from 'react'; +import PropTypes from 'prop-types'; import NavLink from 'react-router-dom/NavLink'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, injectIntl } from 'react-intl'; export const links = [ - , - , - , + , + , + , - , - , + , + , - , + , ]; export function getIndex (path) { @@ -21,13 +22,20 @@ export function getLink (index) { return links[index].props.to; } +@injectIntl export default class TabsBar extends React.Component { + static propTypes = { + intl: PropTypes.object.isRequired, + } + render () { + const { intl: { formatMessage } } = this.props; + return ( -
- {React.Children.toArray(links)} -
+ ); } diff --git a/app/javascript/mastodon/locales/ar.json b/app/javascript/mastodon/locales/ar.json index 7f27d78cd..8ce254bde 100644 --- a/app/javascript/mastodon/locales/ar.json +++ b/app/javascript/mastodon/locales/ar.json @@ -34,7 +34,9 @@ "column.notifications": "الإشعارات", "column.public": "الخيط العام الموحد", "column_back_button.label": "العودة", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "التصفح", "column_subheading.settings": "الإعدادات", @@ -168,6 +170,7 @@ "status.report": "إبلِغ عن @{name}", "status.sensitive_toggle": "اضغط للعرض", "status.sensitive_warning": "محتوى حساس", + "status.share": "Share", "status.show_less": "إعرض أقلّ", "status.show_more": "أظهر المزيد", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/bg.json b/app/javascript/mastodon/locales/bg.json index 68aaf56b0..e3db1c7e1 100644 --- a/app/javascript/mastodon/locales/bg.json +++ b/app/javascript/mastodon/locales/bg.json @@ -34,7 +34,9 @@ "column.notifications": "Известия", "column.public": "Публичен канал", "column_back_button.label": "Назад", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Report @{name}", "status.sensitive_toggle": "Покажи", "status.sensitive_warning": "Деликатно съдържание", + "status.share": "Share", "status.show_less": "Show less", "status.show_more": "Show more", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/ca.json b/app/javascript/mastodon/locales/ca.json index 6fdcde4b4..2bb51653f 100644 --- a/app/javascript/mastodon/locales/ca.json +++ b/app/javascript/mastodon/locales/ca.json @@ -34,7 +34,9 @@ "column.notifications": "Notificacions", "column.public": "Línia de temps federada", "column_back_button.label": "Enrere", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navegació", "column_subheading.settings": "Configuració", @@ -168,6 +170,7 @@ "status.report": "Informar sobre @{name}", "status.sensitive_toggle": "Clic per veure", "status.sensitive_warning": "Contingut sensible", + "status.share": "Share", "status.show_less": "Mostra menys", "status.show_more": "Mostra més", "status.unmute_conversation": "Activar conversació", diff --git a/app/javascript/mastodon/locales/de.json b/app/javascript/mastodon/locales/de.json index f911c7b75..eb67b5a06 100644 --- a/app/javascript/mastodon/locales/de.json +++ b/app/javascript/mastodon/locales/de.json @@ -34,7 +34,9 @@ "column.notifications": "Mitteilungen", "column.public": "Gesamtes bekanntes Netz", "column_back_button.label": "Zurück", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "@{name} melden", "status.sensitive_toggle": "Klicke, um sie zu sehen", "status.sensitive_warning": "Heikle Inhalte", + "status.share": "Share", "status.show_less": "Weniger anzeigen", "status.show_more": "Mehr anzeigen", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index 047a89ebb..89538f8c3 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -53,6 +53,14 @@ }, { "descriptors": [ + { + "defaultMessage": "Show settings", + "id": "column_header.show_settings" + }, + { + "defaultMessage": "Hide settings", + "id": "column_header.hide_settings" + }, { "defaultMessage": "Unpin", "id": "column_header.unpin" @@ -138,6 +146,10 @@ "defaultMessage": "Reply", "id": "status.reply" }, + { + "defaultMessage": "Share", + "id": "status.share" + }, { "defaultMessage": "Reply to thread", "id": "status.replyAll" diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 3a201b9c1..816ce68ae 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -34,7 +34,9 @@ "column.notifications": "Notifications", "column.public": "Federated timeline", "column_back_button.label": "Back", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Report @{name}", "status.sensitive_toggle": "Click to view", "status.sensitive_warning": "Sensitive content", + "status.share": "Share", "status.show_less": "Show less", "status.show_more": "Show more", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/eo.json b/app/javascript/mastodon/locales/eo.json index 0bb5159c8..a9a6ad150 100644 --- a/app/javascript/mastodon/locales/eo.json +++ b/app/javascript/mastodon/locales/eo.json @@ -34,7 +34,9 @@ "column.notifications": "Sciigoj", "column.public": "Fratara tempolinio", "column_back_button.label": "Reveni", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Report @{name}", "status.sensitive_toggle": "Alklaki por vidi", "status.sensitive_warning": "Tikla enhavo", + "status.share": "Share", "status.show_less": "Show less", "status.show_more": "Show more", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/es.json b/app/javascript/mastodon/locales/es.json index a39b608c6..a3c2cae3a 100644 --- a/app/javascript/mastodon/locales/es.json +++ b/app/javascript/mastodon/locales/es.json @@ -34,7 +34,9 @@ "column.notifications": "Notificaciones", "column.public": "Historia federada", "column_back_button.label": "Atrás", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Reportar", "status.sensitive_toggle": "Click para ver", "status.sensitive_warning": "Contenido sensible", + "status.share": "Share", "status.show_less": "Mostrar menos", "status.show_more": "Mostrar más", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/fa.json b/app/javascript/mastodon/locales/fa.json index 6842558d9..cb918d414 100644 --- a/app/javascript/mastodon/locales/fa.json +++ b/app/javascript/mastodon/locales/fa.json @@ -34,7 +34,9 @@ "column.notifications": "اعلان‌ها", "column.public": "نوشته‌های همه‌جا", "column_back_button.label": "بازگشت", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "گشت و گذار", "column_subheading.settings": "تنظیمات", @@ -168,6 +170,7 @@ "status.report": "گزارش دادن @{name}", "status.sensitive_toggle": "برای دیدن کلیک کنید", "status.sensitive_warning": "محتوای حساس", + "status.share": "Share", "status.show_less": "نهفتن", "status.show_more": "نمایش", "status.unmute_conversation": "باصداکردن گفتگو", diff --git a/app/javascript/mastodon/locales/fi.json b/app/javascript/mastodon/locales/fi.json index efc9b1053..0ad2c5bb9 100644 --- a/app/javascript/mastodon/locales/fi.json +++ b/app/javascript/mastodon/locales/fi.json @@ -34,7 +34,9 @@ "column.notifications": "Ilmoitukset", "column.public": "Yleinen aikajana", "column_back_button.label": "Takaisin", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Report @{name}", "status.sensitive_toggle": "Klikkaa nähdäksesi", "status.sensitive_warning": "Arkaluontoista sisältöä", + "status.share": "Share", "status.show_less": "Show less", "status.show_more": "Show more", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/fr.json b/app/javascript/mastodon/locales/fr.json index 3cc1f152a..9ae9b2d39 100644 --- a/app/javascript/mastodon/locales/fr.json +++ b/app/javascript/mastodon/locales/fr.json @@ -17,7 +17,7 @@ "account.unblock_domain": "Ne plus masquer {domain}", "account.unfollow": "Ne plus suivre", "account.unmute": "Ne plus masquer", -"account.view_full_profile": "Afficher le profil complet", + "account.view_full_profile": "Afficher le profil complet", "boost_modal.combo": "Vous pouvez appuyer sur {combo} pour pouvoir passer ceci, la prochaine fois", "bundle_column_error.body": "Une erreur s'est produite lors du chargement de ce composant.", "bundle_column_error.retry": "Réessayer", @@ -34,7 +34,9 @@ "column.notifications": "Notifications", "column.public": "Fil public global", "column_back_button.label": "Retour", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Épingler", + "column_header.show_settings": "Show settings", "column_header.unpin": "Retirer", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Paramètres", @@ -168,6 +170,7 @@ "status.report": "Signaler @{name}", "status.sensitive_toggle": "Cliquer pour afficher", "status.sensitive_warning": "Contenu sensible", + "status.share": "Share", "status.show_less": "Replier", "status.show_more": "Déplier", "status.unmute_conversation": "Ne plus masquer la conversation", diff --git a/app/javascript/mastodon/locales/he.json b/app/javascript/mastodon/locales/he.json index 36be0842b..eb3c5d9da 100644 --- a/app/javascript/mastodon/locales/he.json +++ b/app/javascript/mastodon/locales/he.json @@ -34,7 +34,9 @@ "column.notifications": "התראות", "column.public": "בפרהסיה", "column_back_button.label": "חזרה", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "ניווט", "column_subheading.settings": "אפשרויות", @@ -168,6 +170,7 @@ "status.report": "דיווח על @{name}", "status.sensitive_toggle": "לחצו כדי לראות", "status.sensitive_warning": "תוכן רגיש", + "status.share": "Share", "status.show_less": "הראה פחות", "status.show_more": "הראה יותר", "status.unmute_conversation": "הסרת השתקת שיחה", diff --git a/app/javascript/mastodon/locales/hr.json b/app/javascript/mastodon/locales/hr.json index 363c4c490..099f3a7ae 100644 --- a/app/javascript/mastodon/locales/hr.json +++ b/app/javascript/mastodon/locales/hr.json @@ -34,7 +34,9 @@ "column.notifications": "Notifikacije", "column.public": "Federalni timeline", "column_back_button.label": "Natrag", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigacija", "column_subheading.settings": "Postavke", @@ -168,6 +170,7 @@ "status.report": "Prijavi @{name}", "status.sensitive_toggle": "Klikni da bi vidio", "status.sensitive_warning": "Osjetljiv sadržaj", + "status.share": "Share", "status.show_less": "Pokaži manje", "status.show_more": "Pokaži više", "status.unmute_conversation": "Poništi utišavanje razgovora", diff --git a/app/javascript/mastodon/locales/hu.json b/app/javascript/mastodon/locales/hu.json index d43570f0d..c2d6dd672 100644 --- a/app/javascript/mastodon/locales/hu.json +++ b/app/javascript/mastodon/locales/hu.json @@ -34,7 +34,9 @@ "column.notifications": "Értesítések", "column.public": "Nyilvános", "column_back_button.label": "Vissza", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Report @{name}", "status.sensitive_toggle": "Katt a megtekintéshez", "status.sensitive_warning": "Érzékeny tartalom", + "status.share": "Share", "status.show_less": "Show less", "status.show_more": "Show more", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/id.json b/app/javascript/mastodon/locales/id.json index 916f313bb..7c9e75892 100644 --- a/app/javascript/mastodon/locales/id.json +++ b/app/javascript/mastodon/locales/id.json @@ -34,7 +34,9 @@ "column.notifications": "Notifikasi", "column.public": "Linimasa gabunggan", "column_back_button.label": "Kembali", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigasi", "column_subheading.settings": "Pengaturan", @@ -168,6 +170,7 @@ "status.report": "Laporkan @{name}", "status.sensitive_toggle": "Klik untuk menampilkan", "status.sensitive_warning": "Konten sensitif", + "status.share": "Share", "status.show_less": "Tampilkan lebih sedikit", "status.show_more": "Tampilkan semua", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/io.json b/app/javascript/mastodon/locales/io.json index a87cc9328..e961a8c39 100644 --- a/app/javascript/mastodon/locales/io.json +++ b/app/javascript/mastodon/locales/io.json @@ -34,7 +34,9 @@ "column.notifications": "Savigi", "column.public": "Federata tempolineo", "column_back_button.label": "Retro", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Denuncar @{name}", "status.sensitive_toggle": "Kliktar por vidar", "status.sensitive_warning": "Trubliva kontenajo", + "status.share": "Share", "status.show_less": "Montrar mine", "status.show_more": "Montrar plue", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/it.json b/app/javascript/mastodon/locales/it.json index 243ed7344..b7d2c1d8c 100644 --- a/app/javascript/mastodon/locales/it.json +++ b/app/javascript/mastodon/locales/it.json @@ -34,7 +34,9 @@ "column.notifications": "Notifiche", "column.public": "Timeline federata", "column_back_button.label": "Indietro", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Segnala @{name}", "status.sensitive_toggle": "Clicca per vedere", "status.sensitive_warning": "Materiale sensibile", + "status.share": "Share", "status.show_less": "Mostra meno", "status.show_more": "Mostra di più", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index ca36122f7..8e0f9f4fa 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -34,7 +34,9 @@ "column.notifications": "通知", "column.public": "連合タイムライン", "column_back_button.label": "戻る", + "column_header.hide_settings": "Hide settings", "column_header.pin": "ピン留めする", + "column_header.show_settings": "Show settings", "column_header.unpin": "ピン留めを外す", "column_subheading.navigation": "ナビゲーション", "column_subheading.settings": "設定", @@ -168,6 +170,7 @@ "status.report": "通報", "status.sensitive_toggle": "クリックして表示", "status.sensitive_warning": "閲覧注意", + "status.share": "Share", "status.show_less": "隠す", "status.show_more": "もっと見る", "status.unmute_conversation": "会話のミュートを解除", diff --git a/app/javascript/mastodon/locales/ko.json b/app/javascript/mastodon/locales/ko.json index 768efa37d..817e53718 100644 --- a/app/javascript/mastodon/locales/ko.json +++ b/app/javascript/mastodon/locales/ko.json @@ -34,7 +34,9 @@ "column.notifications": "알림", "column.public": "연합 타임라인", "column_back_button.label": "돌아가기", + "column_header.hide_settings": "Hide settings", "column_header.pin": "고정하기", + "column_header.show_settings": "Show settings", "column_header.unpin": "고정 해제", "column_subheading.navigation": "내비게이션", "column_subheading.settings": "설정", @@ -168,6 +170,7 @@ "status.report": "신고", "status.sensitive_toggle": "클릭해서 표시하기", "status.sensitive_warning": "민감한 미디어", + "status.share": "Share", "status.show_less": "숨기기", "status.show_more": "더 보기", "status.unmute_conversation": "이 대화의 뮤트 해제하기", diff --git a/app/javascript/mastodon/locales/nl.json b/app/javascript/mastodon/locales/nl.json index fbfabc5d1..70be3275b 100644 --- a/app/javascript/mastodon/locales/nl.json +++ b/app/javascript/mastodon/locales/nl.json @@ -17,7 +17,7 @@ "account.unblock_domain": "{domain} niet meer negeren", "account.unfollow": "Ontvolgen", "account.unmute": "@{name} niet meer negeren", - "account.view_full_profile": "Volledig profiel tonen", + "account.view_full_profile": "Volledig profiel tonen", "boost_modal.combo": "Je kunt {combo} klikken om dit de volgende keer over te slaan", "bundle_column_error.body": "Tijdens het laden van dit onderdeel is er iets fout gegaan.", "bundle_column_error.retry": "Opnieuw proberen", @@ -34,7 +34,9 @@ "column.notifications": "Meldingen", "column.public": "Globale tijdlijn", "column_back_button.label": "terug", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Vastmaken", + "column_header.show_settings": "Show settings", "column_header.unpin": "Losmaken", "column_subheading.navigation": "Navigatie", "column_subheading.settings": "Instellingen", @@ -147,12 +149,12 @@ "privacy.unlisted.long": "Niet op openbare tijdlijnen tonen", "privacy.unlisted.short": "Minder openbaar", "reply_indicator.cancel": "Annuleren", - "report.heading": "Rapporteren", "report.placeholder": "Extra opmerkingen", "report.submit": "Verzenden", "report.target": "Rapporteren van", "search.placeholder": "Zoeken", "search_results.total": "{count, number} {count, plural, one {resultaat} other {resultaten}}", + "standalone.public_title": "A look inside...", "status.cannot_reblog": "Deze toot kan niet geboost worden", "status.delete": "Verwijderen", "status.favourite": "Favoriet", @@ -168,6 +170,7 @@ "status.report": "Rapporteer @{name}", "status.sensitive_toggle": "Klik om te zien", "status.sensitive_warning": "Gevoelige inhoud", + "status.share": "Share", "status.show_less": "Minder tonen", "status.show_more": "Meer tonen", "status.unmute_conversation": "Conversatie niet meer negeren", diff --git a/app/javascript/mastodon/locales/no.json b/app/javascript/mastodon/locales/no.json index 8727f6147..e74ffb3fb 100644 --- a/app/javascript/mastodon/locales/no.json +++ b/app/javascript/mastodon/locales/no.json @@ -34,7 +34,9 @@ "column.notifications": "Varsler", "column.public": "Felles tidslinje", "column_back_button.label": "Tilbake", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigasjon", "column_subheading.settings": "Innstillinger", @@ -168,6 +170,7 @@ "status.report": "Rapporter @{name}", "status.sensitive_toggle": "Klikk for å vise", "status.sensitive_warning": "Følsomt innhold", + "status.share": "Share", "status.show_less": "Vis mindre", "status.show_more": "Vis mer", "status.unmute_conversation": "Ikke demp samtale", diff --git a/app/javascript/mastodon/locales/oc.json b/app/javascript/mastodon/locales/oc.json index c39d57333..21e434ead 100644 --- a/app/javascript/mastodon/locales/oc.json +++ b/app/javascript/mastodon/locales/oc.json @@ -34,7 +34,9 @@ "column.notifications": "Notificacions", "column.public": "Flux public global", "column_back_button.label": "Tornar", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Penjar", + "column_header.show_settings": "Show settings", "column_header.unpin": "Despenjar", "column_subheading.navigation": "Navigacion", "column_subheading.settings": "Paramètres", @@ -168,6 +170,7 @@ "status.report": "Senhalar @{name}", "status.sensitive_toggle": "Clicar per mostrar", "status.sensitive_warning": "Contengut sensible", + "status.share": "Share", "status.show_less": "Tornar plegar", "status.show_more": "Desplegar", "status.unmute_conversation": "Conversacions amb silenci levat", diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index 29e6ca471..60689372e 100644 --- a/app/javascript/mastodon/locales/pl.json +++ b/app/javascript/mastodon/locales/pl.json @@ -34,7 +34,9 @@ "column.notifications": "Powiadomienia", "column.public": "Globalna oś czasu", "column_back_button.label": "Wróć", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Przypnij", + "column_header.show_settings": "Show settings", "column_header.unpin": "Cofnij przypięcie", "column_subheading.navigation": "Nawigacja", "column_subheading.settings": "Ustawienia", diff --git a/app/javascript/mastodon/locales/pt-BR.json b/app/javascript/mastodon/locales/pt-BR.json index 86da7c4e6..ac3675909 100644 --- a/app/javascript/mastodon/locales/pt-BR.json +++ b/app/javascript/mastodon/locales/pt-BR.json @@ -34,7 +34,9 @@ "column.notifications": "Notificações", "column.public": "Global", "column_back_button.label": "Voltar", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Denúnciar @{name}", "status.sensitive_toggle": "Clique para ver", "status.sensitive_warning": "Conteúdo sensível", + "status.share": "Share", "status.show_less": "Mostrar menos", "status.show_more": "Mostrar mais", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/pt.json b/app/javascript/mastodon/locales/pt.json index 86da7c4e6..ac3675909 100644 --- a/app/javascript/mastodon/locales/pt.json +++ b/app/javascript/mastodon/locales/pt.json @@ -34,7 +34,9 @@ "column.notifications": "Notificações", "column.public": "Global", "column_back_button.label": "Voltar", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Denúnciar @{name}", "status.sensitive_toggle": "Clique para ver", "status.sensitive_warning": "Conteúdo sensível", + "status.share": "Share", "status.show_less": "Mostrar menos", "status.show_more": "Mostrar mais", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/ru.json b/app/javascript/mastodon/locales/ru.json index 16af3fe7e..e9bddf918 100644 --- a/app/javascript/mastodon/locales/ru.json +++ b/app/javascript/mastodon/locales/ru.json @@ -34,7 +34,9 @@ "column.notifications": "Уведомления", "column.public": "Глобальная лента", "column_back_button.label": "Назад", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Закрепить", + "column_header.show_settings": "Show settings", "column_header.unpin": "Открепить", "column_subheading.navigation": "Навигация", "column_subheading.settings": "Настройки", @@ -168,6 +170,7 @@ "status.report": "Пожаловаться", "status.sensitive_toggle": "Нажмите для просмотра", "status.sensitive_warning": "Чувствительный контент", + "status.share": "Share", "status.show_less": "Свернуть", "status.show_more": "Развернуть", "status.unmute_conversation": "Снять глушение с треда", diff --git a/app/javascript/mastodon/locales/th.json b/app/javascript/mastodon/locales/th.json index be5c0815d..e41f4193c 100644 --- a/app/javascript/mastodon/locales/th.json +++ b/app/javascript/mastodon/locales/th.json @@ -34,7 +34,9 @@ "column.notifications": "Notifications", "column.public": "Federated timeline", "column_back_button.label": "Back", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigation", "column_subheading.settings": "Settings", @@ -168,6 +170,7 @@ "status.report": "Report @{name}", "status.sensitive_toggle": "Click to view", "status.sensitive_warning": "Sensitive content", + "status.share": "Share", "status.show_less": "Show less", "status.show_more": "Show more", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/tr.json b/app/javascript/mastodon/locales/tr.json index 9d4d5fa17..aafa6739c 100644 --- a/app/javascript/mastodon/locales/tr.json +++ b/app/javascript/mastodon/locales/tr.json @@ -34,7 +34,9 @@ "column.notifications": "Bildirimler", "column.public": "Federe zaman tüneli", "column_back_button.label": "Geri", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Navigasyon", "column_subheading.settings": "Ayarlar", @@ -168,6 +170,7 @@ "status.report": "@{name}'i raporla", "status.sensitive_toggle": "Görmek için tıklayınız", "status.sensitive_warning": "Hassas içerik", + "status.share": "Share", "status.show_less": "Daha azı", "status.show_more": "Daha fazlası", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/uk.json b/app/javascript/mastodon/locales/uk.json index 60a551bb6..3f496d953 100644 --- a/app/javascript/mastodon/locales/uk.json +++ b/app/javascript/mastodon/locales/uk.json @@ -34,7 +34,9 @@ "column.notifications": "Сповіщення", "column.public": "Глобальна стрічка", "column_back_button.label": "Назад", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "Навігація", "column_subheading.settings": "Налаштування", @@ -168,6 +170,7 @@ "status.report": "Поскаржитися", "status.sensitive_toggle": "Натисніть, щоб подивитися", "status.sensitive_warning": "Непристойний зміст", + "status.share": "Share", "status.show_less": "Згорнути", "status.show_more": "Розгорнути", "status.unmute_conversation": "Зняти глушення з діалогу", diff --git a/app/javascript/mastodon/locales/zh-CN.json b/app/javascript/mastodon/locales/zh-CN.json index 97f1f5e27..e27061d95 100644 --- a/app/javascript/mastodon/locales/zh-CN.json +++ b/app/javascript/mastodon/locales/zh-CN.json @@ -34,7 +34,9 @@ "column.notifications": "通知", "column.public": "跨站公共时间轴", "column_back_button.label": "Back", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "导航", "column_subheading.settings": "设置", @@ -168,6 +170,7 @@ "status.report": "举报 @{name}", "status.sensitive_toggle": "点击显示", "status.sensitive_warning": "敏感内容", + "status.share": "Share", "status.show_less": "减少显示", "status.show_more": "显示更多", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/zh-HK.json b/app/javascript/mastodon/locales/zh-HK.json index c65c3d45c..1ce4153bf 100644 --- a/app/javascript/mastodon/locales/zh-HK.json +++ b/app/javascript/mastodon/locales/zh-HK.json @@ -34,7 +34,9 @@ "column.notifications": "通知", "column.public": "跨站時間軸", "column_back_button.label": "返回", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "瀏覽", "column_subheading.settings": "設定", @@ -168,6 +170,7 @@ "status.report": "舉報 @{name}", "status.sensitive_toggle": "點擊顯示", "status.sensitive_warning": "敏感內容", + "status.share": "Share", "status.show_less": "減少顯示", "status.show_more": "顯示更多", "status.unmute_conversation": "Unmute conversation", diff --git a/app/javascript/mastodon/locales/zh-TW.json b/app/javascript/mastodon/locales/zh-TW.json index 12e840b16..6b1310463 100644 --- a/app/javascript/mastodon/locales/zh-TW.json +++ b/app/javascript/mastodon/locales/zh-TW.json @@ -34,7 +34,9 @@ "column.notifications": "通知", "column.public": "聯盟時間軸", "column_back_button.label": "上一頁", + "column_header.hide_settings": "Hide settings", "column_header.pin": "Pin", + "column_header.show_settings": "Show settings", "column_header.unpin": "Unpin", "column_subheading.navigation": "瀏覽", "column_subheading.settings": "設定", @@ -168,6 +170,7 @@ "status.report": "通報 @{name}", "status.sensitive_toggle": "點來看", "status.sensitive_warning": "敏感內容", + "status.share": "Share", "status.show_less": "看少點", "status.show_more": "看更多", "status.unmute_conversation": "不消音對話", -- cgit From 7874c6d630ddd54b08e96b67831a5eb2352bd7b1 Mon Sep 17 00:00:00 2001 From: m4sk1n Date: Wed, 26 Jul 2017 09:09:16 +0200 Subject: i18n: Update Polish translation (#4371) --- app/javascript/mastodon/locales/pl.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index 60689372e..a24c920f4 100644 --- a/app/javascript/mastodon/locales/pl.json +++ b/app/javascript/mastodon/locales/pl.json @@ -34,9 +34,9 @@ "column.notifications": "Powiadomienia", "column.public": "Globalna oś czasu", "column_back_button.label": "Wróć", - "column_header.hide_settings": "Hide settings", + "column_header.hide_settings": "Ukryj ustawienia", "column_header.pin": "Przypnij", - "column_header.show_settings": "Show settings", + "column_header.show_settings": "Pokaż ustawienia", "column_header.unpin": "Cofnij przypięcie", "column_subheading.navigation": "Nawigacja", "column_subheading.settings": "Ustawienia", -- cgit From aa8fa71df6c57297ea859d3deca5794612d4d281 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Wed, 26 Jul 2017 20:45:49 +0900 Subject: Fix padding in hero container of landing page (#4373) * Fix padding in hero container, landing page Erase hero container padding to fit registration form to full width. By this setting, heading padding disappears, so I adjust heading padding. * Specify attribute strictly for heading padding To overwrite padding-bottom in superior settings. * Make padding shorthand more concise --- app/javascript/styles/about.scss | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 5a4bcef61..9be95c028 100644 --- a/app/javascript/styles/about.scss +++ b/app/javascript/styles/about.scss @@ -708,6 +708,11 @@ .hero { margin-top: 30px; + padding: 0; + + .heading { + padding: 0 20px 20px; + } } .floats { -- cgit From 6a6a62f13fd7846ba032543635580980b74ea14c Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 13:46:53 +0200 Subject: Improve accessibility (part 2) (#4377) * fix(column_header): Invalid ARIA role * fix(column): Remove hidden nodes from the DOM * refactor(column_link): Remove unused property hideOnMobile * fix(column_header): Use aria-pressed * fix(column_header): Make collapsed content not focusable, add focusable property * fix(column_loading): Make header non-focusable * fix(column_settings): Use role to group the toggles --- .../mastodon/components/column_header.js | 13 +++-- .../notifications/components/column_settings.js | 58 ++++++++++++---------- .../mastodon/features/ui/components/column.js | 12 ++--- .../features/ui/components/column_header.js | 5 +- .../mastodon/features/ui/components/column_link.js | 6 +-- .../features/ui/components/column_loading.js | 2 +- app/javascript/styles/components.scss | 12 ----- 7 files changed, 54 insertions(+), 54 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 89e2f9189..d3256fbec 100644 --- a/app/javascript/mastodon/components/column_header.js +++ b/app/javascript/mastodon/components/column_header.js @@ -21,6 +21,7 @@ export default class ColumnHeader extends React.PureComponent { icon: PropTypes.string.isRequired, active: PropTypes.bool, multiColumn: PropTypes.bool, + focusable: PropTypes.bool, showBackButton: PropTypes.bool, children: PropTypes.node, pinned: PropTypes.bool, @@ -29,6 +30,10 @@ export default class ColumnHeader extends React.PureComponent { onClick: PropTypes.func, }; + static defaultProps = { + focusable: true, + } + state = { collapsed: true, animating: false, @@ -61,7 +66,7 @@ export default class ColumnHeader extends React.PureComponent { } render () { - const { title, icon, active, children, pinned, onPin, multiColumn, showBackButton, intl: { formatMessage } } = this.props; + const { title, icon, active, children, pinned, onPin, multiColumn, focusable, showBackButton, intl: { formatMessage } } = this.props; const { collapsed, animating } = this.state; const wrapperClassName = classNames('column-header__wrapper', { @@ -123,12 +128,12 @@ export default class ColumnHeader extends React.PureComponent { } if (children || multiColumn) { - collapseButton = ; + collapseButton = ; } return (
-
+
{title} @@ -138,7 +143,7 @@ export default class ColumnHeader extends React.PureComponent {
-
+
{(!collapsed || animating) && collapsedContent}
diff --git a/app/javascript/mastodon/features/notifications/components/column_settings.js b/app/javascript/mastodon/features/notifications/components/column_settings.js index 31cac5bc7..88a29d4d3 100644 --- a/app/javascript/mastodon/features/notifications/components/column_settings.js +++ b/app/javascript/mastodon/features/notifications/components/column_settings.js @@ -36,40 +36,48 @@ export default class ColumnSettings extends React.PureComponent {
- - -
- - {showPushSettings && } - - +
+ + +
+ + {showPushSettings && } + + +
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
- +
+ -
- - {showPushSettings && } - - +
+ + {showPushSettings && } + + +
); diff --git a/app/javascript/mastodon/features/ui/components/column.js b/app/javascript/mastodon/features/ui/components/column.js index ce1dca171..2d46264a2 100644 --- a/app/javascript/mastodon/features/ui/components/column.js +++ b/app/javascript/mastodon/features/ui/components/column.js @@ -3,6 +3,7 @@ import ColumnHeader from './column_header'; import PropTypes from 'prop-types'; import { debounce } from 'lodash'; import scrollTop from '../../../scroll'; +import { isMobile } from '../../../is_mobile'; export default class Column extends React.PureComponent { @@ -37,13 +38,12 @@ export default class Column extends React.PureComponent { render () { const { heading, icon, children, active, hideHeadingOnMobile } = this.props; - let columnHeaderId = null; - let header = ''; + const showHeading = !hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)); - if (heading) { - columnHeaderId = heading.replace(/ /g, '-'); - header = ; - } + const columnHeaderId = showHeading && heading.replace(/ /g, '-'); + const header = showHeading && ( + + ); return (
+
{icon} {type}
diff --git a/app/javascript/mastodon/features/ui/components/column_link.js b/app/javascript/mastodon/features/ui/components/column_link.js index cbdb6534f..ad7ec9318 100644 --- a/app/javascript/mastodon/features/ui/components/column_link.js +++ b/app/javascript/mastodon/features/ui/components/column_link.js @@ -2,17 +2,17 @@ import React from 'react'; import PropTypes from 'prop-types'; import Link from 'react-router-dom/Link'; -const ColumnLink = ({ icon, text, to, href, method, hideOnMobile }) => { +const ColumnLink = ({ icon, text, to, href, method }) => { if (href) { return ( - + {text} ); } else { return ( - + {text} diff --git a/app/javascript/mastodon/features/ui/components/column_loading.js b/app/javascript/mastodon/features/ui/components/column_loading.js index 7ecfaf77a..1c4058926 100644 --- a/app/javascript/mastodon/features/ui/components/column_loading.js +++ b/app/javascript/mastodon/features/ui/components/column_loading.js @@ -6,7 +6,7 @@ import ColumnHeader from '../../../components/column_header'; const ColumnLoading = ({ title = '', icon = ' ' }) => ( - +
); diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss index 8de456754..a51cd962e 100644 --- a/app/javascript/styles/components.scss +++ b/app/javascript/styles/components.scss @@ -1743,12 +1743,6 @@ &:hover { background: lighten($ui-base-color, 11%); } - - &.hidden-on-mobile { - @media screen and (max-width: 1024px) { - display: none; - } - } } .column-link__icon { @@ -2132,12 +2126,6 @@ button.icon-button.active i.fa-retweet { } } - &.hidden-on-mobile { - @media screen and (max-width: 1024px) { - display: none; - } - } - &:focus, &:active { outline: 0; -- cgit From 4ba33f99fc9d903b3b6b836ea86051c407eb4b0a Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 26 Jul 2017 21:57:51 +0900 Subject: Update Japanese translations (#4376) * Update Japanese translations for remote profile, settings toggle button and web share button. * Update Japanese translation for remote profile. --- app/javascript/mastodon/locales/ja.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 8e0f9f4fa..f01838be2 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -1,7 +1,7 @@ { "account.block": "ブロック", "account.block_domain": "{domain}全体を非表示", - "account.disclaimer_full": "Information below may reflect the user's profile incompletely.", + "account.disclaimer_full": "以下の情報は不正確な可能性があります。", "account.edit_profile": "プロフィールを編集", "account.follow": "フォロー", "account.followers": "フォロワー", @@ -17,7 +17,7 @@ "account.unblock_domain": "{domain}を表示", "account.unfollow": "フォロー解除", "account.unmute": "ミュート解除", - "account.view_full_profile": "View full profile", + "account.view_full_profile": "全ての情報を見る", "boost_modal.combo": "次からは{combo}を押せば、これをスキップできます。", "bundle_column_error.body": "コンポーネントの読み込み中に問題が発生しました。", "bundle_column_error.retry": "再試行", @@ -34,9 +34,9 @@ "column.notifications": "通知", "column.public": "連合タイムライン", "column_back_button.label": "戻る", - "column_header.hide_settings": "Hide settings", + "column_header.hide_settings": "設定を隠す", "column_header.pin": "ピン留めする", - "column_header.show_settings": "Show settings", + "column_header.show_settings": "設定を表示", "column_header.unpin": "ピン留めを外す", "column_subheading.navigation": "ナビゲーション", "column_subheading.settings": "設定", @@ -170,7 +170,7 @@ "status.report": "通報", "status.sensitive_toggle": "クリックして表示", "status.sensitive_warning": "閲覧注意", - "status.share": "Share", + "status.share": "共有", "status.show_less": "隠す", "status.show_more": "もっと見る", "status.unmute_conversation": "会話のミュートを解除", -- cgit From b8adb4d7fa6546f415d93d0af8e1d7b0e24a3f54 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 15:03:23 +0200 Subject: fix(column): Crash when heading is undefined (#4378) --- app/javascript/mastodon/features/ui/components/column.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/ui/components/column.js b/app/javascript/mastodon/features/ui/components/column.js index 2d46264a2..aea102aac 100644 --- a/app/javascript/mastodon/features/ui/components/column.js +++ b/app/javascript/mastodon/features/ui/components/column.js @@ -38,7 +38,7 @@ export default class Column extends React.PureComponent { render () { const { heading, icon, children, active, hideHeadingOnMobile } = this.props; - const showHeading = !hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)); + const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth))); const columnHeaderId = showHeading && heading.replace(/ /g, '-'); const header = showHeading && ( -- cgit From a248be4fcedc2908e4fc073ccea3ee3185264417 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 19:03:56 +0200 Subject: fix(columns_area): Manually set tabs style when swiping (#4320) --- app/javascript/mastodon/features/ui/components/columns_area.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js index 7de66ce3f..63bd1b021 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.js +++ b/app/javascript/mastodon/features/ui/components/columns_area.js @@ -56,6 +56,15 @@ export default class ColumnsArea extends ImmutablePureComponent { handleSwipe = (index) => { this.pendingIndex = index; + + const nextLinkTranslationId = links[index].props['data-preview-title-id']; + const currentLinkSelector = '.tabs-bar__link.active'; + const nextLinkSelector = `.tabs-bar__link[data-preview-title-id="${nextLinkTranslationId}"]`; + + // HACK: Remove the active class from the current link and set it to the next one + // React-router does this for us, but too late, feeling laggy. + document.querySelector(currentLinkSelector).classList.remove('active'); + document.querySelector(nextLinkSelector).classList.add('active'); } handleAnimationEnd = () => { -- cgit From 55bee84c97fd662375907520c56fe3a661458e15 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 26 Jul 2017 23:35:03 +0200 Subject: Fix infinite scroll fluidity (#4381) --- app/javascript/mastodon/components/status_list.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/status_list.js b/app/javascript/mastodon/components/status_list.js index dc6f956bf..48858cf13 100644 --- a/app/javascript/mastodon/components/status_list.js +++ b/app/javascript/mastodon/components/status_list.js @@ -6,7 +6,7 @@ import StatusContainer from '../containers/status_container'; import LoadMore from './load_more'; import ImmutablePureComponent from 'react-immutable-pure-component'; import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'; -import { debounce } from 'lodash'; +import { throttle } from 'lodash'; export default class StatusList extends ImmutablePureComponent { @@ -30,13 +30,13 @@ export default class StatusList extends ImmutablePureComponent { intersectionObserverWrapper = new IntersectionObserverWrapper(); - handleScroll = debounce(() => { + handleScroll = throttle(() => { if (this.node) { const { scrollTop, scrollHeight, clientHeight } = this.node; const offset = scrollHeight - scrollTop - clientHeight; this._oldScrollPosition = scrollHeight - scrollTop; - if (250 > offset && this.props.onScrollToBottom && !this.props.isLoading) { + if (400 > offset && this.props.onScrollToBottom && !this.props.isLoading) { this.props.onScrollToBottom(); } else if (scrollTop < 100 && this.props.onScrollToTop) { this.props.onScrollToTop(); @@ -44,7 +44,7 @@ export default class StatusList extends ImmutablePureComponent { this.props.onScroll(); } } - }, 200, { + }, 150, { trailing: true, }); -- cgit From f5e228ad2e2503d7cbe3da975e7d2b473e60712b Mon Sep 17 00:00:00 2001 From: Jeroen Date: Thu, 27 Jul 2017 00:37:35 +0200 Subject: Update Dutch strings (#4389) --- app/javascript/mastodon/locales/nl.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/locales/nl.json b/app/javascript/mastodon/locales/nl.json index 70be3275b..d79b0799a 100644 --- a/app/javascript/mastodon/locales/nl.json +++ b/app/javascript/mastodon/locales/nl.json @@ -34,9 +34,9 @@ "column.notifications": "Meldingen", "column.public": "Globale tijdlijn", "column_back_button.label": "terug", - "column_header.hide_settings": "Hide settings", + "column_header.hide_settings": "Instellingen verbergen", "column_header.pin": "Vastmaken", - "column_header.show_settings": "Show settings", + "column_header.show_settings": "Instellingen tonen", "column_header.unpin": "Losmaken", "column_subheading.navigation": "Navigatie", "column_subheading.settings": "Instellingen", @@ -154,7 +154,7 @@ "report.target": "Rapporteren van", "search.placeholder": "Zoeken", "search_results.total": "{count, number} {count, plural, one {resultaat} other {resultaten}}", - "standalone.public_title": "A look inside...", + "standalone.public_title": "Een kijkje binnenin...", "status.cannot_reblog": "Deze toot kan niet geboost worden", "status.delete": "Verwijderen", "status.favourite": "Favoriet", @@ -168,9 +168,9 @@ "status.reply": "Reageren", "status.replyAll": "Reageer op iedereen", "status.report": "Rapporteer @{name}", - "status.sensitive_toggle": "Klik om te zien", + "status.sensitive_toggle": "Klik om te bekijken", "status.sensitive_warning": "Gevoelige inhoud", - "status.share": "Share", + "status.share": "Delen", "status.show_less": "Minder tonen", "status.show_more": "Meer tonen", "status.unmute_conversation": "Conversatie niet meer negeren", -- cgit From 73890c3cac19df3fdf7162e84024fedea5ecfe5d Mon Sep 17 00:00:00 2001 From: unarist Date: Thu, 27 Jul 2017 22:49:56 +0900 Subject: Fix timeline height on landing page for Safari (#4392) `height: 100%` in `align-self: stretch` flexboxes doesn't work on Safari < 11. https://bugs.webkit.org/show_bug.cgi?id=137730 This workaround uses flexbox instead of `height: 100%` to stretch height. --- app/javascript/styles/about.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 9be95c028..6eddd1322 100644 --- a/app/javascript/styles/about.scss +++ b/app/javascript/styles/about.scss @@ -547,6 +547,7 @@ } #mastodon-timeline { + display: flex; -webkit-overflow-scrolling: touch; -ms-overflow-style: -ms-autohiding-scrollbar; font-family: 'mastodon-font-sans-serif', sans-serif; @@ -565,7 +566,6 @@ padding: 0; border-radius: 4px; overflow: hidden; - height: 100%; } .scrollable { -- cgit From f2233c3e25bd52388798e5d76311896fa8029413 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 27 Jul 2017 23:20:48 +0900 Subject: Update intersection-observer to version 0.4.0 (#4398) --- app/javascript/mastodon/components/status.js | 9 ++------- package.json | 2 +- yarn.lock | 6 +++--- 3 files changed, 6 insertions(+), 11 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 6b9fdd2af..0d7f6deb1 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -107,17 +107,12 @@ export default class Status extends ImmutablePureComponent { this.height = getRectFromEntry(entry).height; } - // Edge 15 doesn't support isIntersecting, but we can infer it - // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12156111/ - // https://github.com/WICG/IntersectionObserver/issues/211 - const isIntersecting = (typeof entry.isIntersecting === 'boolean') ? - entry.isIntersecting : entry.intersectionRect.height > 0; this.setState((prevState) => { - if (prevState.isIntersecting && !isIntersecting) { + if (prevState.isIntersecting && !entry.isIntersecting) { scheduleIdleTask(this.hideIfNotIntersecting); } return { - isIntersecting: isIntersecting, + isIntersecting: entry.isIntersecting, isHidden: false, }; }); diff --git a/package.json b/package.json index 132d7017d..9afb51285 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "glob": "^7.1.1", "http-link-header": "^0.8.0", "immutable": "^3.8.1", - "intersection-observer": "^0.3.2", + "intersection-observer": "^0.4.0", "intl": "^1.2.5", "intl-relativeformat": "^2.0.0", "is-nan": "^1.2.1", diff --git a/yarn.lock b/yarn.lock index 0f895f3b6..5b3df43c2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3608,9 +3608,9 @@ interpret@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" -intersection-observer@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.3.2.tgz#9ed30021c08b29e9e8565c8d512ed84515727433" +intersection-observer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.4.0.tgz#e7c3580be96fc1698170250b500da986c59824fb" intl-format-cache@^2.0.5: version "2.0.5" -- cgit From 50d38d7605b8998463b1428b8da886f33e0714da Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Thu, 27 Jul 2017 22:31:59 +0200 Subject: fix(dropdown_menu): Open as modal on mobile (#4295) * fix(dropdown_menu): Open as modal on mobile * fix(dropdown_menu): Open modal on touch * fix(dropdown_menu): Show status * fix(dropdown_menu): Max dimensions and reduce padding * chore(dropdown_menu): Test new functionality * refactor: Use DropdownMenuContainer instead of DropdownMenu * feat(privacy_dropdown): Open as modal on touch devices * feat(modal_root): Do not load actions-modal async --- .../mastodon/components/dropdown_menu.js | 39 ++++++++++-- .../mastodon/components/status_action_bar.js | 4 +- .../mastodon/containers/dropdown_menu_container.js | 16 +++++ .../features/account/components/action_bar.js | 4 +- .../compose/components/privacy_dropdown.js | 50 +++++++++++---- .../containers/privacy_dropdown_container.js | 7 +++ .../features/status/components/action_bar.js | 4 +- .../features/ui/components/actions_modal.js | 72 ++++++++++++++++++++++ .../mastodon/features/ui/components/modal_root.js | 2 + app/javascript/mastodon/is_mobile.js | 9 +++ app/javascript/styles/components.scss | 62 +++++++++++++++---- spec/javascript/components/dropdown_menu.test.js | 49 ++++++++++++--- 12 files changed, 277 insertions(+), 41 deletions(-) create mode 100644 app/javascript/mastodon/containers/dropdown_menu_container.js create mode 100644 app/javascript/mastodon/features/ui/components/actions_modal.js (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js index 98323b069..8e9e6ab94 100644 --- a/app/javascript/mastodon/components/dropdown_menu.js +++ b/app/javascript/mastodon/components/dropdown_menu.js @@ -1,4 +1,5 @@ import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; import Dropdown, { DropdownTrigger, DropdownContent } from 'react-simple-dropdown'; import PropTypes from 'prop-types'; @@ -9,16 +10,23 @@ export default class DropdownMenu extends React.PureComponent { }; static propTypes = { + isUserTouching: PropTypes.func, + isModalOpen: PropTypes.bool.isRequired, + onModalOpen: PropTypes.func, + onModalClose: PropTypes.func, icon: PropTypes.string.isRequired, items: PropTypes.array.isRequired, size: PropTypes.number.isRequired, direction: PropTypes.string, + status: ImmutablePropTypes.map, ariaLabel: PropTypes.string, disabled: PropTypes.bool, }; static defaultProps = { ariaLabel: 'Menu', + isModalOpen: false, + isUserTouching: () => false, }; state = { @@ -34,6 +42,10 @@ export default class DropdownMenu extends React.PureComponent { const i = Number(e.currentTarget.getAttribute('data-index')); const { action, to } = this.props.items[i]; + if (this.props.isModalOpen) { + this.props.onModalClose(); + } + // Don't call e.preventDefault() when the item uses 'href' property. // ex. "Edit profile" on the account action bar @@ -48,7 +60,17 @@ export default class DropdownMenu extends React.PureComponent { this.dropdown.hide(); } - handleShow = () => this.setState({ expanded: true }) + handleShow = () => { + if (this.props.isUserTouching()) { + this.props.onModalOpen({ + status: this.props.status, + actions: this.props.items, + onClick: this.handleClick, + }); + } else { + this.setState({ expanded: true }); + } + } handleHide = () => this.setState({ expanded: false }) @@ -71,6 +93,7 @@ export default class DropdownMenu extends React.PureComponent { render () { const { icon, items, size, direction, ariaLabel, disabled } = this.props; const { expanded } = this.state; + const isUserTouching = this.props.isUserTouching(); const directionClass = (direction === 'left') ? 'dropdown__left' : 'dropdown__right'; const iconStyle = { fontSize: `${size}px`, width: `${size}px`, lineHeight: `${size}px` }; const iconClassname = `fa fa-fw fa-${icon} dropdown__icon`; @@ -89,15 +112,21 @@ export default class DropdownMenu extends React.PureComponent { ); + // No need to render the actual dropdown if we use the modal. If we + // don't render anything breaks, so we just put an empty div. + const dropdownContent = !isUserTouching ? ( + + {dropdownItems} + + ) :
; + return ( - + - - {dropdownItems} - + {dropdownContent} ); } diff --git a/app/javascript/mastodon/components/status_action_bar.js b/app/javascript/mastodon/components/status_action_bar.js index 4e02e6fad..5c83d626e 100644 --- a/app/javascript/mastodon/components/status_action_bar.js +++ b/app/javascript/mastodon/components/status_action_bar.js @@ -2,7 +2,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import IconButton from './icon_button'; -import DropdownMenu from './dropdown_menu'; +import DropdownMenuContainer from '../containers/dropdown_menu_container'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -156,7 +156,7 @@ export default class StatusActionBar extends ImmutablePureComponent { {shareButton}
- +
); diff --git a/app/javascript/mastodon/containers/dropdown_menu_container.js b/app/javascript/mastodon/containers/dropdown_menu_container.js new file mode 100644 index 000000000..151f25390 --- /dev/null +++ b/app/javascript/mastodon/containers/dropdown_menu_container.js @@ -0,0 +1,16 @@ +import { openModal, closeModal } from '../actions/modal'; +import { connect } from 'react-redux'; +import DropdownMenu from '../components/dropdown_menu'; +import { isUserTouching } from '../is_mobile'; + +const mapStateToProps = state => ({ + isModalOpen: state.get('modal').modalType === 'ACTIONS', +}); + +const mapDispatchToProps = dispatch => ({ + isUserTouching, + onModalOpen: props => dispatch(openModal('ACTIONS', props)), + onModalClose: () => dispatch(closeModal()), +}); + +export default connect(mapStateToProps, mapDispatchToProps)(DropdownMenu); diff --git a/app/javascript/mastodon/features/account/components/action_bar.js b/app/javascript/mastodon/features/account/components/action_bar.js index b8df724c6..b773045fb 100644 --- a/app/javascript/mastodon/features/account/components/action_bar.js +++ b/app/javascript/mastodon/features/account/components/action_bar.js @@ -1,7 +1,7 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; -import DropdownMenu from '../../../components/dropdown_menu'; +import DropdownMenuContainer from '../../../containers/dropdown_menu_container'; import Link from 'react-router-dom/Link'; import { defineMessages, injectIntl, FormattedMessage, FormattedNumber } from 'react-intl'; @@ -96,7 +96,7 @@ export default class ActionBar extends React.PureComponent {
- +
diff --git a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js index 9524f7501..33ce7db46 100644 --- a/app/javascript/mastodon/features/compose/components/privacy_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/privacy_dropdown.js @@ -24,6 +24,10 @@ const iconStyle = { export default class PrivacyDropdown extends React.PureComponent { static propTypes = { + isUserTouching: PropTypes.func, + isModalOpen: PropTypes.bool.isRequired, + onModalOpen: PropTypes.func, + onModalClose: PropTypes.func, value: PropTypes.string.isRequired, onChange: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, @@ -34,7 +38,25 @@ export default class PrivacyDropdown extends React.PureComponent { }; handleToggle = () => { - this.setState({ open: !this.state.open }); + if (this.props.isUserTouching()) { + if (this.state.open) { + this.props.onModalClose(); + } else { + this.props.onModalOpen({ + actions: this.options.map(option => ({ ...option, active: option.value === this.props.value })), + onClick: this.handleModalActionClick, + }); + } + } else { + this.setState({ open: !this.state.open }); + } + } + + handleModalActionClick = (e) => { + e.preventDefault(); + const { value } = this.options[e.currentTarget.getAttribute('data-index')]; + this.props.onModalClose(); + this.props.onChange(value); } handleClick = (e) => { @@ -50,6 +72,17 @@ export default class PrivacyDropdown extends React.PureComponent { } } + componentWillMount () { + const { intl: { formatMessage } } = this.props; + + this.options = [ + { icon: 'globe', value: 'public', text: formatMessage(messages.public_short), meta: formatMessage(messages.public_long) }, + { icon: 'unlock-alt', value: 'unlisted', text: formatMessage(messages.unlisted_short), meta: formatMessage(messages.unlisted_long) }, + { icon: 'lock', value: 'private', text: formatMessage(messages.private_short), meta: formatMessage(messages.private_long) }, + { icon: 'envelope', value: 'direct', text: formatMessage(messages.direct_short), meta: formatMessage(messages.direct_long) }, + ]; + } + componentDidMount () { window.addEventListener('click', this.onGlobalClick); window.addEventListener('touchstart', this.onGlobalClick); @@ -68,25 +101,18 @@ export default class PrivacyDropdown extends React.PureComponent { const { value, intl } = this.props; const { open } = this.state; - const options = [ - { icon: 'globe', value: 'public', shortText: intl.formatMessage(messages.public_short), longText: intl.formatMessage(messages.public_long) }, - { icon: 'unlock-alt', value: 'unlisted', shortText: intl.formatMessage(messages.unlisted_short), longText: intl.formatMessage(messages.unlisted_long) }, - { icon: 'lock', value: 'private', shortText: intl.formatMessage(messages.private_short), longText: intl.formatMessage(messages.private_long) }, - { icon: 'envelope', value: 'direct', shortText: intl.formatMessage(messages.direct_short), longText: intl.formatMessage(messages.direct_long) }, - ]; - - const valueOption = options.find(item => item.value === value); + const valueOption = this.options.find(item => item.value === value); return (
- {open && options.map(item => + {open && this.options.map(item =>
- {item.shortText} - {item.longText} + {item.text} + {item.meta}
)} diff --git a/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js b/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js index 9c05e054e..0ddf531d3 100644 --- a/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js +++ b/app/javascript/mastodon/features/compose/containers/privacy_dropdown_container.js @@ -1,8 +1,11 @@ import { connect } from 'react-redux'; import PrivacyDropdown from '../components/privacy_dropdown'; import { changeComposeVisibility } from '../../../actions/compose'; +import { openModal, closeModal } from '../../../actions/modal'; +import { isUserTouching } from '../../../is_mobile'; const mapStateToProps = state => ({ + isModalOpen: state.get('modal').modalType === 'ACTIONS', value: state.getIn(['compose', 'privacy']), }); @@ -12,6 +15,10 @@ const mapDispatchToProps = dispatch => ({ dispatch(changeComposeVisibility(value)); }, + isUserTouching, + onModalOpen: props => dispatch(openModal('ACTIONS', props)), + onModalClose: () => dispatch(closeModal()), + }); export default connect(mapStateToProps, mapDispatchToProps)(PrivacyDropdown); diff --git a/app/javascript/mastodon/features/status/components/action_bar.js b/app/javascript/mastodon/features/status/components/action_bar.js index 5e150842e..c4d4bb747 100644 --- a/app/javascript/mastodon/features/status/components/action_bar.js +++ b/app/javascript/mastodon/features/status/components/action_bar.js @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import IconButton from '../../../components/icon_button'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import DropdownMenu from '../../../components/dropdown_menu'; +import DropdownMenuContainer from '../../../containers/dropdown_menu_container'; import { defineMessages, injectIntl } from 'react-intl'; const messages = defineMessages({ @@ -84,7 +84,7 @@ export default class ActionBar extends React.PureComponent {
- +
); diff --git a/app/javascript/mastodon/features/ui/components/actions_modal.js b/app/javascript/mastodon/features/ui/components/actions_modal.js new file mode 100644 index 000000000..0fc2560ff --- /dev/null +++ b/app/javascript/mastodon/features/ui/components/actions_modal.js @@ -0,0 +1,72 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import StatusContent from '../../../components/status_content'; +import Avatar from '../../../components/avatar'; +import RelativeTimestamp from '../../../components/relative_timestamp'; +import DisplayName from '../../../components/display_name'; +import IconButton from '../../../components/icon_button'; + +export default class ReportModal extends ImmutablePureComponent { + + static propTypes = { + actions: PropTypes.array, + onClick: PropTypes.func, + intl: PropTypes.object.isRequired, + }; + + renderAction = (action, i) => { + if (action === null) { + return
  • ; + } + + const { icon = null, text, meta = null, active = false, href = '#' } = action; + + return ( +
  • + + {icon && } +
    +
    {text}
    +
    {meta}
    +
    +
    +
  • + ); + } + + render () { + const status = this.props.status && ( +
    + + + +
    + ); + + return ( +
    + {status} + +
      + {this.props.actions.map(this.renderAction)} +
    +
    + ); + } + +} diff --git a/app/javascript/mastodon/features/ui/components/modal_root.js b/app/javascript/mastodon/features/ui/components/modal_root.js index f303088d7..4a917e0a3 100644 --- a/app/javascript/mastodon/features/ui/components/modal_root.js +++ b/app/javascript/mastodon/features/ui/components/modal_root.js @@ -5,6 +5,7 @@ import spring from 'react-motion/lib/spring'; import BundleContainer from '../containers/bundle_container'; import BundleModalError from './bundle_modal_error'; import ModalLoading from './modal_loading'; +import ActionsModal from '../components/actions_modal'; import { MediaModal, OnboardingModal, @@ -21,6 +22,7 @@ const MODAL_COMPONENTS = { 'BOOST': BoostModal, 'CONFIRM': ConfirmationModal, 'REPORT': ReportModal, + 'ACTIONS': () => Promise.resolve({ default: ActionsModal }), }; export default class ModalRoot extends React.PureComponent { diff --git a/app/javascript/mastodon/is_mobile.js b/app/javascript/mastodon/is_mobile.js index 992e63727..e9903d59e 100644 --- a/app/javascript/mastodon/is_mobile.js +++ b/app/javascript/mastodon/is_mobile.js @@ -5,6 +5,15 @@ export function isMobile(width) { }; const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; +let userTouching = false; + +window.addEventListener('touchstart', () => { + userTouching = true; +}, { once: true }); + +export function isUserTouching() { + return userTouching; +} export function isIOS() { return iOS; diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss index a51cd962e..03bc77eb5 100644 --- a/app/javascript/styles/components.scss +++ b/app/javascript/styles/components.scss @@ -214,16 +214,18 @@ } .dropdown--active::after { - content: ""; - display: block; - position: absolute; - width: 0; - height: 0; - border-style: solid; - border-width: 0 4.5px 7.8px; - border-color: transparent transparent $ui-secondary-color; - bottom: 8px; - right: 104px; + @media screen and (min-width: 1025px) { + content: ""; + display: block; + position: absolute; + width: 0; + height: 0; + border-style: solid; + border-width: 0 4.5px 7.8px; + border-color: transparent transparent $ui-secondary-color; + bottom: 8px; + right: 104px; + } } .invisible { @@ -3402,7 +3404,8 @@ button.icon-button.active i.fa-retweet { .boost-modal, .confirmation-modal, -.report-modal { +.report-modal, +.actions-modal { background: lighten($ui-secondary-color, 8%); color: $ui-base-color; border-radius: 8px; @@ -3493,6 +3496,43 @@ button.icon-button.active i.fa-retweet { } } +.actions-modal { + .status { + overflow-y: auto; + max-height: 300px; + } + + max-height: 80vh; + max-width: 80vw; + + ul { + overflow-y: auto; + flex-shrink: 0; + + li:not(:empty) { + a { + color: $ui-base-color; + display: flex; + padding: 10px; + align-items: center; + text-decoration: none; + + &.active { + &, + button { + background: $ui-highlight-color; + color: $primary-text-color; + } + } + + button:first-child { + margin-right: 10px; + } + } + } + } +} + .confirmation-modal__action-bar { .confirmation-modal__cancel-button { background-color: transparent; diff --git a/spec/javascript/components/dropdown_menu.test.js b/spec/javascript/components/dropdown_menu.test.js index 54cdcabf0..a5af730ef 100644 --- a/spec/javascript/components/dropdown_menu.test.js +++ b/spec/javascript/components/dropdown_menu.test.js @@ -5,16 +5,24 @@ import React from 'react'; import DropdownMenu from '../../../app/javascript/mastodon/components/dropdown_menu'; import Dropdown, { DropdownTrigger, DropdownContent } from 'react-simple-dropdown'; +const isTrue = () => true; + describe('', () => { const icon = 'my-icon'; const size = 123; - const action = sinon.spy(); - - const items = [ - { text: 'first item', action: action, href: '/some/url' }, - { text: 'second item', action: 'noop' }, - ]; - const wrapper = shallow(); + let items; + let wrapper; + let action; + + beforeEach(() => { + action = sinon.spy(); + + items = [ + { text: 'first item', action: action, href: '/some/url' }, + { text: 'second item', action: 'noop' }, + ]; + wrapper = shallow(); + }); it('contains one ', () => { expect(wrapper).to.have.exactly(1).descendants(Dropdown); @@ -28,6 +36,16 @@ describe('', () => { expect(wrapper.find(Dropdown)).to.have.exactly(1).descendants(DropdownContent); }); + it('does not contain a if isUserTouching', () => { + const touchingWrapper = shallow(); + expect(touchingWrapper.find(Dropdown)).to.have.exactly(0).descendants(DropdownContent); + }); + + it('does not contain a if isUserTouching', () => { + const touchingWrapper = shallow(); + expect(touchingWrapper.find(Dropdown)).to.have.exactly(0).descendants(DropdownContent); + }); + it('uses props.size for style values', () => { ['font-size', 'width', 'line-height'].map((property) => { expect(wrapper.find(DropdownTrigger)).to.have.style(property, `${size}px`); @@ -53,6 +71,23 @@ describe('', () => { expect(wrapper.state('expanded')).to.be.equal(true); }); + it('calls onModalOpen when clicking the trigger if isUserTouching', () => { + const onModalOpen = sinon.spy(); + const touchingWrapper = mount(); + touchingWrapper.find(DropdownTrigger).first().simulate('click'); + expect(onModalOpen.calledOnce).to.be.equal(true); + expect(onModalOpen.args[0][0]).to.be.deep.equal({ status: 3.14, actions: items, onClick: touchingWrapper.node.handleClick }); + }); + + it('calls onModalClose when clicking an action if isUserTouching and isModalOpen', () => { + const onModalOpen = sinon.spy(); + const onModalClose = sinon.spy(); + const touchingWrapper = mount(); + touchingWrapper.find(DropdownTrigger).first().simulate('click'); + touchingWrapper.node.handleClick({ currentTarget: { getAttribute: () => '0' }, preventDefault: () => null }); + expect(onModalClose.calledOnce).to.be.equal(true); + }); + // Error: ReactWrapper::state() can only be called on the root /*it('sets expanded to false when clicking outside', () => { const wrapper = mount(( -- cgit From f9075577e4929ec796339331408d857015411ebd Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Thu, 27 Jul 2017 23:01:50 +0200 Subject: fix(actions_modal): Warning about missing prop (#4406) --- app/javascript/mastodon/features/ui/components/actions_modal.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/ui/components/actions_modal.js b/app/javascript/mastodon/features/ui/components/actions_modal.js index 0fc2560ff..a7b7357b6 100644 --- a/app/javascript/mastodon/features/ui/components/actions_modal.js +++ b/app/javascript/mastodon/features/ui/components/actions_modal.js @@ -7,12 +7,11 @@ import RelativeTimestamp from '../../../components/relative_timestamp'; import DisplayName from '../../../components/display_name'; import IconButton from '../../../components/icon_button'; -export default class ReportModal extends ImmutablePureComponent { +export default class ActionsModal extends ImmutablePureComponent { static propTypes = { actions: PropTypes.array, onClick: PropTypes.func, - intl: PropTypes.object.isRequired, }; renderAction = (action, i) => { -- cgit From 6884dd79ba8909e17cc6d48e658775fcf7f87890 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Fri, 28 Jul 2017 00:54:48 +0200 Subject: Improve accessibility (part 3) (#4405) * fix(compose): Add aria-label for the navigation links * fix(search): Add input label * fix(navigation_bar): Link description * fix(autosuggest_textarea): Add input label * fix(compose_form): Add input label * fix(upload_button): Add input label * fix(account/header): Add link content * fix(column_header): Use h1 tag * fix(column_header): Labels move buttons moving column * fix(settings_text): Add label to input * fix(column_header): Remove role from h1 * fix(modal_root): Use role=dialog * fix(modal_root): Focus restauration * fix(modal_root): Apply inert to sibligs * fix(column_header): Add role=button * chore(eslint): Disable jsx-a11y/label-has-for --- .eslintrc.yml | 2 +- .../mastodon/components/autosuggest_textarea.js | 31 ++++++++++++---------- .../mastodon/components/column_header.js | 10 ++++--- app/javascript/mastodon/components/setting_text.js | 15 ++++++----- .../mastodon/features/account/components/header.js | 7 +++-- .../features/compose/components/compose_form.js | 5 +++- .../features/compose/components/navigation_bar.js | 1 + .../mastodon/features/compose/components/search.js | 21 ++++++++------- .../features/compose/components/upload_button.js | 23 +++++++++------- app/javascript/mastodon/features/compose/index.js | 14 +++++----- .../mastodon/features/ui/components/modal_root.js | 28 +++++++++++++++++-- app/javascript/mastodon/locales/ar.json | 2 ++ app/javascript/mastodon/locales/bg.json | 2 ++ app/javascript/mastodon/locales/ca.json | 2 ++ app/javascript/mastodon/locales/de.json | 2 ++ .../mastodon/locales/defaultMessages.json | 8 ++++++ app/javascript/mastodon/locales/en.json | 2 ++ app/javascript/mastodon/locales/eo.json | 2 ++ app/javascript/mastodon/locales/es.json | 2 ++ app/javascript/mastodon/locales/fa.json | 2 ++ app/javascript/mastodon/locales/fi.json | 2 ++ app/javascript/mastodon/locales/fr.json | 2 ++ app/javascript/mastodon/locales/he.json | 2 ++ app/javascript/mastodon/locales/hr.json | 2 ++ app/javascript/mastodon/locales/hu.json | 2 ++ app/javascript/mastodon/locales/id.json | 2 ++ app/javascript/mastodon/locales/io.json | 2 ++ app/javascript/mastodon/locales/it.json | 2 ++ app/javascript/mastodon/locales/ja.json | 2 ++ app/javascript/mastodon/locales/ko.json | 2 ++ app/javascript/mastodon/locales/nl.json | 2 ++ app/javascript/mastodon/locales/no.json | 2 ++ app/javascript/mastodon/locales/oc.json | 2 ++ app/javascript/mastodon/locales/pl.json | 2 ++ app/javascript/mastodon/locales/pt-BR.json | 2 ++ app/javascript/mastodon/locales/pt.json | 2 ++ app/javascript/mastodon/locales/ru.json | 2 ++ app/javascript/mastodon/locales/th.json | 2 ++ app/javascript/mastodon/locales/tr.json | 2 ++ app/javascript/mastodon/locales/uk.json | 2 ++ app/javascript/mastodon/locales/zh-CN.json | 2 ++ app/javascript/mastodon/locales/zh-HK.json | 2 ++ app/javascript/mastodon/locales/zh-TW.json | 2 ++ 43 files changed, 171 insertions(+), 56 deletions(-) (limited to 'app/javascript') diff --git a/.eslintrc.yml b/.eslintrc.yml index a816bffef..2c264351e 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -112,7 +112,7 @@ rules: jsx-a11y/iframe-has-title: warn jsx-a11y/img-has-alt: warn jsx-a11y/img-redundant-alt: warn - jsx-a11y/label-has-for: warn + jsx-a11y/label-has-for: off jsx-a11y/mouse-events-have-key-events: warn jsx-a11y/no-access-key: warn jsx-a11y/no-distracting-elements: warn diff --git a/app/javascript/mastodon/components/autosuggest_textarea.js b/app/javascript/mastodon/components/autosuggest_textarea.js index fa41e59e1..35b37600f 100644 --- a/app/javascript/mastodon/components/autosuggest_textarea.js +++ b/app/javascript/mastodon/components/autosuggest_textarea.js @@ -162,20 +162,23 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { return (
    -