From 43aae19f2bcecb02f81b674f445d27addbc8ffcb Mon Sep 17 00:00:00 2001 From: highemerly Date: Sat, 18 Nov 2023 12:46:13 +0900 Subject: [PATCH] [add] (4.0 compatibility) add regacy 'toot' button for single column mode - 'toot' (not 'publish' in handon.club) button appears in single column mode - If vanilla theme is selected, this button may be disabled --- .../features/ui/components/navigation_panel.jsx | 2 ++ app/javascript/mastodon/locales/en.json | 2 +- app/javascript/mastodon/locales/ja.json | 2 +- app/javascript/styles/contrast.scss | 1 + app/javascript/styles/default.scss | 2 ++ app/javascript/styles/handon/compatibility.scss | 8 ++++++++ app/javascript/styles/handon/handon.scss | 14 ++++++++++++++ app/javascript/styles/mastodon-light.scss | 1 + config/themes.yml | 2 +- 9 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 app/javascript/styles/default.scss create mode 100644 app/javascript/styles/handon/compatibility.scss diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx index 8006ca89a24a39..c7824ede09f0a0 100644 --- a/app/javascript/mastodon/features/ui/components/navigation_panel.jsx +++ b/app/javascript/mastodon/features/ui/components/navigation_panel.jsx @@ -27,6 +27,7 @@ const messages = defineMessages({ bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' }, lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' }, preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, + publish: { id: 'compose_form.publish', defaultMessage: 'Toot!' }, followsAndFollowers: { id: 'navigation_bar.follows_and_followers', defaultMessage: 'Follows and followers' }, about: { id: 'navigation_bar.about', defaultMessage: 'About' }, search: { id: 'navigation_bar.search', defaultMessage: 'Search' }, @@ -108,6 +109,7 @@ class NavigationPanel extends Component {
+ )} diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 4399b999513363..cada3eccd9fd9b 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -150,7 +150,7 @@ "compose_form.poll.remove_option": "Remove this choice", "compose_form.poll.switch_to_multiple": "Change poll to allow multiple choices", "compose_form.poll.switch_to_single": "Change poll to allow for a single choice", - "compose_form.publish": "Publish", + "compose_form.publish": "Toot", "compose_form.publish_form": "New post", "compose_form.publish_loud": "{publish}!", "compose_form.save_changes": "Save changes", diff --git a/app/javascript/mastodon/locales/ja.json b/app/javascript/mastodon/locales/ja.json index 0bf0a96a272dfd..ae04cd7d3efefd 100644 --- a/app/javascript/mastodon/locales/ja.json +++ b/app/javascript/mastodon/locales/ja.json @@ -150,7 +150,7 @@ "compose_form.poll.remove_option": "この項目を削除", "compose_form.poll.switch_to_multiple": "複数選択に変更", "compose_form.poll.switch_to_single": "単一選択に変更", - "compose_form.publish": "投稿", + "compose_form.publish": "トゥート", "compose_form.publish_form": "投稿", "compose_form.publish_loud": "{publish}!", "compose_form.save_changes": "変更を保存", diff --git a/app/javascript/styles/contrast.scss b/app/javascript/styles/contrast.scss index 5b43aecbe7d876..065002d980efcb 100644 --- a/app/javascript/styles/contrast.scss +++ b/app/javascript/styles/contrast.scss @@ -1,3 +1,4 @@ @import 'contrast/variables'; @import 'application'; @import 'contrast/diff'; +@import 'handon/compatibility'; diff --git a/app/javascript/styles/default.scss b/app/javascript/styles/default.scss new file mode 100644 index 00000000000000..5fb01fd1611fe8 --- /dev/null +++ b/app/javascript/styles/default.scss @@ -0,0 +1,2 @@ +@import 'application'; +@import 'handon/compatibility'; diff --git a/app/javascript/styles/handon/compatibility.scss b/app/javascript/styles/handon/compatibility.scss new file mode 100644 index 00000000000000..8c3e1da84e36ed --- /dev/null +++ b/app/javascript/styles/handon/compatibility.scss @@ -0,0 +1,8 @@ +.drawer__inner__mastodon > img { + display: none; +} + +div.columns-area__panels__pane__inner a.column-link[href='/publish'] { + display: none; + width: 0; +} diff --git a/app/javascript/styles/handon/handon.scss b/app/javascript/styles/handon/handon.scss index 4e53082b8873e6..233408d914ba35 100644 --- a/app/javascript/styles/handon/handon.scss +++ b/app/javascript/styles/handon/handon.scss @@ -33,6 +33,20 @@ width: auto !important; } +/**** compatibility 4.0 or before ****/ + +/* Add post button to side bar */ +div.columns-area__panels__pane__inner a.column-link[href='/publish'] { + background-color: #595aff; + border: 6px; + border-radius: 6px; + color: $white; +} + +div.columns-area__panels__pane__inner a.column-link.active[href='/publish'] { + display: none; +} + /**** misc ****/ /* Change color of display-name who is belong to handon.club */ diff --git a/app/javascript/styles/mastodon-light.scss b/app/javascript/styles/mastodon-light.scss index 756a12d868961c..ba2e1ce0a32767 100644 --- a/app/javascript/styles/mastodon-light.scss +++ b/app/javascript/styles/mastodon-light.scss @@ -1,3 +1,4 @@ @import 'mastodon-light/variables'; @import 'application'; @import 'mastodon-light/diff'; +@import 'handon/compatibility'; diff --git a/config/themes.yml b/config/themes.yml index e5d133d1593065..7b1f8caf3ca7c9 100644 --- a/config/themes.yml +++ b/config/themes.yml @@ -3,6 +3,6 @@ contrast: styles/handon-contrast.scss mastodon-light: styles/handon-light.scss blacklead: styles/handon-blacklead.scss cantadark: styles/handon-cantadark.scss -vanilla-default: styles/application.scss +vanilla-default: styles/default.scss vanilla-contrast: styles/contrast.scss vanilla-light: styles/mastodon-light.scss