forked from AkkomaGang/akkoma-fe
Compare commits
10 commits
3d65eccf04
...
6f48569e59
Author | SHA1 | Date | |
---|---|---|---|
|
6f48569e59 | ||
|
ed0b403c33 | ||
|
0f842b300b | ||
|
865cb6f96a | ||
|
050c7df2e6 | ||
|
a77a9e04d9 | ||
|
a57334991e | ||
|
8dce31d0ad | ||
|
ea9ad4d600 | ||
|
34e2800f59 |
|
@ -64,6 +64,11 @@ export default {
|
||||||
'-' + this.layoutType
|
'-' + this.layoutType
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
pageBackground () {
|
||||||
|
return this.mergedConfig.displayPageBackgrounds
|
||||||
|
? this.$store.state.users.displayBackground
|
||||||
|
: null
|
||||||
|
},
|
||||||
currentUser () { return this.$store.state.users.currentUser },
|
currentUser () { return this.$store.state.users.currentUser },
|
||||||
userBackground () { return this.currentUser.background_image },
|
userBackground () { return this.currentUser.background_image },
|
||||||
instanceBackground () {
|
instanceBackground () {
|
||||||
|
@ -71,7 +76,7 @@ export default {
|
||||||
? null
|
? null
|
||||||
: this.$store.state.instance.background
|
: this.$store.state.instance.background
|
||||||
},
|
},
|
||||||
background () { return this.userBackground || this.instanceBackground },
|
background () { return this.pageBackground || this.userBackground || this.instanceBackground },
|
||||||
bgStyle () {
|
bgStyle () {
|
||||||
if (this.background) {
|
if (this.background) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -138,7 +138,7 @@ const PostStatusForm = {
|
||||||
statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser)
|
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 = {
|
let statusParams = {
|
||||||
spoilerText: this.subject || '',
|
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 {
|
return {
|
||||||
dropFiles: [],
|
dropFiles: [],
|
||||||
uploadingFiles: false,
|
uploadingFiles: false,
|
||||||
|
@ -215,7 +219,8 @@ const PostStatusForm = {
|
||||||
emojiInputShown: false,
|
emojiInputShown: false,
|
||||||
idempotencyKey: '',
|
idempotencyKey: '',
|
||||||
activeEmojiInput: undefined,
|
activeEmojiInput: undefined,
|
||||||
activeTextInput: undefined
|
activeTextInput: undefined,
|
||||||
|
subjectVisible: showSubject
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -690,6 +695,20 @@ const PostStatusForm = {
|
||||||
this.activeEmojiInput = 'subject-emoji-input'
|
this.activeEmojiInput = 'subject-emoji-input'
|
||||||
this.activeTextInput = 'subject-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 () {
|
clearError () {
|
||||||
this.error = null
|
this.error = null
|
||||||
},
|
},
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
</div>
|
</div>
|
||||||
<EmojiInput
|
<EmojiInput
|
||||||
ref="subject-emoji-input"
|
ref="subject-emoji-input"
|
||||||
v-if="!disableSubject && (newStatus.spoilerText || alwaysShowSubject)"
|
v-if="subjectVisible"
|
||||||
v-model="newStatus.spoilerText"
|
v-model="newStatus.spoilerText"
|
||||||
enable-emoji-picker
|
enable-emoji-picker
|
||||||
hide-emoji-button
|
hide-emoji-button
|
||||||
|
@ -281,6 +281,15 @@
|
||||||
>
|
>
|
||||||
<FAIcon icon="poll-h" />
|
<FAIcon icon="poll-h" />
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="!disableSubject"
|
||||||
|
class="spoiler-icon button-unstyled"
|
||||||
|
:class="{ selected: subjectVisible }"
|
||||||
|
:title="$t('post_status.toggle_content_warning')"
|
||||||
|
@click="toggleSubjectVisible"
|
||||||
|
>
|
||||||
|
<FAIcon icon="eye-slash" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
v-if="posting"
|
v-if="posting"
|
||||||
|
@ -461,7 +470,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-upload-icon, .poll-icon, .emoji-icon {
|
.media-upload-icon, .poll-icon, .emoji-icon, .spoiler-icon {
|
||||||
font-size: 1.85em;
|
font-size: 1.85em;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
@ -504,6 +513,11 @@
|
||||||
|
|
||||||
.poll-icon {
|
.poll-icon {
|
||||||
order: 3;
|
order: 3;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.spoiler-icon {
|
||||||
|
order: 4;
|
||||||
justify-content: right;
|
justify-content: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,11 @@
|
||||||
{{ $t('settings.show_wider_shortcuts') }}
|
{{ $t('settings.show_wider_shortcuts') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting path="displayPageBackgrounds">
|
||||||
|
{{ $t('settings.show_page_backgrounds') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<BooleanSetting path="stopGifs">
|
<BooleanSetting path="stopGifs">
|
||||||
{{ $t('settings.stop_gifs') }}
|
{{ $t('settings.stop_gifs') }}
|
||||||
|
|
|
@ -33,6 +33,7 @@ const ProfileTab = {
|
||||||
newName: this.$store.state.users.currentUser.name_unescaped,
|
newName: this.$store.state.users.currentUser.name_unescaped,
|
||||||
newBio: unescape(this.$store.state.users.currentUser.description),
|
newBio: unescape(this.$store.state.users.currentUser.description),
|
||||||
newLocked: this.$store.state.users.currentUser.locked,
|
newLocked: this.$store.state.users.currentUser.locked,
|
||||||
|
newPermitFollowback: this.$store.state.users.currentUser.permit_followback,
|
||||||
newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })),
|
newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })),
|
||||||
showRole: this.$store.state.users.currentUser.show_role,
|
showRole: this.$store.state.users.currentUser.show_role,
|
||||||
role: this.$store.state.users.currentUser.role,
|
role: this.$store.state.users.currentUser.role,
|
||||||
|
@ -135,6 +136,7 @@ const ProfileTab = {
|
||||||
bot: this.bot,
|
bot: this.bot,
|
||||||
show_role: this.showRole,
|
show_role: this.showRole,
|
||||||
status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1,
|
status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1,
|
||||||
|
permit_followback: this.permit_followback,
|
||||||
accepts_direct_messages_from: this.userAcceptsDirectMessagesFrom
|
accepts_direct_messages_from: this.userAcceptsDirectMessagesFrom
|
||||||
/* eslint-enable camelcase */
|
/* eslint-enable camelcase */
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,6 +259,19 @@
|
||||||
<BooleanSetting path="serverSide_locked">
|
<BooleanSetting path="serverSide_locked">
|
||||||
{{ $t('settings.lock_account_description') }}
|
{{ $t('settings.lock_account_description') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
|
<ul
|
||||||
|
class="setting-list suboptions"
|
||||||
|
:class="[{disabled: !serverSide_locked}]"
|
||||||
|
>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting
|
||||||
|
path="serverSide_permitFollowback"
|
||||||
|
:disabled="!serverSide_locked"
|
||||||
|
>
|
||||||
|
{{ $t('settings.permit_followback_description') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<BooleanSetting path="serverSide_discoverable">
|
<BooleanSetting path="serverSide_discoverable">
|
||||||
|
|
|
@ -145,10 +145,12 @@ const UserProfile = {
|
||||||
if (user) {
|
if (user) {
|
||||||
loadById(user.id)
|
loadById(user.id)
|
||||||
this.note = user.relationship.note
|
this.note = user.relationship.note
|
||||||
|
this.$store.dispatch('setDisplayBackground', user.background_image)
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('fetchUser', userNameOrId)
|
this.$store.dispatch('fetchUser', userNameOrId)
|
||||||
.then(({ id, relationship }) => {
|
.then(({ id, relationship, background_image }) => {
|
||||||
this.note = relationship.note
|
this.note = relationship.note
|
||||||
|
this.$store.dispatch('setDisplayBackground', background_image)
|
||||||
return loadById(id)
|
return loadById(id)
|
||||||
})
|
})
|
||||||
.catch((reason) => {
|
.catch((reason) => {
|
||||||
|
@ -225,6 +227,9 @@ const UserProfile = {
|
||||||
Conversation,
|
Conversation,
|
||||||
RichContent,
|
RichContent,
|
||||||
FollowedTagList
|
FollowedTagList
|
||||||
|
},
|
||||||
|
beforeRouteLeave(to, from) {
|
||||||
|
this.$store.dispatch('setDisplayBackground', null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -380,6 +380,7 @@
|
||||||
"text/x.misskeymarkdown": "MFM"
|
"text/x.misskeymarkdown": "MFM"
|
||||||
},
|
},
|
||||||
"content_warning": "Content Warning (optional)",
|
"content_warning": "Content Warning (optional)",
|
||||||
|
"toggle_content_warning": "Toggle content warning",
|
||||||
"default": "Just arrived at Luna Nova Academy",
|
"default": "Just arrived at Luna Nova Academy",
|
||||||
"direct_warning_to_all": "This post will be visible to all the mentioned users.",
|
"direct_warning_to_all": "This post will be visible to all the mentioned users.",
|
||||||
"direct_warning_to_first_only": "This post will only be visible to the mentioned users at the beginning of the message.",
|
"direct_warning_to_first_only": "This post will only be visible to the mentioned users at the beginning of the message.",
|
||||||
|
@ -600,6 +601,7 @@
|
||||||
"list_aliases_error": "Error fetching aliases: {error}",
|
"list_aliases_error": "Error fetching aliases: {error}",
|
||||||
"list_backups_error": "Error fetching backup list: {error}",
|
"list_backups_error": "Error fetching backup list: {error}",
|
||||||
"lock_account_description": "Restrict your account to approved followers only",
|
"lock_account_description": "Restrict your account to approved followers only",
|
||||||
|
"permit_followback_description": "Automatically approve requests from already followed users",
|
||||||
"loop_video": "Loop videos",
|
"loop_video": "Loop videos",
|
||||||
"loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")",
|
"loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")",
|
||||||
"mascot": "Mastodon FE Mascot",
|
"mascot": "Mastodon FE Mascot",
|
||||||
|
@ -749,6 +751,7 @@
|
||||||
"show_nav_shortcuts": "Show extra navigation shortcuts in top panel",
|
"show_nav_shortcuts": "Show extra navigation shortcuts in top panel",
|
||||||
"show_panel_nav_shortcuts": "Show timeline navigation shortcuts at the top of the panel",
|
"show_panel_nav_shortcuts": "Show timeline navigation shortcuts at the top of the panel",
|
||||||
"show_scrollbars": "Show side column's scrollbars",
|
"show_scrollbars": "Show side column's scrollbars",
|
||||||
|
"show_page_backgrounds": "Show page-specific backgrounds, e.g. for user profiles",
|
||||||
"show_wider_shortcuts": "Show wider gap between top panel shortcuts",
|
"show_wider_shortcuts": "Show wider gap between top panel shortcuts",
|
||||||
"show_yous": "Show (You)s",
|
"show_yous": "Show (You)s",
|
||||||
"stop_gifs": "Pause animated images until you hover on them",
|
"stop_gifs": "Pause animated images until you hover on them",
|
||||||
|
|
|
@ -21,6 +21,7 @@ const loaders = {
|
||||||
ga: () => import('./ga.json'),
|
ga: () => import('./ga.json'),
|
||||||
he: () => import('./he.json'),
|
he: () => import('./he.json'),
|
||||||
hu: () => import('./hu.json'),
|
hu: () => import('./hu.json'),
|
||||||
|
id: () => import('./id.json'),
|
||||||
it: () => import('./it.json'),
|
it: () => import('./it.json'),
|
||||||
ja: () => import('./ja_pedantic.json'),
|
ja: () => import('./ja_pedantic.json'),
|
||||||
ja_easy: () => import('./ja_easy.json'),
|
ja_easy: () => import('./ja_easy.json'),
|
||||||
|
|
|
@ -55,6 +55,7 @@ export const defaultState = {
|
||||||
alwaysShowNewPostButton: false,
|
alwaysShowNewPostButton: false,
|
||||||
autohideFloatingPostButton: false,
|
autohideFloatingPostButton: false,
|
||||||
pauseOnUnfocused: true,
|
pauseOnUnfocused: true,
|
||||||
|
displayPageBackgrounds: true,
|
||||||
stopGifs: undefined,
|
stopGifs: undefined,
|
||||||
replyVisibility: 'all',
|
replyVisibility: 'all',
|
||||||
thirdColumnMode: 'notifications',
|
thirdColumnMode: 'notifications',
|
||||||
|
|
|
@ -47,6 +47,10 @@ export const settingsMap = {
|
||||||
},
|
},
|
||||||
// Privacy
|
// Privacy
|
||||||
'locked': 'locked',
|
'locked': 'locked',
|
||||||
|
'permitFollowback': {
|
||||||
|
get: 'akkoma.permit_followback',
|
||||||
|
set: 'permit_followback'
|
||||||
|
},
|
||||||
'allowFollowingMove': {
|
'allowFollowingMove': {
|
||||||
get: 'pleroma.allow_following_move',
|
get: 'pleroma.allow_following_move',
|
||||||
set: 'allow_following_move'
|
set: 'allow_following_move'
|
||||||
|
|
|
@ -135,6 +135,10 @@ export const mutations = {
|
||||||
const user = state.usersObject[id]
|
const user = state.usersObject[id]
|
||||||
user['deactivated'] = deactivated
|
user['deactivated'] = deactivated
|
||||||
},
|
},
|
||||||
|
setDisplayBackground(state, url) {
|
||||||
|
console.log("Commiting user profile bg mutation")
|
||||||
|
state.displayBackground = url
|
||||||
|
},
|
||||||
setCurrentUser (state, user) {
|
setCurrentUser (state, user) {
|
||||||
state.lastLoginName = user.screen_name
|
state.lastLoginName = user.screen_name
|
||||||
state.currentUser = mergeWith(state.currentUser || {}, user, mergeArrayLength)
|
state.currentUser = mergeWith(state.currentUser || {}, user, mergeArrayLength)
|
||||||
|
@ -307,6 +311,7 @@ export const defaultState = {
|
||||||
currentUser: false,
|
currentUser: false,
|
||||||
users: [],
|
users: [],
|
||||||
usersObject: {},
|
usersObject: {},
|
||||||
|
displayBackground: null,
|
||||||
signUpPending: false,
|
signUpPending: false,
|
||||||
signUpErrors: [],
|
signUpErrors: [],
|
||||||
relationships: {},
|
relationships: {},
|
||||||
|
@ -319,6 +324,10 @@ const users = {
|
||||||
mutations,
|
mutations,
|
||||||
getters,
|
getters,
|
||||||
actions: {
|
actions: {
|
||||||
|
setDisplayBackground (store, url) {
|
||||||
|
console.log("Performing user profile bg action...")
|
||||||
|
store.commit('setDisplayBackground', url)
|
||||||
|
},
|
||||||
fetchUserIfMissing (store, id) {
|
fetchUserIfMissing (store, id) {
|
||||||
if (!store.getters.findUser(id)) {
|
if (!store.getters.findUser(id)) {
|
||||||
store.dispatch('fetchUser', id)
|
store.dispatch('fetchUser', id)
|
||||||
|
|
|
@ -95,6 +95,7 @@ export const parseUser = (data) => {
|
||||||
if (data.akkoma) {
|
if (data.akkoma) {
|
||||||
output.instance = data.akkoma.instance
|
output.instance = data.akkoma.instance
|
||||||
output.status_ttl_days = data.akkoma.status_ttl_days
|
output.status_ttl_days = data.akkoma.status_ttl_days
|
||||||
|
output.permit_followback = data.akkoma.permit_followback
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.pleroma) {
|
if (data.pleroma) {
|
||||||
|
|
|
@ -3,8 +3,17 @@ import { filter } from 'lodash'
|
||||||
export const muteWordHits = (status, muteWords) => {
|
export const muteWordHits = (status, muteWords) => {
|
||||||
const statusText = status.text.toLowerCase()
|
const statusText = status.text.toLowerCase()
|
||||||
const statusSummary = status.summary.toLowerCase()
|
const statusSummary = status.summary.toLowerCase()
|
||||||
|
|
||||||
const hits = filter(muteWords, (muteWord) => {
|
const hits = filter(muteWords, (muteWord) => {
|
||||||
return statusText.includes(muteWord.toLowerCase()) || statusSummary.includes(muteWord.toLowerCase())
|
muteWord = muteWord.toLowerCase()
|
||||||
|
|
||||||
|
let res = statusText.includes(muteWord) || statusSummary.includes(muteWord)
|
||||||
|
|
||||||
|
for (let attachment of status.attachments) {
|
||||||
|
res |= attachment.description?.toLowerCase().includes(muteWord)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res
|
||||||
})
|
})
|
||||||
|
|
||||||
return hits
|
return hits
|
||||||
|
|
Loading…
Reference in a new issue