forked from MapComplete/MapComplete
Studio: get basic translations working kindoff
This commit is contained in:
parent
2923020575
commit
b58ba665b5
36 changed files with 13542 additions and 15486 deletions
|
@ -118,8 +118,11 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: Use a dynamic tagRendering ; use a fixed value\ntypesdefault: 0",
|
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages\ntypesdefault: 1",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/TagRenderingConfigJson"
|
"$ref": "#/definitions/TagRenderingConfigJson"
|
||||||
},
|
},
|
||||||
|
@ -536,33 +539,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -599,7 +577,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -613,7 +591,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -647,10 +625,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -661,7 +639,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -690,6 +668,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -1203,33 +1196,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1266,7 +1234,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1280,7 +1248,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1292,6 +1260,21 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1385,33 +1368,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1448,7 +1406,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1462,7 +1420,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1474,6 +1432,21 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -118,8 +118,11 @@ export default {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: Use a dynamic tagRendering ; use a fixed value\ntypesdefault: 0",
|
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages\ntypesdefault: 1",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/TagRenderingConfigJson"
|
"$ref": "#/definitions/TagRenderingConfigJson"
|
||||||
},
|
},
|
||||||
|
@ -531,33 +534,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -594,7 +572,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -608,7 +586,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -642,10 +620,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -656,7 +634,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -685,6 +663,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1191,33 +1184,8 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1254,7 +1222,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1268,7 +1236,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1280,6 +1248,21 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1372,33 +1355,8 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1435,7 +1393,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1449,7 +1407,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1461,6 +1419,21 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -436,33 +436,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -499,7 +474,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -513,7 +488,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -547,10 +522,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -561,7 +536,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -590,6 +565,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -1103,33 +1093,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1166,7 +1131,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1180,7 +1145,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1192,6 +1157,21 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1285,33 +1265,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1348,7 +1303,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1362,7 +1317,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1374,6 +1329,21 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
@ -1807,8 +1777,11 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: Use a dynamic tagRendering ; use a fixed value\ntypesdefault: 0",
|
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages\ntypesdefault: 1",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/TagRenderingConfigJson"
|
"$ref": "#/definitions/TagRenderingConfigJson"
|
||||||
},
|
},
|
||||||
|
@ -2214,8 +2187,11 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: Use a dynamic tagRendering ; use a fixed value\ntypesdefault: 0",
|
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages\ntypesdefault: 1",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/TagRenderingConfigJson"
|
"$ref": "#/definitions/TagRenderingConfigJson"
|
||||||
},
|
},
|
||||||
|
|
|
@ -431,33 +431,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -494,7 +469,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -508,7 +483,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -542,10 +517,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -556,7 +531,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -585,6 +560,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1091,33 +1081,8 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1154,7 +1119,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1168,7 +1133,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1180,6 +1145,21 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1272,33 +1252,8 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -1335,7 +1290,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1349,7 +1304,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -1361,6 +1316,21 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1786,8 +1756,11 @@ export default {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: Use a dynamic tagRendering ; use a fixed value\ntypesdefault: 0",
|
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages\ntypesdefault: 1",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/TagRenderingConfigJson"
|
"$ref": "#/definitions/TagRenderingConfigJson"
|
||||||
},
|
},
|
||||||
|
@ -2192,8 +2165,11 @@ export default {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: Use a dynamic tagRendering ; use a fixed value\ntypesdefault: 0",
|
"description": "The title shown in a popup for elements of this layer.\n\ngroup: title\nquestion: What title should be shown on the infobox?\ntypes: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages\ntypesdefault: 1",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/TagRenderingConfigJson"
|
"$ref": "#/definitions/TagRenderingConfigJson"
|
||||||
},
|
},
|
||||||
|
|
|
@ -204,33 +204,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -267,7 +242,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -281,7 +256,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -315,10 +290,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -329,7 +304,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -358,6 +333,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -199,33 +199,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -262,7 +237,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -276,7 +251,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -310,10 +285,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -324,7 +299,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -353,6 +328,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,33 +237,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -300,7 +275,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -314,7 +289,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -348,10 +323,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -362,7 +337,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -391,6 +366,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -232,33 +232,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -295,7 +270,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -309,7 +284,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -343,10 +318,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -357,7 +332,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -386,6 +361,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -302,33 +302,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -365,7 +340,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -379,7 +354,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -413,10 +388,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -427,7 +402,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -456,6 +431,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -297,33 +297,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -360,7 +335,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -374,7 +349,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -408,10 +383,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -422,7 +397,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -451,6 +426,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,33 +85,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -148,7 +123,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -162,7 +137,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -174,6 +149,21 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -311,33 +301,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -374,7 +339,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -388,7 +353,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -422,10 +387,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -436,7 +401,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -465,6 +430,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -85,33 +85,8 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -148,7 +123,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -162,7 +137,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -174,6 +149,21 @@ export default {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -306,33 +296,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -369,7 +334,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -383,7 +348,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -417,10 +382,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -431,7 +396,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -460,6 +425,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -164,33 +164,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -227,7 +202,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -241,7 +216,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -275,10 +250,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -289,7 +264,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -318,6 +293,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|
|
@ -159,33 +159,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -222,7 +197,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -236,7 +211,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -270,10 +245,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -284,7 +259,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -313,6 +288,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,33 +2,8 @@
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -65,7 +40,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -79,7 +54,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -113,10 +88,10 @@
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -127,7 +102,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -156,6 +131,21 @@
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
|
|
|
@ -2,33 +2,8 @@ export default {
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"classes": {
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
"description": "question: What text should be rendered?\n\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`\ntype: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -65,7 +40,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"condition": {
|
"condition": {
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
"description": "question: When should this item be shown?\n\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -79,7 +54,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"metacondition": {
|
"metacondition": {
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
"description": "question: When should this item be shown (including special conditions)?\n\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -113,10 +88,10 @@ export default {
|
||||||
"properties": {
|
"properties": {
|
||||||
"if": {
|
"if": {
|
||||||
"$ref": "#/definitions/TagConfigJson",
|
"$ref": "#/definitions/TagConfigJson",
|
||||||
"description": "If this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
"description": "question: When should this single mapping match?\n\nIf this condition is met, then the text under `then` will be shown.\nIf no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.\n\nFor example: {'if': 'diet:vegetarion=yes', 'then':'A vegetarian option is offered here'}\n\nThis can be an substituting-tag as well, e.g. {'if': 'addr:street:={_calculated_nearby_streetname}', 'then': '{_calculated_nearby_streetname}'}"
|
||||||
},
|
},
|
||||||
"then": {
|
"then": {
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
"description": "question: What text should be shown?\n\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option\nType: rendered",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
@ -127,7 +102,7 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"icon": {
|
"icon": {
|
||||||
"description": "An icon supporting this mapping; typically shown pretty small\nType: icon",
|
"description": "question: What icon should be added to this mapping?\nAn icon supporting this mapping; typically shown pretty small\nType: icon",
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -156,6 +131,21 @@ export default {
|
||||||
"then"
|
"then"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"classes": {
|
||||||
|
"description": "question: What css-classes should be applied to showing this attribute?\n\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
|
|
|
@ -206,11 +206,11 @@ export interface LayerConfigJson {
|
||||||
*
|
*
|
||||||
* group: title
|
* group: title
|
||||||
* question: What title should be shown on the infobox?
|
* question: What title should be shown on the infobox?
|
||||||
* types: Use a dynamic tagRendering ; use a fixed value
|
* types: use a fixed translation ; Use a dynamic tagRendering ; use a fixed string for all languages
|
||||||
* typesdefault: 0
|
* typesdefault: 1
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
title?: TagRenderingConfigJson | string
|
title?: TagRenderingConfigJson | Translatable
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,22 +7,16 @@ import { Translatable } from "./Translatable"
|
||||||
*/
|
*/
|
||||||
export interface TagRenderingConfigJson {
|
export interface TagRenderingConfigJson {
|
||||||
/**
|
/**
|
||||||
* A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).
|
* question: What text should be rendered?
|
||||||
* This is only for advanced users
|
|
||||||
*/
|
|
||||||
classes?: string | string[]
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A human-readable text explaining what this tagRendering does.
|
|
||||||
* Mostly used for the shared tagrenderings
|
|
||||||
*/
|
|
||||||
description?: string | Record<string, string>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renders this value. Note that "{key}"-parts are substituted by the corresponding values of the element.
|
|
||||||
* If neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.
|
|
||||||
*
|
*
|
||||||
* Note that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`
|
* This piece of text will be shown in the infobox.
|
||||||
|
* Note that "{key}"-parts are substituted by the corresponding values of the element.
|
||||||
|
*
|
||||||
|
* This text will be shown if:
|
||||||
|
* - there is no mapping which matches (or there are no matches)
|
||||||
|
* - no question, no mappings and no 'freeform' is set
|
||||||
|
*
|
||||||
|
* Note that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`
|
||||||
* type: rendered
|
* type: rendered
|
||||||
*/
|
*/
|
||||||
render?:
|
render?:
|
||||||
|
@ -30,6 +24,9 @@ export interface TagRenderingConfigJson {
|
||||||
| { special: Record<string, string | Record<string, string>> & { type: string } }
|
| { special: Record<string, string | Record<string, string>> & { type: string } }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
* question: When should this item be shown?
|
||||||
|
*
|
||||||
* Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.
|
* Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.
|
||||||
*
|
*
|
||||||
* This is useful to ask a follow-up question.
|
* This is useful to ask a follow-up question.
|
||||||
|
@ -71,6 +68,9 @@ export interface TagRenderingConfigJson {
|
||||||
condition?: TagConfigJson
|
condition?: TagConfigJson
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
* question: When should this item be shown (including special conditions)?
|
||||||
|
*
|
||||||
* If set, this tag will be evaluated agains the _usersettings/application state_ table.
|
* If set, this tag will be evaluated agains the _usersettings/application state_ table.
|
||||||
* Enable 'show debug info' in user settings to see available options.
|
* Enable 'show debug info' in user settings to see available options.
|
||||||
* Note that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_
|
* Note that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_
|
||||||
|
@ -93,6 +93,8 @@ export interface TagRenderingConfigJson {
|
||||||
*/
|
*/
|
||||||
mappings?: {
|
mappings?: {
|
||||||
/**
|
/**
|
||||||
|
* question: When should this single mapping match?
|
||||||
|
*
|
||||||
* If this condition is met, then the text under `then` will be shown.
|
* If this condition is met, then the text under `then` will be shown.
|
||||||
* If no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.
|
* If no value matches, and the user selects this mapping as an option, then these tags will be uploaded to OSM.
|
||||||
*
|
*
|
||||||
|
@ -102,12 +104,15 @@ export interface TagRenderingConfigJson {
|
||||||
*/
|
*/
|
||||||
if: TagConfigJson
|
if: TagConfigJson
|
||||||
/**
|
/**
|
||||||
|
* question: What text should be shown?
|
||||||
|
*
|
||||||
* If the condition `if` is met, the text `then` will be rendered.
|
* If the condition `if` is met, the text `then` will be rendered.
|
||||||
* If not known yet, the user will be presented with `then` as an option
|
* If not known yet, the user will be presented with `then` as an option
|
||||||
* Type: rendered
|
* Type: rendered
|
||||||
*/
|
*/
|
||||||
then: string | Record<string, string>
|
then: Translatable
|
||||||
/**
|
/**
|
||||||
|
* question: What icon should be added to this mapping?
|
||||||
* An icon supporting this mapping; typically shown pretty small
|
* An icon supporting this mapping; typically shown pretty small
|
||||||
* Type: icon
|
* Type: icon
|
||||||
*/
|
*/
|
||||||
|
@ -126,4 +131,21 @@ export interface TagRenderingConfigJson {
|
||||||
class?: "small" | "medium" | "large" | string
|
class?: "small" | "medium" | "large" | string
|
||||||
}
|
}
|
||||||
}[]
|
}[]
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A human-readable text explaining what this tagRendering does.
|
||||||
|
* Mostly used for the shared tagrenderings
|
||||||
|
*/
|
||||||
|
description?: Translatable
|
||||||
|
|
||||||
|
/**
|
||||||
|
* question: What css-classes should be applied to showing this attribute?
|
||||||
|
*
|
||||||
|
* A list of css-classes to apply to the entire tagRendering.
|
||||||
|
* These classes are applied in 'answer'-mode, not in question mode
|
||||||
|
* This is only for advanced users.
|
||||||
|
*
|
||||||
|
* Values are split on ` ` (space)
|
||||||
|
*/
|
||||||
|
classes?: string
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ import Svg from "../../Svg"
|
||||||
import { ImmutableStore } from "../../Logic/UIEventSource"
|
import { ImmutableStore } from "../../Logic/UIEventSource"
|
||||||
import { OsmTags } from "../OsmFeature"
|
import { OsmTags } from "../OsmFeature"
|
||||||
import Constants from "../Constants"
|
import Constants from "../Constants"
|
||||||
|
import { QuestionableTagRenderingConfigJson } from "./Json/QuestionableTagRenderingConfigJson"
|
||||||
|
|
||||||
export default class LayerConfig extends WithContextLoader {
|
export default class LayerConfig extends WithContextLoader {
|
||||||
public static readonly syncSelectionAllowed = ["no", "local", "theme-only", "global"] as const
|
public static readonly syncSelectionAllowed = ["no", "local", "theme-only", "global"] as const
|
||||||
|
@ -340,7 +341,7 @@ export default class LayerConfig extends WithContextLoader {
|
||||||
this.tagRenderings = (Utils.NoNull(json.tagRenderings) ?? []).map(
|
this.tagRenderings = (Utils.NoNull(json.tagRenderings) ?? []).map(
|
||||||
(tr, i) =>
|
(tr, i) =>
|
||||||
new TagRenderingConfig(
|
new TagRenderingConfig(
|
||||||
<TagRenderingConfigJson>tr,
|
<QuestionableTagRenderingConfigJson>tr,
|
||||||
this.id + ".tagRenderings[" + i + "]"
|
this.id + ".tagRenderings[" + i + "]"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -113,10 +113,12 @@ export default class TagRenderingConfig {
|
||||||
|
|
||||||
this.labels = json.labels ?? []
|
this.labels = json.labels ?? []
|
||||||
if (typeof json.classes === "string") {
|
if (typeof json.classes === "string") {
|
||||||
this.classes = json.classes.split(" ")
|
this.classes = (<string>json.classes).split(" ")
|
||||||
} else {
|
} else {
|
||||||
this.classes = json.classes ?? []
|
this.classes = json.classes ?? []
|
||||||
}
|
}
|
||||||
|
this.classes = [].concat(...this.classes.map((cl) => cl.split(" ")))
|
||||||
|
|
||||||
this.render = Translations.T(<any>json.render, translationKey + ".render")
|
this.render = Translations.T(<any>json.render, translationKey + ".render")
|
||||||
this.question = Translations.T(json.question, translationKey + ".question")
|
this.question = Translations.T(json.question, translationKey + ".question")
|
||||||
this.questionhint = Translations.T(json.questionHint, translationKey + ".questionHint")
|
this.questionhint = Translations.T(json.questionHint, translationKey + ".questionHint")
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import TagRenderingConfig from "./TagRenderingConfig"
|
import TagRenderingConfig from "./TagRenderingConfig"
|
||||||
import SharedTagRenderings from "../../Customizations/SharedTagRenderings"
|
import SharedTagRenderings from "../../Customizations/SharedTagRenderings"
|
||||||
import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson"
|
import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson"
|
||||||
|
import { Translatable } from "./Json/Translatable"
|
||||||
|
import { QuestionableTagRenderingConfigJson } from "./Json/QuestionableTagRenderingConfigJson"
|
||||||
|
|
||||||
export default class WithContextLoader {
|
export default class WithContextLoader {
|
||||||
protected readonly _context: string
|
protected readonly _context: string
|
||||||
|
@ -16,7 +18,7 @@ export default class WithContextLoader {
|
||||||
* The found value is interpreted as a tagrendering and fetched/parsed
|
* The found value is interpreted as a tagrendering and fetched/parsed
|
||||||
* */
|
* */
|
||||||
public tr(key: string, deflt?: string, translationContext?: string) {
|
public tr(key: string, deflt?: string, translationContext?: string) {
|
||||||
const v = this._json[key]
|
let v: Translatable | TagRenderingConfigJson = this._json[key]
|
||||||
if (v === undefined || v === null) {
|
if (v === undefined || v === null) {
|
||||||
if (deflt === undefined) {
|
if (deflt === undefined) {
|
||||||
return undefined
|
return undefined
|
||||||
|
@ -31,6 +33,11 @@ export default class WithContextLoader {
|
||||||
if (shared) {
|
if (shared) {
|
||||||
return shared
|
return shared
|
||||||
}
|
}
|
||||||
|
v = <TagRenderingConfigJson>{ render: { "*": v } }
|
||||||
|
}
|
||||||
|
if (v["en"] || v["*"]) {
|
||||||
|
// This is probably a translation
|
||||||
|
v = <TagRenderingConfigJson>{ render: v }
|
||||||
}
|
}
|
||||||
if (Object.keys(v).length === 1 && typeof v["render"] === "string") {
|
if (Object.keys(v).length === 1 && typeof v["render"] === "string") {
|
||||||
throw `At ${
|
throw `At ${
|
||||||
|
@ -38,7 +45,10 @@ export default class WithContextLoader {
|
||||||
}: use the content directly instead of {${key}: ${JSON.stringify(v)}}`
|
}: use the content directly instead of {${key}: ${JSON.stringify(v)}}`
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TagRenderingConfig(v, `${translationContext ?? this._context}.${key}`)
|
return new TagRenderingConfig(
|
||||||
|
<QuestionableTagRenderingConfigJson>v,
|
||||||
|
`${translationContext ?? this._context}.${key}`
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,7 +78,10 @@ export default class WithContextLoader {
|
||||||
const renderings: TagRenderingConfig[] = []
|
const renderings: TagRenderingConfig[] = []
|
||||||
for (let i = 0; i < tagRenderings.length; i++) {
|
for (let i = 0; i < tagRenderings.length; i++) {
|
||||||
const preparedConfig = tagRenderings[i]
|
const preparedConfig = tagRenderings[i]
|
||||||
const tr = new TagRenderingConfig(preparedConfig, `${context}.tagrendering[${i}]`)
|
const tr = new TagRenderingConfig(
|
||||||
|
<QuestionableTagRenderingConfigJson>preparedConfig,
|
||||||
|
`${context}.tagrendering[${i}]`
|
||||||
|
)
|
||||||
if (options.readOnlyMode && tr.question !== undefined) {
|
if (options.readOnlyMode && tr.question !== undefined) {
|
||||||
throw (
|
throw (
|
||||||
"A question is defined for " +
|
"A question is defined for " +
|
||||||
|
|
53
UI/InputElement/Helpers/TranslationInput.svelte
Normal file
53
UI/InputElement/Helpers/TranslationInput.svelte
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
<script lang="ts">
|
||||||
|
|
||||||
|
import { UIEventSource } from "../../../Logic/UIEventSource";
|
||||||
|
import LanguageUtils from "../../../Utils/LanguageUtils";
|
||||||
|
import { onDestroy } from "svelte";
|
||||||
|
import ValidatedInput from "../ValidatedInput.svelte";
|
||||||
|
|
||||||
|
export let value: UIEventSource<string> = new UIEventSource<string>("");
|
||||||
|
|
||||||
|
let translations: UIEventSource<Record<string, string>> = value.sync((s) => {
|
||||||
|
try {
|
||||||
|
return JSON.parse(s);
|
||||||
|
} catch (e) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}, [], v => JSON.stringify(v));
|
||||||
|
|
||||||
|
const allLanguages: string[] = LanguageUtils.usedLanguagesSorted;
|
||||||
|
let currentLang = new UIEventSource("en");
|
||||||
|
const currentVal = new UIEventSource<string>("");
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
const v = currentVal.data;
|
||||||
|
const l = currentLang.data;
|
||||||
|
if (translations.data[l] === v) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
translations.data[l] = v;
|
||||||
|
translations.ping();
|
||||||
|
}
|
||||||
|
|
||||||
|
onDestroy(currentLang.addCallbackAndRunD(currentLang => {
|
||||||
|
console.log("Applying current lang:", currentLang);
|
||||||
|
translations.data[currentLang] = translations.data[currentLang] ?? "";
|
||||||
|
currentVal.setData(translations.data[currentLang]);
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
onDestroy(currentVal.addCallbackAndRunD(v => {
|
||||||
|
update();
|
||||||
|
}));
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<div class="flex">
|
||||||
|
<select bind:value={$currentLang}>
|
||||||
|
{#each allLanguages as language}
|
||||||
|
<option value={language}>
|
||||||
|
{language}
|
||||||
|
</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
<ValidatedInput type="string" value={currentVal} />
|
||||||
|
</div>
|
|
@ -14,6 +14,7 @@ import Locale from "../i18n/Locale"
|
||||||
import { Feature } from "geojson"
|
import { Feature } from "geojson"
|
||||||
import { GeoOperations } from "../../Logic/GeoOperations"
|
import { GeoOperations } from "../../Logic/GeoOperations"
|
||||||
import ImageHelper from "./Helpers/ImageHelper.svelte"
|
import ImageHelper from "./Helpers/ImageHelper.svelte"
|
||||||
|
import TranslationInput from "./Helpers/TranslationInput.svelte"
|
||||||
|
|
||||||
export interface InputHelperProperties {
|
export interface InputHelperProperties {
|
||||||
/**
|
/**
|
||||||
|
@ -57,6 +58,7 @@ export default class InputHelpers {
|
||||||
opening_hours: (value) => new OpeningHoursInput(value),
|
opening_hours: (value) => new OpeningHoursInput(value),
|
||||||
wikidata: InputHelpers.constructWikidataHelper,
|
wikidata: InputHelpers.constructWikidataHelper,
|
||||||
image: (value) => new SvelteUIElement(ImageHelper, { value }),
|
image: (value) => new SvelteUIElement(ImageHelper, { value }),
|
||||||
|
translation: (value) => new SvelteUIElement(TranslationInput, { value }),
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -77,6 +77,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onDestroy(_value.addCallbackAndRun((_) => setValues()))
|
onDestroy(_value.addCallbackAndRun((_) => setValues()))
|
||||||
|
onDestroy(value.addCallbackAndRunD(fromUpstream => {
|
||||||
|
if(_value.data !== fromUpstream){
|
||||||
|
_value.setData(fromUpstream)
|
||||||
|
}
|
||||||
|
}))
|
||||||
onDestroy(selectedUnit.addCallback((_) => setValues()))
|
onDestroy(selectedUnit.addCallback((_) => setValues()))
|
||||||
if (validator === undefined) {
|
if (validator === undefined) {
|
||||||
throw "Not a valid type (no validator found) for type '" + type+"'; did you perhaps mean one of: "+Utils.sortedByLevenshteinDistance(type, Validators.AllValidators.map(v => v.name), v => v).slice(0, 5).join(", ")
|
throw "Not a valid type (no validator found) for type '" + type+"'; did you perhaps mean one of: "+Utils.sortedByLevenshteinDistance(type, Validators.AllValidators.map(v => v.name), v => v).slice(0, 5).join(", ")
|
||||||
|
|
|
@ -21,6 +21,7 @@ import Title from "../Base/Title"
|
||||||
import SimpleTagValidator from "./Validators/SimpleTagValidator"
|
import SimpleTagValidator from "./Validators/SimpleTagValidator"
|
||||||
import ImageUrlValidator from "./Validators/ImageUrlValidator"
|
import ImageUrlValidator from "./Validators/ImageUrlValidator"
|
||||||
import TagKeyValidator from "./Validators/TagKeyValidator"
|
import TagKeyValidator from "./Validators/TagKeyValidator"
|
||||||
|
import TranslationValidator from "./Validators/TranslationValidator"
|
||||||
|
|
||||||
export type ValidatorType = (typeof Validators.availableTypes)[number]
|
export type ValidatorType = (typeof Validators.availableTypes)[number]
|
||||||
|
|
||||||
|
@ -45,6 +46,7 @@ export default class Validators {
|
||||||
"image",
|
"image",
|
||||||
"simple_tag",
|
"simple_tag",
|
||||||
"key",
|
"key",
|
||||||
|
"translation",
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
public static readonly AllValidators: ReadonlyArray<Validator> = [
|
public static readonly AllValidators: ReadonlyArray<Validator> = [
|
||||||
|
@ -67,6 +69,7 @@ export default class Validators {
|
||||||
new ImageUrlValidator(),
|
new ImageUrlValidator(),
|
||||||
new SimpleTagValidator(),
|
new SimpleTagValidator(),
|
||||||
new TagKeyValidator(),
|
new TagKeyValidator(),
|
||||||
|
new TranslationValidator(),
|
||||||
]
|
]
|
||||||
|
|
||||||
private static _byType = Validators._byTypeConstructor()
|
private static _byType = Validators._byTypeConstructor()
|
||||||
|
|
16
UI/InputElement/Validators/TranslationValidator.ts
Normal file
16
UI/InputElement/Validators/TranslationValidator.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { Validator } from "../Validator"
|
||||||
|
|
||||||
|
export default class TranslationValidator extends Validator {
|
||||||
|
constructor() {
|
||||||
|
super("translation", "Makes sure the the string is of format `Record<string, string>` ")
|
||||||
|
}
|
||||||
|
|
||||||
|
isValid(value: string, getCountry?: () => string): boolean {
|
||||||
|
try {
|
||||||
|
JSON.parse(value)
|
||||||
|
return true
|
||||||
|
} catch (e) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -22,12 +22,6 @@ export default class EditLayerState {
|
||||||
featureSwitchIsDebugging: new UIEventSource<boolean>(true),
|
featureSwitchIsDebugging: new UIEventSource<boolean>(true),
|
||||||
}
|
}
|
||||||
this.configuration.addCallback((config) => {
|
this.configuration.addCallback((config) => {
|
||||||
if (
|
|
||||||
config?.deletion !== undefined &&
|
|
||||||
(<DeleteConfigJson>config?.deletion)?.neededChangesets === undefined
|
|
||||||
) {
|
|
||||||
console.trace("Needed changesets is undefined")
|
|
||||||
}
|
|
||||||
console.log("Current config is", Utils.Clone(config))
|
console.log("Current config is", Utils.Clone(config))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -65,7 +59,19 @@ export default class EditLayerState {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSchema(path: string[]) {
|
public getTranslationAt(path: string[]): ConfigMeta {
|
||||||
|
const origConfig = this.getSchema(path)[0]
|
||||||
|
return {
|
||||||
|
path,
|
||||||
|
type: "translation",
|
||||||
|
hints: {
|
||||||
|
typehint: "translation",
|
||||||
|
},
|
||||||
|
required: origConfig.required ?? false,
|
||||||
|
description: origConfig.description ?? "A translatable object",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public getSchema(path: string[]): ConfigMeta[] {
|
||||||
return this.schema.filter(
|
return this.schema.filter(
|
||||||
(sch) =>
|
(sch) =>
|
||||||
sch !== undefined &&
|
sch !== undefined &&
|
||||||
|
|
|
@ -1,142 +1,168 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|
||||||
import EditLayerState from "./EditLayerState";
|
import EditLayerState from "./EditLayerState";
|
||||||
import type { ConfigMeta } from "./configMeta";
|
import type { ConfigMeta } from "./configMeta";
|
||||||
import { UIEventSource } from "../../Logic/UIEventSource";
|
import { UIEventSource } from "../../Logic/UIEventSource";
|
||||||
import type {
|
import type {
|
||||||
QuestionableTagRenderingConfigJson
|
QuestionableTagRenderingConfigJson
|
||||||
} from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson";
|
} from "../../Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson";
|
||||||
import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte";
|
import TagRenderingEditable from "../Popup/TagRendering/TagRenderingEditable.svelte";
|
||||||
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig";
|
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig";
|
||||||
import { onDestroy } from "svelte";
|
import { onDestroy } from "svelte";
|
||||||
import SchemaBasedInput from "./SchemaBasedInput.svelte";
|
import SchemaBasedInput from "./SchemaBasedInput.svelte";
|
||||||
import type { JsonSchemaType } from "./jsonSchema";
|
import type { JsonSchemaType } from "./jsonSchema";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import nmd from "nano-markdown";
|
import nmd from "nano-markdown";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If 'types' is defined: allow the user to pick one of the types to input.
|
* If 'types' is defined: allow the user to pick one of the types to input.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export let state: EditLayerState
|
export let state: EditLayerState;
|
||||||
export let path: (string | number)[] = []
|
export let path: (string | number)[] = [];
|
||||||
export let schema: ConfigMeta
|
export let schema: ConfigMeta;
|
||||||
const defaultOption = schema.hints.typesdefault ? Number(schema.hints.typesdefault) : undefined
|
const defaultOption = schema.hints.typesdefault ? Number(schema.hints.typesdefault) : undefined;
|
||||||
|
|
||||||
const hasBooleanOption = (<JsonSchemaType[]>schema.type)?.findIndex(t => t["type"] === "boolean")
|
const hasBooleanOption = (<JsonSchemaType[]>schema.type)?.findIndex(t => t["type"] === "boolean");
|
||||||
const types = schema.hints.types.split(";")
|
const types = schema.hints.types.split(";");
|
||||||
if (hasBooleanOption >= 0) {
|
if (hasBooleanOption >= 0) {
|
||||||
console.log(path.join("."), ": types are", types, ", boolean index is", hasBooleanOption)
|
console.log(path.join("."), ": types are", types, ", boolean index is", hasBooleanOption);
|
||||||
types.splice(hasBooleanOption)
|
types.splice(hasBooleanOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
const configJson: QuestionableTagRenderingConfigJson = {
|
const configJson: QuestionableTagRenderingConfigJson = {
|
||||||
id: "TYPE_OF:" + path.join("_"),
|
id: "TYPE_OF:" + path.join("_"),
|
||||||
question: "Which subcategory is needed?",
|
question: "Which subcategory is needed?",
|
||||||
questionHint: nmd(schema.description),
|
questionHint: nmd(schema.description),
|
||||||
mappings: types.map(opt => opt.trim()).filter(opt => opt.length > 0).map((opt, i) => ({
|
mappings: types.map(opt => opt.trim()).filter(opt => opt.length > 0).map((opt, i) => ({
|
||||||
if: "value=" + i,
|
if: "value=" + i,
|
||||||
addExtraTags: ["direct="],
|
addExtraTags: ["direct="],
|
||||||
then: opt + (i === defaultOption ? " (Default)" : "")
|
then: opt + (i === defaultOption ? " (Default)" : "")
|
||||||
}))
|
|
||||||
}
|
|
||||||
let tags = new UIEventSource<Record<string, string>>({})
|
|
||||||
|
|
||||||
if (hasBooleanOption >= 0) {
|
|
||||||
configJson.mappings.unshift(
|
|
||||||
{
|
|
||||||
if: "direct=true",
|
|
||||||
then: "Yes " + (schema.hints.iftrue ?? ""),
|
|
||||||
addExtraTags: ["value="]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
if: "direct=false",
|
|
||||||
then: "No " + (schema.hints.iffalse ?? ""),
|
|
||||||
addExtraTags: ["value="]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
const config = new TagRenderingConfig(configJson, "config based on " + schema.path.join("."))
|
|
||||||
|
|
||||||
|
|
||||||
const existingValue = state.getCurrentValueFor(path)
|
|
||||||
console.log("Setting direct: ", hasBooleanOption, path.join("."), existingValue)
|
|
||||||
if (hasBooleanOption >= 0 && (existingValue === true || existingValue === false)) {
|
|
||||||
tags.setData({direct: "" + existingValue})
|
|
||||||
} else if (existingValue) {
|
|
||||||
// We found an existing value. Let's figure out what type it matches and select that one
|
|
||||||
// We run over all possibilities and check what is required
|
|
||||||
const possibleTypes = []
|
|
||||||
outer: for (let i = 0; i < (<[]>schema.type).length; i++) {
|
|
||||||
const type = schema.type[i];
|
|
||||||
if (type.required) {
|
|
||||||
for (const requiredAttribute of type.required) {
|
|
||||||
if (existingValue[requiredAttribute] === undefined) {
|
|
||||||
console.log(path.join("."), " does not have required field", requiredAttribute, " so it cannot be type ", type)
|
|
||||||
// The 'existingValue' does _not_ have this required attribute, so it cannot be of this type
|
|
||||||
continue outer
|
|
||||||
}
|
|
||||||
}
|
|
||||||
possibleTypes.push(i)
|
|
||||||
} else {
|
|
||||||
possibleTypes.push(i)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (possibleTypes.length > 0) {
|
|
||||||
tags.setData({value: "" + possibleTypes[0]})
|
|
||||||
}
|
|
||||||
} else if (defaultOption !== undefined) {
|
|
||||||
tags.setData({value: "" + defaultOption})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasBooleanOption >= 0) {
|
|
||||||
|
|
||||||
const directValue = tags.mapD(tags => {
|
|
||||||
if(tags["value"]){
|
|
||||||
return undefined
|
|
||||||
}
|
|
||||||
return tags["direct"] === "true";
|
|
||||||
})
|
|
||||||
onDestroy(state.register(path, directValue, true))
|
|
||||||
}
|
|
||||||
|
|
||||||
let chosenOption: number = defaultOption
|
|
||||||
let subSchemas: ConfigMeta[] = []
|
|
||||||
onDestroy(tags.addCallbackAndRun(tags => {
|
|
||||||
const oldOption = chosenOption
|
|
||||||
chosenOption = tags["value"] ? Number(tags["value"]) : defaultOption
|
|
||||||
if(chosenOption !== oldOption){
|
|
||||||
// Reset the values beneath
|
|
||||||
subSchemas = []
|
|
||||||
state.setValueAt(path, undefined)
|
|
||||||
}
|
|
||||||
const type = schema.type[chosenOption]
|
|
||||||
if (!type) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!type.properties) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const cleanPath = <string[]>path.filter(p => typeof p === "string")
|
|
||||||
for (const crumble of Object.keys(type.properties)) {
|
|
||||||
subSchemas.push(...(state.getSchema([...cleanPath, crumble])))
|
|
||||||
}
|
|
||||||
}))
|
}))
|
||||||
|
};
|
||||||
|
let tags = new UIEventSource<Record<string, string>>({});
|
||||||
|
|
||||||
|
if (hasBooleanOption >= 0) {
|
||||||
|
configJson.mappings.unshift(
|
||||||
|
{
|
||||||
|
if: "direct=true",
|
||||||
|
then: "Yes " + (schema.hints.iftrue ?? ""),
|
||||||
|
addExtraTags: ["value="]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
if: "direct=false",
|
||||||
|
then: "No " + (schema.hints.iffalse ?? ""),
|
||||||
|
addExtraTags: ["value="]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const config = new TagRenderingConfig(configJson, "config based on " + schema.path.join("."));
|
||||||
|
|
||||||
|
|
||||||
|
const existingValue = state.getCurrentValueFor(path);
|
||||||
|
console.log("Setting direct: ", hasBooleanOption, path.join("."), existingValue);
|
||||||
|
if (hasBooleanOption >= 0 && (existingValue === true || existingValue === false)) {
|
||||||
|
tags.setData({ direct: "" + existingValue });
|
||||||
|
} else if (existingValue) {
|
||||||
|
// We found an existing value. Let's figure out what type it matches and select that one
|
||||||
|
// We run over all possibilities and check what is required
|
||||||
|
const possibleTypes: { index: number, matchingPropertiesCount: number, optionalMatches: number }[] = [];
|
||||||
|
outer: for (let i = 0; i < (<[]>schema.type).length; i++) {
|
||||||
|
const type = schema.type[i];
|
||||||
|
let optionalMatches = 0
|
||||||
|
for (const key of Object.keys(type.properties ?? {})) {
|
||||||
|
if(!!existingValue[key]){
|
||||||
|
optionalMatches++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type.required) {
|
||||||
|
let numberOfMatches = 0;
|
||||||
|
|
||||||
|
for (const requiredAttribute of type.required) {
|
||||||
|
if (existingValue[requiredAttribute] === undefined) {
|
||||||
|
console.log(path.join("."), " does not have required field", requiredAttribute, " so it cannot be type ", type);
|
||||||
|
// The 'existingValue' does _not_ have this required attribute, so it cannot be of this type
|
||||||
|
continue outer;
|
||||||
|
}
|
||||||
|
numberOfMatches++;
|
||||||
|
}
|
||||||
|
possibleTypes.push({ index: i, matchingPropertiesCount: numberOfMatches , optionalMatches});
|
||||||
|
} else {
|
||||||
|
possibleTypes.push({ index: i, matchingPropertiesCount: 0, optionalMatches });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
possibleTypes.sort((a, b) => b.optionalMatches - a.optionalMatches);
|
||||||
|
possibleTypes.sort((a, b) => b.matchingPropertiesCount - a.matchingPropertiesCount);
|
||||||
|
console.log(">>> possible types", possibleTypes)
|
||||||
|
if (possibleTypes.length > 0) {
|
||||||
|
tags.setData({ value: "" + possibleTypes[0].index });
|
||||||
|
}
|
||||||
|
} else if (defaultOption !== undefined) {
|
||||||
|
tags.setData({ value: "" + defaultOption });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasBooleanOption >= 0) {
|
||||||
|
|
||||||
|
const directValue = tags.mapD(tags => {
|
||||||
|
if (tags["value"]) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return tags["direct"] === "true";
|
||||||
|
});
|
||||||
|
onDestroy(state.register(path, directValue, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
let chosenOption: number = defaultOption;
|
||||||
|
let subSchemas: ConfigMeta[] = [];
|
||||||
|
|
||||||
|
let subpath = path;
|
||||||
|
|
||||||
|
onDestroy(tags.addCallbackAndRun(tags => {
|
||||||
|
const oldOption = chosenOption;
|
||||||
|
chosenOption = tags["value"] ? Number(tags["value"]) : defaultOption;
|
||||||
|
if (chosenOption !== oldOption) {
|
||||||
|
// Reset the values beneath
|
||||||
|
subSchemas = [];
|
||||||
|
state.setValueAt(path, undefined);
|
||||||
|
}
|
||||||
|
const type = schema.type[chosenOption];
|
||||||
|
console.log("Subtype is", type);
|
||||||
|
if (!type) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
subpath = path;
|
||||||
|
const cleanPath = <string[]>path.filter(p => typeof p === "string");
|
||||||
|
if (type["$ref"] === "#/definitions/Record<string,string>") {
|
||||||
|
// The subtype is a translation object
|
||||||
|
const schema = state.getTranslationAt(cleanPath);
|
||||||
|
console.log("Got a translation,", schema);
|
||||||
|
subSchemas.push(schema);
|
||||||
|
subpath = path.slice(0, path.length - 2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!type.properties) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (const crumble of Object.keys(type.properties)) {
|
||||||
|
subSchemas.push(...(state.getSchema([...cleanPath, crumble])));
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="p-2 border-2 border-dashed border-gray-300 flex flex-col gap-y-2">
|
<div class="p-2 border-2 border-dashed border-gray-300 flex flex-col gap-y-2">
|
||||||
<div>
|
<div>
|
||||||
<TagRenderingEditable selectedElement={undefined} {config} showQuestionIfUnknown={true} {state} {tags}/>
|
<TagRenderingEditable {config} selectedElement={undefined} showQuestionIfUnknown={true} {state} {tags} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if chosenOption !== undefined}
|
{#if chosenOption !== undefined}
|
||||||
{#each subSchemas as subschema}
|
{#each subSchemas as subschema}
|
||||||
<SchemaBasedInput {state} schema={subschema}
|
<SchemaBasedInput {state} schema={subschema}
|
||||||
path={[...path, (subschema?.path?.at(-1) ?? "???")]}></SchemaBasedInput>
|
path={[...subpath, (subschema?.path?.at(-1) ?? "???")]}></SchemaBasedInput>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,15 +16,21 @@
|
||||||
export let path: (string | number)[] = []
|
export let path: (string | number)[] = []
|
||||||
export let schema: ConfigMeta
|
export let schema: ConfigMeta
|
||||||
let value = new UIEventSource<string>(undefined)
|
let value = new UIEventSource<string>(undefined)
|
||||||
|
|
||||||
|
let type = schema.hints.typehint ?? "string"
|
||||||
|
if(type === "rendered"){
|
||||||
|
type = "translation"
|
||||||
|
}
|
||||||
|
const isTranslation =schema.hints.typehint === "translation" || schema.hints.typehint === "rendered"
|
||||||
|
|
||||||
const configJson: QuestionableTagRenderingConfigJson = {
|
const configJson: QuestionableTagRenderingConfigJson = {
|
||||||
id: path.join("_"),
|
id: path.join("_"),
|
||||||
render: schema.type === "boolean" ? undefined : schema.hints.inline ?? schema.path.at(-1) + ": <b>{value}</b>",
|
render: schema.type === "boolean" ? undefined : ((schema.hints.inline ?? schema.path.at(-1) )+ ": <b>{value}</b>"),
|
||||||
question: schema.hints.question,
|
question: schema.hints.question,
|
||||||
questionHint: nmd(schema.description),
|
questionHint: nmd(schema.description),
|
||||||
freeform: schema.type === "boolean" ? undefined : {
|
freeform: schema.type === "boolean" ? undefined : {
|
||||||
key: "value",
|
key: "value",
|
||||||
type: schema.hints.typehint ?? "string",
|
type,
|
||||||
inline: schema.hints.inline !== undefined
|
inline: schema.hints.inline !== undefined
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -70,11 +76,12 @@
|
||||||
err = path.join(".") + " " + e
|
err = path.join(".") + " " + e
|
||||||
}
|
}
|
||||||
let startValue = state.getCurrentValueFor(path)
|
let startValue = state.getCurrentValueFor(path)
|
||||||
if (startValue?.["en"]) {
|
console.log("StartValue for", path.join("."), " is", startValue)
|
||||||
startValue = startValue["en"]
|
if (typeof startValue !== "string") {
|
||||||
|
startValue = JSON.stringify(startValue)
|
||||||
}
|
}
|
||||||
console.log("Startvalue for", path.join("."), "is", startValue)
|
const tags = new UIEventSource<Record<string, string>>({value: startValue ?? ""})
|
||||||
let tags = new UIEventSource<Record<string, string>>({value: startValue ?? ""})
|
tags.addCallbackAndRunD(tgs => console.log(">>> tgs for",path.join("."),"are",tgs ))
|
||||||
onDestroy(state.register(path, tags.map(tgs => {
|
onDestroy(state.register(path, tags.map(tgs => {
|
||||||
const v = tgs["value"];
|
const v = tgs["value"];
|
||||||
if (schema.type === "boolan") {
|
if (schema.type === "boolan") {
|
||||||
|
@ -83,13 +90,19 @@
|
||||||
if (schema.type === "number") {
|
if (schema.type === "number") {
|
||||||
return Number(v)
|
return Number(v)
|
||||||
}
|
}
|
||||||
|
console.log(schema, v)
|
||||||
|
if(isTranslation) {
|
||||||
|
if(v === ""){
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
return JSON.parse(v)
|
||||||
|
}
|
||||||
return v
|
return v
|
||||||
})))
|
}), isTranslation))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if err !== undefined}
|
{#if err !== undefined}
|
||||||
<span class="alert">{err}</span>
|
<span class="alert">{err}</span>
|
||||||
{JSON.stringify(schema)}
|
|
||||||
{:else}
|
{:else}
|
||||||
<div>
|
<div>
|
||||||
<TagRenderingEditable {config} selectedElement={undefined} showQuestionIfUnknown={true} {state} {tags}/>
|
<TagRenderingEditable {config} selectedElement={undefined} showQuestionIfUnknown={true} {state} {tags}/>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type {ConfigMeta} from "./configMeta";
|
import type { ConfigMeta } from "./configMeta";
|
||||||
import SchemaBasedField from "./SchemaBasedField.svelte";
|
import SchemaBasedField from "./SchemaBasedField.svelte";
|
||||||
import EditLayerState from "./EditLayerState";
|
import EditLayerState from "./EditLayerState";
|
||||||
import SchemaBasedArray from "./SchemaBasedArray.svelte";
|
import SchemaBasedArray from "./SchemaBasedArray.svelte";
|
||||||
import SchemaBaseMultiType from "./SchemaBaseMultiType.svelte";
|
import SchemaBaseMultiType from "./SchemaBaseMultiType.svelte";
|
||||||
import RegisteredTagInput from "./RegisteredTagInput.svelte";
|
import RegisteredTagInput from "./RegisteredTagInput.svelte";
|
||||||
|
import SchemaBasedTranslationInput from "./SchemaBasedTranslationInput.svelte";
|
||||||
|
|
||||||
export let schema: ConfigMeta
|
export let schema: ConfigMeta
|
||||||
export let state: EditLayerState
|
export let state: EditLayerState
|
||||||
|
@ -17,6 +18,8 @@
|
||||||
<SchemaBasedArray {path} {state} {schema}/>
|
<SchemaBasedArray {path} {state} {schema}/>
|
||||||
{:else if schema.hints.typehint === "tag"}
|
{:else if schema.hints.typehint === "tag"}
|
||||||
<RegisteredTagInput {state} {path} {schema}/>
|
<RegisteredTagInput {state} {path} {schema}/>
|
||||||
|
{:else if schema.type === "translation"}
|
||||||
|
<SchemaBasedTranslationInput {path} {state} {schema}/>
|
||||||
{:else if schema.hints.types}
|
{:else if schema.hints.types}
|
||||||
<SchemaBaseMultiType {path} {state} {schema}/>
|
<SchemaBaseMultiType {path} {state} {schema}/>
|
||||||
{:else}
|
{:else}
|
||||||
|
|
16
UI/Studio/SchemaBasedTranslationInput.svelte
Normal file
16
UI/Studio/SchemaBasedTranslationInput.svelte
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import EditLayerState from "./EditLayerState";
|
||||||
|
import type { ConfigMeta } from "./configMeta";
|
||||||
|
import { UIEventSource } from "../../Logic/UIEventSource";
|
||||||
|
import TranslationInput from "../InputElement/Helpers/TranslationInput.svelte";
|
||||||
|
|
||||||
|
export let state: EditLayerState;
|
||||||
|
export let path: (string | number)[] = [];
|
||||||
|
export let schema: ConfigMeta;
|
||||||
|
|
||||||
|
let value = new UIEventSource<string>("{}");
|
||||||
|
console.log("Registering translation to path", path)
|
||||||
|
state.register(path, value.mapD(v => JSON.parse(value.data )));
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<TranslationInput {value} />
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -546,48 +546,14 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"description": "A list of labels. These are strings that are used for various purposes, e.g. to filter them away"
|
"description": "A list of labels. These are strings that are used for various purposes, e.g. to filter them away"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": [
|
|
||||||
"classes"
|
|
||||||
],
|
|
||||||
"required": false,
|
|
||||||
"hints": {},
|
|
||||||
"type": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": [
|
|
||||||
"description"
|
|
||||||
],
|
|
||||||
"required": false,
|
|
||||||
"hints": {},
|
|
||||||
"type": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
"render"
|
"render"
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {
|
"hints": {
|
||||||
"typehint": "rendered"
|
"typehint": "rendered",
|
||||||
|
"question": "What text should be rendered?"
|
||||||
},
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
|
@ -623,14 +589,16 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`"
|
"description": "\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
"condition"
|
"condition"
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {},
|
"hints": {
|
||||||
|
"question": "When should this item be shown?"
|
||||||
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -642,7 +610,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```"
|
"description": "\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
|
@ -715,7 +683,9 @@
|
||||||
"metacondition"
|
"metacondition"
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {},
|
"hints": {
|
||||||
|
"question": "When should this item be shown (including special conditions)?"
|
||||||
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -727,7 +697,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_"
|
"description": "\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
|
@ -794,5 +764,32 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n"
|
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": [
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"required": false,
|
||||||
|
"hints": {},
|
||||||
|
"type": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": [
|
||||||
|
"classes"
|
||||||
|
],
|
||||||
|
"required": false,
|
||||||
|
"hints": {
|
||||||
|
"question": "What css-classes should be applied to showing this attribute?"
|
||||||
|
},
|
||||||
|
"type": "string",
|
||||||
|
"description": "\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)"
|
||||||
}
|
}
|
||||||
]
|
]
|
|
@ -6,48 +6,14 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one"
|
"description": "A TagRenderingConfigJson is a single piece of code which converts one ore more tags into a HTML-snippet.\nFor an _editable_ tagRendering, use 'QuestionableTagRenderingConfigJson' instead, which extends this one"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": [
|
|
||||||
"classes"
|
|
||||||
],
|
|
||||||
"required": false,
|
|
||||||
"hints": {},
|
|
||||||
"type": [
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A list of css-classes to apply to the entire tagRendering if the answer is known (not applied on the question).\nThis is only for advanced users"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": [
|
|
||||||
"description"
|
|
||||||
],
|
|
||||||
"required": false,
|
|
||||||
"hints": {},
|
|
||||||
"type": [
|
|
||||||
{
|
|
||||||
"$ref": "#/definitions/Record<string,string>"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
"render"
|
"render"
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {
|
"hints": {
|
||||||
"typehint": "rendered"
|
"typehint": "rendered",
|
||||||
|
"question": "What text should be rendered?"
|
||||||
},
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
|
@ -83,14 +49,16 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Renders this value. Note that \"{key}\"-parts are substituted by the corresponding values of the element.\nIf neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value.\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`"
|
"description": "\nThis piece of text will be shown in the infobox.\nNote that \"{key}\"-parts are substituted by the corresponding values of the element.\n\nThis text will be shown if:\n- there is no mapping which matches (or there are no matches)\n- no question, no mappings and no 'freeform' is set\n\nNote that this is a HTML-interpreted value, so you can add links as e.g. '<a href='{website}'>{website}</a>' or include images such as `This is of type A <br><img src='typeA-icon.svg' />`"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
"condition"
|
"condition"
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {},
|
"hints": {
|
||||||
|
"question": "When should this item be shown?"
|
||||||
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -102,7 +70,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Only show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```"
|
"description": "\nOnly show this tagrendering (or ask the question) if the selected object also matches the tags specified as `condition`.\n\nThis is useful to ask a follow-up question.\nFor example, within toilets, asking _where_ the diaper changing table is is only useful _if_ there is one.\nThis can be done by adding `\"condition\": \"changing_table=yes\"`\n\nA full example would be:\n```json\n {\n \"question\": \"Where is the changing table located?\",\n \"render\": \"The changing table is located at {changing_table:location}\",\n \"condition\": \"changing_table=yes\",\n \"freeform\": {\n \"key\": \"changing_table:location\",\n \"inline\": true\n },\n \"mappings\": [\n {\n \"then\": \"The changing table is in the toilet for women.\",\n \"if\": \"changing_table:location=female_toilet\"\n },\n {\n \"then\": \"The changing table is in the toilet for men.\",\n \"if\": \"changing_table:location=male_toilet\"\n },\n {\n \"if\": \"changing_table:location=wheelchair_toilet\",\n \"then\": \"The changing table is in the toilet for wheelchair users.\",\n },\n {\n \"if\": \"changing_table:location=dedicated_room\",\n \"then\": \"The changing table is in a dedicated room. \",\n }\n ],\n \"id\": \"toilet-changing_table:location\"\n },\n```"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
|
@ -175,7 +143,9 @@
|
||||||
"metacondition"
|
"metacondition"
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {},
|
"hints": {
|
||||||
|
"question": "When should this item be shown (including special conditions)?"
|
||||||
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
"$ref": "#/definitions/{and:TagConfigJson[];}"
|
||||||
|
@ -187,7 +157,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "If set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_"
|
"description": "\nIf set, this tag will be evaluated agains the _usersettings/application state_ table.\nEnable 'show debug info' in user settings to see available options.\nNote that values with an underscore depicts _application state_ (including metainfo about the user) whereas values without an underscore depict _user settings_"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
|
@ -323,7 +293,8 @@
|
||||||
],
|
],
|
||||||
"required": true,
|
"required": true,
|
||||||
"hints": {
|
"hints": {
|
||||||
"typehint": "rendered"
|
"typehint": "rendered",
|
||||||
|
"question": "What text should be shown?"
|
||||||
},
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
|
@ -333,7 +304,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "If the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option"
|
"description": "\nIf the condition `if` is met, the text `then` will be rendered.\nIf not known yet, the user will be presented with `then` as an option"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": [
|
"path": [
|
||||||
|
@ -342,7 +313,8 @@
|
||||||
],
|
],
|
||||||
"required": false,
|
"required": false,
|
||||||
"hints": {
|
"hints": {
|
||||||
"typehint": "icon"
|
"typehint": "icon",
|
||||||
|
"question": "What icon should be added to this mapping?"
|
||||||
},
|
},
|
||||||
"type": [
|
"type": [
|
||||||
{
|
{
|
||||||
|
@ -390,5 +362,32 @@
|
||||||
"hints": {},
|
"hints": {},
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-<classtype>', so defining your own in combination with a custom CSS is possible (but discouraged)"
|
"description": "A hint to mapcomplete on how to render this icon within the mapping.\nThis is translated to 'mapping-icon-<classtype>', so defining your own in combination with a custom CSS is possible (but discouraged)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": [
|
||||||
|
"description"
|
||||||
|
],
|
||||||
|
"required": false,
|
||||||
|
"hints": {},
|
||||||
|
"type": [
|
||||||
|
{
|
||||||
|
"$ref": "#/definitions/Record<string,string>"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A human-readable text explaining what this tagRendering does.\nMostly used for the shared tagrenderings"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": [
|
||||||
|
"classes"
|
||||||
|
],
|
||||||
|
"required": false,
|
||||||
|
"hints": {
|
||||||
|
"question": "What css-classes should be applied to showing this attribute?"
|
||||||
|
},
|
||||||
|
"type": "string",
|
||||||
|
"description": "\nA list of css-classes to apply to the entire tagRendering.\nThese classes are applied in 'answer'-mode, not in question mode\nThis is only for advanced users.\n\nValues are split on ` ` (space)"
|
||||||
}
|
}
|
||||||
]
|
]
|
|
@ -32,6 +32,7 @@
|
||||||
"query:licenses": "vite-node scripts/generateLicenseInfo.ts -- --query",
|
"query:licenses": "vite-node scripts/generateLicenseInfo.ts -- --query",
|
||||||
"generate:contributor-list": "vite-node scripts/generateContributors.ts",
|
"generate:contributor-list": "vite-node scripts/generateContributors.ts",
|
||||||
"generate:schemas": "ts2json-schema -p Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && vite-node scripts/fixSchemas.ts ",
|
"generate:schemas": "ts2json-schema -p Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && vite-node scripts/fixSchemas.ts ",
|
||||||
|
"watch:schemas": "cd Models/ThemeConfig/Json & ls | entr -s 'npm run generate:schemas' ",
|
||||||
"generate:service-worker": "tsc service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js",
|
"generate:service-worker": "tsc service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js",
|
||||||
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
|
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
|
||||||
"generate:stats": "vite-node scripts/GenerateSeries.ts",
|
"generate:stats": "vite-node scripts/GenerateSeries.ts",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue