Skip to content

Commit 844f17a

Browse files
Update config
1 parent 450e33f commit 844f17a

File tree

2 files changed

+48
-98
lines changed

2 files changed

+48
-98
lines changed

js/configuration.js

Lines changed: 46 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -2,135 +2,85 @@
22
import query from "./query.js";
33
import ls from "./local_storage.js";
44

5+
const DEFAULT_STYLE_OPTIONS = {
6+
showLogo: true,
7+
showFileMenu: true,
8+
showHelpMenu: true,
9+
showSelectLanguage: true,
10+
showCompilerOptions: true,
11+
showCommandLineArguments: true,
12+
showRunButton: true,
13+
showThemeButton: true,
14+
showPuterSignInOutButton: true,
15+
showStatusLine: true,
16+
showCopyright: true,
17+
showNavigation: true
18+
};
19+
20+
const DEFAULT_APP_OPTIONS = {
21+
showAIAssistant: true,
22+
ioLayout: "stack",
23+
assistantLayout: "column",
24+
mainLayout: "row",
25+
showInput: true,
26+
showOutput: true,
27+
apiKey: ""
28+
};
29+
30+
const DEFAULT_CONFIGURATION = {
31+
theme: "system",
32+
style: "default",
33+
styleOptions: DEFAULT_STYLE_OPTIONS,
34+
appOptions: DEFAULT_APP_OPTIONS
35+
};
36+
537
const DEFAULT_CONFIGURATIONS = {
6-
default: {
7-
theme: "system",
8-
style: "default",
9-
styleOptions: {
10-
showLogo: true,
11-
showFileMenu: true,
12-
showHelpMenu: true,
13-
showSelectLanguage: true,
14-
showCompilerOptions: true,
15-
showCommandLineArguments: true,
16-
showRunButton: true,
17-
showThemeButton: true,
18-
showPuterSignInOutButton: true,
19-
showStatusLine: true,
20-
showCopyright: true,
21-
showNavigation: true
22-
},
23-
appOptions: {
24-
showAIAssistant: true,
25-
ioLayout: "stack",
26-
assistantLayout: "column",
27-
mainLayout: "row",
28-
showInput: true,
29-
showOutput: true
30-
}
31-
},
38+
default: DEFAULT_CONFIGURATION,
3239
minimal: {
33-
theme: "system",
40+
...DEFAULT_CONFIGURATION,
3441
style: "minimal",
3542
styleOptions: {
43+
...DEFAULT_STYLE_OPTIONS,
3644
showLogo: false,
3745
showFileMenu: false,
3846
showHelpMenu: false,
39-
showSelectLanguage: true,
4047
showCompilerOptions: false,
4148
showCommandLineArguments: false,
42-
showRunButton: true,
4349
showThemeButton: false,
4450
showPuterSignInOutButton: false,
4551
showStatusLine: false,
46-
showCopyright: false,
47-
showNavigation: true
52+
showCopyright: false
4853
},
4954
appOptions: {
55+
...DEFAULT_APP_OPTIONS,
5056
showAIAssistant: false,
5157
ioLayout: "column",
52-
assistantLayout: "column",
53-
mainLayout: "row",
54-
showInput: true,
55-
showOutput: true
5658
}
5759
},
5860
standalone: {
59-
theme: "system",
61+
...DEFAULT_CONFIGURATION,
6062
style: "standalone",
6163
styleOptions: {
64+
...DEFAULT_STYLE_OPTIONS,
6265
showLogo: false,
63-
showFileMenu: true,
64-
showHelpMenu: true,
65-
showSelectLanguage: true,
66-
showCompilerOptions: true,
67-
showCommandLineArguments: true,
68-
showRunButton: true,
69-
showThemeButton: true,
70-
showPuterSignInOutButton: true,
71-
showStatusLine: true,
72-
showCopyright: false,
73-
showNavigation: true
74-
},
75-
appOptions: {
76-
showAIAssistant: true,
77-
ioLayout: "stack",
78-
assistantLayout: "column",
79-
mainLayout: "row",
80-
showInput: true,
81-
showOutput: true
66+
showCopyright: false
8267
}
8368
},
8469
electron: {
85-
theme: "system",
70+
...DEFAULT_CONFIGURATION,
8671
style: "electron",
8772
styleOptions: {
73+
...DEFAULT_STYLE_OPTIONS,
8874
showLogo: false,
89-
showFileMenu: true,
90-
showHelpMenu: true,
91-
showSelectLanguage: true,
92-
showCompilerOptions: true,
93-
showCommandLineArguments: true,
94-
showRunButton: true,
95-
showThemeButton: true,
96-
showPuterSignInOutButton: true,
97-
showStatusLine: true,
98-
showCopyright: false,
99-
showNavigation: true
100-
},
101-
appOptions: {
102-
showAIAssistant: true,
103-
ioLayout: "stack",
104-
assistantLayout: "column",
105-
mainLayout: "row",
106-
showInput: true,
107-
showOutput: true
75+
showCopyright: false
10876
}
10977
},
11078
puter: {
111-
theme: "system",
79+
...DEFAULT_CONFIGURATION,
11280
style: "puter",
11381
styleOptions: {
114-
showLogo: false,
115-
showFileMenu: true,
116-
showHelpMenu: true,
117-
showSelectLanguage: true,
118-
showCompilerOptions: true,
119-
showCommandLineArguments: true,
120-
showRunButton: true,
121-
showThemeButton: true,
122-
showPuterSignInOutButton: false,
123-
showStatusLine: true,
124-
showCopyright: true,
125-
showNavigation: true
126-
},
127-
appOptions: {
128-
showAIAssistant: true,
129-
ioLayout: "stack",
130-
assistantLayout: "column",
131-
mainLayout: "row",
132-
showInput: true,
133-
showOutput: true
82+
...DEFAULT_STYLE_OPTIONS,
83+
showLogo: false
13484
}
13585
}
13686
};

js/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ const style = {
1111
const showOption = config.styleOptions[styleOption];
1212
if (showOption) {
1313
document.querySelectorAll(`.judge0-${styleOption}`).forEach(e => {
14-
e.classList.remove("hidden");
14+
e.classList.remove("judge0-hidden");
1515
});
1616
} else {
1717
document.querySelectorAll(`.judge0-${styleOption}`).forEach(e => {
18-
e.classList.add("hidden");
18+
e.classList.add("judge0-hidden");
1919
});
2020
}
2121
});

0 commit comments

Comments
 (0)