diff --git a/client/pages/viewerpage/editor.js b/client/pages/viewerpage/editor.js index 3ebd5333b..30a5501b4 100644 --- a/client/pages/viewerpage/editor.js +++ b/client/pages/viewerpage/editor.js @@ -211,6 +211,7 @@ export class EditorClass extends React.Component { else if (ext === "sparql") mode = "sparql"; else if (ext === "properties") mode = "properties"; else if (ext === "c" || ext === "cpp" || ext === "java" || ext === "h") mode = "clike"; + else if (ext === "groovy" || ext === "gvy" || ext === "gy" || ext === "gsh") mode = "groovy"; else mode = "text"; return import(/* webpackChunkName: "editor" */"./editor/"+mode) diff --git a/client/pages/viewerpage/editor/groovy.js b/client/pages/viewerpage/editor/groovy.js new file mode 100644 index 000000000..98c03ec01 --- /dev/null +++ b/client/pages/viewerpage/editor/groovy.js @@ -0,0 +1,3 @@ +import "codemirror/mode/groovy/groovy"; +CodeMirror.__mode = "groovy"; +export default CodeMirror; diff --git a/public/assets/pages/viewerpage/application_editor.js b/public/assets/pages/viewerpage/application_editor.js index 815ff7035..2485220ab 100644 --- a/public/assets/pages/viewerpage/application_editor.js +++ b/public/assets/pages/viewerpage/application_editor.js @@ -266,6 +266,7 @@ function loadMode(ext) { else if (ext === "properties") mode = "properties"; else if (ext === "c" || ext === "cpp" || ext === "h") mode = "clike"; else if (ext === "java") mode = "java"; + else if (ext === "groovy" || ext === "gvy" || ext === "gy" || ext === "gsh") mode = "groovy"; return before.then(() => loadJS(import.meta.url, `./application_editor/${mode}.js`, { type: "module" })) .catch(() => loadJS(import.meta.url, "./application_editor/text.js", { type: "module" })) diff --git a/public/assets/pages/viewerpage/application_editor/groovy.js b/public/assets/pages/viewerpage/application_editor/groovy.js new file mode 100644 index 000000000..146fbf298 --- /dev/null +++ b/public/assets/pages/viewerpage/application_editor/groovy.js @@ -0,0 +1,3 @@ +import "../../../lib/vendor/codemirror/mode/groovy/groovy.js"; +window.CodeMirror.__mode = "groovy"; +export default window.CodeMirror;