mapcomplete/Customizations/Questions/OsmLink.ts

31 lines
715 B
TypeScript
Raw Normal View History

2020-07-05 18:59:47 +02:00
import {Img} from "../../UI/Img";
2020-09-09 18:42:13 +02:00
import {RegexTag, Tag} from "../../Logic/Tags";
2020-07-31 17:38:03 +02:00
import {TagRenderingOptions} from "../TagRenderingOptions";
2020-07-05 18:59:47 +02:00
export class OsmLink extends TagRenderingOptions {
static options = {
freeform: {
key: "id",
template: "$$$",
renderTemplate:
"<span class='osmlink'><a href='https://osm.org/{id}' target='_blank'>" +
Img.osmAbstractLogo +
"</a></span>",
placeholder: "",
},
mappings: [
2020-09-09 18:42:13 +02:00
{k: new RegexTag("id", /node\/-.+/), txt: "<span class='alert'>Uploading</span>"}
2020-07-05 18:59:47 +02:00
]
}
constructor() {
super(OsmLink.options);
}
}