Compare commits

...

13 Commits

Author SHA1 Message Date
FloatingGhost 174f98b1cb don't die on my arm box please 2023-08-05 14:17:42 +01:00
FloatingGhost ab146b67ec version 2023-08-05 13:29:44 +01:00
FloatingGhost 3b4208ea41 debounce emoji searching 2023-08-04 16:48:13 +01:00
floatingghost 856324fa26 Merge pull request 'Make favicon next to post username use Still-Image functionality' (#327) from Mergan/pleroma-fe:still-image-instance-favicon into develop
Reviewed-on: AkkomaGang/akkoma-fe#327
2023-08-04 15:09:56 +00:00
floatingghost 5a9322d2c7 Merge pull request 'StillImage: Improved animated image detection' (#335) from yukijoou/akkoma-fe:still-image-better-gif-detection into develop
Reviewed-on: AkkomaGang/akkoma-fe#335
2023-08-04 15:09:32 +00:00
Weblate b52bfbcba0 Merge branch 'origin/develop' into Weblate. 2023-08-04 14:56:22 +00:00
floatingghost 2b05a738c9 Merge pull request 'Add replying info for redraft' (#332) from xarvos/pleroma-fe:fix-reply-redraft into develop
Reviewed-on: AkkomaGang/akkoma-fe#332
2023-08-04 14:56:20 +00:00
Weblate fa5d31b793 Merge branch 'origin/develop' into Weblate. 2023-08-04 14:54:38 +00:00
tusooa 29cfdcbbcd Add load more to blocks/mutes 2023-08-04 15:54:04 +01:00
Weblate 5174b95918 Translated using Weblate (Greek)
Currently translated at 15.4% (162 of 1046 strings)

Added translation using Weblate (Greek)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: getimiskon <getimiskon@disroot.org>
Translate-URL: http://translate.akkoma.dev/projects/akkoma/pleroma-fe/el/
Translation: Pleroma fe/pleroma-fe
2023-08-04 13:34:26 +00:00
Yuki Joou 43d0a24547 StillImage: Improved animated image detection
This patch makes StillImage's animation detection return early in cases
where we can't detect the mimetype of the image. It also sets the image
as animated in those cases if the user agent wants reduced motion.

As reduced motion is an accessibility setting, I think it's best to use
a "better safe than sorry" approach, it's better to accidentally mark
something as animated that isn't than to have unblocked animations.
2023-08-03 16:34:28 +02:00
Ngô Ngọc Đức Huy 7c14e1a5bd
Add replying info for redraft 2023-08-02 08:40:19 +07:00
David 0da0e2c814 Make favicon next to post username use Still-Image functionality 2023-07-24 01:08:11 -07:00
13 changed files with 322 additions and 46 deletions

View File

@ -1,3 +1,4 @@
platform: linux/amd64
pipeline:
lint:
when:

View File

@ -1,6 +1,6 @@
{
"name": "pleroma_fe",
"version": "3.5.0",
"version": "3.10.0",
"description": "A frontend for Akkoma instances",
"author": "Roger Braun <roger@rogerbraun.net>",
"private": true,

View File

@ -7,7 +7,7 @@ import {
faStickyNote,
faSmileBeam
} from '@fortawesome/free-solid-svg-icons'
import { trim, escapeRegExp, startCase } from 'lodash'
import { trim, escapeRegExp, startCase, debounce } from 'lodash'
library.add(
faBoxOpen,
@ -42,6 +42,9 @@ const EmojiPicker = {
EmojiGrid
},
methods: {
debouncedSearch: debounce(function (e) {
this.keyword = e.target.value
}, 500),
onStickerUploaded (e) {
this.$emit('sticker-uploaded', e)
},
@ -85,17 +88,6 @@ const EmojiPicker = {
activeGroupView () {
return this.showingStickers ? '' : this.activeGroup
},
stickersAvailable () {
if (this.$store.state.instance.stickers) {
return this.$store.state.instance.stickers.length > 0
}
return 0
},
filteredEmoji () {
return this.filterByKeyword(
this.$store.state.instance.customEmoji || []
)
},
emojis () {
const recentEmojis = this.$store.getters.recentEmojis
const standardEmojis = this.$store.state.instance.emoji || []

View File

@ -44,11 +44,10 @@
>
<div class="emoji-search">
<input
v-model="keyword"
type="text"
class="form-control"
:placeholder="$t('emoji.search_emoji')"
@input="$event.target.composing = false"
@input="debouncedSearch"
>
</div>
<EmojiGrid

View File

@ -136,18 +136,26 @@ const ExtraButtons = {
},
doRedraftStatus () {
this.$store.dispatch('fetchStatusSource', { id: this.status.id })
.then(data => this.$store.dispatch('openPostStatusModal', {
isRedraft: true,
statusId: this.status.id,
subject: data.spoiler_text,
statusText: data.text,
statusIsSensitive: this.status.nsfw,
statusPoll: this.status.poll,
statusFiles: [...this.status.attachments],
statusScope: this.status.visibility,
statusLanguage: this.status.language,
statusContentType: data.content_type
}))
.then(data => {
let repliedUserId = this.status.in_reply_to_user_id;
let repliedUser = this.status.attentions.filter(user =>
user.id === repliedUserId);
this.$store.dispatch('openPostStatusModal', {
isRedraft: true,
attentions: this.status.attentions,
statusId: this.status.id,
subject: data.spoiler_text,
statusText: data.text,
statusIsSensitive: this.status.nsfw,
statusPoll: this.status.poll,
statusFiles: [...this.status.attachments],
statusScope: this.status.visibility,
statusLanguage: this.status.language,
statusContentType: data.content_type,
replyTo: this.status.in_reply_to_status_id,
repliedUser: repliedUser
})
})
this.doDeleteStatus()
},
showRedraftStatusConfirmDialog () {

View File

@ -1,9 +1,13 @@
<template>
<div class="list">
<div
class="list"
role="list"
>
<div
v-for="item in items"
:key="getKey(item)"
class="list-item"
role="listitem"
>
<slot
name="item"

View File

@ -10,17 +10,20 @@ import SelectableList from 'src/components/selectable_list/selectable_list.vue'
import ProgressButton from 'src/components/progress_button/progress_button.vue'
import withSubscription from 'src/components/../hocs/with_subscription/with_subscription'
import Checkbox from 'src/components/checkbox/checkbox.vue'
import withLoadMore from 'src/components/../hocs/with_load_more/with_load_more'
const BlockList = withSubscription({
const BlockList = withLoadMore({
fetch: (props, $store) => $store.dispatch('fetchBlocks'),
select: (props, $store) => get($store.state.users.currentUser, 'blockIds', []),
childPropName: 'items'
childPropName: 'items',
destroy: () => {}
})(SelectableList)
const MuteList = withSubscription({
const MuteList = withLoadMore({
fetch: (props, $store) => $store.dispatch('fetchMutes'),
select: (props, $store) => get($store.state.users.currentUser, 'muteIds', []),
childPropName: 'items'
childPropName: 'items',
destroy: () => {}
})(SelectableList)
const DomainMuteList = withSubscription({

View File

@ -20,6 +20,7 @@ import generateProfileLink from 'src/services/user_profile_link_generator/user_p
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
import { muteWordHits } from '../../services/status_parser/status_parser.js'
import { unescape, uniqBy } from 'lodash'
import StillImage from '../still-image/still-image.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@ -117,7 +118,8 @@ const Status = {
RichContent,
MentionLink,
MentionsLine,
QuoteButton
QuoteButton,
StillImage
},
props: [
'statusoid',

View File

@ -174,12 +174,12 @@
>
@{{ status.user.screen_name_ui }}
</router-link>
<img
<StillImage
v-if="!!(status.user && status.user.favicon)"
class="status-favicon"
:src="status.user.favicon"
:title="faviconAlt(status)"
>
/>
</span>
</div>

View File

@ -39,12 +39,25 @@ const StillImage = {
this.imageLoadError && this.imageLoadError()
},
detectAnimation (image) {
// If there are no file extensions, the mimetype isn't set, and no mediaproxy is available, we can't figure out
// the mimetype of the image.
const hasFileExtension = this.src.split('/').pop().includes('.') // TODO: Better check?
const mediaProxyAvailable = this.$store.state.instance.mediaProxyAvailable
if (!hasFileExtension && this.mimetype === undefined && !mediaProxyAvailable) {
// It's a bit aggressive to assume all images we can't find the mimetype of is animated, but necessary for
// people in need of reduced motion accessibility. As such, we'll consider those images animated if the user
// agent is set to prefer reduced motion. Otherwise, it'll just be used as an early exit.
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches)
this.isAnimated = true
return
}
if (this.mimetype === 'image/gif' || this.src.endsWith('.gif')) {
this.isAnimated = true
return
}
// harmless CORS errors without-- clean console with
if (!this.$store.state.instance.mediaProxyAvailable) return
if (!mediaProxyAvailable) return
// Animated JPEGs?
if (!(this.src.endsWith('.webp') || this.src.endsWith('.png'))) return
// Browser Cache should ensure image doesn't get loaded twice if cache exists

215
src/i18n/el.json Normal file
View File

@ -0,0 +1,215 @@
{
"about": {
"mrf": {
"keyword": {
"keyword_policies": "Πολιτικές λέξεων-κλειδιών",
"reject": "Απόρριψη",
"replace": "Αντικατάσταση"
},
"mrf_policies": "Ενεργοποιημένες πολιτικές MRF",
"mrf_policies_desc": "",
"simple": {
"accept": "Αποδοχή",
"accept_desc": "Αυτό το instance αποδέχεται μηνύματα μόνο από τα ακόλουθα instances:",
"ftl_removal": "Αφαίρεση από το χρονολόγιο \"Γνωστού Δίκτυου\"",
"ftl_removal_desc": "Αυτό το instance αφαιρεί αυτά τα instances από το χρονολόγιο \"Γνωστού Δικτύου\":",
"quarantine": "Καραντίνα",
"quarantine_desc": "Αυτό το instance δε θα στέλνει αναρτήσεις στα ακόλουθα instances:",
"reason": "Λόγος",
"simple_policies": "Πολιτικές του instance"
}
}
},
"announcements": {
"all_day_prompt": "Αυτό είναι ένα ολοήμερο συμβάν",
"cancel_edit_action": "Ακύρωση",
"close_error": "Κλείσιμο",
"delete_action": "Διαγραφή",
"edit_action": "Επεξεργασία",
"end_time_display": "Λήγει στις {time}",
"page_header": "Ανακοινώσεις",
"title": "Ανακοίνωση"
},
"chats": {
"empty_message_error": "Δε μπορεί να σταλεί κενό μήνυμα",
"error_sending_message": "Κάτι πήγε λάθος κατά την αποστολή του μηνύματος.",
"message_user": "Στείλε μήνυμα στον/στην {nickname}",
"more": "Περισσότερα",
"new": "Νέο Chat",
"you": "Εσείς:"
},
"display_date": {
"today": "Σήμερα"
},
"domain_mute_card": {
"mute": "Σίγαση"
},
"emoji": {
"add_emoji": "Εισαγωγή emoji",
"load_all": "Φόρτωση όλων των {emojiAmount} emoji",
"recent": "Χρησιμοποιήθηκαν πρόσφατα",
"search_emoji": "Αναζήτηση για ένα emoji",
"stickers": "Αυτοκόλλητα"
},
"errors": {
"storage_unavailable": "Το Pleroma δε μπόρεσε να προσπελάσει τον αποθηκευτικό χώρο του browser. Η σύνδεσή σας ή οι τοπικές ρυθμίσεις σας δε θα αποθηκευτούν και μπορεί να αντιμετωπίσετε απρόοπτα θέματα. Προσπαθήστε να ενεργοποιήσετε τα cookies."
},
"exporter": {
"export": "Εξαγωγή"
},
"features_panel": {
"text_limit": "Όριο κειμένου"
},
"file_type": {
"audio": "Ήχος",
"file": "Αρχείο",
"image": "Εικόνα",
"video": "Βίντεο"
},
"general": {
"apply": "Εφαρμογή",
"cancel": "Ακύρωση",
"close": "Κλείσιμο",
"disable": "Απενεργοποίηση",
"enable": "Ενεργοποίηση",
"error_retry": "Παρακαλώ δοκιμάστε ξανά",
"flash_content": "Κάντε κλικ για την εμφάνιση Flash περιεχομένου με τη χρήση του Ruffle (Πειραματικό, μπορεί να μη λειτουργεί).",
"loading": "Φόρτωση…",
"more": "Περισσότερα",
"optional": "προαιρετικό",
"retry": "Δοκιμάστε ξανά",
"role": {
"admin": "Διαχειριστής",
"moderator": "Συντονιστής"
},
"scope_in_timeline": {
"direct": "Άμεσο",
"local": "Τοπικό",
"private": "Μόνο για ακόλουθους",
"public": "Δημόσιο",
"unlisted": "Εκτός Λίστας"
},
"show_less": "Δείξε λιγότερα",
"show_more": "Δείξε περισσότερα"
},
"image_cropper": {
"cancel": "Ακύρωση",
"crop_picture": "Περικοπή εικόνας",
"save": "Αποθήκευση",
"save_without_cropping": "Αποθήκευση χωρίς περικοπή"
},
"importer": {
"success": "Εισήχθη επιτυχώς."
},
"languages": {
"ar": "Αραβικά",
"az": "Αζερικά",
"bg": "Βουλγαρικά",
"cs": "Τσεχικά",
"da": "Δανικά",
"de": "Γερμανικά",
"el": "Ελληνικά",
"en": "Αγγλικά",
"eo": "Εσπεράντο",
"es": "Ισπανικά",
"fa": "Περσικά",
"fi": "Φινλανδικά",
"fr": "Γαλλικά",
"ga": "Ιρλανδικά",
"he": "Εβραϊκά",
"hi": "Χίντι",
"hu": "Ουγγρικά",
"id": "Ινδονησιακά",
"it": "Ιταλικά",
"ja": "Ιαπωνικά",
"ko": "Κορεατικά",
"lt": "Λιθουανικά",
"lv": "Λετονικά",
"nl": "Ολλανδικά",
"pl": "Πολωνικά",
"pt": "Πορτογαλικά",
"ru": "Ρωσικά",
"sk": "Σλοβακικά",
"sv": "Σουηδικά",
"tr": "Τουρκικά",
"translated_from": {
"ar": "Μεταφράστηκε από τα @:languages.ar",
"az": "Μεταφράστηκε από τα @:languages.az",
"bg": "Μεταφράστηκε από τα @:languages.bg",
"cs": "Μεταφράστηκε από τα @:languages.cs",
"da": "Μεταφράστηκε από τα @:languages.da",
"de": "Μεταφράστηκε από τα @:languages.de",
"el": "Μεταφράστηκε από τα @:languages.el",
"en": "Μεταφράστηκε από τα @:languages.en",
"eo": "Μεταφράστηκε από τα @:languages.eo",
"es": "Μεταφράστηκε από τα @:languages.es",
"fa": "Μεταφράστηκε από τα @:languages.fa",
"fi": "Μεταφράστηκε από τα @:languages.fi",
"fr": "Μεταφράστηκε από τα @:languages.fr",
"ga": "Μεταφράστηκε από τα @:languages.ga",
"he": "Μεταφράστηκε από τα @:languages.he",
"hi": "Μεταφράστηκε από τα @:languages.hi",
"hu": "Μεταφράστηκε από τα @:languages.hu",
"id": "Μεταφράστηκε από τα @:languages.id",
"it": "Μεταφράστηκε από τα @:languages.it",
"ja": "Μεταφράστηκε από τα @:languages.ja",
"ko": "Μεταφράστηκε από τα @:languages.ko",
"lt": "Μεταφράστηκε από τα @:languages.lt",
"lv": "Μεταφράστηκε από τα @:languages.lv",
"nl": "Μεταφράστηκε από τα @:languages.nl",
"pl": "Μεταφράστηκε από τα @:languages.pl",
"pt": "Μεταφράστηκε από τα @:languages.pt",
"ru": "Μεταφράστηκε από τα @:languages.ru",
"sk": "Μεταφράστηκε από τα @:languages.sk",
"sv": "Μεταφράστηκε από τα @:languages.sv",
"tr": "tr",
"uk": "Μεταφράστηκε από τα @:languages.uk",
"zh": "Μεταφράστηκε από τα @:languages.zh"
},
"uk": "Ουκρανικά",
"zh": "Κινεζικά"
},
"lists": {
"create": "Δημιουργία",
"delete": "Διαγραφή λίστας",
"lists": "Λίστες",
"new": "Νέα Λίστα",
"save": "Αποθήκευση αλλαγών",
"search": "Αναζήτηση χρηστών",
"title": "Τίτλος λίστας"
},
"login": {
"authentication_code": "Κωδικός επαλήθευσης",
"description": "Σύνδεση με OAuth",
"enter_recovery_code": "Εισάγετε τον κωδικό ανάκτησης",
"hint": "Συνδεθείτε για να μπείτε στη συζήτηση",
"login": "Σύνδεση",
"logout": "Αποσύνδεση",
"logout_confirm": "Θέλετε σίγουρα να αποσυνδεθείτε;",
"logout_confirm_accept_button": "Αποσύνδεση",
"logout_confirm_cancel_button": "Ακύρωση",
"logout_confirm_title": "Αποσύνδεση",
"password": "Κωδικός πρόσβασης",
"placeholder": "τοονομαχρηστημου",
"recovery_code": "Κωδικός ανάκτησης",
"register": "Εγγραφή",
"username": "Όνομα χρήστη"
},
"media_modal": {
"next": "Επόμενο",
"previous": "Προηγούμενο"
},
"moderation": {
"reports": {
"add_note": "Προσθήκη σημείωσης",
"close": "Κλείσιμο",
"delete_note": "Διαγραφή",
"delete_note_accept": "Ναι, διάγραψέ το",
"delete_note_cancel": "Όχι, κράτα το",
"delete_note_confirm": "Θέλετε σίγουρα να διαγράψετε αυτήν τη σημείωση;",
"note_placeholder": "Αφήστε μια σημείωση",
"notes": "{ count } σημείωση | { count } σημειώσεις",
"statuses": "{ count } ανάρτηση| { count } αναρτήσεις"
}
}
}

View File

@ -199,21 +199,28 @@ export const mutations = {
})
},
saveBlockIds (state, blockIds) {
state.currentUser.blockIds = blockIds
console.log("ADDING BLOCK IDS", blockIds);
state.currentUser.blockIds = uniq(concat(state.currentUser.blockIds || [], blockIds))
},
addBlockId (state, blockId) {
if (state.currentUser.blockIds.indexOf(blockId) === -1) {
state.currentUser.blockIds.push(blockId)
}
},
setBlockIdsMaxId (state, blockIdsMaxId) {
state.currentUser.blockIdsMaxId = blockIdsMaxId
},
saveMuteIds (state, muteIds) {
state.currentUser.muteIds = muteIds
state.currentUser.muteIds = uniq(concat(state.currentUser.muteIds || [], muteIds))
},
addMuteId (state, muteId) {
if (state.currentUser.muteIds.indexOf(muteId) === -1) {
state.currentUser.muteIds.push(muteId)
}
},
setMuteIdsMaxId (state, muteIdsMaxId) {
state.currentUser.muteIdsMaxId = muteIdsMaxId
},
updateMascot (state, mascotUrl) {
state.currentUser.mascot = mascotUrl
},
@ -330,10 +337,21 @@ const users = {
.then((relationships) => store.commit('updateUserRelationship', relationships))
}
},
fetchBlocks (store) {
return store.rootState.api.backendInteractor.fetchBlocks()
fetchBlocks (store, args) {
const { reset } = args || {}
const maxId = store.state.currentUser.blockIdsMaxId
return store.rootState.api.backendInteractor.fetchBlocks({ maxId })
.then((blocks) => {
store.commit('saveBlockIds', map(blocks, 'id'))
if (reset) {
store.commit('saveBlockIds', map(blocks, 'id'))
} else {
map(blocks, 'id').map(id => store.commit('addBlockId', id))
}
if (blocks.length) {
store.commit('setBlockIdsMaxId', last(blocks).id)
}
store.commit('addNewUsers', blocks)
return blocks
})
@ -353,10 +371,22 @@ const users = {
unblockUsers (store, ids = []) {
return Promise.all(ids.map(id => unblockUser(store, id)))
},
fetchMutes (store) {
return store.rootState.api.backendInteractor.fetchMutes()
fetchMutes (store, args) {
const { reset } = args || {}
const maxId = store.state.currentUser.muteIdsMaxId
return store.rootState.api.backendInteractor.fetchMutes({ maxId })
.then((mutes) => {
store.commit('saveMuteIds', map(mutes, 'id'))
if (reset) {
store.commit('saveMuteIds', map(mutes, 'id'))
} else {
map(mutes, 'id').map(id => store.commit('addMuteId', id))
}
if (mutes.length) {
store.commit('setMuteIdsMaxId', last(mutes).id)
}
store.commit('addNewUsers', mutes)
return mutes
})

View File

@ -1166,8 +1166,13 @@ const generateMfaBackupCodes = ({ credentials }) => {
}).then((data) => data.json())
}
const fetchMutes = ({ credentials }) => {
return promisedRequest({ url: MASTODON_USER_MUTES_URL, credentials })
const fetchMutes = ({ maxId, credentials }) => {
const query = new URLSearchParams({ with_relationships: true })
if (maxId) {
query.append('max_id', maxId)
}
return promisedRequest({ url: `${MASTODON_USER_MUTES_URL}?${query.toString()}`, credentials })
.then((users) => users.map(parseUser))
}
@ -1213,8 +1218,12 @@ const unsubscribeUser = ({ id, credentials }) => {
return promisedRequest({ url: MASTODON_UNSUBSCRIBE_USER(id), credentials, method: 'POST' })
}
const fetchBlocks = ({ credentials }) => {
return promisedRequest({ url: MASTODON_USER_BLOCKS_URL, credentials })
const fetchBlocks = ({ maxId, credentials }) => {
const query = new URLSearchParams({ with_relationships: true })
if (maxId) {
query.append('max_id', maxId)
}
return promisedRequest({ url: `${MASTODON_USER_BLOCKS_URL}?${query.toString()}`, credentials })
.then((users) => users.map(parseUser))
}