mapcomplete/test.ts

55 lines
1.5 KiB
TypeScript
Raw Normal View History

2020-10-27 00:01:34 +00:00
//*
2020-10-09 19:11:52 +00:00
2020-10-22 23:20:48 +00:00
import {UIEventSource} from "./Logic/UIEventSource";
2020-10-27 00:01:34 +00:00
import {TagRenderingConfigJson} from "./Customizations/JSON/TagRenderingConfigJson";
import TagRenderingConfig from "./Customizations/JSON/TagRenderingConfig";
import Locale from "./UI/i18n/Locale";
import EditableTagRendering from "./UI/Popup/EditableTagRendering";
2020-10-27 13:13:37 +00:00
import TagRenderingQuestion from "./UI/Popup/TagRenderingQuestion";
2020-10-27 00:01:34 +00:00
const tagRendering: TagRenderingConfigJson = {
question: {"en": "What is the name of?", nl: "Wat is de naam van?", fr: "C'est quoi le nom"},
mappings: [
{
2020-10-27 13:13:37 +00:00
if: "valves=A",
then: "A"
},
{
if: "valves=B",
then: "B"
},
{
if: "valves=C",
then: "C"
}, {
if: "valves:special=A",
then: "SPecial"
2020-10-27 00:01:34 +00:00
}
],
2020-10-27 13:13:37 +00:00
render: "Valves: {valves}",
multiAnswer: true,
2020-10-27 00:01:34 +00:00
freeform: {
2020-10-27 13:13:37 +00:00
key: "valves",
2020-10-27 00:01:34 +00:00
type: "string",
2020-10-27 13:13:37 +00:00
addExtraTags: ["fixme=valves"]
}
2020-10-27 00:01:34 +00:00
}
const config = new TagRenderingConfig(tagRendering)
const tags = new UIEventSource({id: "node/-1", "amenity": "bench", name: "pietervdvn"})
2020-10-27 13:13:37 +00:00
new TagRenderingQuestion(tags, config).AttachTo("maindiv")
// new EditableTagRendering(tags, config).AttachTo('maindiv')
2020-10-27 00:01:34 +00:00
Locale.CreateLanguagePicker(["nl", "en", "fr"]).AttachTo("extradiv")
2020-10-05 23:37:02 +00:00
/*/
import {Utils} from "./Utils";
import {FixedUiElement} from "./UI/Base/FixedUiElement";
Utils.generateStats((stats) => {
2020-10-05 23:37:02 +00:00
new FixedUiElement(stats).AttachTo('maindiv')
})
//*/