diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-29 14:48:47 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-29 14:48:47 +0900 |
| commit | bfc193d8cd9aecdb82d585e8b4e101deac60a5bb (patch) | |
| tree | 8b4dac3a56cf703650c8207f9279028a8560a96b /src/server/web/app/common | |
| parent | resolve conflict (diff) | |
| download | sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.gz sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.bz2 sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.zip | |
Resolve conflicts
Diffstat (limited to 'src/server/web/app/common')
26 files changed, 117 insertions, 116 deletions
diff --git a/src/server/web/app/common/define-widget.ts b/src/server/web/app/common/define-widget.ts index d8d29873a4..27db59b5ee 100644 --- a/src/server/web/app/common/define-widget.ts +++ b/src/server/web/app/common/define-widget.ts @@ -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; }); } }, { diff --git a/src/server/web/app/common/mios.ts b/src/server/web/app/common/mios.ts index 2c6c9988e7..bcb8b60678 100644 --- a/src/server/web/app/common/mios.ts +++ b/src/server/web/app/common/mios.ts @@ -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)); diff --git a/src/server/web/app/common/scripts/compose-notification.ts b/src/server/web/app/common/scripts/compose-notification.ts index e1dbd3bc13..273579cbc6 100644 --- a/src/server/web/app/common/scripts/compose-notification.ts +++ b/src/server/web/app/common/scripts/compose-notification.ts @@ -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: diff --git a/src/server/web/app/common/scripts/parse-search-query.ts b/src/server/web/app/common/scripts/parse-search-query.ts index 512791ecb0..4f09d2b93f 100644 --- a/src/server/web/app/common/scripts/parse-search-query.ts +++ b/src/server/web/app/common/scripts/parse-search-query.ts @@ -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'; diff --git a/src/server/web/app/common/scripts/streaming/home.ts b/src/server/web/app/common/scripts/streaming/home.ts index ffcf6e5360..c198619400 100644 --- a/src/server/web/app/common/scripts/streaming/home.ts +++ b/src/server/web/app/common/scripts/streaming/home.ts @@ -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); // 自分の情報が更新されたとき diff --git a/src/server/web/app/common/views/components/autocomplete.vue b/src/server/web/app/common/views/components/autocomplete.vue index 8afa291e3c..79bd2ba023 100644 --- a/src/server/web/app/common/views/components/autocomplete.vue +++ b/src/server/web/app/common/views/components/autocomplete.vue @@ -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> diff --git a/src/server/web/app/common/views/components/messaging-room.form.vue b/src/server/web/app/common/views/components/messaging-room.form.vue index 01886b19c8..704f2016d8 100644 --- a/src/server/web/app/common/views/components/messaging-room.form.vue +++ b/src/server/web/app/common/views/components/messaging-room.form.vue @@ -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 diff --git a/src/server/web/app/common/views/components/messaging-room.message.vue b/src/server/web/app/common/views/components/messaging-room.message.vue index 5f2eb1ba86..94f87fd709 100644 --- a/src/server/web/app/common/views/components/messaging-room.message.vue +++ b/src/server/web/app/common/views/components/messaging-room.message.vue @@ -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) { diff --git a/src/server/web/app/common/views/components/messaging-room.vue b/src/server/web/app/common/views/components/messaging-room.vue index 6ff808b617..d30c64d74a 100644 --- a/src/server/web/app/common/views/components/messaging-room.vue +++ b/src/server/web/app/common/views/components/messaging-room.vue @@ -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 diff --git a/src/server/web/app/common/views/components/messaging.vue b/src/server/web/app/common/views/components/messaging.vue index 88574b94d1..8317c3738a 100644 --- a/src/server/web/app/common/views/components/messaging.vue +++ b/src/server/web/app/common/views/components/messaging.vue @@ -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() { diff --git a/src/server/web/app/common/views/components/othello.game.vue b/src/server/web/app/common/views/components/othello.game.vue index 414d819a55..f08742ad10 100644 --- a/src/server/web/app/common/views/components/othello.game.vue +++ b/src/server/web/app/common/views/components/othello.game.vue @@ -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 => { diff --git a/src/server/web/app/common/views/components/othello.gameroom.vue b/src/server/web/app/common/views/components/othello.gameroom.vue index 38a25f6686..dba9ccd16d 100644 --- a/src/server/web/app/common/views/components/othello.gameroom.vue +++ b/src/server/web/app/common/views/components/othello.gameroom.vue @@ -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> diff --git a/src/server/web/app/common/views/components/othello.room.vue b/src/server/web/app/common/views/components/othello.room.vue index 3965414836..a32be6b74f 100644 --- a/src/server/web/app/common/views/components/othello.room.vue +++ b/src/server/web/app/common/views/components/othello.room.vue @@ -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); }, diff --git a/src/server/web/app/common/views/components/othello.vue b/src/server/web/app/common/views/components/othello.vue index d650322341..8f7d9dfd6a 100644 --- a/src/server/web/app/common/views/components/othello.vue +++ b/src/server/web/app/common/views/components/othello.vue @@ -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; diff --git a/src/server/web/app/common/views/components/poll.vue b/src/server/web/app/common/views/components/poll.vue index 8156c8bc58..711d89720e 100644 --- a/src/server/web/app/common/views/components/poll.vue +++ b/src/server/web/app/common/views/components/poll.vue @@ -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; diff --git a/src/server/web/app/common/views/components/post-menu.vue b/src/server/web/app/common/views/components/post-menu.vue index a53680e55a..35116db7e2 100644 --- a/src/server/web/app/common/views/components/post-menu.vue +++ b/src/server/web/app/common/views/components/post-menu.vue @@ -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(); }); diff --git a/src/server/web/app/common/views/components/reaction-picker.vue b/src/server/web/app/common/views/components/reaction-picker.vue index df8100f2fc..bcb6b2b965 100644 --- a/src/server/web/app/common/views/components/reaction-picker.vue +++ b/src/server/web/app/common/views/components/reaction-picker.vue @@ -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(); diff --git a/src/server/web/app/common/views/components/reactions-viewer.vue b/src/server/web/app/common/views/components/reactions-viewer.vue index f6a27d9139..246451008f 100644 --- a/src/server/web/app/common/views/components/reactions-viewer.vue +++ b/src/server/web/app/common/views/components/reactions-viewer.vue @@ -20,7 +20,7 @@ export default Vue.extend({ props: ['post'], computed: { reactions(): number { - return this.post.reaction_counts; + return this.post.reactionCounts; } } }); diff --git a/src/server/web/app/common/views/components/signin.vue b/src/server/web/app/common/views/components/signin.vue index 2434684085..17154e6b31 100644 --- a/src/server/web/app/common/views/components/signin.vue +++ b/src/server/web/app/common/views/components/signin.vue @@ -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(() => { diff --git a/src/server/web/app/common/views/components/signup.vue b/src/server/web/app/common/views/components/signup.vue index c2e78aa8a3..e77d849ade 100644 --- a/src/server/web/app/common/views/components/signup.vue +++ b/src/server/web/app/common/views/components/signup.vue @@ -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> diff --git a/src/server/web/app/common/views/components/twitter-setting.vue b/src/server/web/app/common/views/components/twitter-setting.vue index 15968d20a6..082d2b435d 100644 --- a/src/server/web/app/common/views/components/twitter-setting.vue +++ b/src/server/web/app/common/views/components/twitter-setting.vue @@ -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> diff --git a/src/server/web/app/common/views/components/uploader.vue b/src/server/web/app/common/views/components/uploader.vue index 73006b16e9..c74a1edb41 100644 --- a/src/server/web/app/common/views/components/uploader.vue +++ b/src/server/web/app/common/views/components/uploader.vue @@ -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); diff --git a/src/server/web/app/common/views/components/welcome-timeline.vue b/src/server/web/app/common/views/components/welcome-timeline.vue index 7586e9264e..8f6199732a 100644 --- a/src/server/web/app/common/views/components/welcome-timeline.vue +++ b/src/server/web/app/common/views/components/welcome-timeline.vue @@ -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> diff --git a/src/server/web/app/common/views/directives/autocomplete.ts b/src/server/web/app/common/views/directives/autocomplete.ts index 3440c4212a..94635d301a 100644 --- a/src/server/web/app/common/views/directives/autocomplete.ts +++ b/src/server/web/app/common/views/directives/autocomplete.ts @@ -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; } diff --git a/src/server/web/app/common/views/widgets/slideshow.vue b/src/server/web/app/common/views/widgets/slideshow.vue index e9451663e2..ad32299f37 100644 --- a/src/server/web/app/common/views/widgets/slideshow.vue +++ b/src/server/web/app/common/views/widgets/slideshow.vue @@ -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 => { diff --git a/src/server/web/app/common/views/widgets/version.vue b/src/server/web/app/common/views/widgets/version.vue index 5072d9b74a..30b632b396 100644 --- a/src/server/web/app/common/views/widgets/version.vue +++ b/src/server/web/app/common/views/widgets/version.vue @@ -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 }; } }); |