mapcomplete/Customizations/Questions/OsmLink.ts

29 lines
670 B
TypeScript
Raw Normal View History

2020-07-05 16:59:47 +00:00
import {Img} from "../../UI/Img";
import {RegexTag} from "../../Logic/Tags";
2020-07-31 15:38:03 +00:00
import {TagRenderingOptions} from "../TagRenderingOptions";
2020-07-05 16:59:47 +00: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: [
{k: new RegexTag("id", /node\/-.+/), txt: ""}
2020-07-05 16:59:47 +00:00
]
}
constructor() {
super(OsmLink.options);
}
}