Fixed single page login for a certain poor Simon with a weird browser

This commit is contained in:
Pieter Vander Vennet 2020-07-29 21:32:51 +02:00
parent 2913c28271
commit 4a85fa82c3
7 changed files with 44 additions and 26 deletions

View file

@ -7,21 +7,21 @@ import {link} from "fs";
export class SubtleButton extends UIElement{
private imageUrl: string;
private message: UIElement;
private linkTo: string = undefined;
private linkTo: { url: string, newTab?: boolean } = undefined;
constructor(imageUrl: string, message: string | UIElement, linkTo : string = undefined) {
constructor(imageUrl: string, message: string | UIElement, linkTo: { url: string, newTab?: boolean } = undefined) {
super(undefined);
this.linkTo = linkTo;
this.message = Translations.W(message);
this.imageUrl = imageUrl;
}
InnerRender(): string {
if(this.linkTo != undefined){
return new Combine([
`<a class="subtle-button" href="${this.linkTo}" target="_blank">`,
`<a class="subtle-button" href="${this.linkTo.url}" ${this.linkTo.newTab ? 'target="_blank"' : ""}>`,
this.imageUrl !== undefined ? `<img src='${this.imageUrl}'>` : "",
this.message,
'</a>'

View file

@ -44,7 +44,7 @@ export class MoreScreen extends UIElement {
"</b>",
"<br/>",
Translations.W(layout.description),
]), linkText);
]), {url: linkText, newTab: false});
els.push(link)
}

View file

@ -36,7 +36,7 @@ export class SimpleAddUI extends UIElement {
private confirmButton: UIElement = undefined;
private cancelButton: UIElement;
private goToInboxButton: UIElement = new SubtleButton("/assets/envelope.svg",
Translations.t.general.goToInbox, "https://www.openstreetmap.org/messages/inbox");
Translations.t.general.goToInbox, {url:"https://www.openstreetmap.org/messages/inbox", newTab: false});
constructor(zoomlevel: UIEventSource<{ zoom: number }>,
lastClickLocation: UIEventSource<{ lat: number, lon: number }>,