From de3d574804637c5f99e0993c0d4750c218fde07c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 19 Mar 2018 22:01:53 -0400 Subject: do page layout with golden-layout --- public-src/main.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 4 deletions(-) (limited to 'public-src/main.js') diff --git a/public-src/main.js b/public-src/main.js index ebb09a9..0979000 100644 --- a/public-src/main.js +++ b/public-src/main.js @@ -1,5 +1,56 @@ define([ - //'jquerytools/dateinput', - 'cfg/jarmon-winston', - 'cfg/jarmon-proton', -], {}); + 'golden-layout', + 'jarmon', + './cfg/jarmon-proton.js', + './cfg/jarmon-winston.js', + './components/gl/jarmon-tabbed-chart-ui.js', + './components/gl/html.js', +], function( + GoldenLayout, + jarmon, + cfgProton, + cfgWinston, + glJarmon, + glHTML, +) { + jQuery.migrateMute = true; + + // set the default plot range + for (var i = 0; i < jarmon.timeRangeShortcuts.length; i++) { + if (jarmon.timeRangeShortcuts[i][0] === 'last day') { + jarmon.timeRangeShortcuts[i][2] = true; + } + } + + var layoutManager = new GoldenLayout({ + settings: { + }, + content: [{ + type: 'row', + content: [ + { + title: 'proton', + type: 'component', + componentName: 'jarmon:tabbed-chart-ui', + componentState: cfgProton, + }, + { + title: 'winston', + type: 'component', + componentName: 'jarmon:tabbed-chart-ui', + componentState: cfgWinston, + }, + { + title: 'TLS', + type: 'component', + componentName: 'html', + componentState: document.getElementById("tls").innerHTML, + }, + ], + }], + }, document.body); + layoutManager.registerComponent('jarmon:tabbed-chart-ui', glJarmon); + layoutManager.registerComponent('html', glHTML); + + layoutManager.init(); +}); -- cgit v1.2.3