-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy patheditor.js
More file actions
28 lines (24 loc) · 839 Bytes
/
editor.js
File metadata and controls
28 lines (24 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$(document).on('turbo-migration:load', function(event) {
//Merge all editor components.
$.extend(
CodeOceanEditor,
CodeOceanEditorAJAX,
CodeOceanEditorEvaluation,
CodeOceanEditorFlowr,
CodeOceanEditorSubmissions,
CodeOceanEditorTurtle,
CodeOceanEditorWebsocket,
CodeOceanEditorPrompt,
CodeOceanEditorRequestForComments
);
if ($('#editor').isPresent() && CodeOceanEditor && event.detail.url.includes("/implement")) {
CodeOceanEditor.initializeEverything();
}
});
function handleThemeChangeEvent(event) {
if (CodeOceanEditor) {
CodeOceanEditor.THEME = event.detail.currentTheme === 'dark' ? 'ace/theme/tomorrow_night' : 'ace/theme/tomorrow';
document.dispatchEvent(new Event('theme:change:ace'));
}
}
$(document).on('theme:change', handleThemeChangeEvent);