mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 17:57:31 -06:00
Some config tweaks
This commit is contained in:
+23
-13
@@ -35,26 +35,36 @@ define(function (require) {
|
||||
$('.language-name').text(options.language);
|
||||
var safeLang = options.language.toLowerCase().replace(/[^a-z_]+/g, '');
|
||||
var defaultSrc = $('.template.lang.' + safeLang).text().trim();
|
||||
var config = {
|
||||
var defaultConfig = {
|
||||
content: [{
|
||||
type: 'row',
|
||||
content: [{
|
||||
type: 'component',
|
||||
componentName: 'codeEditor',
|
||||
componentState: {}
|
||||
}, {
|
||||
type: 'component',
|
||||
componentName: 'compilerOutput',
|
||||
componentState: {}
|
||||
}]
|
||||
content: [
|
||||
{
|
||||
type: 'component',
|
||||
componentName: 'codeEditor',
|
||||
componentState: {}
|
||||
},
|
||||
{
|
||||
type: 'column', content: [
|
||||
{
|
||||
type: 'component',
|
||||
componentName: 'compilerOutput',
|
||||
componentState: {}
|
||||
},
|
||||
{
|
||||
type: 'component',
|
||||
componentName: 'compilerOutput',
|
||||
componentState: {}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}]
|
||||
};
|
||||
var root = $("#root");
|
||||
// TODO: find old storage and convert
|
||||
var savedState = localStorage.getItem('gl');
|
||||
if (savedState !== null) {
|
||||
config = JSON.parse(savedState);
|
||||
}
|
||||
var config = savedState !== null ? JSON.parse(savedState) : defaultConfig;
|
||||
|
||||
var layout = new GoldenLayout(config, root);
|
||||
layout.on('stateChanged', function () {
|
||||
|
||||
Reference in New Issue
Block a user