forked from MapComplete/MapComplete
Styling tweaks
This commit is contained in:
parent
c941f567cf
commit
7f63a88e9a
4 changed files with 145 additions and 14 deletions
66
Docs/Schemas/ExtraLinkConfigJson.schema.json
Normal file
66
Docs/Schemas/ExtraLinkConfigJson.schema.json
Normal file
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"text": {},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
"newTab": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"iframe",
|
||||
"no-iframe",
|
||||
"no-welcome-message",
|
||||
"welcome-message"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"href"
|
||||
],
|
||||
"definitions": {
|
||||
"AndOrTagConfigJson": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"and": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AndOrTagConfigJson"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"or": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AndOrTagConfigJson"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"additionalProperties": false
|
||||
}
|
64
Docs/Schemas/ExtraLinkConfigJsonJSC.ts
Normal file
64
Docs/Schemas/ExtraLinkConfigJsonJSC.ts
Normal file
|
@ -0,0 +1,64 @@
|
|||
export default {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"text": {},
|
||||
"href": {
|
||||
"type": "string"
|
||||
},
|
||||
"newTab": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"requirements": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"iframe",
|
||||
"no-iframe",
|
||||
"no-welcome-message",
|
||||
"welcome-message"
|
||||
],
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"href"
|
||||
],
|
||||
"definitions": {
|
||||
"AndOrTagConfigJson": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"and": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AndOrTagConfigJson"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"or": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/AndOrTagConfigJson"
|
||||
},
|
||||
{
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"$schema": "http://json-schema.org/draft-07/schema#"
|
||||
}
|
|
@ -64,7 +64,7 @@ export default class ExtraLinkButton extends UIElement{
|
|||
|
||||
link = new SubtleButton(img,c.text, {url:
|
||||
href,
|
||||
newTab: c.newTab}).SetClass("w-64 block")
|
||||
newTab: c.newTab})
|
||||
}
|
||||
|
||||
if(c.requirements.has("no-welcome-message")){
|
||||
|
|
|
@ -159,24 +159,25 @@ export default class DefaultGUI {
|
|||
const guiState = this._guiState;
|
||||
|
||||
const self = this
|
||||
Toggle.If(state.featureSwitchUserbadge,
|
||||
() => new UserBadge(state)
|
||||
).AttachTo("userbadge")
|
||||
new Combine([
|
||||
Toggle.If(state.featureSwitchUserbadge,
|
||||
() => new UserBadge(state)
|
||||
),
|
||||
Toggle.If(state.featureSwitchExtraLinkEnabled,
|
||||
() => new ExtraLinkButton(state, state.layoutToUse.extraLink)
|
||||
)
|
||||
]).SetClass("flex flex-col")
|
||||
.AttachTo("userbadge")
|
||||
|
||||
Toggle.If(state.featureSwitchSearch,
|
||||
() => new SearchAndGo(state))
|
||||
.AttachTo("searchbox");
|
||||
|
||||
new Combine([
|
||||
Toggle.If(state.featureSwitchExtraLinkEnabled,
|
||||
() => new ExtraLinkButton(state, state.layoutToUse.extraLink).SetClass("pointer-events-auto")
|
||||
)
|
||||
,
|
||||
Toggle.If(
|
||||
state.featureSwitchWelcomeMessage,
|
||||
() => self.InitWelcomeMessage()
|
||||
)])
|
||||
.SetClass("flex flex-col")
|
||||
|
||||
Toggle.If(
|
||||
state.featureSwitchWelcomeMessage,
|
||||
() => self.InitWelcomeMessage()
|
||||
)
|
||||
.AttachTo("messagesbox");
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue