85
85
<span v-else >{{$t('navbar.captioner.stopCaptioning')}}</span >
86
86
<kbd v-show =" largerLayout" class =" small ml-3" >c</kbd >
87
87
</div >
88
-
89
- <!-- <b-popover
90
- id="captioningPreviewPopover"
91
- target="startCaptioningDropdown"
92
- placement="top"
93
- >
94
- {{transcriptExcerpt}}
95
- </b-popover>-->
96
88
</b-btn >
97
89
<b-btn
98
90
v-show =" experiments.includes('typingMode') && !typingModeOn"
110
102
<b-popover
111
103
target =" navbar-settings-button"
112
104
placement =" top"
113
- :show.sync =" showMenu "
105
+ :show.sync =" showSettingsMenu "
114
106
triggers =" click blur"
115
107
boundary =" viewport"
116
- title
117
108
>
118
109
<b-btn-group vertical class =" d-flex" >
119
110
<b-btn
185
176
{{$t('navbar.menu.settings')}}
186
177
</b-btn >
187
178
</b-popover >
179
+ <b-tooltip target =" navbar-settings-button" :title =" $t('navbar.menu.menu')" ></b-tooltip >
188
180
<b-btn
189
181
id =" navbar-settings-button"
190
- @click =" showMenu = !showMenu "
182
+ @click =" showSettingsMenu = !showSettingsMenu "
191
183
v-b-tooltip.top
192
184
:variant =" captioningToggleButtonVariant"
193
- :title =" $t('navbar.menu.menu')"
194
185
>
195
186
<fa icon =" bars" />
196
187
</b-btn >
197
188
</b-btn-group >
189
+ <b-popover
190
+ target =" navbar-profile-button-logged-in"
191
+ placement =" top"
192
+ :show.sync =" showProfileMenu"
193
+ triggers =" click blur"
194
+ boundary =" viewport"
195
+ title
196
+ >
197
+ <div style =" min-width :300px " >
198
+ <img
199
+ :src =" $store.state.user.photoURL"
200
+ v-if =" $store.state.user.photoURL"
201
+ class =" rounded-circle float-left p-1 pr-2"
202
+ style =" max-width :50px "
203
+ >
204
+ <fa v-else icon =" user-circle" class =" rounded-circle float-left p-1 pr-2 text-muted" />
205
+
206
+ <div class =" pt-1" style =" line-height :1.25rem " >
207
+ <span class =" text-muted" >
208
+ Signed in
209
+ <span v-if =" $store.state.user.email || $store.state.user.displayName" >as</span >
210
+ </span >
211
+ <div
212
+ v-if =" $store.state.user.email || $store.state.user.displayName"
213
+ >{{$store.state.user.email || $store.state.user.displayName}}</div >
214
+ </div >
215
+ <div class =" clearfix" ></div >
216
+ <hr >
217
+ <b-btn variant =" link" class =" d-block" @click =" signOut()" >Sign out</b-btn >
218
+ </div >
219
+ </b-popover >
220
+
221
+ <!-- if logged in -->
222
+ <b-tooltip target =" navbar-profile-button-logged-in" title =" Profile" ></b-tooltip >
223
+ <b-btn
224
+ id =" navbar-profile-button-logged-in"
225
+ v-show =" $store.state.user.signedIn"
226
+ @click =" showProfileMenu = !showProfileMenu"
227
+ v-b-tooltip.top
228
+ class =" ml-2 text-white px-2 profile-button"
229
+ style =" position :relative "
230
+ variant =" link"
231
+ >
232
+ <transition name =" fade" >
233
+ <img
234
+ :src =" $store.state.user.photoURL"
235
+ v-if =" $store.state.user.photoURL"
236
+ class =" rounded-circle"
237
+ style =" max-width : 30px ;position : absolute ;margin-left : -2px ;margin-top : -2px ;"
238
+ >
239
+ </transition >
240
+ <fa icon =" user-circle" />
241
+ </b-btn >
242
+
243
+ <!-- not logged in -->
244
+ <b-tooltip target =" navbar-profile-button-logged-out" title =" Sign in or sign up" ></b-tooltip >
245
+ <b-btn
246
+ id =" navbar-profile-button-logged-out"
247
+ v-show =" !$store.state.user.signedIn && experiments.includes('signin')"
248
+ v-b-tooltip.top
249
+ class =" ml-2 text-white px-2 profile-button"
250
+ variant =" link"
251
+ :to =" localePath('captioner-sign-in')"
252
+ >
253
+ <fa icon =" user-circle" />
254
+ </b-btn >
198
255
</div >
199
256
</nav >
200
257
</div >
201
258
</template >
202
259
203
260
<style >
261
+ .firebaseui-title {
262
+ text-align : center !important ;
263
+ }
264
+ </style >
265
+
266
+
267
+ <style scoped>
204
268
.button-only-disabled > .btn-primary :first-child {
205
269
opacity : 0.6 ;
206
270
cursor : default ;
207
271
}
272
+ .profile-button {
273
+ font-size : 1.5rem ;
274
+ line-height : 1.5rem ;
275
+ opacity : 0.7 ;
276
+ }
277
+ .profile-button :hover ,
278
+ .profile-button :active ,
279
+ .profile-button :focus {
280
+ opacity : 1 ;
281
+ }
208
282
</style >
209
283
210
284
@@ -217,7 +291,8 @@ import saveToFile from '~/mixins/saveToFile';
217
291
import dateFormat from ' ~/mixins/dateFormat' ;
218
292
import bBtn from ' bootstrap-vue/es/components/button/button' ;
219
293
import bBtnGroup from ' bootstrap-vue/es/components/button-group/button-group' ;
220
- import bTooltip from ' bootstrap-vue/es/directives/tooltip/tooltip' ;
294
+ import bTooltipDirective from ' bootstrap-vue/es/directives/tooltip/tooltip' ;
295
+ import bTooltipComponent from ' bootstrap-vue/es/components/tooltip/tooltip' ;
221
296
import bPopover from ' bootstrap-vue/es/components/popover/popover' ;
222
297
223
298
export default {
@@ -229,14 +304,16 @@ export default {
229
304
bBtn,
230
305
bBtnGroup,
231
306
bPopover,
307
+ bTooltip: bTooltipComponent,
232
308
},
233
309
directives: {
234
- bTooltip,
310
+ bTooltip: bTooltipDirective ,
235
311
},
236
312
data : function () {
237
313
return {
238
314
vmixNotFullySetUpMessageDismissed: false ,
239
- showMenu: false ,
315
+ showSettingsMenu: false ,
316
+ showProfileMenu: false ,
240
317
};
241
318
},
242
319
computed: {
@@ -299,22 +376,31 @@ export default {
299
376
},
300
377
},
301
378
watch: {
302
- showMenu : function () {
303
- // Hide all tooltips
304
- this .$root .$emit (' bv::hide::tooltip' );
379
+ showProfileMenu : function () {
380
+ this .hideAllTooltips ();
381
+ },
382
+ showSettingsMenu : function () {
383
+ this .hideAllTooltips ();
305
384
},
306
- // transcriptExcerpt: function(transcriptExcerpt) {
307
- // if (this.$router.currentRoute.name.startsWith('captioner-settings')) {
308
- // if (transcriptExcerpt) {
309
- // this.$root.$emit('bv::show::popover', 'startCaptioningDropdown');
310
- // }
311
- // else {
312
- // this.$root.$emit('bv::hide::popover', 'startCaptioningDropdown');
313
- // }
314
- // }
315
- // },
316
385
},
317
386
methods: {
387
+ hideAllTooltips : function () {
388
+ this .$root .$emit (' bv::hide::tooltip' );
389
+ },
390
+ signOut : function () {
391
+ this .showProfileMenu = false ;
392
+ setTimeout (() => {
393
+ this .$firebase
394
+ .auth ()
395
+ .signOut ()
396
+ .then (() => {
397
+ // Success signing out
398
+ // INIT_CHECK_AUTH_STATUS_WATCHER handles
399
+ // updating the store and removing the user
400
+ this .$store .commit (' SHOW_TOAST' , { toastName: ' signedOut' });
401
+ });
402
+ }, 350 ); // let popover fade out first to get around positioning issue on close
403
+ },
318
404
captioningToggleButtonClick : function () {
319
405
if (this .captioningOn ) {
320
406
this .stopCaptioning ();
@@ -324,6 +410,7 @@ export default {
324
410
},
325
411
startCaptioning : function () {
326
412
this .$store .dispatch (' captioner/startManual' );
413
+ this .$router .push (' /captioner' );
327
414
},
328
415
stopCaptioning : function () {
329
416
this .$store .dispatch (' captioner/stopManual' );
0 commit comments