summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/views/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-05-18 15:34:38 +0900
committerGitHub <noreply@github.com>2018-05-18 15:34:38 +0900
commit0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef (patch)
treebb848206ce941fdf784418ad18060522d51eec18 /src/client/app/desktop/views/components
parentNew translations ja.yml (Korean) (diff)
parent2.10.0 (diff)
downloadmisskey-0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef.tar.gz
misskey-0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef.tar.bz2
misskey-0d0c45a4cfa541c2d2d4abc2a332ee06ff8e89ef.zip
Merge branch 'master' into l10n_master
Diffstat (limited to 'src/client/app/desktop/views/components')
-rw-r--r--src/client/app/desktop/views/components/drive.file.vue4
-rw-r--r--src/client/app/desktop/views/components/home.vue48
-rw-r--r--src/client/app/desktop/views/components/media-image.vue2
-rw-r--r--src/client/app/desktop/views/components/note-detail.sub.vue2
-rw-r--r--src/client/app/desktop/views/components/note-detail.vue2
-rw-r--r--src/client/app/desktop/views/components/note-preview.vue7
-rw-r--r--src/client/app/desktop/views/components/notes.note.sub.vue2
-rw-r--r--src/client/app/desktop/views/components/notes.note.vue21
-rw-r--r--src/client/app/desktop/views/components/settings.api.vue2
-rw-r--r--src/client/app/desktop/views/components/settings.vue11
-rw-r--r--src/client/app/desktop/views/components/user-lists-window.vue2
-rw-r--r--src/client/app/desktop/views/components/user-preview.vue6
-rw-r--r--src/client/app/desktop/views/components/users-list.vue10
13 files changed, 69 insertions, 50 deletions
diff --git a/src/client/app/desktop/views/components/drive.file.vue b/src/client/app/desktop/views/components/drive.file.vue
index 39881711fa..d8b8420ece 100644
--- a/src/client/app/desktop/views/components/drive.file.vue
+++ b/src/client/app/desktop/views/components/drive.file.vue
@@ -50,7 +50,7 @@ export default Vue.extend({
return `${this.file.name}\n${this.file.type} ${Vue.filter('bytes')(this.file.datasize)}`;
},
background(): string {
- return this.file.properties.avgColor
+ return this.file.properties.avgColor && this.file.properties.avgColor.length == 3
? `rgb(${this.file.properties.avgColor.join(',')})`
: 'transparent';
}
@@ -129,7 +129,7 @@ export default Vue.extend({
},
onThumbnailLoaded() {
- if (this.file.properties.avgColor) {
+ if (this.file.properties.avgColor && this.file.properties.avgColor.length == 3) {
anime({
targets: this.$refs.thumbnail,
backgroundColor: `rgba(${this.file.properties.avgColor.join(',')}, 0)`,
diff --git a/src/client/app/desktop/views/components/home.vue b/src/client/app/desktop/views/components/home.vue
index cae6233cd8..a3d7927cfc 100644
--- a/src/client/app/desktop/views/components/home.vue
+++ b/src/client/app/desktop/views/components/home.vue
@@ -1,34 +1,34 @@
<template>
<div class="mk-home" :data-customize="customize">
<div class="customize" v-if="customize">
- <router-link to="/">%fa:check%完了</router-link>
+ <router-link to="/">%fa:check%%i18n:@done%</router-link>
<div>
<div class="adder">
- <p>ウィジェットを追加:</p>
+ <p>%i18n:@add-widget%</p>
<select v-model="widgetAdderSelected">
- <option value="profile">プロフィール</option>
- <option value="calendar">カレンダー</option>
- <option value="timemachine">カレンダー(タイムマシン)</option>
- <option value="activity">アクティビティ</option>
- <option value="rss">RSSリーダー</option>
- <option value="trends">トレンド</option>
- <option value="photo-stream">フォトストリーム</option>
- <option value="slideshow">スライドショー</option>
- <option value="version">バージョン</option>
- <option value="broadcast">ブロードキャスト</option>
- <option value="notifications">通知</option>
- <option value="users">おすすめユーザー</option>
- <option value="polls">投票</option>
- <option value="post-form">投稿フォーム</option>
- <option value="messaging">メッセージ</option>
- <option value="channel">チャンネル</option>
- <option value="access-log">アクセスログ</option>
- <option value="server">サーバー情報</option>
- <option value="donation">寄付のお願い</option>
- <option value="nav">ナビゲーション</option>
- <option value="tips">ヒント</option>
+ <option value="profile">%i18n:@profile%</option>
+ <option value="calendar">%i18n:@calendar%</option>
+ <option value="timemachine">%i18n:@timemachine%</option>
+ <option value="activity">%i18n:@activity%</option>
+ <option value="rss">%i18n:@rss%</option>
+ <option value="trends">%i18n:@trends%</option>
+ <option value="photo-stream">%i18n:@photo-stream%</option>
+ <option value="slideshow">%i18n:@slideshow%</option>
+ <option value="version">%i18n:@version%</option>
+ <option value="broadcast">%i18n:@broadcast%</option>
+ <option value="notifications">%i18n:@notifications%</option>
+ <option value="users">%i18n:@users%</option>
+ <option value="polls">%i18n:@polls%</option>
+ <option value="post-form">%i18n:@post-form%</option>
+ <option value="messaging">%i18n:@messaging%</option>
+ <option value="channel">%i18n:@channel%</option>
+ <option value="access-log">%i18n:@access-log%</option>
+ <option value="server">%i18n:@server%</option>
+ <option value="donation">%i18n:@donation%</option>
+ <option value="nav">%i18n:@nav%</option>
+ <option value="tips">%i18n:@tips%</option>
</select>
- <button @click="addWidget">追加</button>
+ <button @click="addWidget">%i18n:@add%</button>
</div>
<div class="trash">
<x-draggable v-model="trash" :options="{ group: 'x' }" @add="onTrash"></x-draggable>
diff --git a/src/client/app/desktop/views/components/media-image.vue b/src/client/app/desktop/views/components/media-image.vue
index e5803cc36e..b98a4707ec 100644
--- a/src/client/app/desktop/views/components/media-image.vue
+++ b/src/client/app/desktop/views/components/media-image.vue
@@ -26,7 +26,7 @@ export default Vue.extend({
computed: {
style(): any {
return {
- 'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
+ 'background-color': this.image.properties.avgColor && this.image.properties.avgColor.length == 3 ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
};
}
diff --git a/src/client/app/desktop/views/components/note-detail.sub.vue b/src/client/app/desktop/views/components/note-detail.sub.vue
index 24550c4e94..32119da50d 100644
--- a/src/client/app/desktop/views/components/note-detail.sub.vue
+++ b/src/client/app/desktop/views/components/note-detail.sub.vue
@@ -5,7 +5,7 @@
<header>
<div class="left">
<router-link class="name" :to="note.user | userPage" v-user-preview="note.userId">{{ note.user | userName }}</router-link>
- <span class="username">@{{ note.user | acct }}</span>
+ <span class="username"><mk-acct :user="note.user"/></span>
</div>
<div class="right">
<router-link class="time" :to="note | notePage">
diff --git a/src/client/app/desktop/views/components/note-detail.vue b/src/client/app/desktop/views/components/note-detail.vue
index a0e3915149..bda53db918 100644
--- a/src/client/app/desktop/views/components/note-detail.vue
+++ b/src/client/app/desktop/views/components/note-detail.vue
@@ -28,7 +28,7 @@
<mk-avatar class="avatar" :user="p.user"/>
<header>
<router-link class="name" :to="p.user | userPage" v-user-preview="p.user.id">{{ p.user | userName }}</router-link>
- <span class="username">@{{ p.user | acct }}</span>
+ <span class="username"><mk-acct :user="p.user"/></span>
<router-link class="time" :to="p | notePage">
<mk-time :time="p.createdAt"/>
</router-link>
diff --git a/src/client/app/desktop/views/components/note-preview.vue b/src/client/app/desktop/views/components/note-preview.vue
index d04abfc5a7..302c5e803f 100644
--- a/src/client/app/desktop/views/components/note-preview.vue
+++ b/src/client/app/desktop/views/components/note-preview.vue
@@ -4,7 +4,7 @@
<div class="main">
<header>
<router-link class="name" :to="note.user | userPage" v-user-preview="note.userId">{{ note.user | userName }}</router-link>
- <span class="username">@{{ note.user | acct }}</span>
+ <span class="username"><mk-acct :user="note.user"/></span>
<router-link class="time" :to="note | notePage">
<mk-time :time="note.createdAt"/>
</router-link>
@@ -59,17 +59,20 @@ root(isDark)
> .name
margin 0 .5em 0 0
padding 0
+ overflow hidden
color isDark ? #fff : #607073
font-size 1em
font-weight bold
text-decoration none
- white-space normal
+ text-overflow ellipsis
&:hover
text-decoration underline
> .username
margin 0 .5em 0 0
+ overflow hidden
+ text-overflow ellipsis
color isDark ? #606984 : #d1d8da
> .time
diff --git a/src/client/app/desktop/views/components/notes.note.sub.vue b/src/client/app/desktop/views/components/notes.note.sub.vue
index 575d605203..503982b1a8 100644
--- a/src/client/app/desktop/views/components/notes.note.sub.vue
+++ b/src/client/app/desktop/views/components/notes.note.sub.vue
@@ -4,7 +4,7 @@
<div class="main">
<header>
<router-link class="name" :to="note.user | userPage" v-user-preview="note.userId">{{ note.user | userName }}</router-link>
- <span class="username">@{{ note.user | acct }}</span>
+ <span class="username"><mk-acct :user="note.user"/></span>
<div class="info">
<span class="mobile" v-if="note.viaMobile">%fa:mobile-alt%</span>
<router-link class="created-at" :to="note | notePage">
diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue
index 057c3c0956..8660a5f899 100644
--- a/src/client/app/desktop/views/components/notes.note.vue
+++ b/src/client/app/desktop/views/components/notes.note.vue
@@ -17,7 +17,7 @@
<header>
<router-link class="name" :to="p.user | userPage" v-user-preview="p.user.id">{{ p.user | userName }}</router-link>
<span class="is-bot" v-if="p.user.host === null && p.user.isBot">bot</span>
- <span class="username">@{{ p.user | acct }}</span>
+ <span class="username"><mk-acct :user="p.user"/></span>
<div class="info">
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
<span class="mobile" v-if="p.viaMobile">%fa:mobile-alt%</span>
@@ -44,7 +44,7 @@
<div class="text">
<span v-if="p.isHidden" style="opacity: 0.5">(この投稿は非公開です)</span>
<a class="reply" v-if="p.reply">%fa:reply%</a>
- <mk-note-html v-if="p.text" :text="p.text" :i="os.i" :class="$style.text"/>
+ <mk-note-html v-if="p.text && !canHideText(p)" :text="p.text" :i="os.i" :class="$style.text"/>
<a class="rp" v-if="p.renote">RP:</a>
</div>
<div class="media" v-if="p.media.length > 0">
@@ -94,6 +94,7 @@
<script lang="ts">
import Vue from 'vue';
import dateStringify from '../../../common/scripts/date-stringify';
+import canHideText from '../../../common/scripts/can-hide-text';
import parse from '../../../../../text/parse';
import MkPostFormWindow from './post-form-window.vue';
@@ -130,16 +131,17 @@ export default Vue.extend({
},
computed: {
-
isRenote(): boolean {
return (this.note.renote &&
this.note.text == null &&
this.note.mediaIds.length == 0 &&
this.note.poll == null);
},
+
p(): any {
return this.isRenote ? this.note.renote : this.note;
},
+
reactionsCount(): number {
return this.p.reactionCounts
? Object.keys(this.p.reactionCounts)
@@ -147,9 +149,11 @@ export default Vue.extend({
.reduce((a, b) => a + b)
: 0;
},
+
title(): string {
return dateStringify(this.p.createdAt);
},
+
urls(): string[] {
if (this.p.text) {
const ast = parse(this.p.text);
@@ -205,6 +209,8 @@ export default Vue.extend({
},
methods: {
+ canHideText,
+
capture(withHandler = false) {
if ((this as any).os.isSignedIn) {
this.connection.send({
@@ -214,6 +220,7 @@ export default Vue.extend({
if (withHandler) this.connection.on('note-updated', this.onStreamNoteUpdated);
}
},
+
decapture(withHandler = false) {
if ((this as any).os.isSignedIn) {
this.connection.send({
@@ -223,9 +230,11 @@ export default Vue.extend({
if (withHandler) this.connection.off('note-updated', this.onStreamNoteUpdated);
}
},
+
onStreamConnected() {
this.capture();
},
+
onStreamNoteUpdated(data) {
const note = data.note;
if (note.id == this.note.id) {
@@ -234,28 +243,33 @@ export default Vue.extend({
this.note.renote = note;
}
},
+
reply() {
(this as any).os.new(MkPostFormWindow, {
reply: this.p
});
},
+
renote() {
(this as any).os.new(MkRenoteFormWindow, {
note: this.p
});
},
+
react() {
(this as any).os.new(MkReactionPicker, {
source: this.$refs.reactButton,
note: this.p
});
},
+
menu() {
(this as any).os.new(MkNoteMenu, {
source: this.$refs.menuButton,
note: this.p
});
},
+
onKeydown(e) {
let shouldBeCancel = true;
@@ -336,6 +350,7 @@ root(isDark)
align-items center
padding 16px 32px
line-height 28px
+ white-space pre
color #9dbb00
background isDark ? linear-gradient(to bottom, #314027 0%, #282c37 100%) : linear-gradient(to bottom, #edfde2 0%, #fff 100%)
diff --git a/src/client/app/desktop/views/components/settings.api.vue b/src/client/app/desktop/views/components/settings.api.vue
index 377f2e689b..b22ee6cdab 100644
--- a/src/client/app/desktop/views/components/settings.api.vue
+++ b/src/client/app/desktop/views/components/settings.api.vue
@@ -1,6 +1,6 @@
<template>
<div class="root api">
- <p>Token: <code>{{ os.i.token }}</code></p>
+ <p>%i18n:@token% <code>{{ os.i.token }}</code></p>
<p>%i18n:@intro%</p>
<div class="ui info warn"><p>%fa:exclamation-triangle%%i18n:@caution%</p></div>
<p>%i18n:@regeneration-of-token%</p>
diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue
index 9439ded2fc..4e5e281fd0 100644
--- a/src/client/app/desktop/views/components/settings.vue
+++ b/src/client/app/desktop/views/components/settings.vue
@@ -80,10 +80,11 @@
<el-option label="自動" value=""/>
</el-option-group>
<el-option-group label="言語を指定">
- <el-option label="ja-JP" value="ja"/>
- <el-option label="en-US" value="en"/>
+ <el-option label="ja" value="ja"/>
+ <el-option label="en" value="en"/>
<el-option label="fr" value="fr"/>
<el-option label="pl" value="pl"/>
+ <el-option label="de" value="de"/>
</el-option-group>
</el-select>
<div class="none ui info">
@@ -100,7 +101,7 @@
</section>
<section class="notification" v-show="page == 'notification'">
- <h1>通知</h1>
+ <h1>%i18n:@notification%</h1>
<mk-switch v-model="os.i.settings.autoWatch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
<span>リアクションしたり返信したりした投稿に関する通知を自動的に受け取るようにします。</span>
</mk-switch>
@@ -117,7 +118,7 @@
</section>
<section class="apps" v-show="page == 'apps'">
- <h1>アプリケーション</h1>
+ <h1>%i18n:@apps%</h1>
<x-apps/>
</section>
@@ -137,7 +138,7 @@
</section>
<section class="signin" v-show="page == 'security'">
- <h1>サインイン履歴</h1>
+ <h1>%i18n:@signin%</h1>
<x-signins/>
</section>
diff --git a/src/client/app/desktop/views/components/user-lists-window.vue b/src/client/app/desktop/views/components/user-lists-window.vue
index d082610132..585c0a864f 100644
--- a/src/client/app/desktop/views/components/user-lists-window.vue
+++ b/src/client/app/desktop/views/components/user-lists-window.vue
@@ -3,7 +3,7 @@
<span slot="header">%fa:list% リスト</span>
<div data-id="6e4caea3-d8f9-4ab7-96de-ab67fe8d5c82" :data-darkmode="_darkmode_">
- <button class="ui" @click="add">リストを作成</button>
+ <button class="ui" @click="add">%i18n:@create-list%</button>
<a v-for="list in lists" :key="list.id" @click="choice(list)">{{ list.title }}</a>
</div>
</mk-window>
diff --git a/src/client/app/desktop/views/components/user-preview.vue b/src/client/app/desktop/views/components/user-preview.vue
index cc5e021390..f40e60dff9 100644
--- a/src/client/app/desktop/views/components/user-preview.vue
+++ b/src/client/app/desktop/views/components/user-preview.vue
@@ -10,13 +10,13 @@
<div class="description">{{ u.description }}</div>
<div class="status">
<div>
- <p>投稿</p><a>{{ u.notesCount }}</a>
+ <p>%i18n:@notes%</p><a>{{ u.notesCount }}</a>
</div>
<div>
- <p>フォロー</p><a>{{ u.followingCount }}</a>
+ <p>%i18n:@following%</p><a>{{ u.followingCount }}</a>
</div>
<div>
- <p>フォロワー</p><a>{{ u.followersCount }}</a>
+ <p>%i18n:@followers%</p><a>{{ u.followersCount }}</a>
</div>
</div>
<mk-follow-button v-if="os.isSignedIn && user.id != os.i.id" :user="u"/>
diff --git a/src/client/app/desktop/views/components/users-list.vue b/src/client/app/desktop/views/components/users-list.vue
index 13d0d07bbc..1ed5c33b13 100644
--- a/src/client/app/desktop/views/components/users-list.vue
+++ b/src/client/app/desktop/views/components/users-list.vue
@@ -2,8 +2,8 @@
<div class="mk-users-list">
<nav>
<div>
- <span :data-active="mode == 'all'" @click="mode = 'all'">すべて<span>{{ count }}</span></span>
- <span v-if="os.isSignedIn && youKnowCount" :data-active="mode == 'iknow'" @click="mode = 'iknow'">知り合い<span>{{ youKnowCount }}</span></span>
+ <span :data-active="mode == 'all'" @click="mode = 'all'">%i18n:@all%<span>{{ count }}</span></span>
+ <span v-if="os.isSignedIn && youKnowCount" :data-active="mode == 'iknow'" @click="mode = 'iknow'">%i18n:@iknow%<span>{{ youKnowCount }}</span></span>
</div>
</nav>
<div class="users" v-if="!fetching && users.length != 0">
@@ -12,13 +12,13 @@
</div>
</div>
<button class="more" v-if="!fetching && next != null" @click="more" :disabled="moreFetching">
- <span v-if="!moreFetching">もっと</span>
- <span v-if="moreFetching">読み込み中<mk-ellipsis/></span>
+ <span v-if="!moreFetching">%i18n:@load-more%</span>
+ <span v-if="moreFetching">%i18n:common.loading%<mk-ellipsis/></span>
</button>
<p class="no" v-if="!fetching && users.length == 0">
<slot></slot>
</p>
- <p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%読み込んでいます<mk-ellipsis/></p>
+ <p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:@fetching%<mk-ellipsis/></p>
</div>
</template>