diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-19 03:27:53 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-19 03:27:53 +0900 |
| commit | 1c95cdffdc70d5d84f5c7d80ee92f5b274b70493 (patch) | |
| tree | f98855eda419b56d28a7df79bbec2394fff53b5f /src | |
| parent | Update CHANGELOG.md (diff) | |
| parent | 特定ホストへのメンションの特別処理をクライアントに... (diff) | |
| download | sharkey-1c95cdffdc70d5d84f5c7d80ee92f5b274b70493.tar.gz sharkey-1c95cdffdc70d5d84f5c7d80ee92f5b274b70493.tar.bz2 sharkey-1c95cdffdc70d5d84f5c7d80ee92f5b274b70493.zip | |
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
Diffstat (limited to 'src')
| -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)}`; }, |