summaryrefslogtreecommitdiff
path: root/src/web/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-04 18:50:30 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-04 18:50:30 +0900
commit9cff3868deaa35e5433bc39a392f8fd6d3e5a89e (patch)
treee865ac806627fbf10a538cf93e5cf7dfbae6ba91 /src/web/app/common
parent:art: (diff)
downloadsharkey-9cff3868deaa35e5433bc39a392f8fd6d3e5a89e.tar.gz
sharkey-9cff3868deaa35e5433bc39a392f8fd6d3e5a89e.tar.bz2
sharkey-9cff3868deaa35e5433bc39a392f8fd6d3e5a89e.zip
make sounds great again
Diffstat (limited to 'src/web/app/common')
-rw-r--r--src/web/app/common/mios.ts7
-rw-r--r--src/web/app/common/views/components/messaging-room.vue6
2 files changed, 13 insertions, 0 deletions
diff --git a/src/web/app/common/mios.ts b/src/web/app/common/mios.ts
index bc83ec0bbb..c5f0d1d4dc 100644
--- a/src/web/app/common/mios.ts
+++ b/src/web/app/common/mios.ts
@@ -94,6 +94,13 @@ export default class MiOS extends EventEmitter {
return localStorage.getItem('debug') == 'true';
}
+ /**
+ * Whether enable sounds
+ */
+ public get isEnableSounds() {
+ return localStorage.getItem('enableSounds') == 'true';
+ }
+
public apis: API;
/**
diff --git a/src/web/app/common/views/components/messaging-room.vue b/src/web/app/common/views/components/messaging-room.vue
index 0a675ba03e..e15e10ec7d 100644
--- a/src/web/app/common/views/components/messaging-room.vue
+++ b/src/web/app/common/views/components/messaging-room.vue
@@ -29,6 +29,7 @@ import Vue from 'vue';
import MessagingStreamConnection from '../../scripts/streaming/messaging-stream';
import XMessage from './messaging-room.message.vue';
import XForm from './messaging-room.form.vue';
+import { url } from '../../../config';
export default Vue.extend({
components: {
@@ -147,6 +148,11 @@ export default Vue.extend({
},
onMessage(message) {
+ // サウンドを再生する
+ if ((this as any).os.isEnableSounds) {
+ new Audio(`${url}/assets/message.mp3`).play();
+ }
+
const isBottom = this.isBottom();
this.messages.push(message);