mapcomplete/test.ts

55 lines
1.5 KiB
TypeScript
Raw Normal View History

2020-10-27 01:01:34 +01:00
//*
2020-10-09 21:11:52 +02:00
2020-10-23 01:20:48 +02:00
import {UIEventSource} from "./Logic/UIEventSource";
2020-10-27 01:01:34 +01: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 14:13:37 +01:00
import TagRenderingQuestion from "./UI/Popup/TagRenderingQuestion";
2020-10-27 01:01:34 +01: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 14:13:37 +01: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 01:01:34 +01:00
}
],
2020-10-27 14:13:37 +01:00
render: "Valves: {valves}",
multiAnswer: true,
2020-10-27 01:01:34 +01:00
freeform: {
2020-10-27 14:13:37 +01:00
key: "valves",
2020-10-27 01:01:34 +01:00
type: "string",
2020-10-27 14:13:37 +01:00
addExtraTags: ["fixme=valves"]
}
2020-10-27 01:01:34 +01:00
}
const config = new TagRenderingConfig(tagRendering)
const tags = new UIEventSource({id: "node/-1", "amenity": "bench", name: "pietervdvn"})
2020-10-27 14:13:37 +01:00
new TagRenderingQuestion(tags, config).AttachTo("maindiv")
// new EditableTagRendering(tags, config).AttachTo('maindiv')
2020-10-27 01:01:34 +01:00
Locale.CreateLanguagePicker(["nl", "en", "fr"]).AttachTo("extradiv")
2020-10-06 01:37:02 +02:00
/*/
import {Utils} from "./Utils";
import {FixedUiElement} from "./UI/Base/FixedUiElement";
Utils.generateStats((stats) => {
2020-10-06 01:37:02 +02:00
new FixedUiElement(stats).AttachTo('maindiv')
})
//*/