-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplugin-blocksound.html
More file actions
58 lines (53 loc) · 1.76 KB
/
Copy pathplugin-blocksound.html
File metadata and controls
58 lines (53 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<template id="block-sound">
<div class="kiwi-statebrowser-btnblocksound">
<a @click="buttonClicked">
<i v-if="blockSOUND" class="fa fa-bell-slash kiwi-statebrowser-btnRedBS" aria-hidden="true" title="Activer les notifications sonores"></i>
<i v-else class="fa fa-bell" aria-hidden="true" title="Désactiver les notifications sonores"></i>
</a>
</div>
</template>
<script>
kiwi.plugin('block_sound', function(kiwi, log) {
var button = new kiwi.Vue({
template: '#block-sound',
computed: {
blockSOUND: function blockSOUND() {
return kiwi.state.setting('buffers.mute_sound');
}
},
methods: {
buttonClicked: function buttonClicked() {
var msg = 'Vous venez ' + (this.blockSOUND ? 'd\'activer' : 'de désactiver') + ' les notifications sonores.';
var network = this.$state.getActiveNetwork();
kiwi.state.setting('buffers.mute_sound', !this.blockSOUND);
kiwi.state.addMessage(kiwi.state.getActiveBuffer(), { nick: 'Message automatique', message: msg, type: 'notice' });
if (kiwi.state.ui.is_narrow) {
kiwi.state.$emit('statebrowser.hide');
}
}
},
});
kiwi.addUi('browser', button.$mount().$el);
});
</script>
<style>
.kiwi-statebrowser-btnblocksound {
position: absolute;
top: 0px;
left: 56px;
z-index: 1002;
width: 32px;
text-align: center;
cursor: pointer;
transition: background .2s,opacity .2s;
line-height: 32px;
font-size: 18px;
}
.kiwi-statebrowser-btnblocksound:hover {
background-color: hsla(0,0%,50.2%,.2);
opacity: 1;
}
.kiwi-statebrowser-btnRedBS {
color: #F1948A;
}
</style>