From 9891ff80f9679ed3dfdd6e8352abfb661f321a00 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Wed, 26 Jul 2017 04:31:56 +0900 Subject: [PATCH 01/94] 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(-) diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 8aa5d8eb49..5a4bcef612 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 { From 7062cb764fe450981b4a8b482b01f85fed1914a0 Mon Sep 17 00:00:00 2001 From: m4sk1n Date: Tue, 25 Jul 2017 23:56:04 +0200 Subject: [PATCH 02/94] i18n: Update Polish translation (#4367) --- app/javascript/mastodon/locales/pl.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index af069b6d72..29e6ca4717 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", From 4115043dc7be6e5cc8a5bb2e95ef97d391111611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Wed, 26 Jul 2017 02:00:36 +0200 Subject: [PATCH 03/94] Added external link icons to joinmastodon navbar buttons (#4368) --- app/views/about/more.html.haml | 5 ++++- app/views/about/show.html.haml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/views/about/more.html.haml b/app/views/about/more.html.haml index 11315fefaa..6342c72481 100644 --- a/app/views/about/more.html.haml +++ b/app/views/about/more.html.haml @@ -29,7 +29,10 @@ - else = link_to t('auth.login'), new_user_session_path, class: 'webapp-btn' %li= link_to t('about.about_this'), about_more_path - %li= link_to t('about.other_instances'), 'https://joinmastodon.org/' + %li + = link_to 'https://joinmastodon.org/' do + = "#{t('about.other_instances')}" + %i.fa.fa-external-link{ style: 'padding-left: 5px;' } .container.hero .heading diff --git a/app/views/about/show.html.haml b/app/views/about/show.html.haml index a3c8e4a84a..d0c9a66506 100644 --- a/app/views/about/show.html.haml +++ b/app/views/about/show.html.haml @@ -33,7 +33,10 @@ - else = link_to t('auth.login'), new_user_session_path, class: 'webapp-btn' %li= link_to t('about.about_this'), about_more_path - %li= link_to t('about.other_instances'), 'https://joinmastodon.org/' + %li + = link_to 'https://joinmastodon.org/' do + = "#{t('about.other_instances')}" + %i.fa.fa-external-link{ style: 'padding-left: 5px;' } .container.hero .floats From 2f8bfb3d387e1c187f90c9dbbaaa011447269213 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 02:01:27 +0200 Subject: [PATCH 04/94] 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 +++++++-- .../mastodon/features/compose/index.js | 18 ++++++------ .../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(-) diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 5b2a4d84c4..89e2f91896 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 e3cf2d33b6..b3f410f3b6 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 baec86d0d5..4d488f82d6 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 7f27d78cd3..8ce254bde8 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 68aaf56b0e..e3db1c7e18 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 6fdcde4b44..2bb51653f4 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 f911c7b75e..eb67b5a067 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 047a89ebbb..89538f8c38 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 3a201b9c11..816ce68aec 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 0bb5159c8c..a9a6ad150e 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 a39b608c69..a3c2cae3ad 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 6842558d99..cb918d4145 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 efc9b1053a..0ad2c5bb96 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 3cc1f152aa..9ae9b2d391 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 36be0842be..eb3c5d9da8 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 363c4c490e..099f3a7ae2 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 d43570f0d3..c2d6dd6724 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 916f313bb0..7c9e758922 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 a87cc93286..e961a8c39c 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 243ed7344a..b7d2c1d8c1 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 ca36122f7f..8e0f9f4fad 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 768efa37d3..817e53718f 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 fbfabc5d14..70be3275bc 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 8727f61471..e74ffb3fbc 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 c39d573332..21e434ead8 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 29e6ca4717..60689372ef 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 86da7c4e67..ac3675909f 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 86da7c4e67..ac3675909f 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 16af3fe7e7..e9bddf9189 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 be5c0815df..e41f4193cd 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 9d4d5fa17e..aafa6739c7 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 60a551bb62..3f496d9535 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 97f1f5e275..e27061d959 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 c65c3d45cc..1ce4153bf9 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 12e840b169..6b13104631 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": "不消音對話", From 7bf0afb1dc5cb3d91f568f974b330cafa2922c2a Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Wed, 26 Jul 2017 10:35:25 +0900 Subject: [PATCH 05/94] Add index favourites on account_id and id (#4360) --- ...70720000000_add_index_favourites_on_account_id_and_id.rb | 6 ++++++ db/schema.rb | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb diff --git a/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb b/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb new file mode 100644 index 0000000000..99903584c9 --- /dev/null +++ b/db/migrate/20170720000000_add_index_favourites_on_account_id_and_id.rb @@ -0,0 +1,6 @@ +class AddIndexFavouritesOnAccountIdAndId < ActiveRecord::Migration[5.1] + def change + # Used to query favourites of an account ordered by id. + add_index :favourites, [:account_id, :id] + end +end diff --git a/db/schema.rb b/db/schema.rb index cf7b0722fc..2501e451d0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170718211102) do +ActiveRecord::Schema.define(version: 20170720000000) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -103,6 +103,7 @@ ActiveRecord::Schema.define(version: 20170718211102) do t.integer "status_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["account_id", "id"], name: "index_favourites_on_account_id_and_id" t.index ["account_id", "status_id"], name: "index_favourites_on_account_id_and_status_id", unique: true t.index ["status_id"], name: "index_favourites_on_status_id" end From 7874c6d630ddd54b08e96b67831a5eb2352bd7b1 Mon Sep 17 00:00:00 2001 From: m4sk1n Date: Wed, 26 Jul 2017 09:09:16 +0200 Subject: [PATCH 06/94] i18n: Update Polish translation (#4371) --- app/javascript/mastodon/locales/pl.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/locales/pl.json b/app/javascript/mastodon/locales/pl.json index 60689372ef..a24c920f46 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", From aa8fa71df6c57297ea859d3deca5794612d4d281 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Wed, 26 Jul 2017 20:45:49 +0900 Subject: [PATCH 07/94] 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(+) diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 5a4bcef612..9be95c0281 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 { From 6a6a62f13fd7846ba032543635580980b74ea14c Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 13:46:53 +0200 Subject: [PATCH 08/94] 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 +++-- .../components/column_settings.js | 56 +++++++++++-------- .../mastodon/features/ui/components/column.js | 12 ++-- .../features/ui/components/column_header.js | 5 +- .../features/ui/components/column_link.js | 6 +- .../features/ui/components/column_loading.js | 2 +- app/javascript/styles/components.scss | 12 ---- 7 files changed, 53 insertions(+), 53 deletions(-) diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 89e2f91896..d3256fbec8 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 31cac5bc7a..88a29d4d31 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 ce1dca171e..2d46264a21 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 cbdb6534fd..ad7ec9318d 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 7ecfaf77a5..1c4058926c 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 8de456754b..a51cd962e3 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; From 7905739c2a2bd1df0e128a4f9867704c4f2d0262 Mon Sep 17 00:00:00 2001 From: m4sk1n Date: Wed, 26 Jul 2017 13:47:41 +0200 Subject: [PATCH 09/94] s/PubSubHubbub/WebSub/g (#4372) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Mikołajczak --- README.md | 4 ++-- config/locales/ca.yml | 2 +- config/locales/de.yml | 2 +- config/locales/en.yml | 2 +- config/locales/fa.yml | 2 +- config/locales/fr.yml | 2 +- config/locales/he.yml | 2 +- config/locales/id.yml | 2 +- config/locales/io.yml | 2 +- config/locales/ja.yml | 2 +- config/locales/ko.yml | 2 +- config/locales/nl.yml | 2 +- config/locales/no.yml | 2 +- config/locales/oc.yml | 2 +- config/locales/pl.yml | 2 +- config/locales/pt-BR.yml | 2 +- config/locales/pt.yml | 2 +- config/locales/ru.yml | 2 +- config/locales/th.yml | 2 +- config/locales/tr.yml | 2 +- config/locales/uk.yml | 2 +- config/locales/zh-CN.yml | 2 +- config/locales/zh-TW.yml | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index dd7c519a88..13e580e3fb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Mastodon is a free, open-source social network server. A decentralized solution to commercial platforms, it avoids the risks of a single company monopolizing your communication. Anyone can run Mastodon and participate in the social network seamlessly. -An alternative implementation of the GNU social project. Based on [ActivityStreams](https://en.wikipedia.org/wiki/Activity_Streams_(format)), [Webfinger](https://en.wikipedia.org/wiki/WebFinger), [PubsubHubbub](https://en.wikipedia.org/wiki/PubSubHubbub) and [Salmon](https://en.wikipedia.org/wiki/Salmon_(protocol)). +An alternative implementation of the GNU social project. Based on [ActivityStreams](https://en.wikipedia.org/wiki/Activity_Streams_(format)), [Webfinger](https://en.wikipedia.org/wiki/WebFinger), [WebSub](https://en.wikipedia.org/wiki/WebSub) and [Salmon](https://en.wikipedia.org/wiki/Salmon_(protocol)). Click on the screenshot to watch a demo of the UI: @@ -34,7 +34,7 @@ If you would like, you can [support the development of this project on Patreon][ ## Features - **Fully interoperable with GNU social and any OStatus platform** - Whatever implements Atom feeds, ActivityStreams, Salmon, PubSubHubbub and Webfinger is part of the network + Whatever implements Atom feeds, ActivityStreams, Salmon, WebSub and Webfinger is part of the network - **Real-time timeline updates** See the updates of people you're following appear in real-time in the UI via WebSockets - **Federated thread resolving** diff --git a/config/locales/ca.yml b/config/locales/ca.yml index ce4831ac2b..725b120ec3 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -161,7 +161,7 @@ ca: confirmed: Confirmat expires_in: Expira en last_delivery: Últim lliurament - title: PubSubHubbub + title: WebSub topic: Tòpic title: Administració application_mailer: diff --git a/config/locales/de.yml b/config/locales/de.yml index 04d3fd0b89..87c5fa67a0 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -144,7 +144,7 @@ de: confirmed: Bestätigt expires_in: Verfällt in last_delivery: Letzte Zustellung - title: PubSubHubbub + title: WebSub topic: Thema title: Administration application_mailer: diff --git a/config/locales/en.yml b/config/locales/en.yml index 8fa1ac0e38..cb4c51a116 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -207,7 +207,7 @@ en: confirmed: Confirmed expires_in: Expires in last_delivery: Last delivery - title: PubSubHubbub + title: WebSub topic: Topic title: Administration admin_mailer: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index c42016eb3e..23d2512a21 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -147,7 +147,7 @@ fa: confirmed: تأییدشده expires_in: مهلت انقضا last_delivery: آخرین ارسال - title: PubSubHubbub + title: WebSub topic: موضوع title: مدیریت application_mailer: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 13514bfc3e..7fde60a2be 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -200,7 +200,7 @@ fr: confirmed: Confirmé expires_in: Expire dans last_delivery: Dernière livraison - title: PubSubHubbub + title: WebSub topic: Sujet title: Administration admin_mailer: diff --git a/config/locales/he.yml b/config/locales/he.yml index dc6caf87ac..7772e6a76e 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -155,7 +155,7 @@ he: confirmed: מאושר expires_in: פג תוקף ב- last_delivery: משלוח אחרון - title: PubSubHubbub + title: WebSub topic: נושא title: ניהול application_mailer: diff --git a/config/locales/id.yml b/config/locales/id.yml index e0e82d378e..0d5937cfbb 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -146,7 +146,7 @@ id: confirmed: Dikonfirmasi expires_in: Kadaluarsa dalam last_delivery: Terakhir dikirim - title: PubSubHubbub + title: WebSub topic: Topik title: Administrasi application_mailer: diff --git a/config/locales/io.yml b/config/locales/io.yml index 4f7323a6f2..c9abd57110 100644 --- a/config/locales/io.yml +++ b/config/locales/io.yml @@ -144,7 +144,7 @@ io: confirmed: Confirmed expires_in: Expires in last_delivery: Last delivery - title: PubSubHubbub + title: WebSub topic: Topic title: Administration application_mailer: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 6763ed301a..74e0df982a 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -200,7 +200,7 @@ ja: confirmed: 確認済み expires_in: 期限 last_delivery: 最終配送 - title: PubSubHubbub + title: WebSub topic: トピック title: 管理 admin_mailer: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index a081de38da..aae0e62e72 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -161,7 +161,7 @@ ko: confirmed: 확인됨 expires_in: 기한 last_delivery: 최종 발송 - title: PubSubHubbub + title: WebSub topic: 토픽 title: 관리 admin_mailer: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 58282259d1..e65658d8b6 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -206,7 +206,7 @@ nl: confirmed: Bevestigd expires_in: Verloopt over last_delivery: Laatste bezorging - title: PubSubHubbub + title: WebSub topic: Account title: Beheer admin_mailer: diff --git a/config/locales/no.yml b/config/locales/no.yml index 122ad56758..b2e5773de0 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -148,7 +148,7 @@ confirmed: Bekreftet expires_in: Utløper om last_delivery: Siste levering - title: PubSubHubbub + title: WebSub topic: Emne title: Administrasjon application_mailer: diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 6d9996dbcc..c1ec633f6a 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -180,7 +180,7 @@ oc: confirmed: Confirmat expires_in: S’acaba dins last_delivery: Darrièra distribucion - title: PubSubHubbub + title: WebSub topic: Subjècte title: Administracion application_mailer: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 02c97e955d..584c077309 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -205,7 +205,7 @@ pl: confirmed: Potwierdzono expires_in: Wygasa last_delivery: Ostatnio doręczono - title: PubSubHubbub + title: WebSub topic: Temat title: Administracja admin_mailer: diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 9bd1b0d282..68b1c549ce 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -147,7 +147,7 @@ pt-BR: confirmed: Confirmado expires_in: Expira em last_delivery: Última entrega - title: PubSubHubbub + title: WebSub topic: Tópico title: Administração application_mailer: diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 6bf592d1cb..f6dd322005 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -142,7 +142,7 @@ pt: confirmed: Confirmado expires_in: Expira em last_delivery: Última entrega - title: PubSubHubbub + title: WebSub topic: Tópico title: Administração application_mailer: diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 141017f40f..90276c3623 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -138,7 +138,7 @@ ru: confirmed: Подтверждено expires_in: Истекает через last_delivery: Последняя доставка - title: PubSubHubbub + title: WebSub topic: Тема title: Администрирование application_mailer: diff --git a/config/locales/th.yml b/config/locales/th.yml index 89782209e7..801f4886fa 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -148,7 +148,7 @@ th: confirmed: ยืนยัน expires_in: หมดอายุภายใน last_delivery: จัดส่งครั้งล่าสุด - title: PubSubHubbub + title: WebSub topic: ชื่อเรื่อง title: แอดมิน application_mailer: diff --git a/config/locales/tr.yml b/config/locales/tr.yml index a1f2d2078a..ac378090c7 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -147,7 +147,7 @@ tr: confirmed: Onaylandı expires_in: Bitiş Tarihi last_delivery: Son gönderim - title: PubSubHubbub + title: WebSub topic: Konu title: Yönetim application_mailer: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 3237ea1db7..22fff6961d 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -138,7 +138,7 @@ uk: confirmed: Підтверджено expires_in: Спливає через last_delivery: Остання доставка - title: PubSubHubbub + title: WebSub topic: Тема title: Адміністрування application_mailer: diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index 0b02632945..5018b48b80 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -154,7 +154,7 @@ zh-CN: confirmed: 确定 expires_in: 期限 last_delivery: 数据最后送抵时间 - title: PubSubHubbub 订阅 + title: WebSub 订阅 topic: 所订阅资源 title: 管理 application_mailer: diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index e25edc8905..0ea3457c7e 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -118,7 +118,7 @@ zh-TW: confirmed: 已確認 expires_in: 期限 last_delivery: 最後遞送 - title: PubSubHubbub + title: WebSub topic: 主題 title: 管理介面 application_mailer: From 4ba33f99fc9d903b3b6b836ea86051c407eb4b0a Mon Sep 17 00:00:00 2001 From: mayaeh Date: Wed, 26 Jul 2017 21:57:51 +0900 Subject: [PATCH 10/94] 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(-) diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 8e0f9f4fad..f01838be24 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": "会話のミュートを解除", From b8adb4d7fa6546f415d93d0af8e1d7b0e24a3f54 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 15:03:23 +0200 Subject: [PATCH 11/94] fix(column): Crash when heading is undefined (#4378) --- app/javascript/mastodon/features/ui/components/column.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/ui/components/column.js b/app/javascript/mastodon/features/ui/components/column.js index 2d46264a21..aea102aac5 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 && ( From 8b43d6bf9c3c85b093ae9581d7400776aaa97322 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 16:14:39 +0200 Subject: [PATCH 12/94] fix(web_push_notification_worker): Guard against deleted notifications (#4379) --- app/workers/web_push_notification_worker.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/workers/web_push_notification_worker.rb b/app/workers/web_push_notification_worker.rb index da4043ddbd..51b8daae7c 100644 --- a/app/workers/web_push_notification_worker.rb +++ b/app/workers/web_push_notification_worker.rb @@ -9,6 +9,8 @@ class WebPushNotificationWorker session_activation = SessionActivation.find(session_activation_id) notification = Notification.find(notification_id) + return if session_activation.nil? || notification.nil? + begin session_activation.web_push_subscription.push(notification) rescue Webpush::InvalidSubscription, Webpush::ExpiredSubscription => e From a248be4fcedc2908e4fc073ccea3ee3185264417 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Wed, 26 Jul 2017 19:03:56 +0200 Subject: [PATCH 13/94] fix(columns_area): Manually set tabs style when swiping (#4320) --- .../mastodon/features/ui/components/columns_area.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js index 7de66ce3f9..63bd1b0212 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 = () => { From 55bee84c97fd662375907520c56fe3a661458e15 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 26 Jul 2017 23:35:03 +0200 Subject: [PATCH 14/94] Fix infinite scroll fluidity (#4381) --- app/javascript/mastodon/components/status_list.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/mastodon/components/status_list.js b/app/javascript/mastodon/components/status_list.js index dc6f956bff..48858cf132 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, }); From 92cb451da80051f242fe1fce32421f89841f4adc Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 26 Jul 2017 23:36:33 +0200 Subject: [PATCH 15/94] Fix #4026 - Accept backup codes for disabling 2FA (#4382) --- .../settings/two_factor_authentications_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/settings/two_factor_authentications_controller.rb b/app/controllers/settings/two_factor_authentications_controller.rb index 9834838817..863cc7351b 100644 --- a/app/controllers/settings/two_factor_authentications_controller.rb +++ b/app/controllers/settings/two_factor_authentications_controller.rb @@ -18,7 +18,7 @@ module Settings end def destroy - if current_user.validate_and_consume_otp!(confirmation_params[:code]) + if acceptable_code? current_user.otp_required_for_login = false current_user.save! redirect_to settings_two_factor_authentication_path @@ -38,5 +38,10 @@ module Settings def verify_otp_required redirect_to settings_two_factor_authentication_path if current_user.otp_required_for_login? end + + def acceptable_code? + current_user.validate_and_consume_otp!(confirmation_params[:code]) || + current_user.invalidate_otp_backup_code!(confirmation_params[:code]) + end end end From f5e228ad2e2503d7cbe3da975e7d2b473e60712b Mon Sep 17 00:00:00 2001 From: Jeroen Date: Thu, 27 Jul 2017 00:37:35 +0200 Subject: [PATCH 16/94] Update Dutch strings (#4389) --- app/javascript/mastodon/locales/nl.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/locales/nl.json b/app/javascript/mastodon/locales/nl.json index 70be3275bc..d79b0799a1 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", From 994d948c3947b75140c2a2a7de5b81713c7b8ea3 Mon Sep 17 00:00:00 2001 From: Clworld Date: Thu, 27 Jul 2017 07:38:20 +0900 Subject: [PATCH 17/94] Add callback_url/acct information for Sidekiq PuSH workers Exception. (#4281) * Add destination informations to exception on SubscribeWorker and DeliveryWorker. * Simplify delivery error message. * Prevent changing Exception type... * fix typo. --- app/lib/exceptions.rb | 10 +++++----- app/workers/pubsubhubbub/delivery_worker.rb | 2 ++ app/workers/pubsubhubbub/subscribe_worker.rb | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/lib/exceptions.rb b/app/lib/exceptions.rb index 34d84a34f9..b2489711da 100644 --- a/app/lib/exceptions.rb +++ b/app/lib/exceptions.rb @@ -8,11 +8,11 @@ module Mastodon class UnexpectedResponseError < Error def initialize(response = nil) - @response = response - end - - def to_s - "#{@response.uri} returned code #{@response.code}" + if response.respond_to? :uri + super("#{response.uri} returned code #{response.code}") + else + super + end end end end diff --git a/app/workers/pubsubhubbub/delivery_worker.rb b/app/workers/pubsubhubbub/delivery_worker.rb index 035a590481..88645cf338 100644 --- a/app/workers/pubsubhubbub/delivery_worker.rb +++ b/app/workers/pubsubhubbub/delivery_worker.rb @@ -16,6 +16,8 @@ class Pubsubhubbub::DeliveryWorker @subscription = Subscription.find(subscription_id) @payload = payload process_delivery unless blocked_domain? + rescue => e + raise e.class, "Delivery failed for #{subscription&.callback_url}: #{e.message}" end private diff --git a/app/workers/pubsubhubbub/subscribe_worker.rb b/app/workers/pubsubhubbub/subscribe_worker.rb index 6865e71360..9178079d4e 100644 --- a/app/workers/pubsubhubbub/subscribe_worker.rb +++ b/app/workers/pubsubhubbub/subscribe_worker.rb @@ -22,5 +22,7 @@ class Pubsubhubbub::SubscribeWorker account = Account.find(account_id) logger.debug "PuSH re-subscribing to #{account.acct}" ::SubscribeService.new.call(account) + rescue => e + raise e.class, "Subscribe failed for #{account&.acct}: #{e.message}" end end From f49339ca9ca2fbc7feca30be217ed2311ebd106a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Thu, 27 Jul 2017 01:02:15 +0200 Subject: [PATCH 18/94] Fix multipoint shortcode bug (#4387) * Fix multipoint shortcode bug * Added testcase for composite emoji shortcode --- app/lib/emoji.rb | 2 +- spec/helpers/emoji_helper_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/lib/emoji.rb b/app/lib/emoji.rb index e444b68937..6de70e9b41 100644 --- a/app/lib/emoji.rb +++ b/app/lib/emoji.rb @@ -32,7 +32,7 @@ class Emoji def codepoint_to_unicode(codepoint) if codepoint.include?('-') - codepoint.split('-').map(&:hex).pack('U') + codepoint.split('-').map(&:hex).pack('U*') else [codepoint.hex].pack('U') end diff --git a/spec/helpers/emoji_helper_spec.rb b/spec/helpers/emoji_helper_spec.rb index 1eedfb7194..6edf7672f7 100644 --- a/spec/helpers/emoji_helper_spec.rb +++ b/spec/helpers/emoji_helper_spec.rb @@ -7,6 +7,11 @@ RSpec.describe EmojiHelper, type: :helper do expect(emojify(text)).to eq '📖 Book' end + it 'converts composite emoji shortcodes to unicode' do + text = ':couple_ww:' + expect(emojify(text)).to eq '👩❤👩' + end + it 'does not convert shortcodes that are part of a string into unicode' do text = ':see_no_evil::hear_no_evil::speak_no_evil:' expect(emojify(text)).to eq text From 6654c3003351e3ee77977a9ff6e161a10b3d5afc Mon Sep 17 00:00:00 2001 From: nullkal Date: Thu, 27 Jul 2017 22:11:59 +0900 Subject: [PATCH 19/94] Fix an error when a user tries to search nonexistent remote user (regression from #4275) (#4400) --- app/services/account_search_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/account_search_service.rb b/app/services/account_search_service.rb index c266494f00..b0c663d020 100644 --- a/app/services/account_search_service.rb +++ b/app/services/account_search_service.rb @@ -18,7 +18,7 @@ class AccountSearchService < BaseService return [] if query_blank_or_hashtag? || limit < 1 if resolving_non_matching_remote_account? - [ResolveRemoteAccountService.new.call("#{query_username}@#{query_domain}")] + [ResolveRemoteAccountService.new.call("#{query_username}@#{query_domain}")].compact else search_results_and_exact_match.compact.uniq.slice(0, limit) end From 97a48f237dc0c283913adfe023774358fdfc9d45 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 27 Jul 2017 22:12:51 +0900 Subject: [PATCH 20/94] Add default settings for user (#4393) --- config/settings.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/settings.yml b/config/settings.yml index d239fb6a65..2ab91a102f 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -17,9 +17,11 @@ defaults: &defaults closed_registrations_message: '' open_deletion: true timeline_preview: true + default_sensitive: false + unfollow_modal: false boost_modal: false - auto_play_gif: false delete_modal: true + auto_play_gif: false system_font_ui: false noindex: false notification_emails: From bdf573d1403ff5aa662b430dbc353fd757bdaada Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 27 Jul 2017 22:13:10 +0900 Subject: [PATCH 21/94] Remove redundant fabrication in the spec for Api::V1::FavouritesController (#4391) --- spec/controllers/api/v1/favourites_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/api/v1/favourites_controller_spec.rb b/spec/controllers/api/v1/favourites_controller_spec.rb index 062e91adcc..17e1ec31c9 100644 --- a/spec/controllers/api/v1/favourites_controller_spec.rb +++ b/spec/controllers/api/v1/favourites_controller_spec.rb @@ -3,7 +3,7 @@ require 'rails_helper' RSpec.describe Api::V1::FavouritesController, type: :controller do render_views - let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } + let(:user) { Fabricate(:user) } let(:token) { double acceptable?: true, resource_owner_id: user.id } before do From 5bf4838e2f77430a0f3f72a6d9eb431930a03abd Mon Sep 17 00:00:00 2001 From: Daniel Hunsaker Date: Thu, 27 Jul 2017 07:13:32 -0600 Subject: [PATCH 22/94] [nanobox] Minor tweaks for 1.5 (#4395) - Be less strict about the Ruby version, which resolves a build failure. - Add libidn as a dependency (until Nanobox adds idn-ruby to the list of gems with a dependency on it). - Remove redundant bundler commands (Nanobox's Ruby engine handles these things cleanly on its own, now). --- boxfile.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/boxfile.yml b/boxfile.yml index 3302231109..59a66d87bc 100644 --- a/boxfile.yml +++ b/boxfile.yml @@ -1,7 +1,7 @@ run.config: engine: ruby engine.config: - runtime: ruby-2.4.1 + runtime: ruby-2.4 extra_packages: # basic servers: @@ -20,6 +20,9 @@ run.config: # for node-gyp, used in the asset compilation process: - python-2 + # i18n: + - libidn + cache_dirs: - node_modules @@ -35,10 +38,6 @@ run.config: extra_steps: - envsubst < .env.nanobox > .env - - gem install bundler - - bundle config build.nokogiri --with-iconv-dir=/data/ --with-zlib-dir=/data/ - - bundle config build.nokogumbo --with-iconv-dir=/data/ --with-zlib-dir=/data/ - - bundle install --clean - yarn fs_watch: true From bb96ba13cf78c0bee1919c32e61bf0644c89a209 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 27 Jul 2017 22:13:49 +0900 Subject: [PATCH 23/94] Fallback to site_hostname when site_title is empty (#4394) --- app/helpers/instance_helper.rb | 2 +- spec/helpers/instance_helper_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/instance_helper.rb b/app/helpers/instance_helper.rb index a1c3c3521f..70027cca91 100644 --- a/app/helpers/instance_helper.rb +++ b/app/helpers/instance_helper.rb @@ -2,7 +2,7 @@ module InstanceHelper def site_title - Setting.site_title.to_s + Setting.site_title.presence || site_hostname end def site_hostname diff --git a/spec/helpers/instance_helper_spec.rb b/spec/helpers/instance_helper_spec.rb index c3d28544f2..bc5950d91c 100644 --- a/spec/helpers/instance_helper_spec.rb +++ b/spec/helpers/instance_helper_spec.rb @@ -19,7 +19,7 @@ describe InstanceHelper do it 'returns empty string when Setting.site_title is nil' do Setting.site_title = nil - expect(helper.site_title).to eq '' + expect(helper.site_title).to eq 'cb6e6126.ngrok.io' end end From 4f0b638cda82810c83f89f23e83efefb60375514 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 27 Jul 2017 22:16:07 +0900 Subject: [PATCH 24/94] Introduce access token fabricators (#4401) --- .../api/v1/accounts/credentials_controller_spec.rb | 2 +- .../api/v1/accounts/follower_accounts_controller_spec.rb | 2 +- .../api/v1/accounts/following_accounts_controller_spec.rb | 2 +- .../api/v1/accounts/relationships_controller_spec.rb | 2 +- spec/controllers/api/v1/accounts/search_controller_spec.rb | 2 +- spec/controllers/api/v1/accounts/statuses_controller_spec.rb | 2 +- spec/controllers/api/v1/accounts_controller_spec.rb | 2 +- spec/controllers/api/v1/blocks_controller_spec.rb | 2 +- spec/controllers/api/v1/domain_blocks_controller_spec.rb | 2 +- spec/controllers/api/v1/favourites_controller_spec.rb | 2 +- spec/controllers/api/v1/follow_requests_controller_spec.rb | 2 +- spec/controllers/api/v1/follows_controller_spec.rb | 2 +- spec/controllers/api/v1/instances_controller_spec.rb | 2 +- spec/controllers/api/v1/media_controller_spec.rb | 2 +- spec/controllers/api/v1/mutes_controller_spec.rb | 2 +- spec/controllers/api/v1/notifications_controller_spec.rb | 2 +- spec/controllers/api/v1/reports_controller_spec.rb | 2 +- spec/controllers/api/v1/search_controller_spec.rb | 2 +- .../api/v1/statuses/favourited_by_accounts_controller_spec.rb | 2 +- .../controllers/api/v1/statuses/favourites_controller_spec.rb | 2 +- spec/controllers/api/v1/statuses/mutes_controller_spec.rb | 2 +- .../api/v1/statuses/reblogged_by_accounts_controller_spec.rb | 2 +- spec/controllers/api/v1/statuses/reblogs_controller_spec.rb | 2 +- spec/controllers/api/v1/statuses_controller_spec.rb | 2 +- spec/controllers/api/v1/timelines/home_controller_spec.rb | 4 ++-- spec/controllers/api/v1/timelines/public_controller_spec.rb | 4 ++-- spec/controllers/api/v1/timelines/tag_controller_spec.rb | 4 ++-- spec/fabricators/access_token_fabricator.rb | 2 ++ spec/fabricators/accessible_access_token_fabricator.rb | 4 ++++ 29 files changed, 36 insertions(+), 30 deletions(-) create mode 100644 spec/fabricators/access_token_fabricator.rb create mode 100644 spec/fabricators/accessible_access_token_fabricator.rb diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb index 89dbca1119..4a31003487 100644 --- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb @@ -4,7 +4,7 @@ describe Api::V1::Accounts::CredentialsController do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/accounts/follower_accounts_controller_spec.rb b/spec/controllers/api/v1/accounts/follower_accounts_controller_spec.rb index 171852c755..33982cb8f6 100644 --- a/spec/controllers/api/v1/accounts/follower_accounts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/follower_accounts_controller_spec.rb @@ -4,7 +4,7 @@ describe Api::V1::Accounts::FollowerAccountsController do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do Fabricate(:follow, target_account: user.account) diff --git a/spec/controllers/api/v1/accounts/following_accounts_controller_spec.rb b/spec/controllers/api/v1/accounts/following_accounts_controller_spec.rb index a4cad9163e..e22f54a31d 100644 --- a/spec/controllers/api/v1/accounts/following_accounts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/following_accounts_controller_spec.rb @@ -4,7 +4,7 @@ describe Api::V1::Accounts::FollowingAccountsController do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do Fabricate(:follow, account: user.account) diff --git a/spec/controllers/api/v1/accounts/relationships_controller_spec.rb b/spec/controllers/api/v1/accounts/relationships_controller_spec.rb index e281afcb92..3a9607317c 100644 --- a/spec/controllers/api/v1/accounts/relationships_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/relationships_controller_spec.rb @@ -4,7 +4,7 @@ describe Api::V1::Accounts::RelationshipsController do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/accounts/search_controller_spec.rb b/spec/controllers/api/v1/accounts/search_controller_spec.rb index 40c82437dd..42cc3f64de 100644 --- a/spec/controllers/api/v1/accounts/search_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/search_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::Accounts::SearchController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb index 55cb5bcc24..8b4fd6a5bc 100644 --- a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb @@ -4,7 +4,7 @@ describe Api::V1::Accounts::StatusesController do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/accounts_controller_spec.rb b/spec/controllers/api/v1/accounts_controller_spec.rb index 216a9cb3b6..c13509e7bb 100644 --- a/spec/controllers/api/v1/accounts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::AccountsController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow read') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/blocks_controller_spec.rb b/spec/controllers/api/v1/blocks_controller_spec.rb index 4fd968b27c..f25a7e8788 100644 --- a/spec/controllers/api/v1/blocks_controller_spec.rb +++ b/spec/controllers/api/v1/blocks_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::BlocksController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') } before do Fabricate(:block, account: user.account) diff --git a/spec/controllers/api/v1/domain_blocks_controller_spec.rb b/spec/controllers/api/v1/domain_blocks_controller_spec.rb index ff5c5f3302..3713931dc6 100644 --- a/spec/controllers/api/v1/domain_blocks_controller_spec.rb +++ b/spec/controllers/api/v1/domain_blocks_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::DomainBlocksController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') } before do user.account.block_domain!('example.com') diff --git a/spec/controllers/api/v1/favourites_controller_spec.rb b/spec/controllers/api/v1/favourites_controller_spec.rb index 17e1ec31c9..85da87ad97 100644 --- a/spec/controllers/api/v1/favourites_controller_spec.rb +++ b/spec/controllers/api/v1/favourites_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::FavouritesController, type: :controller do render_views let(:user) { Fabricate(:user) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do Fabricate(:favourite, account: user.account) diff --git a/spec/controllers/api/v1/follow_requests_controller_spec.rb b/spec/controllers/api/v1/follow_requests_controller_spec.rb index d455a0255d..51df006a22 100644 --- a/spec/controllers/api/v1/follow_requests_controller_spec.rb +++ b/spec/controllers/api/v1/follow_requests_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::FollowRequestsController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice', locked: true)) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') } let(:follower) { Fabricate(:account, username: 'bob') } before do diff --git a/spec/controllers/api/v1/follows_controller_spec.rb b/spec/controllers/api/v1/follows_controller_spec.rb index cc4958ab59..b5e1d16dd7 100644 --- a/spec/controllers/api/v1/follows_controller_spec.rb +++ b/spec/controllers/api/v1/follows_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::FollowsController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/instances_controller_spec.rb b/spec/controllers/api/v1/instances_controller_spec.rb index 544f3d28f8..eba233b053 100644 --- a/spec/controllers/api/v1/instances_controller_spec.rb +++ b/spec/controllers/api/v1/instances_controller_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Api::V1::InstancesController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/media_controller_spec.rb b/spec/controllers/api/v1/media_controller_spec.rb index 00dcac95dc..6bad3f05d8 100644 --- a/spec/controllers/api/v1/media_controller_spec.rb +++ b/spec/controllers/api/v1/media_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::MediaController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/mutes_controller_spec.rb b/spec/controllers/api/v1/mutes_controller_spec.rb index 85aad43841..3e6fa887b2 100644 --- a/spec/controllers/api/v1/mutes_controller_spec.rb +++ b/spec/controllers/api/v1/mutes_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::MutesController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'follow') } before do Fabricate(:mute, account: user.account) diff --git a/spec/controllers/api/v1/notifications_controller_spec.rb b/spec/controllers/api/v1/notifications_controller_spec.rb index e06230913a..f493d0d38e 100644 --- a/spec/controllers/api/v1/notifications_controller_spec.rb +++ b/spec/controllers/api/v1/notifications_controller_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Api::V1::NotificationsController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } let(:other) { Fabricate(:user, account: Fabricate(:account, username: 'bob')) } before do diff --git a/spec/controllers/api/v1/reports_controller_spec.rb b/spec/controllers/api/v1/reports_controller_spec.rb index 471ea4e0bc..1eb5a43534 100644 --- a/spec/controllers/api/v1/reports_controller_spec.rb +++ b/spec/controllers/api/v1/reports_controller_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Api::V1::ReportsController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read write') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/search_controller_spec.rb b/spec/controllers/api/v1/search_controller_spec.rb index 4d22ddc98f..ff0c254b1f 100644 --- a/spec/controllers/api/v1/search_controller_spec.rb +++ b/spec/controllers/api/v1/search_controller_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Api::V1::SearchController, type: :controller do render_views let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } before do allow(controller).to receive(:doorkeeper_token) { token } diff --git a/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb b/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb index 1acb990a00..556731d578 100644 --- a/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/favourited_by_accounts_controller_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Api::V1::Statuses::FavouritedByAccountsController, type: :control let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } - let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, application: app) } context 'with an oauth token' do before do diff --git a/spec/controllers/api/v1/statuses/favourites_controller_spec.rb b/spec/controllers/api/v1/statuses/favourites_controller_spec.rb index eb77072d25..2a029230d7 100644 --- a/spec/controllers/api/v1/statuses/favourites_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/favourites_controller_spec.rb @@ -7,7 +7,7 @@ describe Api::V1::Statuses::FavouritesController do let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } - let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write', application: app) } context 'with an oauth token' do before do diff --git a/spec/controllers/api/v1/statuses/mutes_controller_spec.rb b/spec/controllers/api/v1/statuses/mutes_controller_spec.rb index 1f8c29e3d8..54c594e92c 100644 --- a/spec/controllers/api/v1/statuses/mutes_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/mutes_controller_spec.rb @@ -7,7 +7,7 @@ describe Api::V1::Statuses::MutesController do let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } - let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write', application: app) } context 'with an oauth token' do before do diff --git a/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb b/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb index c5624023f1..ba022a96e0 100644 --- a/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/reblogged_by_accounts_controller_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Api::V1::Statuses::RebloggedByAccountsController, type: :controll let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } - let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, application: app) } context 'with an oauth token' do before do diff --git a/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb b/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb index 36c323736b..d6d36c1b2f 100644 --- a/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb +++ b/spec/controllers/api/v1/statuses/reblogs_controller_spec.rb @@ -7,7 +7,7 @@ describe Api::V1::Statuses::ReblogsController do let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } - let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'write', application: app) } context 'with an oauth token' do before do diff --git a/spec/controllers/api/v1/statuses_controller_spec.rb b/spec/controllers/api/v1/statuses_controller_spec.rb index 3d65180ab3..a36265395b 100644 --- a/spec/controllers/api/v1/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/statuses_controller_spec.rb @@ -5,7 +5,7 @@ RSpec.describe Api::V1::StatusesController, type: :controller do let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) } let(:app) { Fabricate(:application, name: 'Test app', website: 'http://testapp.com') } - let(:token) { double acceptable?: true, resource_owner_id: user.id, application: app } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, application: app, scopes: 'write') } context 'with an oauth token' do before do diff --git a/spec/controllers/api/v1/timelines/home_controller_spec.rb b/spec/controllers/api/v1/timelines/home_controller_spec.rb index faa6c60ce2..4d45235209 100644 --- a/spec/controllers/api/v1/timelines/home_controller_spec.rb +++ b/spec/controllers/api/v1/timelines/home_controller_spec.rb @@ -12,7 +12,7 @@ describe Api::V1::Timelines::HomeController do end context 'with a user context' do - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'read') } describe 'GET #show' do before do @@ -30,7 +30,7 @@ describe Api::V1::Timelines::HomeController do end context 'without a user context' do - let(:token) { double acceptable?: true, resource_owner_id: nil } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: nil, scopes: 'read') } describe 'GET #show' do it 'returns http unprocessable entity' do diff --git a/spec/controllers/api/v1/timelines/public_controller_spec.rb b/spec/controllers/api/v1/timelines/public_controller_spec.rb index 353ab9bc2d..3acf2e2678 100644 --- a/spec/controllers/api/v1/timelines/public_controller_spec.rb +++ b/spec/controllers/api/v1/timelines/public_controller_spec.rb @@ -12,7 +12,7 @@ describe Api::V1::Timelines::PublicController do end context 'with a user context' do - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } describe 'GET #show' do before do @@ -42,7 +42,7 @@ describe Api::V1::Timelines::PublicController do end context 'without a user context' do - let(:token) { double acceptable?: true, resource_owner_id: nil } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: nil) } describe 'GET #show' do it 'returns http success' do diff --git a/spec/controllers/api/v1/timelines/tag_controller_spec.rb b/spec/controllers/api/v1/timelines/tag_controller_spec.rb index f743f0cde1..74de1e81f2 100644 --- a/spec/controllers/api/v1/timelines/tag_controller_spec.rb +++ b/spec/controllers/api/v1/timelines/tag_controller_spec.rb @@ -12,7 +12,7 @@ describe Api::V1::Timelines::TagController do end context 'with a user context' do - let(:token) { double acceptable?: true, resource_owner_id: user.id } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id) } describe 'GET #show' do before do @@ -28,7 +28,7 @@ describe Api::V1::Timelines::TagController do end context 'without a user context' do - let(:token) { double acceptable?: true, resource_owner_id: nil } + let(:token) { Fabricate(:accessible_access_token, resource_owner_id: nil) } describe 'GET #show' do it 'returns http success' do diff --git a/spec/fabricators/access_token_fabricator.rb b/spec/fabricators/access_token_fabricator.rb new file mode 100644 index 0000000000..1856a8eb3b --- /dev/null +++ b/spec/fabricators/access_token_fabricator.rb @@ -0,0 +1,2 @@ +Fabricator :access_token, from: 'Doorkeeper::AccessToken' do +end diff --git a/spec/fabricators/accessible_access_token_fabricator.rb b/spec/fabricators/accessible_access_token_fabricator.rb new file mode 100644 index 0000000000..4b7e99b207 --- /dev/null +++ b/spec/fabricators/accessible_access_token_fabricator.rb @@ -0,0 +1,4 @@ +Fabricator :accessible_access_token, from: :access_token do + expires_in { nil } + revoked_at { nil } +end From e1798d0eb0180bea9237e3cff399a4883173f195 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Thu, 27 Jul 2017 15:46:33 +0200 Subject: [PATCH 25/94] fix(push_subscription): Use star icon for favourite action (#4396) --- app/models/web/push_subscription.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/web/push_subscription.rb b/app/models/web/push_subscription.rb index 86df9b591c..02002db5a6 100644 --- a/app/models/web/push_subscription.rb +++ b/app/models/web/push_subscription.rb @@ -117,7 +117,7 @@ class Web::PushSubscription < ApplicationRecord when :mention then [ { title: translate('push_notifications.mention.action_favourite'), - icon: full_asset_url('emoji/2764.png', skip_pipeline: true), + icon: full_asset_url('emoji/2b50.png', skip_pipeline: true), todo: 'request', method: 'POST', action: "/api/v1/statuses/#{notification.target_status.id}/favourite", From 73890c3cac19df3fdf7162e84024fedea5ecfe5d Mon Sep 17 00:00:00 2001 From: unarist Date: Thu, 27 Jul 2017 22:49:56 +0900 Subject: [PATCH 26/94] 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(-) diff --git a/app/javascript/styles/about.scss b/app/javascript/styles/about.scss index 9be95c0281..6eddd13227 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 { From f2233c3e25bd52388798e5d76311896fa8029413 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Thu, 27 Jul 2017 23:20:48 +0900 Subject: [PATCH 27/94] 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(-) diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 6b9fdd2afe..0d7f6deb16 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 132d7017d5..9afb51285e 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 0f895f3b61..5b3df43c2b 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" From aa803153e2161f4462d9d26ecd021fe0d2396cc5 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Fri, 28 Jul 2017 05:30:27 +0900 Subject: [PATCH 28/94] Remove Storybook (#4397) --- .dockerignore | 1 - .nanoignore | 1 - .slugignore | 1 - package.json | 5 +- storybook/config.js | 15 - storybook/initial_state.js | 24 - .../stories/autosuggest_textarea.story.js | 18 - storybook/stories/button.story.js | 18 - storybook/stories/character_counter.story.js | 21 - storybook/stories/loading_indicator.story.js | 12 - storybook/stories/onboarding_modal.story.js | 24 - storybook/storybook.scss | 3 - storybook/webpack.config.js | 21 - yarn.lock | 893 ++---------------- 14 files changed, 65 insertions(+), 992 deletions(-) delete mode 100644 storybook/config.js delete mode 100644 storybook/initial_state.js delete mode 100644 storybook/stories/autosuggest_textarea.story.js delete mode 100644 storybook/stories/button.story.js delete mode 100644 storybook/stories/character_counter.story.js delete mode 100644 storybook/stories/loading_indicator.story.js delete mode 100644 storybook/stories/onboarding_modal.story.js delete mode 100644 storybook/storybook.scss delete mode 100644 storybook/webpack.config.js diff --git a/.dockerignore b/.dockerignore index 2ddfa9b953..5cd3b179a5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,7 +4,6 @@ public/system public/assets public/packs node_modules -storybook neo4j vendor/bundle .DS_Store diff --git a/.nanoignore b/.nanoignore index f02c0a68ac..80e9397035 100644 --- a/.nanoignore +++ b/.nanoignore @@ -14,7 +14,6 @@ node_modules/ public/assets/ public/system/ spec/ -storybook/ tmp/ .vagrant/ vendor/bundle/ diff --git a/.slugignore b/.slugignore index b0141b0e2b..5470f6e3f3 100644 --- a/.slugignore +++ b/.slugignore @@ -2,4 +2,3 @@ node_modules/ .cache/ docs/ spec/ -storybook/ diff --git a/package.json b/package.json index 9afb51285e..34198c35b1 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,8 @@ "build:production": "cross-env RAILS_ENV=production ./bin/webpack", "manage:translations": "node ./config/webpack/translationRunner.js", "start": "node ./streaming/index.js", - "storybook": "cross-env NODE_ENV=test start-storybook -s ./public -p 9001 -c storybook", "test": "npm run test:lint && npm run test:mocha", - "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ storybook/ streaming/", + "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ streaming/", "test:mocha": "cross-env NODE_ENV=test mocha --require ./spec/javascript/setup.js --compilers js:babel-register ./spec/javascript/components/*.test.js", "postinstall": "npm rebuild node-sass" }, @@ -120,8 +119,6 @@ "websocket.js": "^0.1.12" }, "devDependencies": { - "@storybook/addon-actions": "^3.1.8", - "@storybook/react": "^3.1.8", "babel-eslint": "^7.2.3", "chai": "^4.1.0", "chai-enzyme": "^0.8.0", diff --git a/storybook/config.js b/storybook/config.js deleted file mode 100644 index 87479560f5..0000000000 --- a/storybook/config.js +++ /dev/null @@ -1,15 +0,0 @@ -import { configure } from '@storybook/react'; -import { addLocaleData } from 'react-intl'; -import en from 'react-intl/locale-data/en'; -import '../app/javascript/styles/application.scss'; -import './storybook.scss'; - -addLocaleData(en); - -let req = require.context('./stories/', true, /.story.js$/); - -function loadStories () { - req.keys().forEach((filename) => req(filename)); -} - -configure(loadStories, module); diff --git a/storybook/initial_state.js b/storybook/initial_state.js deleted file mode 100644 index 3872586f61..0000000000 --- a/storybook/initial_state.js +++ /dev/null @@ -1,24 +0,0 @@ -export default { - meta: { - admin: 1, - domain: 'example.com', - me: 2, - }, - accounts: { - 1: { - acct: 'admin', - avatar: '/avatars/original/missing.png', - id: 1, - url: 'https://example.com/@admin', - }, - 2: { - acct: 'user', - avatar: '/avatars/original/missing.png', - id: 1, - url: 'https://example.com/@user', - }, - }, - media_attachments: { - accept_content_types: [], - }, -}; diff --git a/storybook/stories/autosuggest_textarea.story.js b/storybook/stories/autosuggest_textarea.story.js deleted file mode 100644 index 65dfe965ca..0000000000 --- a/storybook/stories/autosuggest_textarea.story.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { List } from 'immutable'; -import { storiesOf } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import AutosuggestTextarea from 'mastodon/components/autosuggest_textarea'; - -const props = { - onChange: action('changed'), - onPaste: action('pasted'), - onSuggestionSelected: action('suggestionsSelected'), - onSuggestionsClearRequested: action('suggestionsClearRequested'), - onSuggestionsFetchRequested: action('suggestionsFetchRequested'), - suggestions: List([]), -}; - -storiesOf('AutosuggestTextarea', module) - .add('default state', () => ) - .add('with text', () => ); diff --git a/storybook/stories/button.story.js b/storybook/stories/button.story.js deleted file mode 100644 index 1971451e8c..0000000000 --- a/storybook/stories/button.story.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { storiesOf } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import Button from 'mastodon/components/button'; - -storiesOf('Button', module) - .add('default state', () => ( -