Update Turbolinks, load additional assets only on request, fix JS
Signed-off-by: Sebastian Serth <Sebastian.Serth@student.hpi.de>
This commit is contained in:
24
app/assets/javascripts/editor.js
Normal file
24
app/assets/javascripts/editor.js
Normal file
@ -0,0 +1,24 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
|
||||
//Merge all editor components.
|
||||
$.extend(
|
||||
CodeOceanEditor,
|
||||
CodeOceanEditorAJAX,
|
||||
CodeOceanEditorEvaluation,
|
||||
CodeOceanEditorFlowr,
|
||||
CodeOceanEditorSubmissions,
|
||||
CodeOceanEditorTurtle,
|
||||
CodeOceanEditorWebsocket,
|
||||
CodeOceanEditorPrompt,
|
||||
CodeOceanEditorCodePilot,
|
||||
CodeOceanEditorRequestForComments
|
||||
);
|
||||
|
||||
if ($('#editor').isPresent() && CodeOceanEditor) {
|
||||
if (CodeOceanEditor.isBrowserSupported()) {
|
||||
CodeOceanEditor.initializeEverything();
|
||||
} else {
|
||||
$('#alert').show();
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user