Use webpack to deliver newest ACE editor

With this commit, we change the delivery method for the ACE editor from manually copied files to using yarn and webpack. As a side-change, we also modify how the mode is selected through JavaScript instead of Ruby.

Through webpack, the `modePath`, `themePath`, and `workerPath` are automatically determined and working as expected.

Closes #250
This commit is contained in:
Sebastian Serth
2024-02-14 00:47:50 +01:00
committed by Sebastian Serth
parent 942dbd20db
commit 4f8d313da4
480 changed files with 39 additions and 329597 deletions

View File

@ -1,7 +1,4 @@
var CodeOceanEditor = {
//ACE-Editor-Path
// ruby part adds the relative_url_root, if it is set.
ACE_FILES_PATH: '<%= "#{Rails.application.config.relative_url_root.chomp('/')}/assets/ace/" %>',
THEME: window.getCurrentTheme() === 'dark' ? 'ace/theme/tomorrow_night' : 'ace/theme/tomorrow',
//Color-Encoding for Percentages in Progress Bars (For submissions)
@ -40,13 +37,6 @@ var CodeOceanEditor = {
eventURL: "<%= @config['codeocean_events'] ? events_path : '' %>",
fileTypeURL: "<%= file_types_path %>",
configureEditors: function () {
_.each(['modePath', 'themePath', 'workerPath'], function (attribute) {
ace.config.set(attribute, this.ACE_FILES_PATH);
}.bind(this));
},
confirmDestroy: function (event) {
event.preventDefault();
if (confirm(I18n.t('shared.confirm_destroy'))) {
@ -1087,7 +1077,6 @@ var CodeOceanEditor = {
initializeEverything: function () {
CodeOceanEditor.editors = [];
this.initializeRegexes();
this.configureEditors();
this.initializeEditors();
this.initializeEventHandlers();
this.initializeFileTree();