Styling tweaks

This commit is contained in:
pietervdvn 2022-02-14 04:56:34 +01:00
parent c941f567cf
commit 7f63a88e9a
4 changed files with 145 additions and 14 deletions

View 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
}

View 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#"
}

View file

@ -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")){

View file

@ -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");