Resolve conflicts
This commit is contained in:
parent
281b388e39
commit
bfc193d8cd
308 changed files with 3045 additions and 3200 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export default Vue.extend({
|
|||
props: ['post'],
|
||||
computed: {
|
||||
reactions(): number {
|
||||
return this.post.reaction_counts;
|
||||
return this.post.reactionCounts;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue