change defaults

This commit is contained in:
Henry Jameson 2021-06-08 14:51:42 +03:00
parent 0ae3985a52
commit 7ae85c8318
10 changed files with 74 additions and 59 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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