Commit 3ffa0d4a authored by VladikB's avatar VladikB

Funktionen von Buttons

parent 37b419db
<div class="modal-header">
<h5 class="modal-title">Bonustoken</h5>
<button (click)="dismiss()"
<button (click)="close()"
aria-label="Close"
class="close cursor-pointer"
data-dismiss="modal"
......@@ -9,18 +9,17 @@
</button>
</div>
<div class="modal-body">
<p>Mit diesem Token kann dir der Quizleiter dein Ergebnis zuordnen.</p>
<p>Mit diesem Token kann dir der Quizleiter dein Ergebnis zuordnen.</p>
<p>Deine Tokennummer ist {{bonusToken}}.</p>
</div>
<div class="modal-footer">
<button (click)="clipboard()"
<button (click)="copy()"
aria-label="Copy to clipboard"
class="btn btn-primary"
type="button">
<span aria-hidden="true">Zwischenablage</span>
</button>
<!--<button type="button" class="btn btn-primary" >Zwischenablage</button>-->
<button (click)="email()"
<button
aria-label="Send token via Email"
class="btn btn-primary"
type="button">
......
import {Component} from '@angular/core';
import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
import {BonusTokenService} from '../../../../../service/user/shared/bonus-token.service';
@Component({
selector: 'app-user-token',
......@@ -7,20 +8,36 @@ import {NgbActiveModal} from '@ng-bootstrap/ng-bootstrap';
styleUrls: ['./user-token.component.scss']
})
export class UserTokenComponent {
public bonusToken: string;
constructor(private activeModal: NgbActiveModal) {
constructor(private activeModal: NgbActiveModal, bonusToken: BonusTokenService) {
this.bonusToken = bonusToken.getToken();
}
public dismiss(): void {
this.activeModal.dismiss();
public copy(): void {
const selBox = document.createElement('textarea');
selBox.style.position = 'fixed';
selBox.style.left = '0';
selBox.style.top = '0';
selBox.style.opacity = '0';
selBox.value = this.bonusToken;
document.body.appendChild(selBox);
selBox.focus();
selBox.select();
document.execCommand('copy');
document.body.removeChild(selBox);
}
public close(): void {
this.activeModal.close();
}
public clipboard(): void {
alert('TODO');
public confirm(): void {
this.activeModal.close();
}
public email(): void {
window.location.href = 'mailto:user@example.com?subject=BonusToken&body=' + 'token';
public abort(): void {
this.activeModal.dismiss();
}
}
......@@ -417,8 +417,7 @@ export class FooterBarService {
showIntro: false,
introTranslate: 'region.footer.footer_bar.showToken',
linkTarget: null,
}, function (): void {
});
}, function (): void {});
private _footerElements: Array<IFooterBarElement> = [];
......
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