Skip to content

Commit 43b1823

Browse files
committed
cherry-pick colab
1 parent 205c446 commit 43b1823

File tree

7 files changed

+228
-109
lines changed

7 files changed

+228
-109
lines changed

src/components/basecanvas.vue

Lines changed: 109 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
<div class="div-container">
33
<b-card :class="bytheme" class=" mb-3 shadow-lg cnbase">
44

5-
<b-modal id="options" hide-footer>
5+
<b-modal hide-header id="options" hide-footer v-if="visibles.options">
6+
<p style="cursor:pointer" @click="$bvModal.hide('options')">X</p>
67
<b-container class="d-inline">
78
<b-form-select
8-
class="text-center mt-1 text-dark col-sm-3 font-weight-bold"
9+
class="text-center mt-1 text-dark col-sm-3 font-weight-bold noneshine"
910
v-model="standar"
1011

1112
title="el estandar con el que se compilara c++"
@@ -17,7 +18,7 @@
1718
</b-form-select>
1819
<b-form-select
1920
variant="primary"
20-
class="ml-3 mt-1 text-dark col-sm-2 font-weight-bold"
21+
class="ml-3 mt-1 text-dark col-sm-2 font-weight-bold noneshine"
2122
v-model="optimizar"
2223
title="el nivel de optimizacion a la hora de compilar, esto se vera en el codigo ensamblador"
2324
>
@@ -43,50 +44,86 @@
4344
</b-container>
4445

4546
</b-modal>
46-
<b-modal hide-footer id="program-input">
47+
48+
<b-modal hide-header hide-footer id="program-input">
49+
<p style="cursor:pointer" @click="$bvModal.hide('program-input')">X</p>
4750
<inputData />
4851
</b-modal>
4952

5053
<b-modal hide-footer id="headers">
5154
<headers />
5255
</b-modal>
5356

54-
<b-modal hide-footer id="flags-modal" title="flags">
57+
<b-modal title="Compartir" id="share-link" hide-footer hide-header>
58+
<p style="cursor:pointer" @click="$bvModal.hide('share-link')">X</p>
59+
<b-container fluid>
60+
<b-icon icon="share-fill" class="text-primary" ></b-icon>
61+
62+
<span class="text-dark font-weight-bolder ml-2"> Comparte este codigo usando este enlace</span> <br/> <br/>
63+
64+
<b-button class="btn-outline-dark bg-transparent w-100">
65+
<a :href="shared_path()">{{shared_path()}}</a>
66+
</b-button>
67+
<b-icon scale="1.7" class="text-dark mx-auto float-center mt-3 w-100" @click="copy(shared_path())" icon="files"></b-icon>
68+
</b-container>
69+
70+
</b-modal>
71+
72+
<b-modal hide-footer hide-header id="flags-modal">
73+
<p style="cursor:pointer" @click="$bvModal.hide('flags-modal')">X</p>
5574
<b-badge class="mb-1 bg-transparent text-dark"
5675
>e.g &nbsp; -Wall -pedantic</b-badge
5776
>
5877
<b-input placeholder="-some" class="mb-4" v-model="flags"></b-input>
5978
</b-modal>
6079

61-
<b-modal hide-footer id="extra-modal" title="addons">
80+
<b-modal hide-footer id="extra-modal" title="complementos">
81+
82+
<b-button
83+
title="colaboracion"
84+
variant="dark"
85+
class="mx-2"
86+
v-b-modal.colab
87+
>
88+
<b-icon icon="thunder" variant="primary"></b-icon>
89+
Colaboracion
90+
</b-button>
91+
6292
<b-button
6393
v-b-modal.notas-modal
6494
title="mostrar panel de notas"
6595
variant="dark"
6696
>Notas</b-button
6797
>
68-
<b-modal id="notas-modal" hide-footer>
98+
<b-modal id="notas-modal" hide-header hide-footer>
99+
<p style="cursor:pointer" @click="$bvModal.hide('notas-modal')">X</p>
69100
<notas />
70-
</b-modal>
101+
</b-modal>
102+
103+
<colaborate/>
104+
71105

72106
<b-button
73107
title="mostrar lista de themas"
74108
class="ml-1"
75109
v-b-modal.themes-modal
76110
variant="dark"
77-
>themes</b-button
111+
>Temas</b-button
78112
>
79-
<b-modal id="themes-modal">
113+
<b-modal hide-backdrop hide-header hide-footer id="themes-modal">
114+
<p style="cursor:pointer" @click="$bvModal.hide('themes-modal')">X</p>
80115
<themes />
116+
<p class="mx-auto float-center mt-3">selecciona tu tema favorito, no lo perderas al recargar</p>
81117
</b-modal>
82118

83-
<b-form-checkbox
84-
class="ml-3 mt-2 p-3 "
119+
<b-form-checkbox
120+
v-if="visibles.libcurl"
121+
class="ml-3 mt-2 p-3 font-weight-bolder"
85122
id="curlmode"
86123
v-model="usecurl"
87124
name="curlmode"
88125
value="on"
89-
unchecked-value="off"> enable libcurl <b-icon icon="cloud"></b-icon> </b-form-checkbox>
126+
unchecked-value="off"> Usar libcurl (http) <b-icon icon="cloud"></b-icon> </b-form-checkbox>
90127

91128
</b-modal>
92129

@@ -98,7 +135,10 @@
98135
<b-icon icon="grid-fill"></b-icon>
99136
</button>
100137

138+
<b-badge v-if="visibles.colab" class="text-white" variant="transparent">Modo colaboracion <b-icon icon="emoji-smile" variant="white"></b-icon></b-badge>
139+
101140
<button
141+
v-if="visibles.poo"
102142
title="cambiar a modo de clases"
103143
@click="changeMode"
104144
class="classmode mx-1 bt-hover"
@@ -108,6 +148,7 @@
108148
</button>
109149

110150
<button
151+
v-if="visibles.tabs"
111152
title="tab home"
112153
id="tab_id0"
113154
@click="setSpace({ id: 'tab_id0' })"
@@ -117,6 +158,7 @@
117158
</button>
118159

119160
<button
161+
v-if="visibles.tabs"
120162
title="añadir un nuevo archivo"
121163
class="classmode bt-hover"
122164
id="newspace-button"
@@ -132,7 +174,7 @@
132174
v-b-modal.flags-modal
133175
title="banderas de compilacion para c++"
134176
>
135-
flags
177+
Banderas
136178
</b-button>
137179
<b-button
138180
class="btn-sm float-right ml-auto bg-transparent"
@@ -158,9 +200,10 @@
158200
</div>
159201
</div>
160202

161-
<b-modal id="output-modal" hide-footer>
203+
<b-modal size="lg" id="output-modal" hide-footer hide-header>
204+
<p style="cursor:pointer" @click="$bvModal.hide('output-modal')">X</p>
162205
<b-card
163-
class="w-100 mt-2"
206+
class="w-100"
164207
style="
165208
background: rgba(0, 0, 0, 0);
166209
max-height: 400px;
@@ -169,18 +212,14 @@
169212
border: none;
170213
"
171214
>
172-
<b-badge variant="danger" class="text-white"
173-
>salida:
174-
<b-icon icon="receipt-cutoff" variant="white"></b-icon>
175-
</b-badge>
176-
<br />
177-
<span class="text-dark" style="font-family: monospace">
178-
{{ output }}
179-
</span>
215+
<pre class="text-dark" style="font-family: monospace">{{ output }}</pre>
216+
180217
</b-card>
181218
</b-modal>
182219

183220
</div>
221+
222+
184223
<b-button
185224
title="establer entrada del programa"
186225
v-b-modal.program-input
@@ -225,6 +264,7 @@ import themes from "./extra/themes.vue";
225264
import inputData from "./extra/program-input.vue";
226265
import Editor from "./editor.vue";
227266
import headers from "./extra/headers.vue";
267+
import colaborate from "./extra/colabVue.vue"
228268
229269
import { mapGetters } from "vuex";
230270
import { codemirror } from "vue-codemirror";
@@ -244,6 +284,7 @@ export default {
244284
name: "basecanvas",
245285
components: {
246286
notas,
287+
colaborate,
247288
themes,
248289
inputData,
249290
codemirror,
@@ -275,6 +316,7 @@ export default {
275316
this.local_widthQuery.addEventListener('change',()=>{
276317
this.local_widthMatch = this.local_widthQuery.matches;
277318
});
319+
this.$store.commit("setColabUrl")
278320
},
279321
280322
data(){
@@ -322,10 +364,13 @@ export default {
322364
reset() {
323365
this.$store.state.output = "";
324366
},
367+
shared_path(){
368+
return window.location.origin + "?sq=" + this.share_id
369+
},
325370
},
326371
327372
computed: {
328-
...mapGetters(["time", "seed", "cmOption", "codeSpaces", "mode"]),
373+
...mapGetters(["time", "seed", "cmOption", "codeSpaces", "mode", "visibles"]),
329374
330375
331376
flags: {
@@ -407,6 +452,8 @@ export default {
407452

408453
<style scoped>
409454
455+
456+
410457
.cnbase {
411458
min-height: 100vh;
412459
@@ -491,4 +538,40 @@ export default {
491538
color: black;
492539
}
493540
494-
</style>
541+
.hovery{
542+
color: #272927;
543+
}
544+
.hovery:hover{
545+
color:#171818;
546+
}
547+
548+
</style>
549+
550+
551+
<style>
552+
input:focus, select:focus, select, input.form-control:focus {
553+
554+
outline:none !important;
555+
556+
outline-width: 0 !important;
557+
558+
box-shadow: none;
559+
560+
-moz-box-shadow: none;
561+
562+
-webkit-box-shadow: none;
563+
564+
}
565+
pre {
566+
white-space: pre-wrap;
567+
margin-left: 0;
568+
margin: 0;
569+
padding: 0;
570+
}
571+
572+
.noneshine {
573+
outline: none;
574+
box-shadow: none !important;
575+
}
576+
577+
</style>

src/components/extra/colabVue.vue

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<template>
2+
3+
<b-modal id="colab" hide-backdrop hide-header hide-footer>
4+
<p style="cursor:pointer" @click="$bvModal.hide('colab')">X</p>
5+
<div class="jumbotron">
6+
<h2>Bienviendo a el modo colaboración <b-icon icon="sun"></b-icon> </h2>
7+
</div>
8+
9+
<div v-if="!visibles.colab">
10+
11+
<p class="texty">
12+
una vez activado este modo, podras escribir codigo en simultaneo con tus amigos.
13+
<br/> <br/>
14+
solo enviales tu enlace que te parece en la barra de direcciones, y ya podran escribir codigo juntos desde
15+
cualquier parte del mundo!
16+
</p>
17+
18+
<div class="fluid">
19+
<b-button @click="activar" class="btn-sm mx-1 bg-dark">
20+
Activar
21+
</b-button>
22+
<b-button @click="close" class="btn-sm mx-1 bg-outline-dark bg-transparent text-dark">
23+
Volver
24+
</b-button>
25+
</div>
26+
</div>
27+
28+
<div v-else>
29+
<p class="texty">
30+
parece que ya estas usando el modo colab, si deseas desactivarlo haz click en el boton desactivar
31+
</p>
32+
<b-button @click="desactivar" class="btn-sm mx-1 bg-dark">
33+
Desactivar
34+
</b-button>
35+
</div>
36+
</b-modal>
37+
38+
</template>
39+
40+
<script>
41+
import { mapGetters } from 'vuex'
42+
export default {
43+
name: 'colabVue',
44+
methods:{
45+
close(){
46+
this.$bvModal.hide("colab")
47+
this.$bvModal.hide("extra-modal")
48+
},
49+
activar() {
50+
this.$store.dispatch('visibles_to_colab', false)
51+
this.close()
52+
},
53+
desactivar(){
54+
localStorage.removeItem("v.codespace")
55+
this.$store.dispatch('setColab', true)
56+
this.close()
57+
this.$store.commit('deleteCodeSpace')
58+
},
59+
},
60+
computed:{
61+
visibles:{
62+
get(){ return this.$store.state.visibles }
63+
}
64+
}
65+
}
66+
</script>
67+
68+
<style scoped>
69+
.texty{
70+
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
71+
}
72+
</style>

src/components/extra/footerVue.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
<li><b-icon icon="twitter"></b-icon> scyth3_c</li>
99
</ul>
1010

11+
<b-modal hide-footer hide-header id="mensaje_enviado">
12+
<p style="cursor:pointer" @click="$bvModal.hide('mensaje_enviado')">X</p>
13+
<strong> Tu mensaje fue enviado, Muchas Gracias</strong> <b-icon variant="warning" icon="emoji-smile"></b-icon>
14+
</b-modal>
15+
1116
<b-card no-body class="col-md-4 float-center mx-auto footer-vw">
1217
<b-badge style="background: rgba(0, 0, 0, 0)" variant="dark" class="p-2"
1318
>enviame algun mensaje:</b-badge
@@ -16,6 +21,7 @@
1621
title="escribe el mensaje aqui"
1722
v-model="model"
1823
placeholder="¡Hola!, ¿Cómo Estás?"
24+
class="font-weigth-bolder"
1925
></b-input>
2026
<b-button
2127
title="enviar mensaje"
@@ -37,6 +43,8 @@ export default {
3743
methods: {
3844
sendMsg() {
3945
store.commit("sendMsg");
46+
this.model = ""
47+
this.$bvModal.show("mensaje_enviado")
4048
},
4149
},
4250
computed: {

src/components/extra/headers.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<template>
22
<div>
33
<b-badge class="p-2" variant="white">set the headers here: </b-badge> <br>
4-
<b-badge variant="transparent" class="m-2 text-dark">actual headers {{ getIn }}</b-badge>
4+
<b-input disabled class="w-100 text-dark" placeholder="entrada del usuario" title="librerias necesarias" v-model="getIn">
5+
</b-input>
56
<b-input
67
title="escribe las cabeceras aqui"
78
class="text-black font-weight-bold"

0 commit comments

Comments
 (0)