1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
import GoldenLayout from "./golden/js/goldenlayout.js";
var config = {
settings: {
showPopoutIcon: false,
showCloseIcon: false
},
dimensions: {
minItemHeight: 40
},
content: [
{
type: "row",
content: [
{
type: "column",
width: 40,
content: [
{
type: "component",
componentName: "template",
title: "Game",
componentState: { id: "client_wrapper" }
},
{
type: "component",
title: "Miscellaneous",
height: 5,
componentName: "template",
componentState: { id: "misc" }
},
]
},
{
type: "column",
content: [
{
type: "stack",
height: 60,
content: [
{
type: "component",
title: "Server chat",
componentName: "template",
componentState: { id: "ooc" }
},
{
type: "component",
title: "Log",
componentName: "template",
componentState: { id: "log" }
}
]
},
{
type: "row",
content: [
{
type: "component",
title: "Music",
componentName: "template",
componentState: { id: "music" }
},
{
type: "stack",
content: [
{
type: "component",
title: "Settings",
componentName: "template",
componentState: { id: "client_settings" }
},
{
type: "component",
title: "About",
componentName: "template",
componentState: { id: "about" }
}
]
}
]
}
]
}
]
}]
};
var golden = new GoldenLayout(config);
golden.registerComponent("template", function(container, componentState) {
let template = document.querySelector(`#${componentState.id}`);
container.getElement().html(template.content);
// TODO: support multiple locales
// container.setTitle(document.querySelector(`#${componentState.id} meta[name='frame-title']`).getAttribute("content"));
});
golden.init();
|