diff options
| author | stonedDiscord <stoned@derpymail.org> | 2019-07-16 18:19:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-16 18:19:40 +0200 |
| commit | b0394289a591417ed2300b076da205b3fa03750d (patch) | |
| tree | 6dd502e5d7e09123f3f107d820ec176782a8b6a0 /webAO/ui.js | |
| parent | 93a4462c3c2f333f9bc54296847d628d6d46bdb1 (diff) | |
| parent | c4c754944c209fc365e04aa17e6bd3a73c504e26 (diff) | |
Merge pull request #4 from AttorneyOnline/master
i'm sure there is a way to do this correctly
Diffstat (limited to 'webAO/ui.js')
| -rw-r--r-- | webAO/ui.js | 153 |
1 files changed, 66 insertions, 87 deletions
diff --git a/webAO/ui.js b/webAO/ui.js index f5c3f3a..b44b425 100644 --- a/webAO/ui.js +++ b/webAO/ui.js @@ -1,96 +1,75 @@ -import GoldenLayout from "./golden/js/goldenlayout.js"; +/* eslint indent: ["error", 2] */ -var config = { - settings: { - showPopoutIcon: false, - showCloseIcon: false - }, - dimensions: { - minItemHeight: 40 +// import GoldenLayout from "./golden/js/goldenlayout.js"; +import GoldenLayout from "golden-layout"; + +const 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" } + }] }, - content: [ { + type: "column", + 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" } - } - ] - } - ] - } - ] - } - ] + height: 65, + content: [{ + type: "stack", + content: [{ + type: "component", + title: "Main", + componentName: "template", + componentState: { id: "mainmenu" } + }, + { + type: "component", + title: "Log", + componentName: "template", + componentState: { id: "log" } + }] + }, + { + type: "component", + title: "Music", + width: 30, + componentName: "template", + componentState: { id: "music" } + }] + }, + { + type: "row", + content: [{ + type: "component", + title: "Server chat", + componentName: "template", + componentState: { id: "ooc" } + }] + }] }] + }] }; -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")); +const golden = new GoldenLayout(config); +golden.registerComponent("template", function (container, componentState) { + const 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();
\ No newline at end of file |
