From 5685e2b1714c8d85e505e9eccee549723773aaab Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Tue, 15 May 2018 21:20:00 -0500 Subject: Move files to webAO folder; GoldenLayout works! --- webAO/ui.js | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 webAO/ui.js (limited to 'webAO/ui.js') diff --git a/webAO/ui.js b/webAO/ui.js new file mode 100644 index 0000000..25e466a --- /dev/null +++ b/webAO/ui.js @@ -0,0 +1,82 @@ +import GoldenLayout from "./golden/js/goldenlayout.js"; + +var config = { + settings: { + showPopoutIcon: false, + showCloseIcon: false + }, + 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: "component", + title: "Settings", + componentName: "template", + componentState: { id: "client_settings" } + } + ] + } + ] + } + ] + }] +}; + +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(); \ No newline at end of file -- cgit From 2f3c66512cae56aa50f705d4669ce64d69e7ad26 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Tue, 15 May 2018 22:21:16 -0500 Subject: Some more layout fixes --- webAO/ui.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'webAO/ui.js') diff --git a/webAO/ui.js b/webAO/ui.js index 25e466a..2d41783 100644 --- a/webAO/ui.js +++ b/webAO/ui.js @@ -5,6 +5,9 @@ var config = { showPopoutIcon: false, showCloseIcon: false }, + dimensions: { + minItemHeight: 40 + }, content: [ { type: "row", -- cgit From 3ac1870877eccf2b8fe40a28bf3807620ac94907 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Tue, 22 May 2018 23:27:59 -0500 Subject: Add "about" tab and set version to 2.1 --- webAO/ui.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'webAO/ui.js') diff --git a/webAO/ui.js b/webAO/ui.js index 2d41783..f5c3f3a 100644 --- a/webAO/ui.js +++ b/webAO/ui.js @@ -62,10 +62,21 @@ var config = { componentState: { id: "music" } }, { - type: "component", - title: "Settings", - componentName: "template", - componentState: { id: "client_settings" } + type: "stack", + content: [ + { + type: "component", + title: "Settings", + componentName: "template", + componentState: { id: "client_settings" } + }, + { + type: "component", + title: "About", + componentName: "template", + componentState: { id: "about" } + } + ] } ] } -- cgit