Compare commits

...

19 Commits

Author SHA1 Message Date
itepechi c889e88e45
Merge remote-tracking branch 'upstream/develop' into bnakkoma 2024-06-14 13:44:36 +09:00
floatingghost 3e86db24d3 Update .woodpecker.yml 2024-05-28 21:33:15 +00:00
floatingghost 7789c5def6 Update .woodpecker.yml 2024-05-28 21:31:46 +00:00
Floatingghost f3934afbd8 make sure we normalise interfaceLanguage 2024-05-28 04:17:04 +01:00
Floatingghost 0b437ab6fd remove line left over in conflict 2024-05-28 04:15:35 +01:00
floatingghost 8964dce609 Merge pull request 'Make animated emojis in reactions pause' (#378) from sarayalth/akkoma-fe:pause-animated-reaction into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma-fe/pulls/378
2024-05-28 02:25:02 +00:00
floatingghost 1a49a1b3ac Merge pull request 'Expand Unicode emoji map' (#385) from Oneric/akkoma-fe:emoji_update into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma-fe/pulls/385
2024-05-28 02:24:06 +00:00
Floatingghost 1adef56603 Merge remote-tracking branch 'partizan/386-default-post-lang' into develop 2024-05-28 03:22:03 +01:00
Floatingghost 5aaa605df0 add asdf tool file 2024-05-28 03:14:50 +01:00
Floatingghost 71e287d56c update CI to v2 2024-05-28 03:14:37 +01:00
floatingghost 70275684bf Merge pull request 'Fix posting for "special" interface languages' (#377) from Oneric/akkoma-fe:post-language-specialcodes into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma-fe/pulls/377
2024-05-28 02:10:15 +00:00
floatingghost 29ff2ef455 Merge pull request 'Fix ordering of favourites timeline' (#392) from Oneric/akkoma-fe:favourite-ordering into develop
Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma-fe/pulls/392
2024-05-28 02:07:15 +00:00
Oneric 62e0dd858c Fix ordering of favourites timeline
The backend returns them order by when the post was favourited;
reordering them by post date jumbles everything up each addition
and serves no purpose.

Fixes: https://akkoma.dev/AkkomaGang/akkoma-fe/issues/391
2024-05-15 18:47:47 +02:00
sarah cc709394c5 remove unused classes on notifications 2024-05-14 18:09:21 +02:00
Serhii Tereshchenko 57beea6a0d fix: Use label and key for options 2024-05-13 16:13:58 +03:00
Serhii Tereshchenko 042e8c78dc feat: Add "Default post language" option
Refs #386
2024-04-20 16:07:03 +03:00
Oneric 0e07d88afa Expand Unicode emoji map
This pulls in 267 new emoji:
  - all 258 non-deprecated country or macro region
    flags (composed by two regional indicators)
  - all 3 regional flags currently recommended for general use
    (Wales, Scotland, England)
  - a few random ones i picked out
    - goose
    - heart on fire
    - heart mending
    - transgender flag
    - rainbow flag
    - pirate flag

The new names are derived from official Unicode names
with minor modifications to fit into the usual shortcode scheme
and dropping the flag_ prefix from country indicators.
Due to a naming conflict the old "japan" emoji
U+1F5FE SILHOUETTE OF JAPAN was renamed to "japan_silhouette".
2024-04-04 21:52:33 +02:00
sarah 1f5f8665c8 make animated reactions pause unless hovered on notifications 2024-03-01 20:02:19 +01:00
Oneric 428ed70b0d Fix posting for special interface languages
Easy Japanses (ja_easy) and traditional Chinses (zh_Hant) use
(custom) non-ISO codes in the interface. Because MastoAPI only accepts
ISO 639 codes, the backend will return an error rendering users
unable to do anything unless the post’s language was explicitly set.
2024-02-26 08:05:55 +01:00
14 changed files with 359 additions and 34 deletions

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
nodejs 20.12.2

View File

@ -1,10 +1,12 @@
platform: linux/amd64
pipeline:
labels:
platform: linux/amd64
steps:
lint:
when:
event:
- pull_request
image: node:18
image: node:20
commands:
- yarn
- yarn lint
@ -14,11 +16,11 @@ pipeline:
when:
event:
- pull_request
image: node:18
image: node:20
commands:
- apt update
- apt install firefox-esr -y --no-install-recommends
- yarn
- yarn
- yarn unit
build:
@ -28,7 +30,7 @@ pipeline:
branch:
- develop
- stable
image: node:18
image: node:20
commands:
- yarn
- yarn build
@ -40,15 +42,15 @@ pipeline:
branch:
- develop
- stable
image: node:18
image: node:20
secrets:
- SCW_ACCESS_KEY
- SCW_SECRET_KEY
- SCW_DEFAULT_ORGANIZATION_ID
commands:
- apt-get update && apt-get install -y rclone wget zip
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.30.0/scaleway-cli_2.30.0_linux_amd64
- mv scaleway-cli_2.30.0_linux_amd64 scaleway-cli
- chmod +x scaleway-cli
- ./scaleway-cli object config install type=rclone
- zip akkoma-fe.zip -r dist
@ -70,8 +72,8 @@ pipeline:
- SCW_DEFAULT_ORGANIZATION_ID
commands:
- apt-get update && apt-get install -y rclone wget git zip
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_linux_amd64
- mv scaleway-cli_2.5.1_linux_amd64 scaleway-cli
- wget https://github.com/scaleway/scaleway-cli/releases/download/v2.30.0/scaleway-cli_2.30.0_linux_amd64
- mv scaleway-cli_2.30.0_linux_amd64 scaleway-cli
- chmod +x scaleway-cli
- ./scaleway-cli object config install type=rclone
- cd docs
@ -79,4 +81,4 @@ pipeline:
- mkdocs build
- zip -r docs.zip site/*
- cd site
- rclone copy . scaleway:akkoma-docs/frontend/$CI_COMMIT_BRANCH/
- rclone copy . scaleway:akkoma-docs/frontend/$CI_COMMIT_BRANCH/

View File

@ -6,6 +6,7 @@ import UserCard from '../user_card/user_card.vue'
import Timeago from '../timeago/timeago.vue'
import RichContent from 'src/components/rich_content/rich_content.jsx'
import ConfirmModal from '../confirm_modal/confirm_modal.vue'
import StillImage from '../still-image/still-image.vue'
import { isStatusNotification } from '../../services/notification_utils/notification_utils.js'
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
@ -50,7 +51,8 @@ const Notification = {
Timeago,
Status,
RichContent,
ConfirmModal
ConfirmModal,
StillImage
},
methods: {
toggleUserExpanded () {

View File

@ -116,12 +116,13 @@
scope="global"
keypath="notifications.reacted_with"
>
<img
<still-image
v-if="notification.emoji_url !== null"
class="notification-reaction-emoji"
:src="notification.emoji_url"
:name="notification.emoji"
>
:title="notification.emoji"
:alt="notification.emoji"
/>
<span
v-else
class="emoji-reaction-emoji"

View File

@ -9,11 +9,12 @@ import StatusContent from '../status_content/status_content.vue'
import fileTypeService from '../../services/file_type/file_type.service.js'
import { findOffset } from '../../services/offset_finder/offset_finder.service.js'
import { reject, map, uniqBy, debounce } from 'lodash'
import { usePostLanguageOptions } from 'src/lib/post_language'
import suggestor from '../emoji_input/suggestor.js'
import { mapGetters, mapState } from 'vuex'
import Checkbox from '../checkbox/checkbox.vue'
import Select from '../select/select.vue'
import iso6391 from 'iso-639-1'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@ -62,6 +63,13 @@ const deleteDraft = (draftKey) => {
localStorage.setItem('drafts', JSON.stringify(draftData));
}
const interfaceToISOLanguage = (ilang) => {
const sep = ilang.indexOf("_");
return sep < 0 ?
ilang :
ilang.substr(0, sep);
}
const PostStatusForm = {
props: [
'statusId',
@ -129,6 +137,13 @@ const PostStatusForm = {
this.$refs.textarea.focus()
}
},
setup() {
const {postLanguageOptions} = usePostLanguageOptions()
return {
postLanguageOptions,
}
},
data () {
const preset = this.$route.query.message
let statusText = preset || ''
@ -140,11 +155,13 @@ const PostStatusForm = {
const {
postContentType: contentType,
postLanguage: language,
postLanguage: defaultPostLanguage,
sensitiveByDefault,
sensitiveIfSubject,
interfaceLanguage,
alwaysShowSubjectInput,
} = this.$store.getters.mergedConfig
const postLanguage = defaultPostLanguage || interfaceToISOLanguage(interfaceLanguage)
let statusParams = {
spoilerText: this.subject || '',
@ -155,8 +172,8 @@ const PostStatusForm = {
poll: {},
mediaDescriptions: {},
visibility: this.suggestedVisibility(),
contentType,
language
language: postLanguage,
contentType
}
if (this.statusId || this.isRedraft) {
@ -171,8 +188,8 @@ const PostStatusForm = {
poll: this.statusPoll || {},
mediaDescriptions: this.statusMediaDescriptions || {},
visibility: this.statusScope || this.suggestedVisibility(),
contentType: statusContentType,
language: statusLanguage
language: this.statusLanguage || postLanguage,
contentType: statusContentType
}
}
@ -316,9 +333,6 @@ const PostStatusForm = {
...mapState({
mobileLayout: state => state.interface.mobileLayout
}),
isoLanguages () {
return iso6391.getAllCodes();
}
},
watch: {
'newStatus': {

View File

@ -212,11 +212,11 @@
class="form-control"
>
<option
v-for="language in isoLanguages"
:key="language"
:value="language"
v-for="language in postLanguageOptions"
:key="language.key"
:value="language.value"
>
{{ language }}
{{ language.label }}
</option>
</Select>
</div>

View File

@ -4,6 +4,7 @@ import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
import IntegerSetting from '../helpers/integer_setting.vue'
import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
import { usePostLanguageOptions } from 'src/lib/post_language'
import SharedComputedObject from '../helpers/shared_computed_object.js'
import ServerSideIndicator from '../helpers/server_side_indicator.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
@ -18,6 +19,11 @@ library.add(
)
const GeneralTab = {
setup() {
const {postLanguageOptions} = usePostLanguageOptions()
return {postLanguageOptions}
},
data () {
return {
subjectLineOptions: ['email', 'noop', 'masto'].map(mode => ({
@ -128,6 +134,12 @@ const GeneralTab = {
this.$store.dispatch('setOption', { name: 'translationLanguage', value: val })
}
},
postLanguage: {
get: function () { return this.$store.getters.mergedConfig.postLanguage },
set: function (val) {
this.$store.dispatch('setOption', { name: 'postLanguage', value: val })
}
},
...SharedComputedObject()
},
methods: {

View File

@ -602,6 +602,15 @@
{{ $t('settings.post_status_content_type') }}
</ChoiceSetting>
</li>
<li>
<ChoiceSetting
id="postLanguage"
path="postLanguage"
:options="postLanguageOptions"
>
{{ $t('settings.post_language') }}
</ChoiceSetting>
</li>
<li>
<BooleanSetting
path="alwaysShowNewPostButton"

View File

@ -687,7 +687,7 @@
"play_videos_in_modal": "Play videos in a popup frame",
"post_look_feel": "Posts Look & Feel",
"post_status_content_type": "Default post content type",
"post_status_language": "Default post language",
"post_language": "Default post language",
"posts": "Posts",
"preload_images": "Preload images",
"presets": "Presets",

View File

@ -685,7 +685,7 @@
"play_videos_in_modal": "ビデオをメディアビューアーで見る",
"post_look_feel": "投稿の見た目",
"post_status_content_type": "投稿のコンテントタイプ",
"post_status_language": "投稿の言語",
"post_language": "投稿の言語",
"posts": "投稿",
"preload_images": "画像をあらかじめ読み込む",
"presets": "プリセット",

16
src/lib/post_language.js Normal file
View File

@ -0,0 +1,16 @@
import iso6391 from 'iso-639-1'
import { computed } from 'vue'
export const usePostLanguageOptions = () => {
const postLanguageOptions = computed(() => {
return iso6391.getAllCodes().map(lang => ({
key: lang,
value: lang,
label: lang,
}));
})
return {
postLanguageOptions,
}
}

View File

@ -118,6 +118,7 @@ export const defaultState = {
conversationTreeFadeAncestors: undefined, // instance default
maxDepthInThread: undefined, // instance default
translationLanguage: undefined, // instance default,
postLanguage: undefined, // instance default,
supportedTranslationLanguages: {}, // instance default
userProfileDefaultTab: 'statuses',
useBlurhash: true,

View File

@ -314,7 +314,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
})
// Keep the visible statuses sorted
if (timeline && !(timeline === 'bookmarks')) {
if (timeline && !(['bookmarks', 'favorites'].includes(timeline))) {
sortTimeline(timelineObject)
}
}

File diff suppressed because it is too large Load Diff