Skip to content
Snippets Groups Projects
Commit 315def32 authored by Lukas Haase's avatar Lukas Haase
Browse files

fix focus bug, add qr code to questionwall

parent 2b563806
No related merge requests found
...@@ -26,26 +26,28 @@ import { MatRippleModule } from '@angular/material/core'; ...@@ -26,26 +26,28 @@ import { MatRippleModule } from '@angular/material/core';
import { ProfanitySettingsComponent } from './_dialogs/profanity-settings/profanity-settings.component'; import { ProfanitySettingsComponent } from './_dialogs/profanity-settings/profanity-settings.component';
import { RoomDescriptionSettingsComponent } from './_dialogs/room-description-settings/room-description-settings.component'; import { RoomDescriptionSettingsComponent } from './_dialogs/room-description-settings/room-description-settings.component';
import { RoomNameSettingsComponent } from './_dialogs/room-name-settings/room-name-settings.component'; import { RoomNameSettingsComponent } from './_dialogs/room-name-settings/room-name-settings.component';
import { QRCodeModule } from 'angularx-qrcode';
@NgModule({ @NgModule({
imports: [ imports:[
CommonModule, CommonModule,
CreatorRoutingModule, CreatorRoutingModule,
EssentialsModule, EssentialsModule,
SharedModule, SharedModule,
ModeratorModule, ModeratorModule,
TranslateModule.forChild({ TranslateModule.forChild({
loader: { loader:{
provide: TranslateLoader, provide:TranslateLoader,
useFactory: (HttpLoaderFactory), useFactory:(HttpLoaderFactory),
deps: [HttpClient] deps:[HttpClient]
}, },
isolate: true isolate:true
}), }),
MarkdownModule, MarkdownModule,
ArsModule, ArsModule,
MatRippleModule MatRippleModule,
], QRCodeModule
],
declarations: [ declarations: [
RoomCreatorPageComponent, RoomCreatorPageComponent,
RoomDeleteComponent, RoomDeleteComponent,
......
...@@ -8,7 +8,7 @@ export class QuestionWallKeyEventSupport { ...@@ -8,7 +8,7 @@ export class QuestionWallKeyEventSupport {
window.addEventListener('keyup', this.windowEvent = e => { window.addEventListener('keyup', this.windowEvent = e => {
if (this.keyMap.has(e.key)) { if (this.keyMap.has(e.key)) {
this.keyMap.get(e.key)(); this.keyMap.get(e.key)();
e.cancelBubble = true; e.preventDefault();
} }
}); });
} }
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
class="period selection" class="period selection"
[ngClass]="{'selected': periodItem === period}" [ngClass]="{'selected': periodItem === period}"
aria-labelledby="{{periodItem}}"> aria-labelledby="{{periodItem}}">
<span>{{ ('comment-list.select-' + periodItem) | translate }}</span> <span>{{ ('comment-list.select-'+periodItem) | translate }}</span>
</button> </button>
</div> </div>
</mat-menu> </mat-menu>
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</div> </div>
<ars-col [width]="50" ars-flex-box> <ars-col [width]="50" ars-flex-box>
<ars-row> <ars-row>
<button mat-icon-button style="margin-top:18px" (click)="toggleSideList($event)"> <button mat-icon-button style="margin-top:18px" (click)="toggleSideList()">
<mat-icon class="icon-color-yellow" *ngIf="sidelistExpanded" aria-describedby="side-list-off" <mat-icon class="icon-color-yellow" *ngIf="sidelistExpanded" aria-describedby="side-list-off"
matTooltip="{{'question-wall.side-list-off' | translate}}"> matTooltip="{{'question-wall.side-list-off' | translate}}">
keyboard_double_arrow_right keyboard_double_arrow_right
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
<p class="questionwall-comment-timestamp">{{comment.timeAgo}}</p> <p class="questionwall-comment-timestamp">{{comment.timeAgo}}</p>
</ars-col> </ars-col>
<ars-col> <ars-col>
<p class="questionwall-comment-notification">{{comment.old ? '' : 'NEW'}}</p> <p class="questionwall-comment-notification">{{comment.old?'':'NEW'}}</p>
</ars-col> </ars-col>
</ars-row> </ars-row>
<ars-row <ars-row
...@@ -460,6 +460,18 @@ ...@@ -460,6 +460,18 @@
<p>{{'question-wall.auto-renew-on' | translate}}</p> <p>{{'question-wall.auto-renew-on' | translate}}</p>
</ng-container> </ng-container>
</button> </button>
<button ars-btn
matRipple
(click)="toggleQRCode()">
<ng-container *ngIf="qrCodeExpanded">
<i>qr_code</i>
<p>{{'question-wall.qrCodeExpanded-off' | translate}}</p>
</ng-container>
<ng-container *ngIf="!qrCodeExpanded">
<i>qr_code</i>
<p>{{'question-wall.qrCodeExpanded-on' | translate}}</p>
</ng-container>
</button>
</ars-col> </ars-col>
<ars-fill></ars-fill> <ars-fill></ars-fill>
<ars-col style="display:flex;flex-direction:column;justify-content:center"> <ars-col style="display:flex;flex-direction:column;justify-content:center">
...@@ -492,6 +504,9 @@ ...@@ -492,6 +504,9 @@
[iconColor]="'#FFFFFF'" [iconColor]="'#FFFFFF'"
[backgroundColor]="'#FFFFFF'" [backgroundColor]="'#FFFFFF'"
[foregroundColor]="'#000000'"></app-active-user> [foregroundColor]="'#000000'"></app-active-user>
<div class="qr-overlay" *ngIf="qrCodeExpanded">
<qrcode [qrdata]="getURL()" [width]="200" [errorCorrectionLevel]="'M'"></qrcode>
</div>
</ars-screen> </ars-screen>
......
...@@ -321,6 +321,25 @@ ...@@ -321,6 +321,25 @@
transition:width ease-in-out 0.1s; transition:width ease-in-out 0.1s;
} }
.qr-overlay {
position: fixed;
left: 32px;
bottom: 64px;
width: 200px;
height: 200px;
animation:popin-qr-overlay 0.2s cubic-bezier(0,.04,0,1) both;
}
@keyframes popin-qr-overlay {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
} }
.selected { .selected {
......
...@@ -28,6 +28,7 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy { ...@@ -28,6 +28,7 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild('sidelist') sidelist: ColComponent; @ViewChild('sidelist') sidelist: ColComponent;
sidelistExpanded: boolean = true; sidelistExpanded: boolean = true;
qrCodeExpanded: boolean = false;
roomId: string; roomId: string;
room: Room; room: Room;
comments: QuestionWallComment[] = []; comments: QuestionWallComment[] = [];
...@@ -89,14 +90,7 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy { ...@@ -89,14 +90,7 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy {
} }
} }
stopBubble(keyEvent:KeyboardEvent){ toggleSideList(){
keyEvent.cancelBubble=true;
}
toggleSideList(event:MouseEvent){
if(event.detail===0){
return;
}
this.sidelistExpanded=!this.sidelistExpanded; this.sidelistExpanded=!this.sidelistExpanded;
if(this.sidelistExpanded){ if(this.sidelistExpanded){
this.sidelist.setPx(450); this.sidelist.setPx(450);
...@@ -106,6 +100,15 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy { ...@@ -106,6 +100,15 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy {
} }
} }
getURL(){
if(!this.room)return '';
return `${window.location.protocol}//${window.location.hostname}/participant/room/${this.room.shortId}`;
}
toggleQRCode(){
this.qrCodeExpanded=!this.qrCodeExpanded;
}
ngOnInit(): void { ngOnInit(): void {
QuestionWallComment.updateTimeFormat(localStorage.getItem('currentLang')); QuestionWallComment.updateTimeFormat(localStorage.getItem('currentLang'));
this.translateService.use(localStorage.getItem('currentLang')); this.translateService.use(localStorage.getItem('currentLang'));
...@@ -166,9 +169,19 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy { ...@@ -166,9 +169,19 @@ export class QuestionWallComponent implements OnInit, AfterViewInit, OnDestroy {
initKeySupport() { initKeySupport() {
this.wrap(this.keySupport, key => { this.wrap(this.keySupport, key => {
key.addKeyEvent('ArrowRight', () => this.nextComment()); const checkSideList=()=>{
key.addKeyEvent('ArrowLeft', () => this.prevComment()); if(!this.sidelistExpanded){
key.addKeyEvent(' ', () => this.nextComment()); this.toggleSideList();
}
}
const zip=(a,b)=>{
a();
b();
}
const zipSideList=a=>()=>zip(()=>checkSideList(),()=>a());
key.addKeyEvent('ArrowRight', zipSideList(() => this.nextComment()));
key.addKeyEvent('ArrowLeft', zipSideList(() => this.prevComment()));
key.addKeyEvent(' ', zipSideList(() => this.nextComment()));
}); });
} }
......
...@@ -119,32 +119,32 @@ import { AccessibilityEscapedInputDirective } from '../../directives/accessibili ...@@ -119,32 +119,32 @@ import { AccessibilityEscapedInputDirective } from '../../directives/accessibili
WorkerConfigDialogComponent, WorkerConfigDialogComponent,
AccessibilityEscapedInputDirective AccessibilityEscapedInputDirective
], ],
exports: [ exports:[
RoomJoinComponent, RoomJoinComponent,
PageNotFoundComponent, PageNotFoundComponent,
RoomPageComponent, RoomPageComponent,
RoomListComponent, RoomListComponent,
HeaderComponent, HeaderComponent,
FooterComponent, FooterComponent,
CommentPageComponent, CommentPageComponent,
CommentListComponent, CommentListComponent,
CreateCommentComponent, CreateCommentComponent,
PresentCommentComponent, PresentCommentComponent,
CommentComponent, CommentComponent,
DialogActionButtonsComponent, DialogActionButtonsComponent,
UserBonusTokenComponent, UserBonusTokenComponent,
CloudConfigurationComponent, CloudConfigurationComponent,
TagCloudPopUpComponent, TagCloudPopUpComponent,
ActiveUserComponent, ActiveUserComponent,
MatSpinnerOverlayComponent, MatSpinnerOverlayComponent,
JoyrideTemplateDirective, JoyrideTemplateDirective,
AutofocusDirective, AutofocusDirective,
CustomMarkdownComponent, CustomMarkdownComponent,
ScrollIntoViewDirective, ScrollIntoViewDirective,
ViewCommentDataComponent, ViewCommentDataComponent,
WriteCommentComponent, WriteCommentComponent,
AccessibilityEscapedInputDirective AccessibilityEscapedInputDirective
] ]
}) })
export class SharedModule { export class SharedModule {
} }
...@@ -302,7 +302,9 @@ ...@@ -302,7 +302,9 @@
"overview-questioners-tooltip": "Anzahl Fragensteller", "overview-questioners-tooltip": "Anzahl Fragensteller",
"questions-blocked": "Weitere Fragen deaktiviert ", "questions-blocked": "Weitere Fragen deaktiviert ",
"side-list-on": "Fragenliste anzeigen", "side-list-on": "Fragenliste anzeigen",
"side-list-off": "Fragenliste ausblenden" "side-list-off": "Fragenliste ausblenden",
"qrCodeExpanded-on": "QR-Code anzeigen",
"qrCodeExpanded-off": "QR-Code ausblenden"
}, },
"quill": { "quill": {
"cancel": "Abbrechen", "cancel": "Abbrechen",
......
...@@ -308,7 +308,9 @@ ...@@ -308,7 +308,9 @@
"overview-questioners-tooltip": "Number of questioners", "overview-questioners-tooltip": "Number of questioners",
"questions-blocked": "New questions blocked", "questions-blocked": "New questions blocked",
"side-list-on": "Show question list", "side-list-on": "Show question list",
"side-list-off": "Hide question list" "side-list-off": "Hide question list",
"qrCodeExpanded-on": "Show QR-Code",
"qrCodeExpanded-off": "Hide QR-Code"
}, },
"quill": { "quill": {
"cancel": "Cancel", "cancel": "Cancel",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment