From 22c8f71945c6d114bf4db89c87eb1b166775f2d6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 7 Jun 2021 16:16:10 +0300 Subject: mention link --- src/modules/users.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/modules') diff --git a/src/modules/users.js b/src/modules/users.js index 2b416f94..9ed06897 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -246,6 +246,10 @@ export const getters = { } return result }, + findUserByUrl: state => query => { + return state.users + .find(u => u.statusnet_profile_url.toLowerCase() === query.toLowerCase()) + }, relationship: state => id => { const rel = id && state.relationships[id] return rel || { id, loading: true } -- cgit v1.2.3-70-g09d2 From 5e8367227424fc2ff1683a244b55809ac4a52d3d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 7 Jun 2021 20:01:57 +0300 Subject: fixed some strange error --- src/modules/users.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modules') diff --git a/src/modules/users.js b/src/modules/users.js index 9ed06897..fb92cc91 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -248,7 +248,8 @@ export const getters = { }, findUserByUrl: state => query => { return state.users - .find(u => u.statusnet_profile_url.toLowerCase() === query.toLowerCase()) + .find(u => u.statusnet_profile_url && + u.statusnet_profile_url.toLowerCase() === query.toLowerCase()) }, relationship: state => id => { const rel = id && state.relationships[id] -- cgit v1.2.3-70-g09d2 From 9ea370033af450c0d5e4650a7c10f0e1ffec911c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 8 Jun 2021 12:58:28 +0300 Subject: configurable mentions placement --- src/components/mention_link/mention_link.js | 14 ++--- src/components/mention_link/mention_link.scss | 22 ++++---- src/components/mention_link/mention_link.vue | 9 ++-- src/components/rich_content/rich_content.jsx | 1 - src/components/settings_modal/tabs/general_tab.vue | 10 ++++ src/components/status/status.js | 8 ++- src/components/status/status.vue | 60 +++++++++++----------- src/i18n/en.json | 2 + src/modules/config.js | 2 + 9 files changed, 75 insertions(+), 53 deletions(-) (limited to 'src/modules') diff --git a/src/components/mention_link/mention_link.js b/src/components/mention_link/mention_link.js index 465c7d00..8a93e8a3 100644 --- a/src/components/mention_link/mention_link.js +++ b/src/components/mention_link/mention_link.js @@ -13,11 +13,6 @@ const MentionLink = { required: true, type: String }, - origattrs: { - required: false, - type: Object, - default: {} - }, firstMention: { required: false, type: Boolean, @@ -56,6 +51,12 @@ const MentionLink = { highlightClass () { if (this.highlight) return highlightClass(this.user) }, + oldPlace () { + return this.mergedConfig.mentionsOldPlace + }, + oldStyle () { + return this.mergedConfig.mentionsOldStyle + }, style () { if (this.highlight) { const { @@ -72,7 +73,8 @@ const MentionLink = { { '-you': this.isYou, '-highlighted': this.highlight, - '-firstMention': this.firstMention + '-firstMention': this.firstMention, + '-oldStyle': this.oldStyle }, this.highlightType ] diff --git a/src/components/mention_link/mention_link.scss b/src/components/mention_link/mention_link.scss index dec11014..261aeaef 100644 --- a/src/components/mention_link/mention_link.scss +++ b/src/components/mention_link/mention_link.scss @@ -3,6 +3,7 @@ white-space: normal; display: inline-block; color: var(--link); + margin-right: 0.25em; & .new, & .original { @@ -33,23 +34,25 @@ & .short, & .full { &::before { - color: var(--faint); content: '@'; } } .new { - &.-firstMention { - display: none; + &.-you { + & .shortName, + & .full { + font-weight: 600; + } } - &, - &.-highlighted { + &:not(.-oldStyle) { .short { line-height: 1.5; font-size: inherit; &::before { + color: var(--faint); display: inline-block; height: 50%; line-height: 1; @@ -111,12 +114,9 @@ } } - .new { - &.-you { - & .shortName, - & .full { - font-weight: 600; - } + &:not(.-oldPlace) { + .new.-firstMention { + display: none; } } diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue index 05f6fd91..0dae1f53 100644 --- a/src/components/mention_link/mention_link.vue +++ b/src/components/mention_link/mention_link.vue @@ -1,5 +1,8 @@