diff options
| author | rinsuki <428rinsuki+git@gmail.com> | 2019-07-19 03:13:47 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-19 03:13:47 +0900 |
| commit | 2af79e98551a295199672c338a38559411ce2bc3 (patch) | |
| tree | ae49542cda0100b8a385fa2d658d1bf8125ae7aa /src/client | |
| parent | fix #5071 (#5184) (diff) | |
| download | sharkey-2af79e98551a295199672c338a38559411ce2bc3.tar.gz sharkey-2af79e98551a295199672c338a38559411ce2bc3.tar.bz2 sharkey-2af79e98551a295199672c338a38559411ce2bc3.zip | |
特定ホストへのメンションの特別処理をクライアントに追加 (#5185)
* 特定ホストへのメンションの特別処理をクライアントに追加
Fix #5168
* Apply suggestions from code review
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* Apply suggestions from code review
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* Apply suggestions from code review
Co-Authored-By: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* Fix indent
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/common/views/components/mention.vue | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/client/app/common/views/components/mention.vue b/src/client/app/common/views/components/mention.vue index f212fd3ca5..4e9f9e90d6 100644 --- a/src/client/app/common/views/components/mention.vue +++ b/src/client/app/common/views/components/mention.vue @@ -1,11 +1,17 @@ <template> -<router-link class="ldlomzub" :to="`/${ canonical }`" v-user-preview="canonical"> +<router-link class="ldlomzub" :to="url" v-user-preview="canonical" v-if="url.startsWith('/')"> <span class="me" v-if="isMe">{{ $t('@.you') }}</span> <span class="main"> <span class="username">@{{ username }}</span> <span class="host" :class="{ fade: $store.state.settings.contrastedAcct }" v-if="(host != localHost) || $store.state.settings.showFullAcct">@{{ toUnicode(host) }}</span> </span> </router-link> +<a class="ldlomzub" :href="url" target="_blank" rel="noopener" v-else> + <span class="main"> + <span class="username">@{{ username }}</span> + <span class="host" :class="{ fade: $store.state.settings.contrastedAcct }">@{{ toUnicode(host) }}</span> + </span> +</a> </template> <script lang="ts"> @@ -32,6 +38,15 @@ export default Vue.extend({ }; }, computed: { + url(): string { + switch (this.host) { + case 'twitter.com': + case 'github.com': + return `https://${this.host}/${this.username}`; + default: + return `/${this.canonical}`; + } + }, canonical(): string { return this.host === localHost ? `@${this.username}` : `@${this.username}@${toUnicode(this.host)}`; }, |