Merge remote-tracking branch 'origin/master' into error-info

# Conflicts:
#	app/controllers/concerns/submission_scoring.rb
#	app/views/application/_navigation.html.slim
#	config/locales/de.yml
#	config/locales/en.yml
#	db/schema.rb
This commit is contained in:
Maximilian Grundke
2017-10-15 17:02:19 +02:00
65 changed files with 1190 additions and 405 deletions

View File

@@ -14,6 +14,7 @@
//
//= require ace/ace
//= require chosen.jquery.min
//= require jquery-ui.min
//= require d3
//= require jquery.turbolinks
//= require jquery_ujs

View File

@@ -59,8 +59,6 @@ CodeOceanEditorCodePilot = {
}
};
//Request for comments does currently not work on staging platform (no relative root_url used here).
//To fix this rely on ruby routes
CodeOceanEditorRequestForComments = {
requestComments: function () {
var user_id = $('#editor').data('user-id');
@@ -83,6 +81,8 @@ CodeOceanEditorRequestForComments = {
}).done(function () {
this.hideSpinner();
$.flash.success({text: $('#askForCommentsButton').data('message-success')});
// trigger a run
this.runSubmission.call(this, submission);
}.bind(this)).error(this.ajaxError.bind(this));
};

View File

@@ -142,19 +142,21 @@ CodeOceanEditorSubmissions = {
* Execution-Logic
*/
runCode: function(event) {
event.preventDefault();
if ($('#run').is(':visible')) {
this.createSubmission('#run', null, function(response) {
//Run part starts here
$('#stop').data('url', response.stop_url);
this.running = true;
this.showSpinner($('#run'));
$('#score_div').addClass('hidden');
this.toggleButtonStates();
var url = response.run_url.replace(this.FILENAME_URL_PLACEHOLDER, this.active_file.filename.replace(/#$/,'')); // remove # if it is the last character, this is not part of the filename and just an anchor
this.initializeSocketForRunning(url);
}.bind(this));
}
event.preventDefault();
if ($('#run').is(':visible')) {
this.createSubmission('#run', null, this.runSubmission.bind(this));
}
},
runSubmission: function (submission) {
//Run part starts here
$('#stop').data('url', submission.stop_url);
this.running = true;
this.showSpinner($('#run'));
$('#score_div').addClass('hidden');
this.toggleButtonStates();
var url = submission.run_url.replace(this.FILENAME_URL_PLACEHOLDER, this.active_file.filename.replace(/#$/,'')); // remove # if it is the last character, this is not part of the filename and just an anchor
this.initializeSocketForRunning(url);
},
saveCode: function(event) {