Huge refactoring (WIP)
This commit is contained in:
parent
62c4f0a928
commit
895aa132ec
55 changed files with 1177 additions and 2190 deletions
50
test.ts
50
test.ts
|
@ -1,33 +1,35 @@
|
|||
/*
|
||||
//*
|
||||
|
||||
|
||||
import OpeningHoursPickerTable from "./UI/Input/OpeningHours/OpeningHoursPickerTable";
|
||||
import {UIElement} from "./UI/UIElement";
|
||||
import {UIEventSource} from "./Logic/UIEventSource";
|
||||
import {OpeningHour} from "./Logic/OpeningHours";
|
||||
import {TagRendering} from "./UI/Popup/TagRendering";
|
||||
import {Tag} from "./Logic/Tags";
|
||||
import {TagRenderingConfigJson} from "./Customizations/JSON/TagRenderingConfigJson";
|
||||
import TagRenderingConfig from "./Customizations/JSON/TagRenderingConfig";
|
||||
import Locale from "./UI/i18n/Locale";
|
||||
import EditableTagRendering from "./UI/Popup/EditableTagRendering";
|
||||
|
||||
const tagRendering: TagRenderingConfigJson = {
|
||||
question: {"en": "What is the name of?", nl: "Wat is de naam van?", fr: "C'est quoi le nom"},
|
||||
mappings: [
|
||||
{
|
||||
if: "noname=yes",
|
||||
then: "Has no name"
|
||||
}
|
||||
],
|
||||
render: "The name is {name}",
|
||||
freeform: {
|
||||
key: "name",
|
||||
type: "string",
|
||||
addExtraTags: ["noname="]
|
||||
}//*/
|
||||
}
|
||||
|
||||
const tr = new TagRendering(
|
||||
new UIEventSource<any>({
|
||||
id: "node/-1",
|
||||
amenity: "bench"
|
||||
}),
|
||||
{
|
||||
question: "Does this bench have a backrest?",
|
||||
mappings: [{
|
||||
k: new Tag("backrest", "yes"),
|
||||
txt: "Has backrest"
|
||||
},
|
||||
{
|
||||
k: new Tag("backrest", "no"),
|
||||
txt: "Has no backrest"
|
||||
}]
|
||||
}
|
||||
)
|
||||
tr.AttachTo("maindiv")
|
||||
const config = new TagRenderingConfig(tagRendering)
|
||||
|
||||
const tags = new UIEventSource({id: "node/-1", "amenity": "bench", name: "pietervdvn"})
|
||||
|
||||
// new TagRenderingQuestion(tags, config).AttachTo("maindiv")
|
||||
new EditableTagRendering(tags, config).AttachTo('maindiv')
|
||||
Locale.CreateLanguagePicker(["nl", "en", "fr"]).AttachTo("extradiv")
|
||||
/*/
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue