remove code that showed tabs and leftovers of serversend events (runmode)
This commit is contained in:
@ -16,10 +16,6 @@ var CodeOceanEditor = {
|
||||
REQUEST_FOR_COMMENTS_DELAY: 3 * 60 * 1000,
|
||||
REQUEST_TOOLTIP_TIME: 5000,
|
||||
|
||||
NONE: 0,
|
||||
WEBSOCKET: 1,
|
||||
SERVER_SEND_EVENT: 2,
|
||||
|
||||
editors: [],
|
||||
editor_for_file: new Map(),
|
||||
regex_for_language: new Map(),
|
||||
@ -30,7 +26,6 @@ var CodeOceanEditor = {
|
||||
running: false,
|
||||
qa_api: undefined,
|
||||
output_mode_is_streaming: true,
|
||||
runmode: this.NONE,
|
||||
|
||||
numMessages: 0,
|
||||
prompt: '#prompt',
|
||||
@ -102,7 +97,6 @@ var CodeOceanEditor = {
|
||||
|
||||
showOutput: function(event) {
|
||||
event.preventDefault();
|
||||
this.showTab(0);
|
||||
this.showOutputBar();
|
||||
$('#output').scrollTo($(this).attr('href'));
|
||||
},
|
||||
@ -147,8 +141,6 @@ var CodeOceanEditor = {
|
||||
handleKeyPress: function (event) {
|
||||
if (event.which === this.ALT_1_KEY_CODE) {
|
||||
this.showWorkspaceTab(event);
|
||||
} else if (event.which === this.ALT_3_KEY_CODE) {
|
||||
this.showTab(1);
|
||||
} else if (event.which === this.ALT_R_KEY_CODE) {
|
||||
$('#run').trigger('click');
|
||||
} else if (event.which === this.ALT_S_KEY_CODE) {
|
||||
@ -498,7 +490,6 @@ var CodeOceanEditor = {
|
||||
this.clearOutput();
|
||||
$('#hint').fadeOut();
|
||||
$('#flowrHint').fadeOut();
|
||||
this.showTab(0);
|
||||
this.showOutputBar();
|
||||
},
|
||||
|
||||
@ -517,21 +508,6 @@ var CodeOceanEditor = {
|
||||
};
|
||||
},
|
||||
|
||||
showRequestedTab: function() {
|
||||
if(this.REMEMBER_TAB){
|
||||
var regexp = /tab=(\d+)/;
|
||||
if (regexp.test(window.location.search)) {
|
||||
var index = regexp.exec(window.location.search)[1] - 1;
|
||||
} else {
|
||||
var index = this.localStorage.tab;
|
||||
}
|
||||
} else {
|
||||
// else start with first tab.
|
||||
var index = 0;
|
||||
}
|
||||
this.showTab(index);
|
||||
},
|
||||
|
||||
showSpinner: function(initiator) {
|
||||
$(initiator).find('i.fa').hide();
|
||||
$(initiator).find('i.fa-spin').show();
|
||||
@ -557,10 +533,6 @@ var CodeOceanEditor = {
|
||||
});
|
||||
},
|
||||
|
||||
showTab: function(index) {
|
||||
$('a[data-toggle="tab"]').eq(index || 0).tab('show');
|
||||
},
|
||||
|
||||
showTimeoutMessage: function() {
|
||||
$.flash.info({
|
||||
icon: ['fa', 'fa-clock-o'],
|
||||
@ -574,13 +546,6 @@ var CodeOceanEditor = {
|
||||
});
|
||||
},
|
||||
|
||||
showWorkspaceTab: function(event) {
|
||||
if(event){
|
||||
event.preventDefault();
|
||||
}
|
||||
this.showTab(0);
|
||||
},
|
||||
|
||||
showFileDialog: function(event) {
|
||||
event.preventDefault();
|
||||
this.createSubmission('#create-file', null, function(response) {
|
||||
@ -637,7 +602,6 @@ var CodeOceanEditor = {
|
||||
this.initPrompt();
|
||||
this.renderScore();
|
||||
this.showFirstFile();
|
||||
this.showRequestedTab();
|
||||
|
||||
$(window).on("beforeunload", function() {
|
||||
if(this.autosaveTimer != null){
|
||||
|
@ -8,7 +8,6 @@ CodeOceanEditorEvaluation = {
|
||||
}, 0).toFixed(2);
|
||||
$('#score').data('score', score);
|
||||
this.renderScore();
|
||||
this.showTab(1);
|
||||
},
|
||||
|
||||
handleTestResponse: function (result) {
|
||||
@ -18,7 +17,6 @@ CodeOceanEditorEvaluation = {
|
||||
this.qa_api.executeCommand('syncOutput', [result]);
|
||||
}
|
||||
this.showStatus(result);
|
||||
this.showTab(0);
|
||||
this.showOutputBar();
|
||||
},
|
||||
|
||||
@ -102,7 +100,6 @@ CodeOceanEditorEvaluation = {
|
||||
|
||||
scoreCode: function (event) {
|
||||
event.preventDefault();
|
||||
this.runmode = this.SERVER_SEND_EVENT;
|
||||
this.createSubmission('#assess', null, function (response) {
|
||||
this.showSpinner($('#assess'));
|
||||
$('#score_div').removeClass('hidden');
|
||||
@ -114,12 +111,7 @@ CodeOceanEditorEvaluation = {
|
||||
stopCode: function (event) {
|
||||
event.preventDefault();
|
||||
if (this.isActiveFileStoppable()) {
|
||||
if (this.runmode == this.WEBSOCKET) {
|
||||
this.killWebsocketAndContainer();
|
||||
} else if (this.runmode == this.SERVER_SEND_EVENT) {
|
||||
this.stopCodeServerSendEvent(event);
|
||||
}
|
||||
this.runmode = this.NONE;
|
||||
this.killWebsocketAndContainer();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -118,7 +118,6 @@ CodeOceanEditorSubmissions = {
|
||||
stderr: message
|
||||
}, true, 0);
|
||||
this.sendError(message, response.id);
|
||||
this.showTab(0);
|
||||
this.showOutputBar();
|
||||
};
|
||||
}
|
||||
@ -130,7 +129,6 @@ CodeOceanEditorSubmissions = {
|
||||
runCode: function(event) {
|
||||
event.preventDefault();
|
||||
if ($('#run').is(':visible')) {
|
||||
this.runmode = this.WEBSOCKET;
|
||||
this.createSubmission('#run', null, function(response) {
|
||||
//Run part starts here
|
||||
$('#stop').data('url', response.stop_url);
|
||||
|
Reference in New Issue
Block a user