projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove watcher for fenStart in BaseGame: call re_setVariables manually. Less Vue...
[vchess.git]
/
client
/
src
/
components
/
Chat.vue
diff --git
a/client/src/components/Chat.vue
b/client/src/components/Chat.vue
index
7205f3b
..
6eb7ef3
100644
(file)
--- a/
client/src/components/Chat.vue
+++ b/
client/src/components/Chat.vue
@@
-1,11
+1,19
@@
<template lang="pug">
div
<template lang="pug">
div
- input#inputChat(type="text" :placeholder="st.tr['Chat here']"
- @keyup.enter="sendChat()")
+ button(@click="clearHistory()")
+ | {{ st.tr["Clear history"] }}
+ input#inputChat(
+ type="text"
+ :placeholder="st.tr['Chat here']"
+ @keyup.enter="sendChat()"
+ )
button(@click="sendChat()") {{ st.tr["Send"] }}
p(v-for="chat in chats.concat(pastChats)")
span.name {{ chat.name }} :
button(@click="sendChat()") {{ st.tr["Send"] }}
p(v-for="chat in chats.concat(pastChats)")
span.name {{ chat.name }} :
- span(:class="classObject(chat)" v-html="chat.msg")
+ span(
+ :class="classObject(chat)"
+ v-html="chat.msg"
+ )
</template>
<script>
</template>
<script>
@@
-45,6
+53,10
@@
export default {
const chat = { msg: chatTxt, name: this.st.user.name || "@nonymous" };
this.$emit("mychat", chat);
this.chats.unshift(chat);
const chat = { msg: chatTxt, name: this.st.user.name || "@nonymous" };
this.$emit("mychat", chat);
this.chats.unshift(chat);
+ },
+ clearHistory: function() {
+ this.chats = [];
+ this.$emit("chatcleared");
}
}
};
}
}
};
@@
-53,6
+65,7
@@
export default {
<style lang="sass" scoped>
.name
color: #abb2b9
<style lang="sass" scoped>
.name
color: #abb2b9
+
.my-chatmsg
color: #7d3c98
.opp-chatmsg
.my-chatmsg
color: #7d3c98
.opp-chatmsg