summaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/GroupMaker.vue22
-rw-r--r--src/components/GroupView.vue47
-rw-r--r--src/components/Searcher.vue13
3 files changed, 74 insertions, 8 deletions
diff --git a/src/components/GroupMaker.vue b/src/components/GroupMaker.vue
index 59f83fd..f3da293 100644
--- a/src/components/GroupMaker.vue
+++ b/src/components/GroupMaker.vue
@@ -49,11 +49,15 @@ export default {
49 "users": this.users_selection 49 "users": this.users_selection
50 }) 50 })
51 51
52 if(status === 201) 52 if(status === 201) {
53 this.$notify({ 53 this.$notify({
54 type: "success", 54 type: "success",
55 text: "Group created!" 55 text: "Group created!"
56 }) 56 })
57
58 this.close()
59 }
60
57 }, 61 },
58 62
59 async set_users() { 63 async set_users() {
@@ -77,3 +81,19 @@ export default {
77 } 81 }
78} 82}
79</script> 83</script>
84
85<style scoped>
86
87.group_maker {
88 position: absolute;
89 width: 30%;
90 height: 80%;
91 top: 50%;
92 left: 50%;
93 background-color: #202020;
94 padding: 20px;
95 border-radius: 10px;
96 transform: translate(-50%, -50%);
97 }
98
99</style>
diff --git a/src/components/GroupView.vue b/src/components/GroupView.vue
new file mode 100644
index 0000000..1608cf4
--- /dev/null
+++ b/src/components/GroupView.vue
@@ -0,0 +1,47 @@
1<template>
2 <div class="group_view">
3 Group maker
4 <form @submit="send_message">
5 <inout type="text" ref="input" />
6 </form>
7 </div>
8</template>
9
10<script>
11import ChatService from "@/services/ChatService.js"
12
13export default {
14 data() {
15 return {
16 }
17 },
18
19 methods: {
20 close() {
21 this.$emit('close')
22 },
23 },
24
25 created() {
26 this.$nextTick(function () {
27 this.$refs.input.focus()
28 })
29 }
30}
31</script>
32
33<style scoped>
34
35.group_view {
36 position: absolute;
37 width: 30%;
38 height: 80%;
39 top: 50%;
40 left: 50%;
41 background-color: #202020;
42 padding: 20px;
43 border-radius: 10px;
44 transform: translate(-50%, -50%);
45 }
46
47</style>
diff --git a/src/components/Searcher.vue b/src/components/Searcher.vue
index 8488fd4..a1093a2 100644
--- a/src/components/Searcher.vue
+++ b/src/components/Searcher.vue
@@ -61,9 +61,10 @@ export default {
61 else this.current = this.sugestions[0] 61 else this.current = this.sugestions[0]
62 }, 62 },
63 63
64 execute_current() { 64 async execute_current() {
65 let out = this.current[1](this) 65 let out = await this.current[1](this)
66 66
67 console.log(out)
67 if(out instanceof Object) { 68 if(out instanceof Object) {
68 this.search = '' 69 this.search = ''
69 this.commands = out 70 this.commands = out
@@ -71,25 +72,23 @@ export default {
71 }, 72 },
72 73
73 hotkeys(e) { 74 hotkeys(e) {
75 e.preventDefault()
76
74 switch(e.code) { 77 switch(e.code) {
75 case 'Escape': 78 case 'Escape':
76 this.close() 79 this.close()
77 break 80 break
78 case 'ArrowDown': 81 case 'ArrowDown':
79 e.preventDefault()
80 this.change_current(1) 82 this.change_current(1)
81 break 83 break
82 case 'ArrowUp': 84 case 'ArrowUp':
83 e.preventDefault()
84 this.change_current(-1) 85 this.change_current(-1)
85 break 86 break
86 case 'Tab': 87 case 'Tab':
87 e.preventDefault()
88 this.change_current(1) 88 this.change_current(1)
89 break 89 break
90 case 'Enter': 90 case 'Enter':
91 this.execute_current() 91 this.execute_current()
92 e.preventDefault()
93 break 92 break
94 case 'ShiftLeft': 93 case 'ShiftLeft':
95 this.commands = CommandsService 94 this.commands = CommandsService