|
1 | | -var CodeOceanEditor = { |
| 1 | +import { CodeOceanEditorTips } from './participantsupport'; |
| 2 | + |
| 3 | +const CodeOceanEditor = { |
2 | 4 | THEME: window.getCurrentTheme() === 'dark' ? 'ace/theme/tomorrow_night' : 'ace/theme/tomorrow', |
3 | 5 |
|
4 | 6 | //Color-Encoding for Percentages in Progress Bars (For submissions) |
@@ -28,8 +30,8 @@ var CodeOceanEditor = { |
28 | 30 | lastCopyText: null, |
29 | 31 |
|
30 | 32 | sendEvents: null, |
31 | | - eventURL: Routes.events_path(), |
32 | | - fileTypeURL: Routes.file_types_path(), |
| 33 | + eventURL: Routes.events_path, |
| 34 | + fileTypeURL: Routes.file_types_path, |
33 | 35 |
|
34 | 36 | confirmDestroy: function (event) { |
35 | 37 | event.preventDefault(); |
@@ -389,7 +391,7 @@ var CodeOceanEditor = { |
389 | 391 | updateEditorModeToFileTypeID: function (editor, fileTypeID) { |
390 | 392 | var newMode = 'ace/mode/text' |
391 | 393 |
|
392 | | - $.ajax(this.fileTypeURL + '/' + fileTypeID, { |
| 394 | + $.ajax(this.fileTypeURL() + '/' + fileTypeID, { |
393 | 395 | dataType: 'json' |
394 | 396 | }).done(function (data) { |
395 | 397 | if (data['editor_mode'] !== null) { |
@@ -668,7 +670,7 @@ var CodeOceanEditor = { |
668 | 670 |
|
669 | 671 | publishCodeOceanEvent: function (payload) { |
670 | 672 | if (this.sendEvents) { |
671 | | - $.ajax(this.eventURL, { |
| 673 | + $.ajax(this.eventURL(), { |
672 | 674 | type: 'POST', |
673 | 675 | cache: false, |
674 | 676 | dataType: 'JSON', |
@@ -1170,3 +1172,5 @@ var CodeOceanEditor = { |
1170 | 1172 | CodeOceanEditor.editors = []; |
1171 | 1173 | } |
1172 | 1174 | }; |
| 1175 | + |
| 1176 | +export default CodeOceanEditor; |
0 commit comments