diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js similarity index 98% rename from app/assets/javascripts/editor/editor.js.erb rename to app/assets/javascripts/editor/editor.js index e5f65eea8..a8e305bd1 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js @@ -1,9 +1,3 @@ -// Note: Directives are only processed if they come before any application code. -// Once you have a line that does not include a comment or whitespace then Sprockets will stop looking for directives. -// If you use a directive outside of the "header" of the document it will not do anything, and won't raise any errors. -// <% config_file = CodeOcean::Config.new(:code_ocean, erb: false) %> -//= depend_on <%= config_file.path.basename %> - var CodeOceanEditor = { THEME: window.getCurrentTheme() === 'dark' ? 'ace/theme/tomorrow_night' : 'ace/theme/tomorrow', @@ -33,7 +27,7 @@ var CodeOceanEditor = { lastCopyText: null, - sendEvents: <%= config_file.read['codeocean_events'] ? config_file.read['codeocean_events']['enabled'] : false %>, + sendEvents: document.documentElement.dataset.eventsEnabled === 'true', eventURL: Routes.events_path(), fileTypeURL: Routes.file_types_path(), diff --git a/app/assets/javascripts/editor/participantsupport.js.erb b/app/assets/javascripts/editor/participantsupport.js similarity index 97% rename from app/assets/javascripts/editor/participantsupport.js.erb rename to app/assets/javascripts/editor/participantsupport.js index a2d6a3f2d..9cb8c3e3c 100644 --- a/app/assets/javascripts/editor/participantsupport.js.erb +++ b/app/assets/javascripts/editor/participantsupport.js @@ -1,5 +1,5 @@ CodeOceanEditorFlowr = { - isFlowrEnabled: <%= CodeOcean::Config.new(:code_ocean).read[:flowr][:enabled] %>, + isFlowrEnabled: document.documentElement.dataset.flowrEnabled === 'true', flowrResultHtml: '
' + '