mapcomplete/Docs/Schemas/ExtraLinkConfigJson.schema.json

107 lines
3 KiB
JSON
Raw Normal View History

2022-02-14 04:56:34 +01:00
{
"type": "object",
"properties": {
"icon": {
2023-10-30 13:45:44 +01:00
"description": "question: What icon should be shown in the link button?\nifunset: do not show an icon\ntype: icon",
2022-02-14 04:56:34 +01:00
"type": "string"
},
2023-10-30 13:45:44 +01:00
"text": {
"description": "question: What text should be shown in the link icon?\n\nNote that {lat},{lon},{zoom}, {language} and {theme} will be replaced\n\nifunset: do not show a text",
"anyOf": [
{
"$ref": "#/definitions/Record<string,string>"
},
{
"type": "string"
}
]
},
2022-02-14 04:56:34 +01:00
"href": {
2023-10-30 13:45:44 +01:00
"description": "question: if clicked, what webpage should open?\nNote that {lat},{lon},{zoom}, {language} and {theme} will be replaced\n\ntype: url",
2022-02-14 04:56:34 +01:00
"type": "string"
},
"newTab": {
2023-10-30 13:45:44 +01:00
"description": "question: Should the link open in a new tab?\niftrue: Open in a new tab\niffalse: do not open in a new tab\nifunset: do not open in a new tab",
2022-02-14 04:56:34 +01:00
"type": "boolean"
},
"requirements": {
2023-10-30 13:45:44 +01:00
"description": "question: When should the extra button be shown?\nsuggestions: return [{if: \"value=iframe\", then: \"When shown in an iframe\"}, {if: \"value=no-iframe\", then: \"When shown as stand-alone webpage\"}, {if: \"value=welcome-message\", then: \"When the welcome messages are enabled\"}, {if: \"value=iframe\", then: \"When the welcome messages are disabled\"}]",
2022-02-14 04:56:34 +01:00
"type": "array",
"items": {
"enum": [
"iframe",
"no-iframe",
"no-welcome-message",
"welcome-message"
],
"type": "string"
}
}
},
"required": [
"href"
],
"definitions": {
"TagConfigJson": {
"description": "The main representation of Tags.\nSee https://github.com/pietervdvn/MapComplete/blob/develop/Docs/Tags_format.md for more documentation\n\ntype: tag",
"anyOf": [
{
"$ref": "#/definitions/{and:TagConfigJson[];}"
},
{
"type": "object",
"properties": {
"or": {
"type": "array",
"items": {
"$ref": "#/definitions/TagConfigJson"
}
}
},
"required": [
"or"
]
},
{
"type": "string"
}
]
},
"{and:TagConfigJson[];}": {
2022-02-14 04:56:34 +01:00
"type": "object",
"properties": {
"and": {
"type": "array",
"items": {
"$ref": "#/definitions/TagConfigJson"
2022-02-14 04:56:34 +01:00
}
}
},
"required": [
"and"
],
"additionalProperties": false
},
"{or:TagConfigJson[];}": {
"type": "object",
"properties": {
2022-02-14 04:56:34 +01:00
"or": {
"type": "array",
"items": {
"$ref": "#/definitions/TagConfigJson"
2022-02-14 04:56:34 +01:00
}
}
},
"required": [
"or"
],
2022-02-14 04:56:34 +01:00
"additionalProperties": false
2023-10-30 13:45:44 +01:00
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
2022-02-14 04:56:34 +01:00
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false
}