From 1ef66c962a1cea81dee4f5db32cd011feac7de44 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 17 Jun 2018 08:10:54 +0900 Subject: reversi :white_flower: :100: --- .../app/common/scripts/compose-notification.ts | 2 +- .../app/common/scripts/streaming/othello-game.ts | 11 - src/client/app/common/scripts/streaming/othello.ts | 31 -- .../app/common/scripts/streaming/reversi-game.ts | 11 + src/client/app/common/scripts/streaming/reversi.ts | 31 ++ src/client/app/common/views/components/index.ts | 4 +- .../app/common/views/components/othello.game.vue | 324 --------------------- .../common/views/components/othello.gameroom.vue | 42 --- .../app/common/views/components/othello.room.vue | 297 ------------------- src/client/app/common/views/components/othello.vue | 313 -------------------- .../app/common/views/components/reversi.game.vue | 324 +++++++++++++++++++++ .../common/views/components/reversi.gameroom.vue | 42 +++ .../app/common/views/components/reversi.room.vue | 297 +++++++++++++++++++ src/client/app/common/views/components/reversi.vue | 313 ++++++++++++++++++++ src/client/app/desktop/script.ts | 10 +- .../app/desktop/views/components/game-window.vue | 6 +- .../app/desktop/views/components/ui.header.nav.vue | 12 +- src/client/app/desktop/views/pages/othello.vue | 50 ---- src/client/app/desktop/views/pages/reversi.vue | 50 ++++ src/client/app/mios.ts | 8 +- src/client/app/mobile/script.ts | 6 +- .../app/mobile/views/components/ui.header.vue | 12 +- src/client/app/mobile/views/components/ui.nav.vue | 14 +- src/client/app/mobile/views/pages/othello.vue | 50 ---- src/client/app/mobile/views/pages/reversi.vue | 50 ++++ src/client/assets/othello-put-me.mp3 | Bin 15672 -> 0 bytes src/client/assets/othello-put-you.mp3 | Bin 26121 -> 0 bytes src/client/assets/reversi-put-me.mp3 | Bin 0 -> 15672 bytes src/client/assets/reversi-put-you.mp3 | Bin 0 -> 26121 bytes 29 files changed, 1155 insertions(+), 1155 deletions(-) delete mode 100644 src/client/app/common/scripts/streaming/othello-game.ts delete mode 100644 src/client/app/common/scripts/streaming/othello.ts create mode 100644 src/client/app/common/scripts/streaming/reversi-game.ts create mode 100644 src/client/app/common/scripts/streaming/reversi.ts delete mode 100644 src/client/app/common/views/components/othello.game.vue delete mode 100644 src/client/app/common/views/components/othello.gameroom.vue delete mode 100644 src/client/app/common/views/components/othello.room.vue delete mode 100644 src/client/app/common/views/components/othello.vue create mode 100644 src/client/app/common/views/components/reversi.game.vue create mode 100644 src/client/app/common/views/components/reversi.gameroom.vue create mode 100644 src/client/app/common/views/components/reversi.room.vue create mode 100644 src/client/app/common/views/components/reversi.vue delete mode 100644 src/client/app/desktop/views/pages/othello.vue create mode 100644 src/client/app/desktop/views/pages/reversi.vue delete mode 100644 src/client/app/mobile/views/pages/othello.vue create mode 100644 src/client/app/mobile/views/pages/reversi.vue delete mode 100644 src/client/assets/othello-put-me.mp3 delete mode 100644 src/client/assets/othello-put-you.mp3 create mode 100644 src/client/assets/reversi-put-me.mp3 create mode 100644 src/client/assets/reversi-put-you.mp3 (limited to 'src/client') diff --git a/src/client/app/common/scripts/compose-notification.ts b/src/client/app/common/scripts/compose-notification.ts index c19b1c5ad0..cc28f75998 100644 --- a/src/client/app/common/scripts/compose-notification.ts +++ b/src/client/app/common/scripts/compose-notification.ts @@ -55,7 +55,7 @@ export default function(type, data): Notification { icon: data.user.avatarUrl + '?thumbnail&size=64' }; - case 'othello_invited': + case 'reversi_invited': return { title: '対局への招待があります', body: `${getUserName(data.parent)}さんから`, diff --git a/src/client/app/common/scripts/streaming/othello-game.ts b/src/client/app/common/scripts/streaming/othello-game.ts deleted file mode 100644 index 9e36f647bb..0000000000 --- a/src/client/app/common/scripts/streaming/othello-game.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Stream from './stream'; -import MiOS from '../../../mios'; - -export class OthelloGameStream extends Stream { - constructor(os: MiOS, me, game) { - super(os, 'othello-game', { - i: me ? me.token : null, - game: game.id - }); - } -} diff --git a/src/client/app/common/scripts/streaming/othello.ts b/src/client/app/common/scripts/streaming/othello.ts deleted file mode 100644 index 8f4f217e39..0000000000 --- a/src/client/app/common/scripts/streaming/othello.ts +++ /dev/null @@ -1,31 +0,0 @@ -import StreamManager from './stream-manager'; -import Stream from './stream'; -import MiOS from '../../../mios'; - -export class OthelloStream extends Stream { - constructor(os: MiOS, me) { - super(os, 'othello', { - i: me.token - }); - } -} - -export class OthelloStreamManager extends StreamManager { - private me; - private os: MiOS; - - constructor(os: MiOS, me) { - super(); - - this.me = me; - this.os = os; - } - - public getConnection() { - if (this.connection == null) { - this.connection = new OthelloStream(this.os, this.me); - } - - return this.connection; - } -} diff --git a/src/client/app/common/scripts/streaming/reversi-game.ts b/src/client/app/common/scripts/streaming/reversi-game.ts new file mode 100644 index 0000000000..5638b3013f --- /dev/null +++ b/src/client/app/common/scripts/streaming/reversi-game.ts @@ -0,0 +1,11 @@ +import Stream from './stream'; +import MiOS from '../../../mios'; + +export class ReversiGameStream extends Stream { + constructor(os: MiOS, me, game) { + super(os, 'reversi-game', { + i: me ? me.token : null, + game: game.id + }); + } +} diff --git a/src/client/app/common/scripts/streaming/reversi.ts b/src/client/app/common/scripts/streaming/reversi.ts new file mode 100644 index 0000000000..2e4395f0f1 --- /dev/null +++ b/src/client/app/common/scripts/streaming/reversi.ts @@ -0,0 +1,31 @@ +import StreamManager from './stream-manager'; +import Stream from './stream'; +import MiOS from '../../../mios'; + +export class ReversiStream extends Stream { + constructor(os: MiOS, me) { + super(os, 'reversi', { + i: me.token + }); + } +} + +export class ReversiStreamManager extends StreamManager { + private me; + private os: MiOS; + + constructor(os: MiOS, me) { + super(); + + this.me = me; + this.os = os; + } + + public getConnection() { + if (this.connection == null) { + this.connection = new ReversiStream(this.os, this.me); + } + + return this.connection; + } +} diff --git a/src/client/app/common/views/components/index.ts b/src/client/app/common/views/components/index.ts index b91008f718..5b2fa084fb 100644 --- a/src/client/app/common/views/components/index.ts +++ b/src/client/app/common/views/components/index.ts @@ -27,7 +27,7 @@ import urlPreview from './url-preview.vue'; import twitterSetting from './twitter-setting.vue'; import fileTypeIcon from './file-type-icon.vue'; import Switch from './switch.vue'; -import Othello from './othello.vue'; +import Reversi from './reversi.vue'; import welcomeTimeline from './welcome-timeline.vue'; import uiInput from './ui/input.vue'; import uiButton from './ui/button.vue'; @@ -65,7 +65,7 @@ Vue.component('mk-url-preview', urlPreview); Vue.component('mk-twitter-setting', twitterSetting); Vue.component('mk-file-type-icon', fileTypeIcon); Vue.component('mk-switch', Switch); -Vue.component('mk-othello', Othello); +Vue.component('mk-reversi', Reversi); Vue.component('mk-welcome-timeline', welcomeTimeline); Vue.component('ui-input', uiInput); Vue.component('ui-button', uiButton); diff --git a/src/client/app/common/views/components/othello.game.vue b/src/client/app/common/views/components/othello.game.vue deleted file mode 100644 index 4c63bd18b8..0000000000 --- a/src/client/app/common/views/components/othello.game.vue +++ /dev/null @@ -1,324 +0,0 @@ - - - - - diff --git a/src/client/app/common/views/components/othello.gameroom.vue b/src/client/app/common/views/components/othello.gameroom.vue deleted file mode 100644 index 2dbd04ce49..0000000000 --- a/src/client/app/common/views/components/othello.gameroom.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/src/client/app/common/views/components/othello.room.vue b/src/client/app/common/views/components/othello.room.vue deleted file mode 100644 index dcf41f2e04..0000000000 --- a/src/client/app/common/views/components/othello.room.vue +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - diff --git a/src/client/app/common/views/components/othello.vue b/src/client/app/common/views/components/othello.vue deleted file mode 100644 index a0971c45b4..0000000000 --- a/src/client/app/common/views/components/othello.vue +++ /dev/null @@ -1,313 +0,0 @@ - - - - - diff --git a/src/client/app/common/views/components/reversi.game.vue b/src/client/app/common/views/components/reversi.game.vue new file mode 100644 index 0000000000..dc79c95bb8 --- /dev/null +++ b/src/client/app/common/views/components/reversi.game.vue @@ -0,0 +1,324 @@ + + + + + diff --git a/src/client/app/common/views/components/reversi.gameroom.vue b/src/client/app/common/views/components/reversi.gameroom.vue new file mode 100644 index 0000000000..7ce0112451 --- /dev/null +++ b/src/client/app/common/views/components/reversi.gameroom.vue @@ -0,0 +1,42 @@ + + + diff --git a/src/client/app/common/views/components/reversi.room.vue b/src/client/app/common/views/components/reversi.room.vue new file mode 100644 index 0000000000..5074845758 --- /dev/null +++ b/src/client/app/common/views/components/reversi.room.vue @@ -0,0 +1,297 @@ + + + + + + + + + diff --git a/src/client/app/common/views/components/reversi.vue b/src/client/app/common/views/components/reversi.vue new file mode 100644 index 0000000000..e4d7740bde --- /dev/null +++ b/src/client/app/common/views/components/reversi.vue @@ -0,0 +1,313 @@ + + + + + diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index 076d532d6d..201ab0a83d 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -34,7 +34,7 @@ import MkMessagingRoom from './views/pages/messaging-room.vue'; import MkNote from './views/pages/note.vue'; import MkSearch from './views/pages/search.vue'; import MkTag from './views/pages/tag.vue'; -import MkOthello from './views/pages/othello.vue'; +import MkReversi from './views/pages/reversi.vue'; import MkShare from './views/pages/share.vue'; /** @@ -64,8 +64,8 @@ init(async (launch) => { { path: '/search', component: MkSearch }, { path: '/tags/:tag', component: MkTag }, { path: '/share', component: MkShare }, - { path: '/othello', component: MkOthello }, - { path: '/othello/:game', component: MkOthello }, + { path: '/reversi', component: MkReversi }, + { path: '/reversi/:game', component: MkReversi }, { path: '/@:user', component: MkUser }, { path: '/notes/:note', component: MkNote } ] @@ -166,8 +166,8 @@ function registerNotifications(stream: HomeStreamManager) { setTimeout(n.close.bind(n), 7000); }); - connection.on('othello_invited', matching => { - const _n = composeNotification('othello_invited', matching); + connection.on('reversi_invited', matching => { + const _n = composeNotification('reversi_invited', matching); const n = new Notification(_n.title, { body: _n.body, icon: _n.icon diff --git a/src/client/app/desktop/views/components/game-window.vue b/src/client/app/desktop/views/components/game-window.vue index c3c0f90075..7c6cb9cd40 100644 --- a/src/client/app/desktop/views/components/game-window.vue +++ b/src/client/app/desktop/views/components/game-window.vue @@ -1,7 +1,7 @@ @@ -18,8 +18,8 @@ export default Vue.extend({ computed: { popout(): string { return this.game - ? `${url}/othello/${this.game.id}` - : `${url}/othello`; + ? `${url}/reversi/${this.game.id}` + : `${url}/reversi`; } } }); diff --git a/src/client/app/desktop/views/components/ui.header.nav.vue b/src/client/app/desktop/views/components/ui.header.nav.vue index fe2637cec3..42211b57fe 100644 --- a/src/client/app/desktop/views/components/ui.header.nav.vue +++ b/src/client/app/desktop/views/components/ui.header.nav.vue @@ -56,23 +56,23 @@ export default Vue.extend({ this.connection = (this as any).os.stream.getConnection(); this.connectionId = (this as any).os.stream.use(); - this.connection.on('othello_invited', this.onOthelloInvited); - this.connection.on('othello_no_invites', this.onOthelloNoInvites); + this.connection.on('reversi_invited', this.onReversiInvited); + this.connection.on('reversi_no_invites', this.onReversiNoInvites); } }, beforeDestroy() { if (this.$store.getters.isSignedIn) { - this.connection.off('othello_invited', this.onOthelloInvited); - this.connection.off('othello_no_invites', this.onOthelloNoInvites); + this.connection.off('reversi_invited', this.onReversiInvited); + this.connection.off('reversi_no_invites', this.onReversiNoInvites); (this as any).os.stream.dispose(this.connectionId); } }, methods: { - onOthelloInvited() { + onReversiInvited() { this.hasGameInvitations = true; }, - onOthelloNoInvites() { + onReversiNoInvites() { this.hasGameInvitations = false; }, diff --git a/src/client/app/desktop/views/pages/othello.vue b/src/client/app/desktop/views/pages/othello.vue deleted file mode 100644 index 0d8e987dd9..0000000000 --- a/src/client/app/desktop/views/pages/othello.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/src/client/app/desktop/views/pages/reversi.vue b/src/client/app/desktop/views/pages/reversi.vue new file mode 100644 index 0000000000..098fc41f1c --- /dev/null +++ b/src/client/app/desktop/views/pages/reversi.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index ba3f967a23..9a8d19adbd 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -11,7 +11,7 @@ import { DriveStreamManager } from './common/scripts/streaming/drive'; import { ServerStatsStreamManager } from './common/scripts/streaming/server-stats'; import { NotesStatsStreamManager } from './common/scripts/streaming/notes-stats'; import { MessagingIndexStreamManager } from './common/scripts/streaming/messaging-index'; -import { OthelloStreamManager } from './common/scripts/streaming/othello'; +import { ReversiStreamManager } from './common/scripts/streaming/reversi'; import Err from './common/views/components/connect-failed.vue'; import { LocalTimelineStreamManager } from './common/scripts/streaming/local-timeline'; @@ -108,7 +108,7 @@ export default class MiOS extends EventEmitter { serverStatsStream: ServerStatsStreamManager; notesStatsStream: NotesStatsStreamManager; messagingIndexStream: MessagingIndexStreamManager; - othelloStream: OthelloStreamManager; + reversiStream: ReversiStreamManager; } = { localTimelineStream: null, globalTimelineStream: null, @@ -116,7 +116,7 @@ export default class MiOS extends EventEmitter { serverStatsStream: null, notesStatsStream: null, messagingIndexStream: null, - othelloStream: null + reversiStream: null }; /** @@ -233,7 +233,7 @@ export default class MiOS extends EventEmitter { this.streams.globalTimelineStream = new GlobalTimelineStreamManager(this, this.store.state.i); this.streams.driveStream = new DriveStreamManager(this, this.store.state.i); this.streams.messagingIndexStream = new MessagingIndexStreamManager(this, this.store.state.i); - this.streams.othelloStream = new OthelloStreamManager(this, this.store.state.i); + this.streams.reversiStream = new ReversiStreamManager(this, this.store.state.i); }); //#endregion diff --git a/src/client/app/mobile/script.ts b/src/client/app/mobile/script.ts index 1572fd73ed..cc0a8331ba 100644 --- a/src/client/app/mobile/script.ts +++ b/src/client/app/mobile/script.ts @@ -35,7 +35,7 @@ import MkFavorites from './views/pages/favorites.vue'; import MkUserLists from './views/pages/user-lists.vue'; import MkUserList from './views/pages/user-list.vue'; import MkSettings from './views/pages/settings.vue'; -import MkOthello from './views/pages/othello.vue'; +import MkReversi from './views/pages/reversi.vue'; import MkTag from './views/pages/tag.vue'; import MkShare from './views/pages/share.vue'; @@ -75,8 +75,8 @@ init((launch) => { { path: '/search', component: MkSearch }, { path: '/tags/:tag', component: MkTag }, { path: '/share', component: MkShare }, - { path: '/othello', name: 'othello', component: MkOthello }, - { path: '/othello/:game', component: MkOthello }, + { path: '/reversi', name: 'reversi', component: MkReversi }, + { path: '/reversi/:game', component: MkReversi }, { path: '/@:user', component: MkUser }, { path: '/@:user/followers', component: MkFollowers }, { path: '/@:user/following', component: MkFollowing }, diff --git a/src/client/app/mobile/views/components/ui.header.vue b/src/client/app/mobile/views/components/ui.header.vue index c72b15fb8b..c1ee70d105 100644 --- a/src/client/app/mobile/views/components/ui.header.vue +++ b/src/client/app/mobile/views/components/ui.header.vue @@ -45,8 +45,8 @@ export default Vue.extend({ this.connection = (this as any).os.stream.getConnection(); this.connectionId = (this as any).os.stream.use(); - this.connection.on('othello_invited', this.onOthelloInvited); - this.connection.on('othello_no_invites', this.onOthelloNoInvites); + this.connection.on('reversi_invited', this.onReversiInvited); + this.connection.on('reversi_no_invites', this.onReversiNoInvites); const ago = (new Date().getTime() - new Date(this.$store.state.i.lastUsedAt).getTime()) / 1000; const isHisasiburi = ago >= 3600; @@ -98,16 +98,16 @@ export default Vue.extend({ }, beforeDestroy() { if (this.$store.getters.isSignedIn) { - this.connection.off('othello_invited', this.onOthelloInvited); - this.connection.off('othello_no_invites', this.onOthelloNoInvites); + this.connection.off('reversi_invited', this.onReversiInvited); + this.connection.off('reversi_no_invites', this.onReversiNoInvites); (this as any).os.stream.dispose(this.connectionId); } }, methods: { - onOthelloInvited() { + onReversiInvited() { this.hasGameInvitation = true; }, - onOthelloNoInvites() { + onReversiNoInvites() { this.hasGameInvitation = false; } } diff --git a/src/client/app/mobile/views/components/ui.nav.vue b/src/client/app/mobile/views/components/ui.nav.vue index 80f60e4232..bb7a2f558c 100644 --- a/src/client/app/mobile/views/components/ui.nav.vue +++ b/src/client/app/mobile/views/components/ui.nav.vue @@ -19,7 +19,7 @@
  • %fa:R bell%%i18n:@notifications%%fa:angle-right%
  • %fa:R comments%%i18n:@messaging%%fa:angle-right%
  • %fa:R envelope%%i18n:@follow-requests%%fa:angle-right%
  • -
  • %fa:gamepad%%i18n:@game%%fa:angle-right%
  • +
  • %fa:gamepad%%i18n:@game%%fa:angle-right%
    • %fa:R calendar-alt%%i18n:@widgets%%fa:angle-right%
    • @@ -66,14 +66,14 @@ export default Vue.extend({ this.connection = (this as any).os.stream.getConnection(); this.connectionId = (this as any).os.stream.use(); - this.connection.on('othello_invited', this.onOthelloInvited); - this.connection.on('othello_no_invites', this.onOthelloNoInvites); + this.connection.on('reversi_invited', this.onReversiInvited); + this.connection.on('reversi_no_invites', this.onReversiNoInvites); } }, beforeDestroy() { if (this.$store.getters.isSignedIn) { - this.connection.off('othello_invited', this.onOthelloInvited); - this.connection.off('othello_no_invites', this.onOthelloNoInvites); + this.connection.off('reversi_invited', this.onReversiInvited); + this.connection.off('reversi_no_invites', this.onReversiNoInvites); (this as any).os.stream.dispose(this.connectionId); } }, @@ -83,10 +83,10 @@ export default Vue.extend({ if (query == null || query == '') return; this.$router.push('/search?q=' + encodeURIComponent(query)); }, - onOthelloInvited() { + onReversiInvited() { this.hasGameInvitation = true; }, - onOthelloNoInvites() { + onReversiNoInvites() { this.hasGameInvitation = false; }, dark() { diff --git a/src/client/app/mobile/views/pages/othello.vue b/src/client/app/mobile/views/pages/othello.vue deleted file mode 100644 index e04e583c20..0000000000 --- a/src/client/app/mobile/views/pages/othello.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/src/client/app/mobile/views/pages/reversi.vue b/src/client/app/mobile/views/pages/reversi.vue new file mode 100644 index 0000000000..e2f0db6d87 --- /dev/null +++ b/src/client/app/mobile/views/pages/reversi.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/client/assets/othello-put-me.mp3 b/src/client/assets/othello-put-me.mp3 deleted file mode 100644 index 4e0e72091c..0000000000 Binary files a/src/client/assets/othello-put-me.mp3 and /dev/null differ diff --git a/src/client/assets/othello-put-you.mp3 b/src/client/assets/othello-put-you.mp3 deleted file mode 100644 index 9244189c2d..0000000000 Binary files a/src/client/assets/othello-put-you.mp3 and /dev/null differ diff --git a/src/client/assets/reversi-put-me.mp3 b/src/client/assets/reversi-put-me.mp3 new file mode 100644 index 0000000000..4e0e72091c Binary files /dev/null and b/src/client/assets/reversi-put-me.mp3 differ diff --git a/src/client/assets/reversi-put-you.mp3 b/src/client/assets/reversi-put-you.mp3 new file mode 100644 index 0000000000..9244189c2d Binary files /dev/null and b/src/client/assets/reversi-put-you.mp3 differ -- cgit v1.2.3-freya