Wikidata language picker
This commit is contained in:
parent
b75581405e
commit
325e30666b
14 changed files with 335 additions and 213 deletions
|
@ -10,6 +10,7 @@ import Constants from "../Models/Constants";
|
|||
import {Utils} from "../Utils";
|
||||
import Link from "../UI/Base/Link";
|
||||
import {LayoutConfigJson} from "../Models/ThemeConfig/Json/LayoutConfigJson";
|
||||
import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson";
|
||||
|
||||
export class AllKnownLayouts {
|
||||
public static allKnownLayouts: Map<string, LayoutConfig> = AllKnownLayouts.AllLayouts();
|
||||
|
@ -209,9 +210,9 @@ export class AllKnownLayouts {
|
|||
])
|
||||
}
|
||||
|
||||
private static getSharedLayers(): Map<string, LayerConfig> {
|
||||
public static getSharedLayers(): Map<string, LayerConfig> {
|
||||
const sharedLayers = new Map<string, LayerConfig>();
|
||||
for (const layer of known_themes.layers) {
|
||||
for (const layer of known_themes["layers"]) {
|
||||
try {
|
||||
// @ts-ignore
|
||||
const parsed = new LayerConfig(layer, "shared_layers")
|
||||
|
@ -226,6 +227,16 @@ export class AllKnownLayouts {
|
|||
return sharedLayers;
|
||||
}
|
||||
|
||||
public static getSharedLayersConfigs(): Map<string, LayerConfigJson> {
|
||||
const sharedLayers = new Map<string, LayerConfigJson>();
|
||||
for (const layer of known_themes["layers"]) {
|
||||
// @ts-ignore
|
||||
sharedLayers.set(layer.id, layer);
|
||||
}
|
||||
|
||||
return sharedLayers;
|
||||
}
|
||||
|
||||
private static GenerateOrderedList(allKnownLayouts: Map<string, LayoutConfig>): LayoutConfig[] {
|
||||
const list = []
|
||||
allKnownLayouts.forEach((layout) => {
|
||||
|
@ -236,7 +247,7 @@ export class AllKnownLayouts {
|
|||
|
||||
private static AllLayouts(): Map<string, LayoutConfig> {
|
||||
const dict: Map<string, LayoutConfig> = new Map();
|
||||
for (const layoutConfigJson of known_themes.themes) {
|
||||
for (const layoutConfigJson of known_themes["themes"]) {
|
||||
const layout = new LayoutConfig(<LayoutConfigJson>layoutConfigJson, true)
|
||||
dict.set(layout.id, layout)
|
||||
for (let i = 0; i < layout.layers.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue