forked from MapComplete/MapComplete
		
	Add a download button, improve share functionality for custom themes
This commit is contained in:
		
							parent
							
								
									303ccfa322
								
							
						
					
					
						commit
						6ad64e3f70
					
				
					 10 changed files with 64 additions and 40 deletions
				
			
		|  | @ -68,7 +68,7 @@ class ValidateTheme extends DesugaringStep<LayoutConfigJson> { | |||
|         const warnings = [] | ||||
|         const information = [] | ||||
| 
 | ||||
|         const theme = new LayoutConfig(json, true, "test") | ||||
|         const theme = new LayoutConfig(json, true) | ||||
| 
 | ||||
|         { | ||||
|             // Legacy format checks  
 | ||||
|  |  | |||
|  | @ -56,9 +56,17 @@ export default class LayoutConfig { | |||
|     public readonly usedImages: string[] | ||||
|     public readonly extraLink?: ExtraLinkConfig | ||||
|      | ||||
|     constructor(json: LayoutConfigJson, official = true, context?: string) { | ||||
|     public readonly definedAtUrl? : string; | ||||
|     public readonly definitionRaw?: string; | ||||
|      | ||||
|     constructor(json: LayoutConfigJson, official = true,options?: { | ||||
|         definedAtUrl?: string, | ||||
|         definitionRaw?: string | ||||
|     }) { | ||||
|         this.official = official; | ||||
|         this.id = json.id; | ||||
|         this.definedAtUrl = options?.definedAtUrl | ||||
|         this.definitionRaw = options?.definitionRaw | ||||
|         if (official) { | ||||
|             if (json.id.toLowerCase() !== json.id) { | ||||
|                 throw "The id of a theme should be lowercase: " + json.id | ||||
|  | @ -67,11 +75,7 @@ export default class LayoutConfig { | |||
|                 throw "The id of a theme should match [a-z0-9-_]*: " + json.id | ||||
|             } | ||||
|         } | ||||
|         if(context === undefined){ | ||||
|             context = this.id | ||||
|         }else{ | ||||
|             context = context + "." + this.id; | ||||
|         } | ||||
|          const   context = this.id | ||||
|         this.maintainer = json.maintainer; | ||||
|         this.credits = json.credits; | ||||
|         this.version = json.version; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue