Commit 96aedc46 authored by VladikB's avatar VladikB

Alles funktioniert

parent 3ffa0d4a
<div class="modal-header">
<h5 class="modal-title">Bonustoken</h5>
<h5 class="modal-title">{{'global.bonustoken' | translate}}</h5>
<button (click)="close()"
aria-label="Close"
class="close cursor-pointer"
......@@ -9,22 +9,26 @@
</button>
</div>
<div class="modal-body">
<p>Deine Tokennummer ist {{bonusToken}}.</p>
<p>{{'global.yourTN' | translate}} {{bonusToken}}.</p>
</div>
<div class="modal-footer">
<button (click)="copy()"
aria-label="Copy to clipboard"
class="btn btn-primary"
type="button">
<span aria-hidden="true">Zwischenablage</span>
<div *ngIf="clipboardText; else copied">{{'global.copy_to_clipboard' | translate}}</div>
<ng-template #copied>{{'global.copied' | translate}}</ng-template>
</button>
<!--<button type="button" class="btn btn-primary" >Zwischenablage</button>-->
<button
aria-label="Send token via Email"
class="btn btn-primary"
type="button">
<span aria-hidden="true">Email</span>
</button>
<a href="{{'global.mail' | translate}}{{bonusToken}}.">
<button class="btn btn-primary" >
{{'global.mail_to' | translate}}
</button>
</a>
<!--<button type="button" class="btn btn-primary">Email</button>-->
</div>
......@@ -9,11 +9,16 @@ import {BonusTokenService} from '../../../../../service/user/shared/bonus-token.
})
export class UserTokenComponent {
public bonusToken: string;
public clipboardText: boolean;
public mailText = '';
constructor(private activeModal: NgbActiveModal, bonusToken: BonusTokenService) {
this.bonusToken = bonusToken.getToken();
this.clipboardText = true;
}
// https://stackoverflow.com/questions/49102724/angular-5-copy-to-clipboard
public copy(): void {
const selBox = document.createElement('textarea');
selBox.style.position = 'fixed';
......@@ -26,18 +31,20 @@ export class UserTokenComponent {
selBox.select();
document.execCommand('copy');
document.body.removeChild(selBox);
this.clipboardText = false;
}
public close(): void {
this.activeModal.close();
}
public confirm(): void {
this.activeModal.close();
}
public abort(): void {
this.activeModal.dismiss();
}
public mailTo(): void {
this.mailText = 'mailto: ?subject=Meine%20Tokennummer&amp;body=Hallo,%0D%0A%0D%0Ameine%20Tokennummer%20ist%20';
window.location.href = this.mailText;
}
}
......@@ -28,7 +28,13 @@
"load-to-play": "Für die gewünschte Seite konnten die Daten nicht geladen werden. Verwende bitte nicht die Navigation deines Browsers, da hier ggf. Daten verloren gehen können. Die Quiz Runde muss für dich beendet werden. Du kannst nur zur Startseite zurückkehren.",
"homepage": "Zur Startseite",
"to-quiz-overview": "Zur Quiz Übersicht"
}
},
"copy_to_clipboard": "Zwischenablage",
"mail_to": "Per Mail senden",
"yourTN": "Deine Tokennummer ist ",
"bonustoken": "Bonustoken",
"copied": "Kopiert",
"mail": "mailto:?subject=Meine%20Tokennummer&body=Hallo,%0D%0Ameine%20Tokennummer%20ist "
},
"region": {
"footer": {
......
......@@ -34,7 +34,13 @@
"load-to-play": "The data for the requested page could not be loaded. Please do not use the browser's navigation as data loss is possible. The quiz round must be quit now. You can only return to the home page.",
"homepage": "To the home page",
"to-quiz-overview": "To the quiz overview"
}
},
"copy_to_clipboard": "Zwischenablage",
"mail_to": "Send as E-Mail",
"yourTN": "Your Tokennumber is",
"bonustoken": "Bonustoken",
"copied": "copied",
"mail": "mailto:?subject=My%20Tokennumber&body=Hello,%0D%0Amy%20Tokennumber%20is "
},
"region": {
"footer": {
......
Markdown is supported
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