Resolve conflicts

This commit is contained in:
syuilo
2018-03-29 14:48:47 +09:00
parent 281b388e39
commit bfc193d8cd
308 changed files with 3045 additions and 3200 deletions

View File

@ -7,7 +7,7 @@
<div class="app">
<section>
<h2>{{ app.name }}</h2>
<p class="nid">{{ app.name_id }}</p>
<p class="nid">{{ app.nameId }}</p>
<p class="description">{{ app.description }}</p>
</section>
<section>

View File

@ -14,9 +14,9 @@
<p>このアプリがあなたのアカウントにアクセスすることはありません</p>
</div>
<div class="accepted" v-if="state == 'accepted'">
<h1>{{ session.app.is_authorized ? 'このアプリは既に連携済みです' : 'アプリケーションの連携を許可しました'}}</h1>
<p v-if="session.app.callback_url">アプリケーションに戻っています<mk-ellipsis/></p>
<p v-if="!session.app.callback_url">アプリケーションに戻ってやっていってください</p>
<h1>{{ session.app.isAuthorized ? 'このアプリは既に連携済みです' : 'アプリケーションの連携を許可しました' }}</h1>
<p v-if="session.app.callbackUrl">アプリケーションに戻っています<mk-ellipsis/></p>
<p v-if="!session.app.callbackUrl">アプリケーションに戻ってやっていってください</p>
</div>
<div class="error" v-if="state == 'fetch-session-error'">
<p>セッションが存在しません</p>
@ -61,7 +61,7 @@ export default Vue.extend({
this.fetching = false;
// 既に連携していた場合
if (this.session.app.is_authorized) {
if (this.session.app.isAuthorized) {
this.$root.$data.os.api('auth/accept', {
token: this.session.token
}).then(() => {
@ -77,8 +77,8 @@ export default Vue.extend({
methods: {
accepted() {
this.state = 'accepted';
if (this.session.app.callback_url) {
location.href = this.session.app.callback_url + '?token=' + this.session.token;
if (this.session.app.callbackUrl) {
location.href = this.session.app.callbackUrl + '?token=' + this.session.token;
}
}
}

View File

@ -5,8 +5,8 @@
<h1>{ channel.title }</h1>
<div v-if="$root.$data.os.isSignedIn">
<p v-if="channel.is_watching">このチャンネルをウォッチしています <a @click="unwatch">ウォッチ解除</a></p>
<p v-if="!channel.is_watching"><a @click="watch">このチャンネルをウォッチする</a></p>
<p v-if="channel.isWatching">このチャンネルをウォッチしています <a @click="unwatch">ウォッチ解除</a></p>
<p v-if="!channel.isWatching"><a @click="watch">このチャンネルをウォッチする</a></p>
</div>
<div class="share">
@ -77,7 +77,7 @@
// チャンネル概要読み込み
this.$root.$data.os.api('channels/show', {
channel_id: this.id
channelId: this.id
}).then(channel => {
if (fetched) {
Progress.done();
@ -96,7 +96,7 @@
// 投稿読み込み
this.$root.$data.os.api('channels/posts', {
channel_id: this.id
channelId: this.id
}).then(posts => {
if (fetched) {
Progress.done();
@ -125,7 +125,7 @@
this.posts.unshift(post);
this.update();
if (document.hidden && this.$root.$data.os.isSignedIn && post.user_id !== this.$root.$data.os.i.id) {
if (document.hidden && this.$root.$data.os.isSignedIn && post.userId !== this.$root.$data.os.i.id) {
this.unreadCount++;
document.title = `(${this.unreadCount}) ${this.channel.title} | Misskey`;
}
@ -140,9 +140,9 @@
this.watch = () => {
this.$root.$data.os.api('channels/watch', {
channel_id: this.id
channelId: this.id
}).then(() => {
this.channel.is_watching = true;
this.channel.isWatching = true;
this.update();
}, e => {
alert('error');
@ -151,9 +151,9 @@
this.unwatch = () => {
this.$root.$data.os.api('channels/unwatch', {
channel_id: this.id
channelId: this.id
}).then(() => {
this.channel.is_watching = false;
this.channel.isWatching = false;
this.update();
}, e => {
alert('error');
@ -166,8 +166,8 @@
<header>
<a class="index" @click="reply">{ post.index }:</a>
<a class="name" href={ _URL_ + '/@' + acct }><b>{ post.user.name }</b></a>
<mk-time time={ post.created_at }/>
<mk-time time={ post.created_at } mode="detail"/>
<mk-time time={ post.createdAt }/>
<mk-time time={ post.createdAt } mode="detail"/>
<span>ID:<i>{ acct }</i></span>
</header>
<div>
@ -328,9 +328,9 @@
this.$root.$data.os.api('posts/create', {
text: this.$refs.text.value == '' ? undefined : this.$refs.text.value,
media_ids: files,
reply_id: this.reply ? this.reply.id : undefined,
channel_id: this.channel.id
mediaIds: files,
replyId: this.reply ? this.reply.id : undefined,
channelId: this.channel.id
}).then(data => {
this.clear();
}).catch(err => {

View File

@ -56,14 +56,14 @@ export default function<T extends object>(data: {
id: this.id,
data: newProps
}).then(() => {
(this as any).os.i.account.client_settings.mobile_home.find(w => w.id == this.id).data = newProps;
(this as any).os.i.account.clientSettings.mobile_home.find(w => w.id == this.id).data = newProps;
});
} else {
(this as any).api('i/update_home', {
id: this.id,
data: newProps
}).then(() => {
(this as any).os.i.account.client_settings.home.find(w => w.id == this.id).data = newProps;
(this as any).os.i.account.clientSettings.home.find(w => w.id == this.id).data = newProps;
});
}
}, {

View File

@ -294,12 +294,12 @@ export default class MiOS extends EventEmitter {
const fetched = me => {
if (me) {
// デフォルトの設定をマージ
me.account.client_settings = Object.assign({
me.account.clientSettings = Object.assign({
fetchOnScroll: true,
showMaps: true,
showPostFormOnTopOfTl: false,
gradientWindowHeader: false
}, me.account.client_settings);
}, me.account.clientSettings);
// ローカルストレージにキャッシュ
localStorage.setItem('me', JSON.stringify(me));

View File

@ -23,42 +23,42 @@ export default function(type, data): Notification {
return {
title: `${data.user.name}さんから:`,
body: getPostSummary(data),
icon: data.user.avatar_url + '?thumbnail&size=64'
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'reply':
return {
title: `${data.user.name}さんから返信:`,
body: getPostSummary(data),
icon: data.user.avatar_url + '?thumbnail&size=64'
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'quote':
return {
title: `${data.user.name}さんが引用:`,
body: getPostSummary(data),
icon: data.user.avatar_url + '?thumbnail&size=64'
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'reaction':
return {
title: `${data.user.name}: ${getReactionEmoji(data.reaction)}:`,
body: getPostSummary(data.post),
icon: data.user.avatar_url + '?thumbnail&size=64'
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'unread_messaging_message':
return {
title: `${data.user.name}さんからメッセージ:`,
body: data.text, // TODO: getMessagingMessageSummary(data),
icon: data.user.avatar_url + '?thumbnail&size=64'
icon: data.user.avatarUrl + '?thumbnail&size=64'
};
case 'othello_invited':
return {
title: '対局への招待があります',
body: `${data.parent.name}さんから`,
icon: data.parent.avatar_url + '?thumbnail&size=64'
icon: data.parent.avatarUrl + '?thumbnail&size=64'
};
default:

View File

@ -8,10 +8,10 @@ export default function(qs: string) {
const [key, value] = x.split(':');
switch (key) {
case 'user':
q['include_user_usernames'] = value.split(',');
q['includeUserUsernames'] = value.split(',');
break;
case 'exclude_user':
q['exclude_user_usernames'] = value.split(',');
q['excludeUserUsernames'] = value.split(',');
break;
case 'follow':
q['following'] = value == 'null' ? null : value == 'true';

View File

@ -16,7 +16,7 @@ export class HomeStream extends Stream {
// 最終利用日時を更新するため定期的にaliveメッセージを送信
setInterval(() => {
this.send({ type: 'alive' });
me.account.last_used_at = new Date();
me.account.lastUsedAt = new Date();
}, 1000 * 60);
// 自分の情報が更新されたとき

View File

@ -2,7 +2,7 @@
<div class="mk-autocomplete" @contextmenu.prevent="() => {}">
<ol class="users" ref="suggests" v-if="users.length > 0">
<li v-for="user in users" @click="complete(type, user)" @keydown="onKeydown" tabindex="-1">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=32`" alt=""/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=32`" alt=""/>
<span class="name">{{ user.name }}</span>
<span class="username">@{{ getAcct(user) }}</span>
</li>

View File

@ -151,9 +151,9 @@ export default Vue.extend({
send() {
this.sending = true;
(this as any).api('messaging/messages/create', {
user_id: this.user.id,
userId: this.user.id,
text: this.text ? this.text : undefined,
file_id: this.file ? this.file.id : undefined
fileId: this.file ? this.file.id : undefined
}).then(message => {
this.clear();
}).catch(err => {
@ -173,7 +173,7 @@ export default Vue.extend({
const data = JSON.parse(localStorage.getItem('message_drafts') || '{}');
data[this.draftId] = {
updated_at: new Date(),
updatedAt: new Date(),
data: {
text: this.text,
file: this.file

View File

@ -1,15 +1,15 @@
<template>
<div class="message" :data-is-me="isMe">
<router-link class="avatar-anchor" :to="`/@${acct}`" :title="acct" target="_blank">
<img class="avatar" :src="`${message.user.avatar_url}?thumbnail&size=80`" alt=""/>
<img class="avatar" :src="`${message.user.avatarUrl}?thumbnail&size=80`" alt=""/>
</router-link>
<div class="content">
<div class="balloon" :data-no-text="message.text == null">
<p class="read" v-if="isMe && message.is_read">%i18n:common.tags.mk-messaging-message.is-read%</p>
<p class="read" v-if="isMe && message.isRead">%i18n:common.tags.mk-messaging-message.is-read%</p>
<button class="delete-button" v-if="isMe" title="%i18n:common.delete%">
<img src="/assets/desktop/messaging/delete.png" alt="Delete"/>
</button>
<div class="content" v-if="!message.is_deleted">
<div class="content" v-if="!message.isDeleted">
<mk-post-html class="text" v-if="message.ast" :ast="message.ast" :i="os.i"/>
<div class="file" v-if="message.file">
<a :href="message.file.url" target="_blank" :title="message.file.name">
@ -18,14 +18,14 @@
</a>
</div>
</div>
<div class="content" v-if="message.is_deleted">
<div class="content" v-if="message.isDeleted">
<p class="is-deleted">%i18n:common.tags.mk-messaging-message.deleted%</p>
</div>
</div>
<div></div>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
<footer>
<mk-time :time="message.created_at"/>
<mk-time :time="message.createdAt"/>
<template v-if="message.is_edited">%fa:pencil-alt%</template>
</footer>
</div>
@ -43,7 +43,7 @@ export default Vue.extend({
return getAcct(this.message.user);
},
isMe(): boolean {
return this.message.user_id == (this as any).os.i.id;
return this.message.userId == (this as any).os.i.id;
},
urls(): string[] {
if (this.message.ast) {

View File

@ -52,8 +52,8 @@ export default Vue.extend({
computed: {
_messages(): any[] {
return (this.messages as any).map(message => {
const date = new Date(message.created_at).getDate();
const month = new Date(message.created_at).getMonth() + 1;
const date = new Date(message.createdAt).getDate();
const month = new Date(message.createdAt).getMonth() + 1;
message._date = date;
message._datetext = `${month}${date}`;
return message;
@ -123,9 +123,9 @@ export default Vue.extend({
const max = this.existMoreMessages ? 20 : 10;
(this as any).api('messaging/messages', {
user_id: this.user.id,
userId: this.user.id,
limit: max + 1,
until_id: this.existMoreMessages ? this.messages[0].id : undefined
untilId: this.existMoreMessages ? this.messages[0].id : undefined
}).then(messages => {
if (messages.length == max + 1) {
this.existMoreMessages = true;
@ -158,7 +158,7 @@ export default Vue.extend({
const isBottom = this.isBottom();
this.messages.push(message);
if (message.user_id != (this as any).os.i.id && !document.hidden) {
if (message.userId != (this as any).os.i.id && !document.hidden) {
this.connection.send({
type: 'read',
id: message.id
@ -170,7 +170,7 @@ export default Vue.extend({
this.$nextTick(() => {
this.scrollToBottom();
});
} else if (message.user_id != (this as any).os.i.id) {
} else if (message.userId != (this as any).os.i.id) {
// Notify
this.notify('%i18n:common.tags.mk-messaging-room.new-message%');
}
@ -181,7 +181,7 @@ export default Vue.extend({
ids.forEach(id => {
if (this.messages.some(x => x.id == id)) {
const exist = this.messages.map(x => x.id).indexOf(id);
this.messages[exist].is_read = true;
this.messages[exist].isRead = true;
}
});
},
@ -223,7 +223,7 @@ export default Vue.extend({
onVisibilitychange() {
if (document.hidden) return;
this.messages.forEach(message => {
if (message.user_id !== (this as any).os.i.id && !message.is_read) {
if (message.userId !== (this as any).os.i.id && !message.isRead) {
this.connection.send({
type: 'read',
id: message.id

View File

@ -13,7 +13,7 @@
@click="navigate(user)"
tabindex="-1"
>
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=32`" alt=""/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=32`" alt=""/>
<span class="name">{{ user.name }}</span>
<span class="username">@{{ getAcct(user) }}</span>
</li>
@ -26,16 +26,16 @@
class="user"
:href="`/i/messaging/${getAcct(isMe(message) ? message.recipient : message.user)}`"
:data-is-me="isMe(message)"
:data-is-read="message.is_read"
:data-is-read="message.isRead"
@click.prevent="navigate(isMe(message) ? message.recipient : message.user)"
:key="message.id"
>
<div>
<img class="avatar" :src="`${isMe(message) ? message.recipient.avatar_url : message.user.avatar_url}?thumbnail&size=64`" alt=""/>
<img class="avatar" :src="`${isMe(message) ? message.recipient.avatarUrl : message.user.avatarUrl}?thumbnail&size=64`" alt=""/>
<header>
<span class="name">{{ isMe(message) ? message.recipient.name : message.user.name }}</span>
<span class="username">@{{ getAcct(isMe(message) ? message.recipient : message.user) }}</span>
<mk-time :time="message.created_at"/>
<mk-time :time="message.createdAt"/>
</header>
<div class="body">
<p class="text"><span class="me" v-if="isMe(message)">%i18n:common.tags.mk-messaging.you%:</span>{{ message.text }}</p>
@ -95,19 +95,19 @@ export default Vue.extend({
methods: {
getAcct,
isMe(message) {
return message.user_id == (this as any).os.i.id;
return message.userId == (this as any).os.i.id;
},
onMessage(message) {
this.messages = this.messages.filter(m => !(
(m.recipient_id == message.recipient_id && m.user_id == message.user_id) ||
(m.recipient_id == message.user_id && m.user_id == message.recipient_id)));
(m.recipientId == message.recipientId && m.userId == message.userId) ||
(m.recipientId == message.userId && m.userId == message.recipientId)));
this.messages.unshift(message);
},
onRead(ids) {
ids.forEach(id => {
const found = this.messages.find(m => m.id == id);
if (found) found.is_read = true;
if (found) found.isRead = true;
});
},
search() {

View File

@ -3,30 +3,30 @@
<header><b>{{ blackUser.name }}</b>() vs <b>{{ whiteUser.name }}</b>()</header>
<div style="overflow: hidden">
<p class="turn" v-if="!iAmPlayer && !game.is_ended">{{ turnUser.name }}のターンです<mk-ellipsis/></p>
<p class="turn" v-if="!iAmPlayer && !game.isEnded">{{ turnUser.name }}のターンです<mk-ellipsis/></p>
<p class="turn" v-if="logPos != logs.length">{{ turnUser.name }}のターン</p>
<p class="turn1" v-if="iAmPlayer && !game.is_ended && !isMyTurn">相手のターンです<mk-ellipsis/></p>
<p class="turn2" v-if="iAmPlayer && !game.is_ended && isMyTurn" v-animate-css="{ classes: 'tada', iteration: 'infinite' }">あなたのターンです</p>
<p class="result" v-if="game.is_ended && logPos == logs.length">
<template v-if="game.winner"><b>{{ game.winner.name }}</b>の勝ち{{ game.settings.is_llotheo ? ' (ロセオ)' : '' }}</template>
<p class="turn1" v-if="iAmPlayer && !game.isEnded && !isMyTurn">相手のターンです<mk-ellipsis/></p>
<p class="turn2" v-if="iAmPlayer && !game.isEnded && isMyTurn" v-animate-css="{ classes: 'tada', iteration: 'infinite' }">あなたのターンです</p>
<p class="result" v-if="game.isEnded && logPos == logs.length">
<template v-if="game.winner"><b>{{ game.winner.name }}</b>の勝ち{{ game.settings.isLlotheo ? ' (ロセオ)' : '' }}</template>
<template v-else>引き分け</template>
</p>
</div>
<div class="board" :style="{ 'grid-template-rows': `repeat(${ game.settings.map.length }, 1fr)`, 'grid-template-columns': `repeat(${ game.settings.map[0].length }, 1fr)` }">
<div v-for="(stone, i) in o.board"
:class="{ empty: stone == null, none: o.map[i] == 'null', isEnded: game.is_ended, myTurn: !game.is_ended && isMyTurn, can: turnUser ? o.canPut(turnUser.id == blackUser.id, i) : null, prev: o.prevPos == i }"
:class="{ empty: stone == null, none: o.map[i] == 'null', isEnded: game.isEnded, myTurn: !game.isEnded && isMyTurn, can: turnUser ? o.canPut(turnUser.id == blackUser.id, i) : null, prev: o.prevPos == i }"
@click="set(i)"
:title="'[' + (o.transformPosToXy(i)[0] + 1) + ', ' + (o.transformPosToXy(i)[1] + 1) + '] (' + i + ')'"
>
<img v-if="stone === true" :src="`${blackUser.avatar_url}?thumbnail&size=128`" alt="">
<img v-if="stone === false" :src="`${whiteUser.avatar_url}?thumbnail&size=128`" alt="">
<img v-if="stone === true" :src="`${blackUser.avatarUrl}?thumbnail&size=128`" alt="">
<img v-if="stone === false" :src="`${whiteUser.avatarUrl}?thumbnail&size=128`" alt="">
</div>
</div>
<p class="status"><b>{{ logPos }}ターン目</b> :{{ o.blackCount }} :{{ o.whiteCount }} 合計:{{ o.blackCount + o.whiteCount }}</p>
<div class="player" v-if="game.is_ended">
<div class="player" v-if="game.isEnded">
<el-button-group>
<el-button type="primary" @click="logPos = 0" :disabled="logPos == 0">%fa:angle-double-left%</el-button>
<el-button type="primary" @click="logPos--" :disabled="logPos == 0">%fa:angle-left%</el-button>
@ -62,12 +62,12 @@ export default Vue.extend({
computed: {
iAmPlayer(): boolean {
if (!(this as any).os.isSignedIn) return false;
return this.game.user1_id == (this as any).os.i.id || this.game.user2_id == (this as any).os.i.id;
return this.game.user1Id == (this as any).os.i.id || this.game.user2Id == (this as any).os.i.id;
},
myColor(): Color {
if (!this.iAmPlayer) return null;
if (this.game.user1_id == (this as any).os.i.id && this.game.black == 1) return true;
if (this.game.user2_id == (this as any).os.i.id && this.game.black == 2) return true;
if (this.game.user1Id == (this as any).os.i.id && this.game.black == 1) return true;
if (this.game.user2Id == (this as any).os.i.id && this.game.black == 2) return true;
return false;
},
opColor(): Color {
@ -97,11 +97,11 @@ export default Vue.extend({
watch: {
logPos(v) {
if (!this.game.is_ended) return;
if (!this.game.isEnded) return;
this.o = new Othello(this.game.settings.map, {
isLlotheo: this.game.settings.is_llotheo,
canPutEverywhere: this.game.settings.can_put_everywhere,
loopedBoard: this.game.settings.looped_board
isLlotheo: this.game.settings.isLlotheo,
canPutEverywhere: this.game.settings.canPutEverywhere,
loopedBoard: this.game.settings.loopedBoard
});
this.logs.forEach((log, i) => {
if (i < v) {
@ -116,9 +116,9 @@ export default Vue.extend({
this.game = this.initGame;
this.o = new Othello(this.game.settings.map, {
isLlotheo: this.game.settings.is_llotheo,
canPutEverywhere: this.game.settings.can_put_everywhere,
loopedBoard: this.game.settings.looped_board
isLlotheo: this.game.settings.isLlotheo,
canPutEverywhere: this.game.settings.canPutEverywhere,
loopedBoard: this.game.settings.loopedBoard
});
this.game.logs.forEach(log => {
@ -129,7 +129,7 @@ export default Vue.extend({
this.logPos = this.logs.length;
// 通信を取りこぼしてもいいように定期的にポーリングさせる
if (this.game.is_started && !this.game.is_ended) {
if (this.game.isStarted && !this.game.isEnded) {
this.pollingClock = setInterval(() => {
const crc32 = CRC32.str(this.logs.map(x => x.pos.toString()).join(''));
this.connection.send({
@ -154,7 +154,7 @@ export default Vue.extend({
methods: {
set(pos) {
if (this.game.is_ended) return;
if (this.game.isEnded) return;
if (!this.iAmPlayer) return;
if (!this.isMyTurn) return;
if (!this.o.canPut(this.myColor, pos)) return;
@ -194,16 +194,16 @@ export default Vue.extend({
},
checkEnd() {
this.game.is_ended = this.o.isEnded;
if (this.game.is_ended) {
this.game.isEnded = this.o.isEnded;
if (this.game.isEnded) {
if (this.o.winner === true) {
this.game.winner_id = this.game.black == 1 ? this.game.user1_id : this.game.user2_id;
this.game.winnerId = this.game.black == 1 ? this.game.user1Id : this.game.user2Id;
this.game.winner = this.game.black == 1 ? this.game.user1 : this.game.user2;
} else if (this.o.winner === false) {
this.game.winner_id = this.game.black == 1 ? this.game.user2_id : this.game.user1_id;
this.game.winnerId = this.game.black == 1 ? this.game.user2Id : this.game.user1Id;
this.game.winner = this.game.black == 1 ? this.game.user2 : this.game.user1;
} else {
this.game.winner_id = null;
this.game.winnerId = null;
this.game.winner = null;
}
}
@ -214,9 +214,9 @@ export default Vue.extend({
this.game = game;
this.o = new Othello(this.game.settings.map, {
isLlotheo: this.game.settings.is_llotheo,
canPutEverywhere: this.game.settings.can_put_everywhere,
loopedBoard: this.game.settings.looped_board
isLlotheo: this.game.settings.isLlotheo,
canPutEverywhere: this.game.settings.canPutEverywhere,
loopedBoard: this.game.settings.loopedBoard
});
this.game.logs.forEach(log => {

View File

@ -1,6 +1,6 @@
<template>
<div>
<x-room v-if="!g.is_started" :game="g" :connection="connection"/>
<x-room v-if="!g.isStarted" :game="g" :connection="connection"/>
<x-game v-else :init-game="g" :connection="connection"/>
</div>
</template>

View File

@ -41,9 +41,9 @@
<div slot="header">
<span>ルール</span>
</div>
<mk-switch v-model="game.settings.is_llotheo" @change="updateSettings" text="石の少ない方が勝ち(ロセオ)"/>
<mk-switch v-model="game.settings.looped_board" @change="updateSettings" text="ループマップ"/>
<mk-switch v-model="game.settings.can_put_everywhere" @change="updateSettings" text="どこでも置けるモード"/>
<mk-switch v-model="game.settings.isLlotheo" @change="updateSettings" text="石の少ない方が勝ち(ロセオ)"/>
<mk-switch v-model="game.settings.loopedBoard" @change="updateSettings" text="ループマップ"/>
<mk-switch v-model="game.settings.canPutEverywhere" @change="updateSettings" text="どこでも置けるモード"/>
</el-card>
<el-card class="bot-form" v-if="form">
@ -116,13 +116,13 @@ export default Vue.extend({
return categories.filter((item, pos) => categories.indexOf(item) == pos);
},
isAccepted(): boolean {
if (this.game.user1_id == (this as any).os.i.id && this.game.user1_accepted) return true;
if (this.game.user2_id == (this as any).os.i.id && this.game.user2_accepted) return true;
if (this.game.user1Id == (this as any).os.i.id && this.game.user1Accepted) return true;
if (this.game.user2Id == (this as any).os.i.id && this.game.user2Accepted) return true;
return false;
},
isOpAccepted(): boolean {
if (this.game.user1_id != (this as any).os.i.id && this.game.user1_accepted) return true;
if (this.game.user2_id != (this as any).os.i.id && this.game.user2_accepted) return true;
if (this.game.user1Id != (this as any).os.i.id && this.game.user1Accepted) return true;
if (this.game.user2Id != (this as any).os.i.id && this.game.user2Accepted) return true;
return false;
}
},
@ -133,8 +133,8 @@ export default Vue.extend({
this.connection.on('init-form', this.onInitForm);
this.connection.on('message', this.onMessage);
if (this.game.user1_id != (this as any).os.i.id && this.game.settings.form1) this.form = this.game.settings.form1;
if (this.game.user2_id != (this as any).os.i.id && this.game.settings.form2) this.form = this.game.settings.form2;
if (this.game.user1Id != (this as any).os.i.id && this.game.settings.form1) this.form = this.game.settings.form1;
if (this.game.user2Id != (this as any).os.i.id && this.game.settings.form2) this.form = this.game.settings.form2;
},
beforeDestroy() {
@ -162,8 +162,8 @@ export default Vue.extend({
},
onChangeAccepts(accepts) {
this.game.user1_accepted = accepts.user1;
this.game.user2_accepted = accepts.user2;
this.game.user1Accepted = accepts.user1;
this.game.user2Accepted = accepts.user2;
this.$forceUpdate();
},
@ -185,12 +185,12 @@ export default Vue.extend({
},
onInitForm(x) {
if (x.user_id == (this as any).os.i.id) return;
if (x.userId == (this as any).os.i.id) return;
this.form = x.form;
},
onMessage(x) {
if (x.user_id == (this as any).os.i.id) return;
if (x.userId == (this as any).os.i.id) return;
this.messages.unshift(x.message);
},

View File

@ -31,28 +31,28 @@
<section v-if="invitations.length > 0">
<h2>対局の招待があります:</h2>
<div class="invitation" v-for="i in invitations" tabindex="-1" @click="accept(i)">
<img :src="`${i.parent.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${i.parent.avatarUrl}?thumbnail&size=32`" alt="">
<span class="name"><b>{{ i.parent.name }}</b></span>
<span class="username">@{{ i.parent.username }}</span>
<mk-time :time="i.created_at"/>
<mk-time :time="i.createdAt"/>
</div>
</section>
<section v-if="myGames.length > 0">
<h2>自分の対局</h2>
<a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
<img :src="`${g.user1.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
<span class="state">{{ g.is_ended ? '終了' : '進行中' }}</span>
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
</a>
</section>
<section v-if="games.length > 0">
<h2>みんなの対局</h2>
<a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
<img :src="`${g.user1.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
<span class="state">{{ g.is_ended ? '終了' : '進行中' }}</span>
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
</a>
</section>
</div>
@ -133,7 +133,7 @@ export default Vue.extend({
methods: {
go(game) {
(this as any).api('othello/games/show', {
game_id: game.id
gameId: game.id
}).then(game => {
this.matching = null;
this.game = game;
@ -147,7 +147,7 @@ export default Vue.extend({
username
}).then(user => {
(this as any).api('othello/match', {
user_id: user.id
userId: user.id
}).then(res => {
if (res == null) {
this.matching = user;
@ -164,7 +164,7 @@ export default Vue.extend({
},
accept(invitation) {
(this as any).api('othello/match', {
user_id: invitation.parent.id
userId: invitation.parent.id
}).then(game => {
if (game) {
this.matching = null;

View File

@ -4,7 +4,7 @@
<li v-for="choice in poll.choices" :key="choice.id" @click="vote(choice.id)" :class="{ voted: choice.voted }" :title="!isVoted ? '%i18n:common.tags.mk-poll.vote-to%'.replace('{}', choice.text) : ''">
<div class="backdrop" :style="{ 'width': (showResult ? (choice.votes / total * 100) : 0) + '%' }"></div>
<span>
<template v-if="choice.is_voted">%fa:check%</template>
<template v-if="choice.isVoted">%fa:check%</template>
<span>{{ choice.text }}</span>
<span class="votes" v-if="showResult">({{ '%i18n:common.tags.mk-poll.vote-count%'.replace('{}', choice.votes) }})</span>
</span>
@ -36,7 +36,7 @@ export default Vue.extend({
return this.poll.choices.reduce((a, b) => a + b.votes, 0);
},
isVoted(): boolean {
return this.poll.choices.some(c => c.is_voted);
return this.poll.choices.some(c => c.isVoted);
}
},
created() {
@ -47,15 +47,15 @@ export default Vue.extend({
this.showResult = !this.showResult;
},
vote(id) {
if (this.poll.choices.some(c => c.is_voted)) return;
if (this.poll.choices.some(c => c.isVoted)) return;
(this as any).api('posts/polls/vote', {
post_id: this.post.id,
postId: this.post.id,
choice: id
}).then(() => {
this.poll.choices.forEach(c => {
if (c.id == id) {
c.votes++;
Vue.set(c, 'is_voted', true);
Vue.set(c, 'isVoted', true);
}
});
this.showResult = true;

View File

@ -2,7 +2,7 @@
<div class="mk-post-menu">
<div class="backdrop" ref="backdrop" @click="close"></div>
<div class="popover" :class="{ compact }" ref="popover">
<button v-if="post.user_id == os.i.id" @click="pin">%i18n:common.tags.mk-post-menu.pin%</button>
<button v-if="post.userId == os.i.id" @click="pin">%i18n:common.tags.mk-post-menu.pin%</button>
</div>
</div>
</template>
@ -51,7 +51,7 @@ export default Vue.extend({
methods: {
pin() {
(this as any).api('i/pin', {
post_id: this.post.id
postId: this.post.id
}).then(() => {
this.$destroy();
});

View File

@ -69,7 +69,7 @@ export default Vue.extend({
methods: {
react(reaction) {
(this as any).api('posts/reactions/create', {
post_id: this.post.id,
postId: this.post.id,
reaction: reaction
}).then(() => {
if (this.cb) this.cb();

View File

@ -20,7 +20,7 @@ export default Vue.extend({
props: ['post'],
computed: {
reactions(): number {
return this.post.reaction_counts;
return this.post.reactionCounts;
}
}
});

View File

@ -1,12 +1,12 @@
<template>
<form class="mk-signin" :class="{ signing }" @submit.prevent="onSubmit">
<label class="user-name">
<input v-model="username" type="text" pattern="^[a-zA-Z0-9-]+$" placeholder="%i18n:common.tags.mk-signin.username%" autofocus required @change="onUsernameChange"/>%fa:at%
<input v-model="username" type="text" pattern="^[a-zA-Z0-9_]+$" placeholder="%i18n:common.tags.mk-signin.username%" autofocus required @change="onUsernameChange"/>%fa:at%
</label>
<label class="password">
<input v-model="password" type="password" placeholder="%i18n:common.tags.mk-signin.password%" required/>%fa:lock%
</label>
<label class="token" v-if="user && user.account.two_factor_enabled">
<label class="token" v-if="user && user.account.twoFactorEnabled">
<input v-model="token" type="number" placeholder="%i18n:common.tags.mk-signin.token%" required/>%fa:lock%
</label>
<button type="submit" :disabled="signing">{{ signing ? '%i18n:common.tags.mk-signin.signing-in%' : '%i18n:common.tags.mk-signin.signin%' }}</button>
@ -43,7 +43,7 @@ export default Vue.extend({
(this as any).api('signin', {
username: this.username,
password: this.password,
token: this.user && this.user.account.two_factor_enabled ? this.token : undefined
token: this.user && this.user.account.twoFactorEnabled ? this.token : undefined
}).then(() => {
location.reload();
}).catch(() => {

View File

@ -2,7 +2,7 @@
<form class="mk-signup" @submit.prevent="onSubmit" autocomplete="off">
<label class="username">
<p class="caption">%fa:at%%i18n:common.tags.mk-signup.username%</p>
<input v-model="username" type="text" pattern="^[a-zA-Z0-9-]{3,20}$" placeholder="a~z、A~Z、0~9、-" autocomplete="off" required @input="onChangeUsername"/>
<input v-model="username" type="text" pattern="^[a-zA-Z0-9_]{3,20}$" placeholder="a~z、A~Z、0~9、-" autocomplete="off" required @input="onChangeUsername"/>
<p class="profile-page-url-preview" v-if="shouldShowProfileUrl">{{ `${url}/@${username}` }}</p>
<p class="info" v-if="usernameState == 'wait'" style="color:#999">%fa:spinner .pulse .fw%%i18n:common.tags.mk-signup.checking%</p>
<p class="info" v-if="usernameState == 'ok'" style="color:#3CB7B5">%fa:check .fw%%i18n:common.tags.mk-signup.available%</p>

View File

@ -1,13 +1,13 @@
<template>
<div class="mk-twitter-setting">
<p>%i18n:common.tags.mk-twitter-setting.description%<a :href="`${docsUrl}/link-to-twitter`" target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
<p class="account" v-if="os.i.account.twitter" :title="`Twitter ID: ${os.i.account.twitter.user_id}`">%i18n:common.tags.mk-twitter-setting.connected-to%: <a :href="`https://twitter.com/${os.i.account.twitter.screen_name}`" target="_blank">@{{ os.i.account.twitter.screen_name }}</a></p>
<p class="account" v-if="os.i.account.twitter" :title="`Twitter ID: ${os.i.account.twitter.userId}`">%i18n:common.tags.mk-twitter-setting.connected-to%: <a :href="`https://twitter.com/${os.i.account.twitter.screenName}`" target="_blank">@{{ os.i.account.twitter.screenName }}</a></p>
<p>
<a :href="`${apiUrl}/connect/twitter`" target="_blank" @click.prevent="connect">{{ os.i.account.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }}</a>
<span v-if="os.i.account.twitter"> or </span>
<a :href="`${apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.account.twitter" @click.prevent="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%</a>
</p>
<p class="id" v-if="os.i.account.twitter">Twitter ID: {{ os.i.account.twitter.user_id }}</p>
<p class="id" v-if="os.i.account.twitter">Twitter ID: {{ os.i.account.twitter.userId }}</p>
</div>
</template>

View File

@ -53,7 +53,7 @@ export default Vue.extend({
data.append('i', (this as any).os.i.account.token);
data.append('file', file);
if (folder) data.append('folder_id', folder);
if (folder) data.append('folderId', folder);
const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true);

View File

@ -2,7 +2,7 @@
<div class="mk-welcome-timeline">
<div v-for="post in posts">
<router-link class="avatar-anchor" :to="`/@${getAcct(post.user)}`" v-user-preview="post.user.id">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=96`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
</router-link>
<div class="body">
<header>
@ -10,7 +10,7 @@
<span class="username">@{{ getAcct(post.user) }}</span>
<div class="info">
<router-link class="created-at" :to="`/@${getAcct(post.user)}/${post.id}`">
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</router-link>
</div>
</header>

View File

@ -77,7 +77,7 @@ class Autocomplete {
if (mentionIndex != -1 && mentionIndex > emojiIndex) {
const username = text.substr(mentionIndex + 1);
if (username != '' && username.match(/^[a-zA-Z0-9-]+$/)) {
if (username != '' && username.match(/^[a-zA-Z0-9_]+$/)) {
this.open('user', username);
opened = true;
}

View File

@ -97,7 +97,7 @@ export default define({
this.fetching = true;
(this as any).api('drive/files', {
folder_id: this.props.folder,
folderId: this.props.folder,
type: 'image/*',
limit: 100
}).then(images => {

View File

@ -1,16 +1,17 @@
<template>
<p>ver {{ v }} ( aoi)</p>
<p>ver {{ version }} ({{ codename }})</p>
</template>
<script lang="ts">
import { version } from '../../../config';
import { version, codename } from '../../../config';
import define from '../../../common/define-widget';
export default define({
name: 'version'
}).extend({
data() {
return {
v: version
version,
codename
};
}
});

View File

@ -7,13 +7,13 @@ declare const _DOCS_URL_: string;
declare const _STATS_URL_: string;
declare const _STATUS_URL_: string;
declare const _DEV_URL_: string;
declare const _CH_URL_: string;
declare const _LANG_: string;
declare const _RECAPTCHA_SITEKEY_: string;
declare const _SW_PUBLICKEY_: string;
declare const _THEME_COLOR_: string;
declare const _COPYRIGHT_: string;
declare const _VERSION_: string;
declare const _CODENAME_: string;
declare const _LICENSE_: string;
declare const _GOOGLE_MAPS_API_KEY_: string;
@ -26,12 +26,12 @@ export const docsUrl = _DOCS_URL_;
export const statsUrl = _STATS_URL_;
export const statusUrl = _STATUS_URL_;
export const devUrl = _DEV_URL_;
export const chUrl = _CH_URL_;
export const lang = _LANG_;
export const recaptchaSitekey = _RECAPTCHA_SITEKEY_;
export const swPublickey = _SW_PUBLICKEY_;
export const themeColor = _THEME_COLOR_;
export const copyright = _COPYRIGHT_;
export const version = _VERSION_;
export const codename = _CODENAME_;
export const license = _LICENSE_;
export const googleMapsApiKey = _GOOGLE_MAPS_API_KEY_;

View File

@ -49,7 +49,7 @@ export default (os: OS) => (cb, file = null) => {
}).$mount();
document.body.appendChild(dialog.$el);
if (folder) data.append('folder_id', folder.id);
if (folder) data.append('folderId', folder.id);
const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true);
@ -68,10 +68,10 @@ export default (os: OS) => (cb, file = null) => {
const set = file => {
os.api('i/update', {
avatar_id: file.id
avatarId: file.id
}).then(i => {
os.i.avatar_id = i.avatar_id;
os.i.avatar_url = i.avatar_url;
os.i.avatarId = i.avatarId;
os.i.avatarUrl = i.avatarUrl;
os.apis.dialog({
title: '%fa:info-circle%アバターを更新しました',

View File

@ -49,7 +49,7 @@ export default (os: OS) => (cb, file = null) => {
}).$mount();
document.body.appendChild(dialog.$el);
if (folder) data.append('folder_id', folder.id);
if (folder) data.append('folderId', folder.id);
const xhr = new XMLHttpRequest();
xhr.open('POST', apiUrl + '/drive/files/create', true);
@ -68,10 +68,10 @@ export default (os: OS) => (cb, file = null) => {
const set = file => {
os.api('i/update', {
banner_id: file.id
bannerId: file.id
}).then(i => {
os.i.banner_id = i.banner_id;
os.i.banner_url = i.banner_url;
os.i.bannerId = i.bannerId;
os.i.bannerUrl = i.bannerUrl;
os.apis.dialog({
title: '%fa:info-circle%バナーを更新しました',

View File

@ -43,7 +43,7 @@ export default Vue.extend({
},
mounted() {
(this as any).api('aggregation/users/activity', {
user_id: this.user.id,
userId: this.user.id,
limit: 20 * 7
}).then(activity => {
this.activity = activity;

View File

@ -9,10 +9,10 @@
@contextmenu.prevent.stop="onContextmenu"
:title="title"
>
<div class="label" v-if="os.i.avatar_id == file.id"><img src="/assets/label.svg"/>
<div class="label" v-if="os.i.avatarId == file.id"><img src="/assets/label.svg"/>
<p>%i18n:desktop.tags.mk-drive-browser-file.avatar%</p>
</div>
<div class="label" v-if="os.i.banner_id == file.id"><img src="/assets/label.svg"/>
<div class="label" v-if="os.i.bannerId == file.id"><img src="/assets/label.svg"/>
<p>%i18n:desktop.tags.mk-drive-browser-file.banner%</p>
</div>
<div class="thumbnail" ref="thumbnail" :style="`background-color: ${ background }`">
@ -50,8 +50,8 @@ export default Vue.extend({
return `${this.file.name}\n${this.file.type} ${Vue.filter('bytes')(this.file.datasize)}`;
},
background(): string {
return this.file.properties.average_color
? `rgb(${this.file.properties.average_color.join(',')})`
return this.file.properties.avgColor
? `rgb(${this.file.properties.avgColor.join(',')})`
: 'transparent';
}
},
@ -129,10 +129,10 @@ export default Vue.extend({
},
onThumbnailLoaded() {
if (this.file.properties.average_color) {
if (this.file.properties.avgColor) {
anime({
targets: this.$refs.thumbnail,
backgroundColor: `rgba(${this.file.properties.average_color.join(',')}, 0)`,
backgroundColor: `rgba(${this.file.properties.avgColor.join(',')}, 0)`,
duration: 100,
easing: 'linear'
});
@ -147,7 +147,7 @@ export default Vue.extend({
allowEmpty: false
}).then(name => {
(this as any).api('drive/files/update', {
file_id: this.file.id,
fileId: this.file.id,
name: name
})
});

View File

@ -135,8 +135,8 @@ export default Vue.extend({
const file = JSON.parse(driveFile);
this.browser.removeFile(file.id);
(this as any).api('drive/files/update', {
file_id: file.id,
folder_id: this.folder.id
fileId: file.id,
folderId: this.folder.id
});
}
//#endregion
@ -151,8 +151,8 @@ export default Vue.extend({
this.browser.removeFolder(folder.id);
(this as any).api('drive/folders/update', {
folder_id: folder.id,
parent_id: this.folder.id
folderId: folder.id,
parentId: this.folder.id
}).then(() => {
// noop
}).catch(err => {
@ -204,7 +204,7 @@ export default Vue.extend({
default: this.folder.name
}).then(name => {
(this as any).api('drive/folders/update', {
folder_id: this.folder.id,
folderId: this.folder.id,
name: name
});
});

View File

@ -78,8 +78,8 @@ export default Vue.extend({
const file = JSON.parse(driveFile);
this.browser.removeFile(file.id);
(this as any).api('drive/files/update', {
file_id: file.id,
folder_id: this.folder ? this.folder.id : null
fileId: file.id,
folderId: this.folder ? this.folder.id : null
});
}
//#endregion
@ -92,8 +92,8 @@ export default Vue.extend({
if (this.folder && folder.id == this.folder.id) return;
this.browser.removeFolder(folder.id);
(this as any).api('drive/folders/update', {
folder_id: folder.id,
parent_id: this.folder ? this.folder.id : null
folderId: folder.id,
parentId: this.folder ? this.folder.id : null
});
}
//#endregion

View File

@ -160,7 +160,7 @@ export default Vue.extend({
onStreamDriveFileUpdated(file) {
const current = this.folder ? this.folder.id : null;
if (current != file.folder_id) {
if (current != file.folderId) {
this.removeFile(file);
} else {
this.addFile(file, true);
@ -173,7 +173,7 @@ export default Vue.extend({
onStreamDriveFolderUpdated(folder) {
const current = this.folder ? this.folder.id : null;
if (current != folder.parent_id) {
if (current != folder.parentId) {
this.removeFolder(folder);
} else {
this.addFolder(folder, true);
@ -282,8 +282,8 @@ export default Vue.extend({
if (this.files.some(f => f.id == file.id)) return;
this.removeFile(file.id);
(this as any).api('drive/files/update', {
file_id: file.id,
folder_id: this.folder ? this.folder.id : null
fileId: file.id,
folderId: this.folder ? this.folder.id : null
});
}
//#endregion
@ -298,8 +298,8 @@ export default Vue.extend({
if (this.folders.some(f => f.id == folder.id)) return false;
this.removeFolder(folder.id);
(this as any).api('drive/folders/update', {
folder_id: folder.id,
parent_id: this.folder ? this.folder.id : null
folderId: folder.id,
parentId: this.folder ? this.folder.id : null
}).then(() => {
// noop
}).catch(err => {
@ -332,7 +332,7 @@ export default Vue.extend({
}).then(url => {
(this as any).api('drive/files/upload_from_url', {
url: url,
folder_id: this.folder ? this.folder.id : undefined
folderId: this.folder ? this.folder.id : undefined
});
(this as any).apis.dialog({
@ -352,7 +352,7 @@ export default Vue.extend({
}).then(name => {
(this as any).api('drive/folders/create', {
name: name,
folder_id: this.folder ? this.folder.id : undefined
folderId: this.folder ? this.folder.id : undefined
}).then(folder => {
this.addFolder(folder, true);
});
@ -412,7 +412,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('drive/folders/show', {
folder_id: target
folderId: target
}).then(folder => {
this.folder = folder;
this.hierarchyFolders = [];
@ -431,7 +431,7 @@ export default Vue.extend({
addFolder(folder, unshift = false) {
const current = this.folder ? this.folder.id : null;
if (current != folder.parent_id) return;
if (current != folder.parentId) return;
if (this.folders.some(f => f.id == folder.id)) {
const exist = this.folders.map(f => f.id).indexOf(folder.id);
@ -448,7 +448,7 @@ export default Vue.extend({
addFile(file, unshift = false) {
const current = this.folder ? this.folder.id : null;
if (current != file.folder_id) return;
if (current != file.folderId) return;
if (this.files.some(f => f.id == file.id)) {
const exist = this.files.map(f => f.id).indexOf(file.id);
@ -514,7 +514,7 @@ export default Vue.extend({
// フォルダ一覧取得
(this as any).api('drive/folders', {
folder_id: this.folder ? this.folder.id : null,
folderId: this.folder ? this.folder.id : null,
limit: foldersMax + 1
}).then(folders => {
if (folders.length == foldersMax + 1) {
@ -527,7 +527,7 @@ export default Vue.extend({
// ファイル一覧取得
(this as any).api('drive/files', {
folder_id: this.folder ? this.folder.id : null,
folderId: this.folder ? this.folder.id : null,
limit: filesMax + 1
}).then(files => {
if (files.length == filesMax + 1) {
@ -557,7 +557,7 @@ export default Vue.extend({
// ファイル一覧取得
(this as any).api('drive/files', {
folder_id: this.folder ? this.folder.id : null,
folderId: this.folder ? this.folder.id : null,
limit: max + 1
}).then(files => {
if (files.length == max + 1) {

View File

@ -1,15 +1,15 @@
<template>
<button class="mk-follow-button"
:class="{ wait, follow: !user.is_following, unfollow: user.is_following, big: size == 'big' }"
:class="{ wait, follow: !user.isFollowing, unfollow: user.isFollowing, big: size == 'big' }"
@click="onClick"
:disabled="wait"
:title="user.is_following ? 'フォロー解除' : 'フォローする'"
:title="user.isFollowing ? 'フォロー解除' : 'フォローする'"
>
<template v-if="!wait && user.is_following">
<template v-if="!wait && user.isFollowing">
<template v-if="size == 'compact'">%fa:minus%</template>
<template v-if="size == 'big'">%fa:minus%フォロー解除</template>
</template>
<template v-if="!wait && !user.is_following">
<template v-if="!wait && !user.isFollowing">
<template v-if="size == 'compact'">%fa:plus%</template>
<template v-if="size == 'big'">%fa:plus%フォロー</template>
</template>
@ -53,23 +53,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', {
user_id: this.user.id
userId: this.user.id
}).then(() => {
this.user.is_following = false;
this.user.isFollowing = false;
}).catch(err => {
console.error(err);
}).then(() => {
@ -77,9 +77,9 @@ export default Vue.extend({
});
} else {
(this as any).api('following/create', {
user_id: this.user.id
userId: this.user.id
}).then(() => {
this.user.is_following = true;
this.user.isFollowing = true;
}).catch(err => {
console.error(err);
}).then(() => {

View File

@ -1,7 +1,7 @@
<template>
<mk-window width="400px" height="550px" @closed="$destroy">
<span slot="header" :class="$style.header">
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロワー
<img :src="`${user.avatarUrl}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロワー
</span>
<mk-followers :user="user"/>
</mk-window>

View File

@ -1,8 +1,8 @@
<template>
<mk-users-list
:fetch="fetch"
:count="user.followers_count"
:you-know-count="user.followers_you_know_count"
:count="user.followersCount"
:you-know-count="user.followersYouKnowCount"
>
フォロワーはいないようです
</mk-users-list>
@ -15,7 +15,7 @@ export default Vue.extend({
methods: {
fetch(iknow, limit, cursor, cb) {
(this as any).api('users/followers', {
user_id: this.user.id,
userId: this.user.id,
iknow: iknow,
limit: limit,
cursor: cursor ? cursor : undefined

View File

@ -1,7 +1,7 @@
<template>
<mk-window width="400px" height="550px" @closed="$destroy">
<span slot="header" :class="$style.header">
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロー
<img :src="`${user.avatarUrl}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロー
</span>
<mk-following :user="user"/>
</mk-window>

View File

@ -1,8 +1,8 @@
<template>
<mk-users-list
:fetch="fetch"
:count="user.following_count"
:you-know-count="user.following_you_know_count"
:count="user.followingCount"
:you-know-count="user.followingYouKnowCount"
>
フォロー中のユーザーはいないようです
</mk-users-list>
@ -15,7 +15,7 @@ export default Vue.extend({
methods: {
fetch(iknow, limit, cursor, cb) {
(this as any).api('users/following', {
user_id: this.user.id,
userId: this.user.id,
iknow: iknow,
limit: limit,
cursor: cursor ? cursor : undefined

View File

@ -4,7 +4,7 @@
<div class="users" v-if="!fetching && users.length > 0">
<div class="user" v-for="user in users" :key="user.id">
<router-link class="avatar-anchor" :to="`/@${getAcct(user)}`">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="user.id"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="user.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="`/@${getAcct(user)}`" v-user-preview="user.id">{{ user.name }}</router-link>

View File

@ -53,7 +53,7 @@
<div class="main">
<a @click="hint">カスタマイズのヒント</a>
<div>
<mk-post-form v-if="os.i.account.client_settings.showPostFormOnTopOfTl"/>
<mk-post-form v-if="os.i.account.clientSettings.showPostFormOnTopOfTl"/>
<mk-timeline ref="tl" @loaded="onTlLoaded"/>
</div>
</div>
@ -63,7 +63,7 @@
<component v-for="widget in widgets[place]" :is="`mkw-${widget.name}`" :key="widget.id" :ref="widget.id" :widget="widget" @chosen="warp"/>
</div>
<div class="main">
<mk-post-form v-if="os.i.account.client_settings.showPostFormOnTopOfTl"/>
<mk-post-form v-if="os.i.account.clientSettings.showPostFormOnTopOfTl"/>
<mk-timeline ref="tl" @loaded="onTlLoaded" v-if="mode == 'timeline'"/>
<mk-mentions @loaded="onTlLoaded" v-if="mode == 'mentions'"/>
</div>
@ -104,16 +104,16 @@ export default Vue.extend({
home: {
get(): any[] {
//#region 互換性のため
(this as any).os.i.account.client_settings.home.forEach(w => {
(this as any).os.i.account.clientSettings.home.forEach(w => {
if (w.name == 'rss-reader') w.name = 'rss';
if (w.name == 'user-recommendation') w.name = 'users';
if (w.name == 'recommended-polls') w.name = 'polls';
});
//#endregion
return (this as any).os.i.account.client_settings.home;
return (this as any).os.i.account.clientSettings.home;
},
set(value) {
(this as any).os.i.account.client_settings.home = value;
(this as any).os.i.account.clientSettings.home = value;
}
},
left(): any[] {
@ -126,7 +126,7 @@ export default Vue.extend({
created() {
this.widgets.left = this.left;
this.widgets.right = this.right;
this.$watch('os.i.account.client_settings', i => {
this.$watch('os.i.account.clientSettings', i => {
this.widgets.left = this.left;
this.widgets.right = this.right;
}, {
@ -161,17 +161,17 @@ export default Vue.extend({
},
onHomeUpdated(data) {
if (data.home) {
(this as any).os.i.account.client_settings.home = data.home;
(this as any).os.i.account.clientSettings.home = data.home;
this.widgets.left = data.home.filter(w => w.place == 'left');
this.widgets.right = data.home.filter(w => w.place == 'right');
} else {
const w = (this as any).os.i.account.client_settings.home.find(w => w.id == data.id);
const w = (this as any).os.i.account.clientSettings.home.find(w => w.id == data.id);
if (w != null) {
w.data = data.data;
this.$refs[w.id][0].preventSave = true;
this.$refs[w.id][0].props = w.data;
this.widgets.left = (this as any).os.i.account.client_settings.home.filter(w => w.place == 'left');
this.widgets.right = (this as any).os.i.account.client_settings.home.filter(w => w.place == 'right');
this.widgets.left = (this as any).os.i.account.clientSettings.home.filter(w => w.place == 'left');
this.widgets.right = (this as any).os.i.account.clientSettings.home.filter(w => w.place == 'right');
}
}
},

View File

@ -18,7 +18,7 @@ export default Vue.extend({
computed: {
style(): any {
return {
'background-color': this.image.properties.average_color ? `rgb(${this.image.properties.average_color.join(',')})` : 'transparent',
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
'background-image': `url(${this.image.url}?thumbnail&size=512)`
};
}

View File

@ -70,7 +70,7 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('posts/mentions', {
following: this.mode == 'following',
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
this.posts = this.posts.concat(posts);
this.moreFetching = false;

View File

@ -3,10 +3,10 @@
<div class="notifications" v-if="notifications.length != 0">
<template v-for="(notification, i) in _notifications">
<div class="notification" :class="notification.type" :key="notification.id">
<mk-time :time="notification.created_at"/>
<mk-time :time="notification.createdAt"/>
<template v-if="notification.type == 'reaction'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -19,12 +19,12 @@
</div>
</template>
<template v-if="notification.type == 'repost'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:retweet%
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">{{ notification.post.user.name }}</router-link>
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">{{ notification.post.user.name }}</router-link>
</p>
<router-link class="post-ref" :to="`/@${getAcct(notification.post.user)}/${notification.post.id}`">
%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%
@ -32,19 +32,19 @@
</div>
</template>
<template v-if="notification.type == 'quote'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:quote-left%
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">{{ notification.post.user.name }}</router-link>
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">{{ notification.post.user.name }}</router-link>
</p>
<router-link class="post-preview" :to="`/@${getAcct(notification.post.user)}/${notification.post.id}`">{{ getPostSummary(notification.post) }}</router-link>
</div>
</template>
<template v-if="notification.type == 'follow'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:user-plus%
@ -53,30 +53,30 @@
</div>
</template>
<template v-if="notification.type == 'reply'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:reply%
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">{{ notification.post.user.name }}</router-link>
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">{{ notification.post.user.name }}</router-link>
</p>
<router-link class="post-preview" :to="`/@${getAcct(notification.post.user)}/${notification.post.id}`">{{ getPostSummary(notification.post) }}</router-link>
</div>
</template>
<template v-if="notification.type == 'mention'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:at%
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.user_id">{{ notification.post.user.name }}</router-link>
<router-link :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">{{ notification.post.user.name }}</router-link>
</p>
<a class="post-preview" :href="`/@${getAcct(notification.post.user)}/${notification.post.id}`">{{ getPostSummary(notification.post) }}</a>
</div>
</template>
<template v-if="notification.type == 'poll_vote'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:chart-pie%<a :href="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">{{ notification.user.name }}</a></p>
@ -120,8 +120,8 @@ export default Vue.extend({
computed: {
_notifications(): any[] {
return (this.notifications as any).map(notification => {
const date = new Date(notification.created_at).getDate();
const month = new Date(notification.created_at).getMonth() + 1;
const date = new Date(notification.createdAt).getDate();
const month = new Date(notification.createdAt).getMonth() + 1;
notification._date = date;
notification._datetext = `${month}${date}`;
return notification;
@ -161,7 +161,7 @@ export default Vue.extend({
(this as any).api('i/notifications', {
limit: max + 1,
until_id: this.notifications[this.notifications.length - 1].id
untilId: this.notifications[this.notifications.length - 1].id
}).then(notifications => {
if (notifications.length == max + 1) {
this.moreNotifications = true;

View File

@ -1,17 +1,17 @@
<template>
<div class="sub" :title="title">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="post.user_id"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
</router-link>
<div class="main">
<header>
<div class="left">
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.user_id">{{ post.user.name }}</router-link>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.userId">{{ post.user.name }}</router-link>
<span class="username">@{{ acct }}</span>
</div>
<div class="right">
<router-link class="time" :to="`/@${acct}/${post.id}`">
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</router-link>
</div>
</header>
@ -37,7 +37,7 @@ export default Vue.extend({
return getAcct(this.post.user);
},
title(): string {
return dateStringify(this.post.created_at);
return dateStringify(this.post.createdAt);
}
}
});

View File

@ -2,7 +2,7 @@
<div class="mk-post-detail" :title="title">
<button
class="read-more"
v-if="p.reply && p.reply.reply_id && context == null"
v-if="p.reply && p.reply.replyId && context == null"
title="会話をもっと読み込む"
@click="fetchContext"
:disabled="contextFetching"
@ -18,8 +18,8 @@
</div>
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="post.user_id">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="post.userId">
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
</router-link>
%fa:retweet%
<router-link class="name" :href="`/@${acct}`">{{ post.user.name }}</router-link>
@ -28,13 +28,13 @@
</div>
<article>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
</router-link>
<header>
<router-link class="name" :to="`/@${acct}`" v-user-preview="p.user.id">{{ p.user.name }}</router-link>
<span class="username">@{{ acct }}</span>
<router-link class="time" :to="`/@${acct}/${p.id}`">
<mk-time :time="p.created_at"/>
<mk-time :time="p.createdAt"/>
</router-link>
</header>
<div class="body">
@ -56,12 +56,12 @@
<footer>
<mk-reactions-viewer :post="p"/>
<button @click="reply" title="返信">
%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="リアクション">
<button :class="{ reacted: p.myReaction != null }" @click="react" ref="reactButton" title="リアクション">
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
</button>
<button @click="menu" ref="menuButton">
@ -115,21 +115,21 @@ export default Vue.extend({
isRepost(): boolean {
return (this.post.repost &&
this.post.text == null &&
this.post.media_ids == null &&
this.post.mediaIds == null &&
this.post.poll == null);
},
p(): any {
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;
},
title(): string {
return dateStringify(this.p.created_at);
return dateStringify(this.p.createdAt);
},
urls(): string[] {
if (this.p.ast) {
@ -145,7 +145,7 @@ export default Vue.extend({
// Get replies
if (!this.compact) {
(this as any).api('posts/replies', {
post_id: this.p.id,
postId: this.p.id,
limit: 8
}).then(replies => {
this.replies = replies;
@ -154,7 +154,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.clientSettings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
@ -176,7 +176,7 @@ export default Vue.extend({
// Fetch context
(this as any).api('posts/context', {
post_id: this.p.reply_id
postId: this.p.replyId
}).then(context => {
this.contextFetching = false;
this.context = context.reverse();

View File

@ -219,9 +219,9 @@ export default Vue.extend({
(this as any).api('posts/create', {
text: this.text == '' ? undefined : this.text,
media_ids: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
reply_id: this.reply ? this.reply.id : undefined,
repost_id: this.repost ? this.repost.id : undefined,
mediaIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined,
replyId: this.reply ? this.reply.id : undefined,
repostId: this.repost ? this.repost.id : undefined,
poll: this.poll ? (this.$refs.poll as any).get() : undefined,
geo: this.geo ? {
latitude: this.geo.latitude,
@ -255,7 +255,7 @@ export default Vue.extend({
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
data[this.draftId] = {
updated_at: new Date(),
updatedAt: new Date(),
data: {
text: this.text,
files: this.files,

View File

@ -1,14 +1,14 @@
<template>
<div class="mk-post-preview" :title="title">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="post.user_id"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
</router-link>
<div class="main">
<header>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.user_id">{{ post.user.name }}</router-link>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.userId">{{ post.user.name }}</router-link>
<span class="username">@{{ acct }}</span>
<router-link class="time" :to="`/@${acct}/${post.id}`">
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</router-link>
</header>
<div class="body">
@ -30,7 +30,7 @@ export default Vue.extend({
return getAcct(this.post.user);
},
title(): string {
return dateStringify(this.post.created_at);
return dateStringify(this.post.createdAt);
}
}
});

View File

@ -1,14 +1,14 @@
<template>
<div class="sub" :title="title">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="post.user_id"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
</router-link>
<div class="main">
<header>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.user_id">{{ post.user.name }}</router-link>
<router-link class="name" :to="`/@${acct}`" v-user-preview="post.userId">{{ post.user.name }}</router-link>
<span class="username">@{{ acct }}</span>
<router-link class="created-at" :to="`/@${acct}/${post.id}`">
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</router-link>
</header>
<div class="body">
@ -30,7 +30,7 @@ export default Vue.extend({
return getAcct(this.post.user);
},
title(): string {
return dateStringify(this.post.created_at);
return dateStringify(this.post.createdAt);
}
}
});

View File

@ -5,30 +5,30 @@
</div>
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="post.user_id">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="post.userId">
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
</router-link>
%fa:retweet%
<span>{{ '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.substr(0, '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.indexOf('{')) }}</span>
<a class="name" :href="`/@${acct}`" v-user-preview="post.user_id">{{ post.user.name }}</a>
<a class="name" :href="`/@${acct}`" v-user-preview="post.userId">{{ post.user.name }}</a>
<span>{{ '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.substr('%i18n:desktop.tags.mk-timeline-post.reposted-by%'.indexOf('}') + 1) }}</span>
</p>
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</div>
<article>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
</router-link>
<div class="main">
<header>
<router-link class="name" :to="`/@${acct}`" v-user-preview="p.user.id">{{ acct }}</router-link>
<span class="is-bot" v-if="p.user.host === null && p.user.account.is_bot">bot</span>
<span class="is-bot" v-if="p.user.host === null && p.user.account.isBot">bot</span>
<span class="username">@{{ acct }}</span>
<div class="info">
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
<span class="mobile" v-if="p.via_mobile">%fa:mobile-alt%</span>
<span class="mobile" v-if="p.viaMobile">%fa:mobile-alt%</span>
<router-link class="created-at" :to="url">
<mk-time :time="p.created_at"/>
<mk-time :time="p.createdAt"/>
</router-link>
</div>
</header>
@ -58,12 +58,12 @@
<footer>
<mk-reactions-viewer :post="p" ref="reactionsViewer"/>
<button @click="reply" title="%i18n:desktop.tags.mk-timeline-post.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="%i18n:desktop.tags.mk-timeline-post.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:desktop.tags.mk-timeline-post.add-reaction%">
<button :class="{ reacted: p.myReaction != null }" @click="react" ref="reactButton" title="%i18n:desktop.tags.mk-timeline-post.add-reaction%">
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
</button>
<button @click="menu" ref="menuButton">
@ -122,21 +122,21 @@ export default Vue.extend({
isRepost(): boolean {
return (this.post.repost &&
this.post.text == null &&
this.post.media_ids == null &&
this.post.mediaIds == null &&
this.post.poll == null);
},
p(): any {
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;
},
title(): string {
return dateStringify(this.p.created_at);
return dateStringify(this.p.createdAt);
},
url(): string {
return `/@${this.acct}/${this.p.id}`;
@ -166,7 +166,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.clientSettings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
@ -216,7 +216,7 @@ export default Vue.extend({
const post = data.post;
if (post.id == this.post.id) {
this.$emit('update:post', post);
} else if (post.id == this.post.repost_id) {
} else if (post.id == this.post.repostId) {
this.post.repost = post;
}
},

View File

@ -30,8 +30,8 @@ export default Vue.extend({
computed: {
_posts(): any[] {
return (this.posts as any).map(post => {
const date = new Date(post.created_at).getDate();
const month = new Date(post.created_at).getMonth() + 1;
const date = new Date(post.createdAt).getDate();
const month = new Date(post.createdAt).getMonth() + 1;
post._date = date;
post._datetext = `${month}${date}`;
return post;

View File

@ -29,7 +29,7 @@ export default Vue.extend({
ok() {
this.wait = true;
(this as any).api('posts/create', {
repost_id: this.post.id
repostId: this.post.id
}).then(data => {
this.$emit('posted');
(this as any).apis.notify('%i18n:desktop.tags.mk-repost-form.success%');

View File

@ -2,8 +2,8 @@
<div class="2fa">
<p>%i18n:desktop.tags.mk-2fa-setting.intro%<a href="%i18n:desktop.tags.mk-2fa-setting.url%" target="_blank">%i18n:desktop.tags.mk-2fa-setting.detail%</a></p>
<div class="ui info warn"><p>%fa:exclamation-triangle%%i18n:desktop.tags.mk-2fa-setting.caution%</p></div>
<p v-if="!data && !os.i.account.two_factor_enabled"><button @click="register" class="ui primary">%i18n:desktop.tags.mk-2fa-setting.register%</button></p>
<template v-if="os.i.account.two_factor_enabled">
<p v-if="!data && !os.i.account.twoFactorEnabled"><button @click="register" class="ui primary">%i18n:desktop.tags.mk-2fa-setting.register%</button></p>
<template v-if="os.i.account.twoFactorEnabled">
<p>%i18n:desktop.tags.mk-2fa-setting.already-registered%</p>
<button @click="unregister" class="ui">%i18n:desktop.tags.mk-2fa-setting.unregister%</button>
</template>
@ -54,7 +54,7 @@ export default Vue.extend({
password: password
}).then(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-2fa-setting.unregistered%');
(this as any).os.i.account.two_factor_enabled = false;
(this as any).os.i.account.twoFactorEnabled = false;
});
});
},
@ -64,7 +64,7 @@ export default Vue.extend({
token: this.token
}).then(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-2fa-setting.success%');
(this as any).os.i.account.two_factor_enabled = true;
(this as any).os.i.account.twoFactorEnabled = true;
}).catch(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-2fa-setting.failed%');
});

View File

@ -33,8 +33,8 @@ export default Vue.extend({
return;
}
(this as any).api('i/change_password', {
current_password: currentPassword,
new_password: newPassword
currentPasword: currentPassword,
newPassword: newPassword
}).then(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-password-setting.changed%');
});

View File

@ -2,7 +2,7 @@
<div class="profile">
<label class="avatar ui from group">
<p>%i18n:desktop.tags.mk-profile-setting.avatar%</p>
<img class="avatar" :src="`${os.i.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${os.i.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<button class="ui" @click="updateAvatar">%i18n:desktop.tags.mk-profile-setting.choice-avatar%</button>
</label>
<label class="ui from group">
@ -24,7 +24,7 @@
<button class="ui primary" @click="save">%i18n:desktop.tags.mk-profile-setting.save%</button>
<section>
<h2>その他</h2>
<mk-switch v-model="os.i.account.is_bot" @change="onChangeIsBot" text="このアカウントはbotです"/>
<mk-switch v-model="os.i.account.isBot" @change="onChangeIsBot" text="このアカウントはbotです"/>
</section>
</div>
</template>
@ -63,7 +63,7 @@ export default Vue.extend({
},
onChangeIsBot() {
(this as any).api('i/update', {
is_bot: (this as any).os.i.account.is_bot
isBot: (this as any).os.i.account.isBot
});
}
}

View File

@ -6,7 +6,7 @@
<template v-if="signin.success">%fa:check%</template>
<template v-else>%fa:times%</template>
<span class="ip">{{ signin.ip }}</span>
<mk-time :time="signin.created_at"/>
<mk-time :time="signin.createdAt"/>
</header>
<div class="headers" v-show="signin._show">
<tree-view :data="signin.headers"/>

View File

@ -20,7 +20,7 @@
<section class="web" v-show="page == 'web'">
<h1>動作</h1>
<mk-switch v-model="os.i.account.client_settings.fetchOnScroll" @change="onChangeFetchOnScroll" text="スクロールで自動読み込み">
<mk-switch v-model="os.i.account.clientSettings.fetchOnScroll" @change="onChangeFetchOnScroll" text="スクロールで自動読み込み">
<span>ページを下までスクロールしたときに自動で追加のコンテンツを読み込みます</span>
</mk-switch>
<mk-switch v-model="autoPopout" text="ウィンドウの自動ポップアウト">
@ -33,11 +33,11 @@
<div class="div">
<button class="ui button" @click="customizeHome">ホームをカスタマイズ</button>
</div>
<mk-switch v-model="os.i.account.client_settings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
<mk-switch v-model="os.i.account.client_settings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
<mk-switch v-model="os.i.account.clientSettings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="タイムライン上部に投稿フォームを表示する"/>
<mk-switch v-model="os.i.account.clientSettings.showMaps" @change="onChangeShowMaps" text="マップの自動展開">
<span>位置情報が添付された投稿のマップを自動的に展開します</span>
</mk-switch>
<mk-switch v-model="os.i.account.client_settings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
<mk-switch v-model="os.i.account.clientSettings.gradientWindowHeader" @change="onChangeGradientWindowHeader" text="ウィンドウのタイトルバーにグラデーションを使用"/>
</section>
<section class="web" v-show="page == 'web'">
@ -57,7 +57,7 @@
<section class="web" v-show="page == 'web'">
<h1>モバイル</h1>
<mk-switch v-model="os.i.account.client_settings.disableViaMobile" @change="onChangeDisableViaMobile" text="モバイルからの投稿フラグを付けない"/>
<mk-switch v-model="os.i.account.clientSettings.disableViaMobile" @change="onChangeDisableViaMobile" text="モバイルからの投稿フラグを付けない"/>
</section>
<section class="web" v-show="page == 'web'">
@ -86,7 +86,7 @@
<section class="notification" v-show="page == 'notification'">
<h1>通知</h1>
<mk-switch v-model="os.i.account.settings.auto_watch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
<mk-switch v-model="os.i.account.settings.autoWatch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
<span>リアクションしたり返信したりした投稿に関する通知を自動的に受け取るようにします。</span>
</mk-switch>
</section>
@ -283,7 +283,7 @@ export default Vue.extend({
},
onChangeAutoWatch(v) {
(this as any).api('i/update', {
auto_watch: v
autoWatch: v
});
},
onChangeShowPostFormOnTopOfTl(v) {

View File

@ -1,9 +1,9 @@
<template>
<div class="mk-sub-post-content">
<div class="body">
<a class="reply" v-if="post.reply_id">%fa:reply%</a>
<a class="reply" v-if="post.replyId">%fa:reply%</a>
<mk-post-html :ast="post.ast" :i="os.i"/>
<a class="rp" v-if="post.repost_id" :href="`/post:${post.repost_id}`">RP: ...</a>
<a class="rp" v-if="post.repostId" :href="`/post:${post.repostId}`">RP: ...</a>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
</div>
<details v-if="post.media">

View File

@ -34,7 +34,7 @@ export default Vue.extend({
},
computed: {
alone(): boolean {
return (this as any).os.i.following_count == 0;
return (this as any).os.i.followingCount == 0;
}
},
mounted() {
@ -65,7 +65,7 @@ export default Vue.extend({
(this as any).api('posts/timeline', {
limit: 11,
until_date: this.date ? this.date.getTime() : undefined
untilDate: this.date ? this.date.getTime() : undefined
}).then(posts => {
if (posts.length == 11) {
posts.pop();
@ -82,7 +82,7 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('posts/timeline', {
limit: 11,
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
if (posts.length == 11) {
posts.pop();
@ -107,7 +107,7 @@ export default Vue.extend({
this.fetch();
},
onScroll() {
if ((this as any).os.i.account.client_settings.fetchOnScroll !== false) {
if ((this as any).os.i.account.clientSettings.fetchOnScroll !== false) {
const current = window.scrollY + window.innerHeight;
if (current > document.body.offsetHeight - 8) this.more();
}

View File

@ -2,7 +2,7 @@
<div class="account">
<button class="header" :data-active="isOpen" @click="toggle">
<span class="username">{{ os.i.username }}<template v-if="!isOpen">%fa:angle-down%</template><template v-if="isOpen">%fa:angle-up%</template></span>
<img class="avatar" :src="`${ os.i.avatar_url }?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${ os.i.avatarUrl }?thumbnail&size=64`" alt="avatar"/>
</button>
<transition name="zoom-in-top">
<div class="menu" v-if="isOpen">

View File

@ -44,9 +44,9 @@ export default Vue.extend({
},
mounted() {
if ((this as any).os.isSignedIn) {
const ago = (new Date().getTime() - new Date((this as any).os.i.account.last_used_at).getTime()) / 1000
const ago = (new Date().getTime() - new Date((this as any).os.i.account.lastUsedAt).getTime()) / 1000
const isHisasiburi = ago >= 3600;
(this as any).os.i.account.last_used_at = new Date();
(this as any).os.i.account.lastUsedAt = new Date();
if (isHisasiburi) {
(this.$refs.welcomeback as any).style.display = 'block';
(this.$refs.main as any).style.overflow = 'hidden';

View File

@ -1,9 +1,9 @@
<template>
<div class="mk-user-preview">
<template v-if="u != null">
<div class="banner" :style="u.banner_url ? `background-image: url(${u.banner_url}?thumbnail&size=512)` : ''"></div>
<div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl}?thumbnail&size=512)` : ''"></div>
<router-link class="avatar" :to="`/@${acct}`">
<img :src="`${u.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="title">
<router-link class="name" :to="`/@${acct}`">{{ u.name }}</router-link>
@ -12,13 +12,13 @@
<div class="description">{{ u.description }}</div>
<div class="status">
<div>
<p>投稿</p><a>{{ u.posts_count }}</a>
<p>投稿</p><a>{{ u.postsCount }}</a>
</div>
<div>
<p>フォロー</p><a>{{ u.following_count }}</a>
<p>フォロー</p><a>{{ u.followingCount }}</a>
</div>
<div>
<p>フォロワー</p><a>{{ u.followers_count }}</a>
<p>フォロワー</p><a>{{ u.followersCount }}</a>
</div>
</div>
<mk-follow-button v-if="os.isSignedIn && user.id != os.i.id" :user="u"/>
@ -58,7 +58,7 @@ export default Vue.extend({
} else {
const query = this.user[0] == '@' ?
parseAcct(this.user[0].substr(1)) :
{ user_id: this.user[0] };
{ userId: this.user[0] };
(this as any).api('users/show', query).then(user => {
this.u = user;

View File

@ -1,7 +1,7 @@
<template>
<div class="root item">
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="user.id">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="main">
<header>
@ -9,7 +9,7 @@
<span class="username">@{{ acct }}</span>
</header>
<div class="body">
<p class="followed" v-if="user.is_followed">フォローされています</p>
<p class="followed" v-if="user.isFollowed">フォローされています</p>
<div class="description">{{ user.description }}</div>
</div>
</div>

View File

@ -24,8 +24,8 @@ export default Vue.extend({
computed: {
withGradient(): boolean {
return (this as any).os.isSignedIn
? (this as any).os.i.account.client_settings.gradientWindowHeader != null
? (this as any).os.i.account.client_settings.gradientWindowHeader
? (this as any).os.i.account.clientSettings.gradientWindowHeader != null
? (this as any).os.i.account.clientSettings.gradientWindowHeader
: false
: false;
}

View File

@ -92,8 +92,8 @@ export default Vue.extend({
},
withGradient(): boolean {
return (this as any).os.isSignedIn
? (this as any).os.i.account.client_settings.gradientWindowHeader != null
? (this as any).os.i.account.client_settings.gradientWindowHeader
? (this as any).os.i.account.clientSettings.gradientWindowHeader != null
? (this as any).os.i.account.clientSettings.gradientWindowHeader
: false
: false;
}

View File

@ -45,7 +45,7 @@ export default Vue.extend({
},
onStreamPost(post) {
if (document.hidden && post.user_id != (this as any).os.i.id) {
if (document.hidden && post.userId != (this as any).os.i.id) {
this.unreadCount++;
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
}

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;

View File

@ -31,7 +31,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('posts/show', {
post_id: this.$route.params.post
postId: this.$route.params.post
}).then(post => {
this.post = post;
this.fetching = false;

View File

@ -4,7 +4,7 @@
<p class="initializing" v-if="fetching">%fa:spinner .pulse .fw%%i18n:desktop.tags.mk-user.followers-you-know.loading%<mk-ellipsis/></p>
<div v-if="!fetching && users.length > 0">
<router-link v-for="user in users" :to="`/@${getAcct(user)}`" :key="user.id">
<img :src="`${user.avatar_url}?thumbnail&size=64`" :alt="user.name" v-user-preview="user.id"/>
<img :src="`${user.avatarUrl}?thumbnail&size=64`" :alt="user.name" v-user-preview="user.id"/>
</router-link>
</div>
<p class="empty" v-if="!fetching && users.length == 0">%i18n:desktop.tags.mk-user.followers-you-know.no-users%</p>
@ -28,7 +28,7 @@ export default Vue.extend({
},
mounted() {
(this as any).api('users/followers', {
user_id: this.user.id,
userId: this.user.id,
iknow: true,
limit: 16
}).then(x => {

View File

@ -5,7 +5,7 @@
<template v-if="!fetching && users.length != 0">
<div class="user" v-for="friend in users">
<router-link class="avatar-anchor" :to="`/@${getAcct(friend)}`">
<img class="avatar" :src="`${friend.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="friend.id"/>
<img class="avatar" :src="`${friend.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="friend.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="`/@${getAcct(friend)}`" v-user-preview="friend.id">{{ friend.name }}</router-link>
@ -35,7 +35,7 @@ export default Vue.extend({
},
mounted() {
(this as any).api('users/get_frequently_replied_users', {
user_id: this.user.id,
userId: this.user.id,
limit: 4
}).then(docs => {
this.users = docs.map(doc => doc.user);

View File

@ -1,11 +1,11 @@
<template>
<div class="header" :data-is-dark-background="user.banner_url != null">
<div class="banner-container" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=2048)` : ''">
<div class="banner" ref="banner" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=2048)` : ''" @click="onBannerClick"></div>
<div class="header" :data-is-dark-background="user.bannerUrl != null">
<div class="banner-container" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''">
<div class="banner" ref="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''" @click="onBannerClick"></div>
</div>
<div class="fade"></div>
<div class="container">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=150`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=150`" alt="avatar"/>
<div class="title">
<p class="name">{{ user.name }}</p>
<p class="username">@{{ acct }}</p>
@ -59,7 +59,7 @@ export default Vue.extend({
if (!(this as any).os.isSignedIn || (this as any).os.i.id != this.user.id) return;
(this as any).apis.updateBanner((this as any).os.i, i => {
this.user.banner_url = i.banner_url;
this.user.bannerUrl = i.bannerUrl;
});
}
}

View File

@ -5,16 +5,16 @@
<x-profile :user="user"/>
<x-photos :user="user"/>
<x-followers-you-know v-if="os.isSignedIn && os.i.id != user.id" :user="user"/>
<p v-if="user.host === null">%i18n:desktop.tags.mk-user.last-used-at%: <b><mk-time :time="user.account.last_used_at"/></b></p>
<p v-if="user.host === null">%i18n:desktop.tags.mk-user.last-used-at%: <b><mk-time :time="user.account.lastUsedAt"/></b></p>
</div>
</div>
<main>
<mk-post-detail v-if="user.pinned_post" :post="user.pinned_post" :compact="true"/>
<mk-post-detail v-if="user.pinnedPost" :post="user.pinnedPost" :compact="true"/>
<x-timeline class="timeline" ref="tl" :user="user"/>
</main>
<div>
<div ref="right">
<mk-calendar @chosen="warp" :start="new Date(user.created_at)"/>
<mk-calendar @chosen="warp" :start="new Date(user.createdAt)"/>
<mk-activity :user="user"/>
<x-friends :user="user"/>
<div class="nav"><mk-nav/></div>

View File

@ -23,8 +23,8 @@ export default Vue.extend({
},
mounted() {
(this as any).api('users/posts', {
user_id: this.user.id,
with_media: true,
userId: this.user.id,
withMedia: true,
limit: 9
}).then(posts => {
posts.forEach(post => {

View File

@ -2,21 +2,21 @@
<div class="profile">
<div class="friend-form" v-if="os.isSignedIn && os.i.id != user.id">
<mk-follow-button :user="user" size="big"/>
<p class="followed" v-if="user.is_followed">%i18n:desktop.tags.mk-user.follows-you%</p>
<p v-if="user.is_muted">%i18n:desktop.tags.mk-user.muted% <a @click="unmute">%i18n:desktop.tags.mk-user.unmute%</a></p>
<p v-if="!user.is_muted"><a @click="mute">%i18n:desktop.tags.mk-user.mute%</a></p>
<p class="followed" v-if="user.isFollowed">%i18n:desktop.tags.mk-user.follows-you%</p>
<p v-if="user.isMuted">%i18n:desktop.tags.mk-user.muted% <a @click="unmute">%i18n:desktop.tags.mk-user.unmute%</a></p>
<p v-if="!user.isMuted"><a @click="mute">%i18n:desktop.tags.mk-user.mute%</a></p>
</div>
<div class="description" v-if="user.description">{{ user.description }}</div>
<div class="birthday" v-if="user.host === null && user.account.profile.birthday">
<p>%fa:birthday-cake%{{ user.account.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }})</p>
</div>
<div class="twitter" v-if="user.host === null && user.account.twitter">
<p>%fa:B twitter%<a :href="`https://twitter.com/${user.account.twitter.screen_name}`" target="_blank">@{{ user.account.twitter.screen_name }}</a></p>
<p>%fa:B twitter%<a :href="`https://twitter.com/${user.account.twitter.screenName}`" target="_blank">@{{ user.account.twitter.screenName }}</a></p>
</div>
<div class="status">
<p class="posts-count">%fa:angle-right%<a>{{ user.posts_count }}</a><b>投稿</b></p>
<p class="following">%fa:angle-right%<a @click="showFollowing">{{ user.following_count }}</a>人を<b>フォロー</b></p>
<p class="followers">%fa:angle-right%<a @click="showFollowers">{{ user.followers_count }}</a>人の<b>フォロワー</b></p>
<p class="posts-count">%fa:angle-right%<a>{{ user.postsCount }}</a><b>投稿</b></p>
<p class="following">%fa:angle-right%<a @click="showFollowing">{{ user.followingCount }}</a>人を<b>フォロー</b></p>
<p class="followers">%fa:angle-right%<a @click="showFollowers">{{ user.followersCount }}</a>人の<b>フォロワー</b></p>
</div>
</div>
</template>
@ -49,9 +49,9 @@ export default Vue.extend({
mute() {
(this as any).api('mute/create', {
user_id: this.user.id
userId: this.user.id
}).then(() => {
this.user.is_muted = true;
this.user.isMuted = true;
}, () => {
alert('error');
});
@ -59,9 +59,9 @@ export default Vue.extend({
unmute() {
(this as any).api('mute/delete', {
user_id: this.user.id
userId: this.user.id
}).then(() => {
this.user.is_muted = false;
this.user.isMuted = false;
}, () => {
alert('error');
});

View File

@ -61,8 +61,8 @@ export default Vue.extend({
},
fetch(cb?) {
(this as any).api('users/posts', {
user_id: this.user.id,
until_date: this.date ? this.date.getTime() : undefined,
userId: this.user.id,
untilDate: this.date ? this.date.getTime() : undefined,
with_replies: this.mode == 'with-replies'
}).then(posts => {
this.posts = posts;
@ -74,9 +74,9 @@ export default Vue.extend({
if (this.moreFetching || this.fetching || this.posts.length == 0) return;
this.moreFetching = true;
(this as any).api('users/posts', {
user_id: this.user.id,
userId: this.user.id,
with_replies: this.mode == 'with-replies',
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
this.moreFetching = false;
this.posts = this.posts.concat(posts);

View File

@ -9,7 +9,7 @@
<p><button class="signup" @click="signup">はじめる</button><button class="signin" @click="signin">ログイン</button></p>
<div class="users">
<router-link v-for="user in users" :key="user.id" class="avatar-anchor" :to="`/@${getAcct(user)}`" v-user-preview="user.id">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
</div>
</div>

View File

@ -30,8 +30,8 @@ export default Vue.extend({
(this as any).api('posts/create', {
text: this.text,
reply_id: reply ? reply.id : undefined,
channel_id: (this.$parent as any).channel.id
replyId: reply ? reply.id : undefined,
channelId: (this.$parent as any).channel.id
}).then(data => {
this.text = '';
}).catch(err => {

View File

@ -44,7 +44,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('channels/posts', {
channel_id: this.channel.id
channelId: this.channel.id
}).then(posts => {
this.posts = posts;
this.fetching = false;

View File

@ -48,7 +48,7 @@ export default define({
this.fetching = true;
(this as any).api('channels/show', {
channel_id: this.props.channel
channelId: this.props.channel
}).then(channel => {
this.channel = channel;
this.fetching = false;

View File

@ -4,12 +4,12 @@
:data-melt="props.design == 2"
>
<div class="banner"
:style="os.i.banner_url ? `background-image: url(${os.i.banner_url}?thumbnail&size=256)` : ''"
:style="os.i.bannerUrl ? `background-image: url(${os.i.bannerUrl}?thumbnail&size=256)` : ''"
title="クリックでバナー編集"
@click="os.apis.updateBanner"
></div>
<img class="avatar"
:src="`${os.i.avatar_url}?thumbnail&size=96`"
:src="`${os.i.avatarUrl}?thumbnail&size=96`"
@click="os.apis.updateAvatar"
alt="avatar"
title="クリックでアバター編集"

View File

@ -8,7 +8,7 @@
<template v-else-if="users.length != 0">
<div class="user" v-for="_user in users">
<router-link class="avatar-anchor" :to="`/@${getAcct(_user)}`">
<img class="avatar" :src="`${_user.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="`/@${getAcct(_user)}`" v-user-preview="_user.id">{{ _user.name }}</router-link>

View File

@ -28,7 +28,7 @@ export default Vue.extend({
fetch() {
this.fetching = true;
(this as any).api('app/show', {
app_id: this.$route.params.id
appId: this.$route.params.id
}).then(app => {
this.app = app;
this.fetching = false;

View File

@ -6,12 +6,12 @@
<b-form-input v-model="name" type="text" placeholder="ex) Misskey for iOS" autocomplete="off" required/>
</b-form-group>
<b-form-group label="ID" description="あなたのアプリのID。">
<b-input v-model="nid" type="text" pattern="^[a-zA-Z0-9-]{3,30}$" placeholder="ex) misskey-for-ios" autocomplete="off" required/>
<b-input v-model="nid" type="text" pattern="^[a-zA-Z0-9_]{3,30}$" placeholder="ex) misskey-for-ios" autocomplete="off" required/>
<p class="info" v-if="nidState == 'wait'" style="color:#999">%fa:spinner .pulse .fw%確認しています...</p>
<p class="info" v-if="nidState == 'ok'" style="color:#3CB7B5">%fa:fw check%利用できます</p>
<p class="info" v-if="nidState == 'unavailable'" style="color:#FF1161">%fa:fw exclamation-triangle%既に利用されています</p>
<p class="info" v-if="nidState == 'error'" style="color:#FF1161">%fa:fw exclamation-triangle%通信エラー</p>
<p class="info" v-if="nidState == 'invalid-format'" style="color:#FF1161">%fa:fw exclamation-triangle%a~zA~Z0~9-(ハイフン)が使えます</p>
<p class="info" v-if="nidState == 'invalid-format'" style="color:#FF1161">%fa:fw exclamation-triangle%a~zA~Z0~9_が使えます</p>
<p class="info" v-if="nidState == 'min-range'" style="color:#FF1161">%fa:fw exclamation-triangle%3文字以上でお願いします</p>
<p class="info" v-if="nidState == 'max-range'" style="color:#FF1161">%fa:fw exclamation-triangle%30文字以内でお願いします</p>
</b-form-group>
@ -77,8 +77,8 @@ export default Vue.extend({
this.nidState = 'wait';
(this as any).api('app/name_id/available', {
name_id: this.nid
(this as any).api('app/nameId/available', {
nameId: this.nid
}).then(result => {
this.nidState = result.available ? 'ok' : 'unavailable';
}).catch(err => {
@ -90,9 +90,9 @@ export default Vue.extend({
onSubmit() {
(this as any).api('app/create', {
name: this.name,
name_id: this.nid,
nameId: this.nid,
description: this.description,
callback_url: this.cb,
callbackUrl: this.cb,
permission: this.permission
}).then(() => {
location.href = '/apps';

View File

@ -14,7 +14,7 @@ import ElementLocaleJa from 'element-ui/lib/locale/lang/ja';
import App from './app.vue';
import checkForUpdate from './common/scripts/check-for-update';
import MiOS, { API } from './common/mios';
import { version, hostname, lang } from './config';
import { version, codename, hostname, lang } from './config';
let elementLocale;
switch (lang) {
@ -51,7 +51,7 @@ Vue.mixin({
* APP ENTRY POINT!
*/
console.info(`Misskey v${version} (葵 aoi)`);
console.info(`Misskey v${version} (${codename})`);
console.info(
'%cここにコードを入力したり張り付けたりしないでください。アカウントが不正利用される可能性があります。',
'color: red; background: yellow; font-size: 16px; font-weight: bold;');

View File

@ -18,7 +18,7 @@ export default (os) => (opts) => {
const text = window.prompt(`${getPostSummary(o.repost)}」をRepost`);
if (text == null) return;
os.api('posts/create', {
repost_id: o.repost.id,
repostId: o.repost.id,
text: text == '' ? undefined : text
});
} else {

View File

@ -29,7 +29,7 @@ export default Vue.extend({
},
mounted() {
(this as any).api('aggregation/users/activity', {
user_id: this.user.id,
userId: this.user.id,
limit: 30
}).then(data => {
data.forEach(d => d.total = d.posts + d.replies + d.reposts);

View File

@ -29,7 +29,7 @@
<span class="separator"></span>
<span class="data-size">{{ file.datasize | bytes }}</span>
<span class="separator"></span>
<span class="created-at" @click="showCreatedAt">%fa:R clock%<mk-time :time="file.created_at"/></span>
<span class="created-at" @click="showCreatedAt">%fa:R clock%<mk-time :time="file.createdAt"/></span>
</div>
</div>
<div class="menu">
@ -86,8 +86,8 @@ export default Vue.extend({
return this.file.type.split('/')[0];
},
style(): any {
return this.file.properties.average_color ? {
'background-color': `rgb(${ this.file.properties.average_color.join(',') })`
return this.file.properties.avgColor ? {
'background-color': `rgb(${ this.file.properties.avgColor.join(',') })`
} : {};
}
},
@ -96,7 +96,7 @@ export default Vue.extend({
const name = window.prompt('名前を変更', this.file.name);
if (name == null || name == '' || name == this.file.name) return;
(this as any).api('drive/files/update', {
file_id: this.file.id,
fileId: this.file.id,
name: name
}).then(() => {
this.browser.cf(this.file, true);
@ -105,15 +105,15 @@ export default Vue.extend({
move() {
(this as any).apis.chooseDriveFolder().then(folder => {
(this as any).api('drive/files/update', {
file_id: this.file.id,
folder_id: folder == null ? null : folder.id
fileId: this.file.id,
folderId: folder == null ? null : folder.id
}).then(() => {
this.browser.cf(this.file, true);
});
});
},
showCreatedAt() {
alert(new Date(this.file.created_at).toLocaleString());
alert(new Date(this.file.createdAt).toLocaleString());
},
onImageLoaded() {
const self = this;

View File

@ -19,7 +19,7 @@
<p class="data-size">{{ file.datasize | bytes }}</p>
<p class="separator"></p>
<p class="created-at">
%fa:R clock%<mk-time :time="file.created_at"/>
%fa:R clock%<mk-time :time="file.createdAt"/>
</p>
</footer>
</div>
@ -42,7 +42,7 @@ export default Vue.extend({
},
thumbnail(): any {
return {
'background-color': this.file.properties.average_color ? `rgb(${this.file.properties.average_color.join(',')})` : 'transparent',
'background-color': this.file.properties.avgColor ? `rgb(${this.file.properties.avgColor.join(',')})` : 'transparent',
'background-image': `url(${this.file.url}?thumbnail&size=128)`
};
}

View File

@ -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">
@ -129,7 +129,7 @@ export default Vue.extend({
onStreamDriveFileUpdated(file) {
const current = this.folder ? this.folder.id : null;
if (current != file.folder_id) {
if (current != file.folderId) {
this.removeFile(file);
} else {
this.addFile(file, true);
@ -142,7 +142,7 @@ export default Vue.extend({
onStreamDriveFolderUpdated(folder) {
const current = this.folder ? this.folder.id : null;
if (current != folder.parent_id) {
if (current != folder.parentId) {
this.removeFolder(folder);
} else {
this.addFolder(folder, true);
@ -167,7 +167,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('drive/folders/show', {
folder_id: target
folderId: target
}).then(folder => {
this.folder = folder;
this.hierarchyFolders = [];
@ -182,7 +182,7 @@ export default Vue.extend({
addFolder(folder, unshift = false) {
const current = this.folder ? this.folder.id : null;
// 追加しようとしているフォルダが、今居る階層とは違う階層のものだったら中断
if (current != folder.parent_id) return;
if (current != folder.parentId) return;
// 追加しようとしているフォルダを既に所有してたら中断
if (this.folders.some(f => f.id == folder.id)) return;
@ -197,7 +197,7 @@ export default Vue.extend({
addFile(file, unshift = false) {
const current = this.folder ? this.folder.id : null;
// 追加しようとしているファイルが、今居る階層とは違う階層のものだったら中断
if (current != file.folder_id) return;
if (current != file.folderId) return;
if (this.files.some(f => f.id == file.id)) {
const exist = this.files.map(f => f.id).indexOf(file.id);
@ -262,7 +262,7 @@ export default Vue.extend({
// フォルダ一覧取得
(this as any).api('drive/folders', {
folder_id: this.folder ? this.folder.id : null,
folderId: this.folder ? this.folder.id : null,
limit: foldersMax + 1
}).then(folders => {
if (folders.length == foldersMax + 1) {
@ -275,7 +275,7 @@ export default Vue.extend({
// ファイル一覧取得
(this as any).api('drive/files', {
folder_id: this.folder ? this.folder.id : null,
folderId: this.folder ? this.folder.id : null,
limit: filesMax + 1
}).then(files => {
if (files.length == filesMax + 1) {
@ -318,9 +318,9 @@ export default Vue.extend({
// ファイル一覧取得
(this as any).api('drive/files', {
folder_id: this.folder ? this.folder.id : null,
folderId: this.folder ? this.folder.id : null,
limit: max + 1,
until_id: this.files[this.files.length - 1].id
untilId: this.files[this.files.length - 1].id
}).then(files => {
if (files.length == max + 1) {
this.moreFiles = true;
@ -357,7 +357,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('drive/files/show', {
file_id: file
fileId: file
}).then(file => {
this.file = file;
this.folder = null;
@ -405,7 +405,7 @@ export default Vue.extend({
if (name == null || name == '') return;
(this as any).api('drive/folders/create', {
name: name,
parent_id: this.folder ? this.folder.id : undefined
parentId: this.folder ? this.folder.id : undefined
}).then(folder => {
this.addFolder(folder, true);
});
@ -420,7 +420,7 @@ export default Vue.extend({
if (name == null || name == '') return;
(this as any).api('drive/folders/update', {
name: name,
folder_id: this.folder.id
folderId: this.folder.id
}).then(folder => {
this.cd(folder);
});
@ -433,8 +433,8 @@ export default Vue.extend({
}
(this as any).apis.chooseDriveFolder().then(folder => {
(this as any).api('drive/folders/update', {
parent_id: folder ? folder.id : null,
folder_id: this.folder.id
parentId: folder ? folder.id : null,
folderId: this.folder.id
}).then(folder => {
this.cd(folder);
});
@ -446,7 +446,7 @@ export default Vue.extend({
if (url == null || url == '') return;
(this as any).api('drive/files/upload_from_url', {
url: url,
folder_id: this.folder ? this.folder.id : undefined
folderId: this.folder ? this.folder.id : undefined
});
alert('アップロードをリクエストしました。アップロードが完了するまで時間がかかる場合があります。');
},

View File

@ -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', {
user_id: this.user.id
userId: this.user.id
}).then(() => {
this.user.is_following = false;
this.user.isFollowing = false;
}).catch(err => {
console.error(err);
}).then(() => {
@ -67,9 +67,9 @@ export default Vue.extend({
});
} else {
(this as any).api('following/create', {
user_id: this.user.id
userId: this.user.id
}).then(() => {
this.user.is_following = true;
this.user.isFollowing = true;
}).catch(err => {
console.error(err);
}).then(() => {

View File

@ -10,7 +10,7 @@ export default Vue.extend({
computed: {
style(): any {
return {
'background-color': this.image.properties.average_color ? `rgb(${this.image.properties.average_color.join(',')})` : 'transparent',
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
'background-image': `url(${this.image.url}?thumbnail&size=512)`
};
}

View File

@ -1,7 +1,7 @@
<template>
<div class="mk-notification-preview" :class="notification.type">
<template v-if="notification.type == 'reaction'">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p><mk-reaction-icon :reaction="notification.reaction"/>{{ notification.user.name }}</p>
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%</p>
@ -9,7 +9,7 @@
</template>
<template v-if="notification.type == 'repost'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:retweet%{{ notification.post.user.name }}</p>
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%</p>
@ -17,7 +17,7 @@
</template>
<template v-if="notification.type == 'quote'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:quote-left%{{ notification.post.user.name }}</p>
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
@ -25,14 +25,14 @@
</template>
<template v-if="notification.type == 'follow'">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:user-plus%{{ notification.user.name }}</p>
</div>
</template>
<template v-if="notification.type == 'reply'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:reply%{{ notification.post.user.name }}</p>
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
@ -40,7 +40,7 @@
</template>
<template v-if="notification.type == 'mention'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:at%{{ notification.post.user.name }}</p>
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
@ -48,7 +48,7 @@
</template>
<template v-if="notification.type == 'poll_vote'">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:chart-pie%{{ notification.user.name }}</p>
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%</p>

View File

@ -1,9 +1,9 @@
<template>
<div class="mk-notification">
<div class="notification reaction" v-if="notification.type == 'reaction'">
<mk-time :time="notification.created_at"/>
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -18,9 +18,9 @@
</div>
<div class="notification repost" v-if="notification.type == 'repost'">
<mk-time :time="notification.created_at"/>
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -38,9 +38,9 @@
</template>
<div class="notification follow" v-if="notification.type == 'follow'">
<mk-time :time="notification.created_at"/>
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -59,9 +59,9 @@
</template>
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
<mk-time :time="notification.created_at"/>
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>

View File

@ -34,8 +34,8 @@ export default Vue.extend({
computed: {
_notifications(): any[] {
return (this.notifications as any).map(notification => {
const date = new Date(notification.created_at).getDate();
const month = new Date(notification.created_at).getMonth() + 1;
const date = new Date(notification.createdAt).getDate();
const month = new Date(notification.createdAt).getMonth() + 1;
notification._date = date;
notification._datetext = `${month}${date}`;
return notification;
@ -75,7 +75,7 @@ export default Vue.extend({
(this as any).api('i/notifications', {
limit: max + 1,
until_id: this.notifications[this.notifications.length - 1].id
untilId: this.notifications[this.notifications.length - 1].id
}).then(notifications => {
if (notifications.length == max + 1) {
this.moreNotifications = true;

View File

@ -7,7 +7,7 @@
<div>
{{ text }}
</div>
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</a>
</div>
</template>

View File

@ -1,14 +1,14 @@
<template>
<div class="root sub">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="main">
<header>
<router-link class="name" :to="`/@${acct}`">{{ post.user.name }}</router-link>
<span class="username">@{{ acct }}</span>
<router-link class="time" :to="`/@${acct}/${post.id}`">
<mk-time :time="post.created_at"/>
<mk-time :time="post.createdAt"/>
</router-link>
</header>
<div class="body">

View File

@ -2,7 +2,7 @@
<div class="mk-post-detail">
<button
class="more"
v-if="p.reply && p.reply.reply_id && context == null"
v-if="p.reply && p.reply.replyId && context == null"
@click="fetchContext"
:disabled="fetchingContext"
>
@ -18,7 +18,7 @@
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
</router-link>
%fa:retweet%
<router-link class="name" :to="`/@${acct}`">
@ -30,7 +30,7 @@
<article>
<header>
<router-link class="avatar-anchor" :to="`/@${pAcct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div>
<router-link class="name" :to="`/@${pAcct}`">{{ p.user.name }}</router-link>
@ -54,17 +54,17 @@
</div>
</div>
<router-link class="time" :to="`/@${pAcct}/${p.id}`">
<mk-time :time="p.created_at" mode="detail"/>
<mk-time :time="p.createdAt" mode="detail"/>
</router-link>
<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%">
<button :class="{ reacted: p.myReaction != 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>
</button>
<button @click="menu" ref="menuButton">
@ -115,16 +115,16 @@ export default Vue.extend({
isRepost(): boolean {
return (this.post.repost &&
this.post.text == null &&
this.post.media_ids == null &&
this.post.mediaIds == null &&
this.post.poll == null);
},
p(): any {
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;
},
@ -142,7 +142,7 @@ export default Vue.extend({
// Get replies
if (!this.compact) {
(this as any).api('posts/replies', {
post_id: this.p.id,
postId: this.p.id,
limit: 8
}).then(replies => {
this.replies = replies;
@ -151,7 +151,7 @@ export default Vue.extend({
// Draw map
if (this.p.geo) {
const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.client_settings.showMaps : true;
const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.clientSettings.showMaps : true;
if (shouldShowMap) {
(this as any).os.getGoogleMaps().then(maps => {
const uluru = new maps.LatLng(this.p.geo.latitude, this.p.geo.longitude);
@ -173,7 +173,7 @@ export default Vue.extend({
// Fetch context
(this as any).api('posts/context', {
post_id: this.p.reply_id
postId: this.p.replyId
}).then(context => {
this.contextFetching = false;
this.context = context.reverse();

Some files were not shown because too many files have changed in this diff Show More