diff options
Diffstat (limited to 'org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/script.js')
-rw-r--r-- | org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/script.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/script.js b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/script.js new file mode 100644 index 00000000..fcaca4a4 --- /dev/null +++ b/org.eclipse.viatra.solver.language.parent/org.eclipse.viatra.solver.language.web/src/main/webapp/script.js | |||
@@ -0,0 +1,20 @@ | |||
1 | var baseUrl = window.location.pathname; | ||
2 | var fileIndex = baseUrl.indexOf("index.html"); | ||
3 | if (fileIndex > 0) | ||
4 | baseUrl = baseUrl.slice(0, fileIndex) | ||
5 | require.config({ | ||
6 | baseUrl: baseUrl, | ||
7 | paths: { | ||
8 | "text": "webjars/requirejs-text/2.26.0.M1/text", | ||
9 | "jquery": "webjars/jquery/3.6.0/jquery.min", | ||
10 | "xtext/xtext-codemirror": "xtext/2.26.0.M1/xtext-codemirror", | ||
11 | }, | ||
12 | packages: [{ | ||
13 | name: "codemirror", | ||
14 | location: "webjars/codemirror/5.41.0", | ||
15 | main: "lib/codemirror" | ||
16 | }] | ||
17 | }); | ||
18 | require(["xtext-resources/generated/mode-problem", "xtext/xtext-codemirror"], function(mode, xtext) { | ||
19 | window.xtextEditor = xtext.createEditor({baseUrl: baseUrl,}); | ||
20 | }); | ||