Skip to content

Commit 5209d96

Browse files
Fix import of HTML in JS Programming tab
1 parent 4618245 commit 5209d96

File tree

1 file changed

+33
-32
lines changed

1 file changed

+33
-32
lines changed

tabs/javascript_programming.js

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,41 @@ TABS.javascript_programming = {
3939
GUI.active_tab = 'javascript_programming';
4040
}
4141

42-
$('#content').load("./tabs/javascript_programming.html", function () {
42+
import('./javascript_programming.html?raw').then(({default: html}) => {
43+
GUI.load(html, () => {
44+
45+
self.initTranspiler();
46+
47+
MonacoLoader.loadMonacoEditor()
48+
.then(function(monaco) {
49+
// Initialize editor with INAV configuration
50+
self.editor = MonacoLoader.initializeMonacoEditor(monaco, 'monaco-editor');
51+
52+
// Add INAV type definitions
53+
MonacoLoader.addINAVTypeDefinitions(monaco);
54+
55+
// Set up linting
56+
MonacoLoader.setupLinting(self.editor, function() {
57+
if (self.lintCode) {
58+
self.lintCode();
59+
}
60+
});
61+
62+
// Continue with initialization
63+
self.setupEventHandlers();
64+
self.loadExamples();
65+
66+
self.loadFromFC(function() {
67+
self.isDirty = false;
68+
GUI.content_ready(callback);
69+
});
70+
})
71+
.catch(function(error) {
72+
console.error('Failed to load Monaco Editor:', error);
73+
GUI.content_ready(callback);
74+
});
4375

44-
self.initTranspiler();
45-
46-
MonacoLoader.loadMonacoEditor()
47-
.then(function(monaco) {
48-
// Initialize editor with INAV configuration
49-
self.editor = MonacoLoader.initializeMonacoEditor(monaco, 'monaco-editor');
50-
51-
// Add INAV type definitions
52-
MonacoLoader.addINAVTypeDefinitions(monaco);
53-
54-
// Set up linting
55-
MonacoLoader.setupLinting(self.editor, function() {
56-
if (self.lintCode) {
57-
self.lintCode();
58-
}
59-
});
60-
61-
// Continue with initialization
62-
self.setupEventHandlers();
63-
self.loadExamples();
64-
65-
self.loadFromFC(function() {
66-
self.isDirty = false;
67-
GUI.content_ready(callback);
68-
});
69-
})
70-
.catch(function(error) {
71-
console.error('Failed to load Monaco Editor:', error);
72-
GUI.content_ready(callback);
7376
});
74-
75-
7677
});
7778
},
7879

0 commit comments

Comments
 (0)