1
0
This commit is contained in:
syuilo
2018-03-28 16:59:11 +09:00
parent 1acc30822d
commit 71065077f6
44 changed files with 132 additions and 126 deletions
@@ -19,10 +19,10 @@
<div class="browser" :class="{ fetching }" v-if="file == null">
<div class="info" v-if="info">
<p v-if="folder == null">{{ (info.usage / info.capacity * 100).toFixed(1) }}% %i18n:mobile.tags.mk-drive.used%</p>
<p v-if="folder != null && (folder.folders_count > 0 || folder.files_count > 0)">
<template v-if="folder.folders_count > 0">{{ folder.folders_count }} %i18n:mobile.tags.mk-drive.folder-count%</template>
<template v-if="folder.folders_count > 0 && folder.files_count > 0">%i18n:mobile.tags.mk-drive.count-separator%</template>
<template v-if="folder.files_count > 0">{{ folder.files_count }} %i18n:mobile.tags.mk-drive.file-count%</template>
<p v-if="folder != null && (folder.foldersCount > 0 || folder.filesCount > 0)">
<template v-if="folder.foldersCount > 0">{{ folder.foldersCount }} %i18n:mobile.tags.mk-drive.folder-count%</template>
<template v-if="folder.foldersCount > 0 && folder.filesCount > 0">%i18n:mobile.tags.mk-drive.count-separator%</template>
<template v-if="folder.filesCount > 0">{{ folder.filesCount }} %i18n:mobile.tags.mk-drive.file-count%</template>
</p>
</div>
<div class="folders" v-if="folders.length > 0">
@@ -1,13 +1,13 @@
<template>
<button class="mk-follow-button"
:class="{ wait: wait, follow: !user.is_following, unfollow: user.is_following }"
:class="{ wait: wait, follow: !user.isFollowing, unfollow: user.isFollowing }"
@click="onClick"
:disabled="wait"
>
<template v-if="!wait && user.is_following">%fa:minus%</template>
<template v-if="!wait && !user.is_following">%fa:plus%</template>
<template v-if="!wait && user.isFollowing">%fa:minus%</template>
<template v-if="!wait && !user.isFollowing">%fa:plus%</template>
<template v-if="wait">%fa:spinner .pulse .fw%</template>
{{ user.is_following ? '%i18n:mobile.tags.mk-follow-button.unfollow%' : '%i18n:mobile.tags.mk-follow-button.follow%' }}
{{ user.isFollowing ? '%i18n:mobile.tags.mk-follow-button.unfollow%' : '%i18n:mobile.tags.mk-follow-button.follow%' }}
</button>
</template>
@@ -43,23 +43,23 @@ export default Vue.extend({
onFollow(user) {
if (user.id == this.user.id) {
this.user.is_following = user.is_following;
this.user.isFollowing = user.isFollowing;
}
},
onUnfollow(user) {
if (user.id == this.user.id) {
this.user.is_following = user.is_following;
this.user.isFollowing = user.isFollowing;
}
},
onClick() {
this.wait = true;
if (this.user.is_following) {
if (this.user.isFollowing) {
(this as any).api('following/delete', {
userId: this.user.id
}).then(() => {
this.user.is_following = false;
this.user.isFollowing = false;
}).catch(err => {
console.error(err);
}).then(() => {
@@ -69,7 +69,7 @@ export default Vue.extend({
(this as any).api('following/create', {
userId: this.user.id
}).then(() => {
this.user.is_following = true;
this.user.isFollowing = true;
}).catch(err => {
console.error(err);
}).then(() => {
@@ -59,10 +59,10 @@
<footer>
<mk-reactions-viewer :post="p"/>
<button @click="reply" title="%i18n:mobile.tags.mk-post-detail.reply%">
%fa:reply%<p class="count" v-if="p.replies_count > 0">{{ p.replies_count }}</p>
%fa:reply%<p class="count" v-if="p.repliesCount > 0">{{ p.repliesCount }}</p>
</button>
<button @click="repost" title="Repost">
%fa:retweet%<p class="count" v-if="p.repost_count > 0">{{ p.repost_count }}</p>
%fa:retweet%<p class="count" v-if="p.repostCount > 0">{{ p.repostCount }}</p>
</button>
<button :class="{ reacted: p.my_reaction != null }" @click="react" ref="reactButton" title="%i18n:mobile.tags.mk-post-detail.reaction%">
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
@@ -122,9 +122,9 @@ export default Vue.extend({
return this.isRepost ? this.post.repost : this.post;
},
reactionsCount(): number {
return this.p.reaction_counts
? Object.keys(this.p.reaction_counts)
.map(key => this.p.reaction_counts[key])
return this.p.reactionCounts
? Object.keys(this.p.reactionCounts)
.map(key => this.p.reactionCounts[key])
.reduce((a, b) => a + b)
: 0;
},
+5 -5
View File
@@ -58,10 +58,10 @@
<footer>
<mk-reactions-viewer :post="p" ref="reactionsViewer"/>
<button @click="reply">
%fa:reply%<p class="count" v-if="p.replies_count > 0">{{ p.replies_count }}</p>
%fa:reply%<p class="count" v-if="p.repliesCount > 0">{{ p.repliesCount }}</p>
</button>
<button @click="repost" title="Repost">
%fa:retweet%<p class="count" v-if="p.repost_count > 0">{{ p.repost_count }}</p>
%fa:retweet%<p class="count" v-if="p.repostCount > 0">{{ p.repostCount }}</p>
</button>
<button :class="{ reacted: p.my_reaction != null }" @click="react" ref="reactButton">
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
@@ -110,9 +110,9 @@ export default Vue.extend({
return this.isRepost ? this.post.repost : this.post;
},
reactionsCount(): number {
return this.p.reaction_counts
? Object.keys(this.p.reaction_counts)
.map(key => this.p.reaction_counts[key])
return this.p.reactionCounts
? Object.keys(this.p.reactionCounts)
.map(key => this.p.reactionCounts[key])
.reduce((a, b) => a + b)
: 0;
},
@@ -34,7 +34,7 @@ export default Vue.extend({
mounted() {
(this as any).api('users/posts', {
userId: this.user.id,
with_media: this.withMedia,
withMedia: this.withMedia,
limit: limit + 1
}).then(posts => {
if (posts.length == limit + 1) {
@@ -51,7 +51,7 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('users/posts', {
userId: this.user.id,
with_media: this.withMedia,
withMedia: this.withMedia,
limit: limit + 1,
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
+1 -1
View File
@@ -8,7 +8,7 @@
v-if="!fetching"
:fetch="fetchUsers"
:count="user.followersCount"
:you-know-count="user.followers_you_know_count"
:you-know-count="user.followersYouKnowCount"
@loaded="onLoaded"
>
%i18n:mobile.tags.mk-user-followers.no-users%
+1 -1
View File
@@ -8,7 +8,7 @@
v-if="!fetching"
:fetch="fetchUsers"
:count="user.followingCount"
:you-know-count="user.following_you_know_count"
:you-know-count="user.followingYouKnowCount"
@loaded="onLoaded"
>
%i18n:mobile.tags.mk-user-following.no-users%
+1 -1
View File
@@ -34,7 +34,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('othello/games/show', {
game_id: this.$route.params.game
gameId: this.$route.params.game
}).then(game => {
this.game = game;
this.fetching = false;
+1 -1
View File
@@ -14,7 +14,7 @@
<div class="title">
<h1>{{ user.name }}</h1>
<span class="username">@{{ acct }}</span>
<span class="followed" v-if="user.is_followed">%i18n:mobile.tags.mk-user.follows-you%</span>
<span class="followed" v-if="user.isFollowed">%i18n:mobile.tags.mk-user.follows-you%</span>
</div>
<div class="description">{{ user.description }}</div>
<div class="info">
@@ -30,7 +30,7 @@ export default Vue.extend({
mounted() {
(this as any).api('users/posts', {
userId: this.user.id,
with_media: true,
withMedia: true,
limit: 6
}).then(posts => {
posts.forEach(post => {