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:
 | 
					            link = new SubtleButton(img,c.text, {url:
 | 
				
			||||||
                href,
 | 
					                href,
 | 
				
			||||||
                newTab: c.newTab}).SetClass("w-64 block")
 | 
					                newTab: c.newTab})
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        if(c.requirements.has("no-welcome-message")){
 | 
					        if(c.requirements.has("no-welcome-message")){
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,24 +159,25 @@ export default class DefaultGUI {
 | 
				
			||||||
        const guiState = this._guiState;
 | 
					        const guiState = this._guiState;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const self = this
 | 
					        const self = this
 | 
				
			||||||
 | 
					        new Combine([
 | 
				
			||||||
            Toggle.If(state.featureSwitchUserbadge,
 | 
					            Toggle.If(state.featureSwitchUserbadge,
 | 
				
			||||||
                () => new UserBadge(state)
 | 
					                () => new UserBadge(state)
 | 
				
			||||||
        ).AttachTo("userbadge")
 | 
					            ),
 | 
				
			||||||
 | 
					            Toggle.If(state.featureSwitchExtraLinkEnabled,
 | 
				
			||||||
 | 
					                () => new ExtraLinkButton(state, state.layoutToUse.extraLink)
 | 
				
			||||||
 | 
					            )
 | 
				
			||||||
 | 
					        ]).SetClass("flex flex-col")
 | 
				
			||||||
 | 
					            .AttachTo("userbadge")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Toggle.If(state.featureSwitchSearch,
 | 
					        Toggle.If(state.featureSwitchSearch,
 | 
				
			||||||
            () => new SearchAndGo(state))
 | 
					            () => new SearchAndGo(state))
 | 
				
			||||||
            .AttachTo("searchbox");
 | 
					            .AttachTo("searchbox");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        new Combine([
 | 
					
 | 
				
			||||||
            Toggle.If(state.featureSwitchExtraLinkEnabled,
 | 
					 | 
				
			||||||
                () => new ExtraLinkButton(state, state.layoutToUse.extraLink).SetClass("pointer-events-auto")
 | 
					 | 
				
			||||||
                )
 | 
					 | 
				
			||||||
            ,
 | 
					 | 
				
			||||||
        Toggle.If(
 | 
					        Toggle.If(
 | 
				
			||||||
            state.featureSwitchWelcomeMessage,
 | 
					            state.featureSwitchWelcomeMessage,
 | 
				
			||||||
            () => self.InitWelcomeMessage()
 | 
					            () => self.InitWelcomeMessage()
 | 
				
			||||||
            )])
 | 
					        )
 | 
				
			||||||
            .SetClass("flex flex-col")
 | 
					 | 
				
			||||||
            .AttachTo("messagesbox");
 | 
					            .AttachTo("messagesbox");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue