diff --git a/README.md b/README.md index 43e177b4..fc8db83c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Akkoma-FE +# Akkoma-FE ![English OK](https://img.shields.io/badge/English-OK-blueviolet) ![日本語OK](https://img.shields.io/badge/%E6%97%A5%E6%9C%AC%E8%AA%9E-OK-blueviolet) @@ -8,7 +8,7 @@ This is a fork of Akkoma-FE from the Pleroma project, with support for new Akkom # For Translators -The [Weblate UI](https://translate.akkoma.dev/projects/akkoma/pleroma-fe/) is recommended for adding or modifying translations for Akkoma-FE. +The [Weblate UI](https://translate.akkoma.dev/projects/akkoma/pleroma-fe/) is recommended for adding or modifying translations for Akkoma-FE. Alternatively, edit/create `src/i18n/$LANGUAGE_CODE.json` (where `$LANGUAGE_CODE` is the [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) for your language), then add your language to [src/i18n/messages.js](https://akkoma.dev/AkkomaGang/pleroma-fe/src/branch/develop/src/i18n/messages.js) if it doesn't already exist there. @@ -22,7 +22,7 @@ To use Akkoma-FE in Akkoma, use the [frontend](https://docs.akkoma.dev/stable/ad ``` bash # install dependencies -npm install -g yarn +corepack enable yarn # serve with hot reload at localhost:8080 @@ -37,7 +37,7 @@ npm run unit # For Contributors: -You can create file `/config/local.json` (see [example](https://git.pleroma.social/pleroma/pleroma-fe/blob/develop/config/local.example.json)) to enable some convenience dev options: +You can create file `/config/local.json` (see [example](https://akkoma.dev/AkkomaGang/akkoma-fe/src/branch/develop/config/local.example.json)) to enable some convenience dev options: * `target`: makes local dev server redirect to some existing instance's BE instead of local BE, useful for testing things in near-production environment and searching for real-life use-cases. * `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/statusnet/config.json`. Only works in dev mode. @@ -52,4 +52,4 @@ Edit config.json for configuration. ### Login methods -```loginMethod``` can be set to either ```password``` (the default) or ```token```, which will use the full oauth redirection flow, which is useful for SSO situations. +```loginMethod``` can be set to either ```password``` (the default) or ```token```, which will use the full oauth redirection flow, which is useful for SSO situations. diff --git a/config/local.example.json b/config/local.example.json index 2a3bd00d..43ebd649 100644 --- a/config/local.example.json +++ b/config/local.example.json @@ -1,4 +1,4 @@ { - "target": "https://pleroma.soykaf.com/", + "target": "https://otp.akkoma.dev/", "staticConfigPreference": false } diff --git a/package.json b/package.json index d0e2d7f9..51ee4830 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pleroma_fe", - "version": "3.10.0", + "version": "3.11.0", "description": "A frontend for Akkoma instances", "author": "Roger Braun ", "private": true, diff --git a/src/App.js b/src/App.js index fa67318f..f876b0f0 100644 --- a/src/App.js +++ b/src/App.js @@ -64,6 +64,11 @@ export default { '-' + this.layoutType ] }, + pageBackground () { + return this.mergedConfig.displayPageBackgrounds + ? this.$store.state.users.displayBackground + : null + }, currentUser () { return this.$store.state.users.currentUser }, userBackground () { return this.currentUser.background_image }, instanceBackground () { @@ -71,7 +76,7 @@ export default { ? null : this.$store.state.instance.background }, - background () { return this.userBackground || this.instanceBackground }, + background () { return this.pageBackground || this.userBackground || this.instanceBackground }, bgStyle () { if (this.background) { return { diff --git a/src/App.scss b/src/App.scss index 36176b35..1d338d15 100644 --- a/src/App.scss +++ b/src/App.scss @@ -8,7 +8,7 @@ } html { - font-size: 14px; + font-size: 0.875rem; // overflow-x: clip causes my browser's tab to crash with SIGILL lul } diff --git a/src/components/attachment/attachment.scss b/src/components/attachment/attachment.scss index 484ca0c4..d65f39fb 100644 --- a/src/components/attachment/attachment.scss +++ b/src/components/attachment/attachment.scss @@ -37,7 +37,7 @@ white-space: pre-line; word-break: break-word; text-overflow: ellipsis; - overflow: scroll; + overflow: auto; } &.-static { diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 55eea195..377f8ea5 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -93,9 +93,6 @@ const MentionLink = { this.highlightType ] }, - useAtIcon () { - return this.mergedConfig.useAtIcon - }, isRemote () { return this.userName !== this.userNameFull }, diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 76101865..5ea6ab04 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -151,7 +151,6 @@ > diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 3d3408f7..635a0a9b 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -105,9 +105,12 @@ flex: 1; padding-left: 0.8em; min-width: 0; + } + .heading-right, .notification-right { .timeago { - min-width: 3em; + display: inline-block; + min-width: 6em; text-align: right; } } diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 5647a9eb..703d8a63 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -138,7 +138,7 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } - const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject, interfaceLanguage } = this.$store.getters.mergedConfig + const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject, interfaceLanguage, alwaysShowSubjectInput } = this.$store.getters.mergedConfig let statusParams = { spoilerText: this.subject || '', @@ -199,6 +199,10 @@ const PostStatusForm = { } } + // When first loading the form, hide the subject (CW) field if it's disabled or doesn't have a starting value. + // "disableSubject" seems to take priority over "alwaysShowSubjectInput". + const showSubject = !this.disableSubject && (statusParams.spoilerText || alwaysShowSubjectInput) + return { dropFiles: [], uploadingFiles: false, @@ -213,7 +217,10 @@ const PostStatusForm = { preview: null, previewLoading: false, emojiInputShown: false, - idempotencyKey: '' + idempotencyKey: '', + activeEmojiInput: undefined, + activeTextInput: undefined, + subjectVisible: showSubject } }, computed: { @@ -674,8 +681,33 @@ const PostStatusForm = { this.$refs['emoji-input'].resize() }, showEmojiPicker () { - this.$refs['textarea'].focus() - this.$refs['emoji-input'].triggerShowPicker() + if (!this.activeEmojiInput || !this.activeTextInput) + this.focusStatusInput() + + this.$refs[this.activeTextInput].focus() + this.$refs[this.activeEmojiInput].triggerShowPicker() + }, + focusStatusInput() { + this.activeEmojiInput = 'emoji-input' + this.activeTextInput = 'textarea' + }, + focusSubjectInput() { + this.activeEmojiInput = 'subject-emoji-input' + this.activeTextInput = 'subject-input' + }, + toggleSubjectVisible() { + // If hiding CW, then we need to clear the subject and reset focus + if (this.subjectVisible) + { + this.focusStatusInput() + + // "nsfw" property is normally set by the @change listener, but this bypasses it. + // We need to clear it manually instead. + this.newStatus.spoilerText = '' + this.newStatus.nsfw = false + } + + this.subjectVisible = !this.subjectVisible }, clearError () { this.error = null diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index f4680336..74663fd7 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -118,13 +118,16 @@ />

+