wip
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user