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