change defaults

This commit is contained in:
Henry Jameson 2021-06-08 14:51:42 +03:00 committed by Sam Therapy
parent 659bf3e265
commit b543eaf9c0
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
10 changed files with 74 additions and 59 deletions

View file

@ -52,10 +52,10 @@ const MentionLink = {
if (this.highlight) return highlightClass(this.user)
},
oldPlace () {
return this.mergedConfig.mentionsOldPlace
return !this.mergedConfig.mentionsOwnLine
},
oldStyle () {
return this.mergedConfig.mentionsOldStyle
return !this.mergedConfig.mentionsNewStyle
},
style () {
if (this.highlight) {

View file

@ -1,8 +1,8 @@
<template>
<span
class="MentionLink"
:class="{ '-oldPlace': oldPlace }"
>
<span
class="MentionLink"
:class="{ '-oldPlace': oldPlace }"
>
<!-- eslint-disable vue/no-v-html -->
<a
v-if="!user"
@ -23,8 +23,14 @@
@click.prevent="onClick"
>
<!-- eslint-disable vue/no-v-html -->
<span class="shortName"><span class="userName" v-html="userName" /></span>
<span class="you" v-if="isYou">{{ $t('status.you') }}</span>
<span class="shortName"><span
class="userName"
v-html="userName"
/></span>
<span
v-if="isYou"
class="you"
>{{ $t('status.you') }}</span>
<!-- eslint-enable vue/no-v-html -->
</button>
<span
@ -33,7 +39,10 @@
:class="[highlightType]"
>
<!-- eslint-disable vue/no-v-html -->
<span class="userNameFull" v-html="userNameFull" />
<span
class="userNameFull"
v-html="userNameFull"
/>
<!-- eslint-enable vue/no-v-html -->
</span>
</span>

View file

@ -15,7 +15,7 @@ const MentionsLine = {
},
computed: {
oldStyle () {
return this.mergedConfig.mentionsOldStyle
return !this.mergedConfig.mentionsNewStyle
},
limit () {
return 6
@ -39,7 +39,7 @@ const MentionsLine = {
: '-newStyle'
]
},
...mapGetters(['mergedConfig']),
...mapGetters(['mergedConfig'])
},
methods: {
toggleShowMore () {

View file

@ -1,42 +1,45 @@
<template>
<span class="MentionsLine">
<MentionLink
v-for="mention in mentions"
class="mention-link"
:key="mention.statusnet_profile_url"
:content="mention.statusnet_profile_url"
:url="mention.statusnet_profile_url"
:first-mention="false"
/><span v-if="manyMentions" class="extraMentions">
<span
v-if="expanded"
class="fullExtraMentions"
<span class="MentionsLine">
<MentionLink
v-for="mention in mentions"
:key="mention.statusnet_profile_url"
class="mention-link"
:content="mention.statusnet_profile_url"
:url="mention.statusnet_profile_url"
:first-mention="false"
/><span
v-if="manyMentions"
class="extraMentions"
>
<MentionLink
v-for="mention in extraMentions"
class="mention-link"
:key="mention.statusnet_profile_url"
:content="mention.statusnet_profile_url"
:url="mention.statusnet_profile_url"
:first-mention="false"
/>
</span><button
v-if="!expanded"
class="showMoreLess"
:class="buttonClasses"
@click="toggleShowMore"
>
{{ $t('status.plus_more', { number: extraMentions.length })}}
</button><button
v-if="expanded"
class="showMoreLess"
:class="buttonClasses"
@click="toggleShowMore"
>
{{ $t('general.show_less')}}
</button>
<span
v-if="expanded"
class="fullExtraMentions"
>
<MentionLink
v-for="mention in extraMentions"
:key="mention.statusnet_profile_url"
class="mention-link"
:content="mention.statusnet_profile_url"
:url="mention.statusnet_profile_url"
:first-mention="false"
/>
</span><button
v-if="!expanded"
class="showMoreLess"
:class="buttonClasses"
@click="toggleShowMore"
>
{{ $t('status.plus_more', { number: extraMentions.length }) }}
</button><button
v-if="expanded"
class="showMoreLess"
:class="buttonClasses"
@click="toggleShowMore"
>
{{ $t('general.show_less') }}
</button>
</span>
</span>
</span>
</template>
<script src="./mentions_line.js" ></script>
<style lang="scss" src="./mentions_line.scss" />

View file

@ -47,13 +47,13 @@
</BooleanSetting>
</li>
<li>
<BooleanSetting path="mentionsOldPlace">
{{ $t('settings.mentions_old_place') }}
<BooleanSetting path="mentionsOwnLine">
{{ $t('settings.mentions_new_place') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="mentionsOldStyle">
{{ $t('settings.mentions_old_style') }}
<BooleanSetting path="mentionsNewStyle">
{{ $t('settings.mentions_new_style') }}
</BooleanSetting>
</li>
<li>

View file

@ -163,8 +163,8 @@ const Status = {
muteWordHits () {
return muteWordHits(this.status, this.muteWords)
},
mentionsOldPlace () {
return this.mergedConfig.mentionsOldPlace
mentionsOwnLine () {
return this.mergedConfig.mentionsOwnLine
},
mentions () {
return this.statusoid.attentions.filter(attn => {

View file

@ -291,7 +291,10 @@
</div>
</div>
<div v-if="hasMentions && !mentionsOldPlace" class="heading-mentions-row">
<div
v-if="hasMentions && mentionsOwnLine"
class="heading-mentions-row"
>
<div
class="mentions"
>

View file

@ -105,8 +105,8 @@ const StatusContent = {
attachmentTypes () {
return this.status.attachments.map(file => fileType.fileType(file.mimetype))
},
mentionsOldPlace () {
return this.mergedConfig.mentionsOldPlace
mentionsOwnLine () {
return this.mergedConfig.mentionsOwnLine
},
mentions () {
return this.status.attentions

View file

@ -43,7 +43,7 @@
v-if="!hideSubjectStatus && !(singleLine && status.summary_html)"
>
<MentionsLine
v-if="mentionsOldPlace"
v-if="!mentionsOwnLine"
:attentions="status.attentions"
class="mentions-line"
/>

View file

@ -55,8 +55,8 @@ export const defaultState = {
interfaceLanguage: browserLocale,
hideScopeNotice: false,
useStreamingApi: false,
mentionsOldPlace: false,
mentionsOldStyle: false,
mentionsOwnLine: false,
mentionsNewStyle: false,
sidebarRight: undefined, // instance default
showThirdColumn: false, // instance default
scopeCopy: undefined, // instance default