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_FOR_COMMENTS_DELAY: 3 * 60 * 1000,
|
||||||
REQUEST_TOOLTIP_TIME: 5000,
|
REQUEST_TOOLTIP_TIME: 5000,
|
||||||
|
|
||||||
NONE: 0,
|
|
||||||
WEBSOCKET: 1,
|
|
||||||
SERVER_SEND_EVENT: 2,
|
|
||||||
|
|
||||||
editors: [],
|
editors: [],
|
||||||
editor_for_file: new Map(),
|
editor_for_file: new Map(),
|
||||||
regex_for_language: new Map(),
|
regex_for_language: new Map(),
|
||||||
@ -30,7 +26,6 @@ var CodeOceanEditor = {
|
|||||||
running: false,
|
running: false,
|
||||||
qa_api: undefined,
|
qa_api: undefined,
|
||||||
output_mode_is_streaming: true,
|
output_mode_is_streaming: true,
|
||||||
runmode: this.NONE,
|
|
||||||
|
|
||||||
numMessages: 0,
|
numMessages: 0,
|
||||||
prompt: '#prompt',
|
prompt: '#prompt',
|
||||||
@ -102,7 +97,6 @@ var CodeOceanEditor = {
|
|||||||
|
|
||||||
showOutput: function(event) {
|
showOutput: function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.showTab(0);
|
|
||||||
this.showOutputBar();
|
this.showOutputBar();
|
||||||
$('#output').scrollTo($(this).attr('href'));
|
$('#output').scrollTo($(this).attr('href'));
|
||||||
},
|
},
|
||||||
@ -147,8 +141,6 @@ var CodeOceanEditor = {
|
|||||||
handleKeyPress: function (event) {
|
handleKeyPress: function (event) {
|
||||||
if (event.which === this.ALT_1_KEY_CODE) {
|
if (event.which === this.ALT_1_KEY_CODE) {
|
||||||
this.showWorkspaceTab(event);
|
this.showWorkspaceTab(event);
|
||||||
} else if (event.which === this.ALT_3_KEY_CODE) {
|
|
||||||
this.showTab(1);
|
|
||||||
} else if (event.which === this.ALT_R_KEY_CODE) {
|
} else if (event.which === this.ALT_R_KEY_CODE) {
|
||||||
$('#run').trigger('click');
|
$('#run').trigger('click');
|
||||||
} else if (event.which === this.ALT_S_KEY_CODE) {
|
} else if (event.which === this.ALT_S_KEY_CODE) {
|
||||||
@ -498,7 +490,6 @@ var CodeOceanEditor = {
|
|||||||
this.clearOutput();
|
this.clearOutput();
|
||||||
$('#hint').fadeOut();
|
$('#hint').fadeOut();
|
||||||
$('#flowrHint').fadeOut();
|
$('#flowrHint').fadeOut();
|
||||||
this.showTab(0);
|
|
||||||
this.showOutputBar();
|
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) {
|
showSpinner: function(initiator) {
|
||||||
$(initiator).find('i.fa').hide();
|
$(initiator).find('i.fa').hide();
|
||||||
$(initiator).find('i.fa-spin').show();
|
$(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() {
|
showTimeoutMessage: function() {
|
||||||
$.flash.info({
|
$.flash.info({
|
||||||
icon: ['fa', 'fa-clock-o'],
|
icon: ['fa', 'fa-clock-o'],
|
||||||
@ -574,13 +546,6 @@ var CodeOceanEditor = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
showWorkspaceTab: function(event) {
|
|
||||||
if(event){
|
|
||||||
event.preventDefault();
|
|
||||||
}
|
|
||||||
this.showTab(0);
|
|
||||||
},
|
|
||||||
|
|
||||||
showFileDialog: function(event) {
|
showFileDialog: function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.createSubmission('#create-file', null, function(response) {
|
this.createSubmission('#create-file', null, function(response) {
|
||||||
@ -637,7 +602,6 @@ var CodeOceanEditor = {
|
|||||||
this.initPrompt();
|
this.initPrompt();
|
||||||
this.renderScore();
|
this.renderScore();
|
||||||
this.showFirstFile();
|
this.showFirstFile();
|
||||||
this.showRequestedTab();
|
|
||||||
|
|
||||||
$(window).on("beforeunload", function() {
|
$(window).on("beforeunload", function() {
|
||||||
if(this.autosaveTimer != null){
|
if(this.autosaveTimer != null){
|
||||||
|
@ -8,7 +8,6 @@ CodeOceanEditorEvaluation = {
|
|||||||
}, 0).toFixed(2);
|
}, 0).toFixed(2);
|
||||||
$('#score').data('score', score);
|
$('#score').data('score', score);
|
||||||
this.renderScore();
|
this.renderScore();
|
||||||
this.showTab(1);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleTestResponse: function (result) {
|
handleTestResponse: function (result) {
|
||||||
@ -18,7 +17,6 @@ CodeOceanEditorEvaluation = {
|
|||||||
this.qa_api.executeCommand('syncOutput', [result]);
|
this.qa_api.executeCommand('syncOutput', [result]);
|
||||||
}
|
}
|
||||||
this.showStatus(result);
|
this.showStatus(result);
|
||||||
this.showTab(0);
|
|
||||||
this.showOutputBar();
|
this.showOutputBar();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -102,7 +100,6 @@ CodeOceanEditorEvaluation = {
|
|||||||
|
|
||||||
scoreCode: function (event) {
|
scoreCode: function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.runmode = this.SERVER_SEND_EVENT;
|
|
||||||
this.createSubmission('#assess', null, function (response) {
|
this.createSubmission('#assess', null, function (response) {
|
||||||
this.showSpinner($('#assess'));
|
this.showSpinner($('#assess'));
|
||||||
$('#score_div').removeClass('hidden');
|
$('#score_div').removeClass('hidden');
|
||||||
@ -114,12 +111,7 @@ CodeOceanEditorEvaluation = {
|
|||||||
stopCode: function (event) {
|
stopCode: function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (this.isActiveFileStoppable()) {
|
if (this.isActiveFileStoppable()) {
|
||||||
if (this.runmode == this.WEBSOCKET) {
|
|
||||||
this.killWebsocketAndContainer();
|
this.killWebsocketAndContainer();
|
||||||
} else if (this.runmode == this.SERVER_SEND_EVENT) {
|
|
||||||
this.stopCodeServerSendEvent(event);
|
|
||||||
}
|
|
||||||
this.runmode = this.NONE;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -118,7 +118,6 @@ CodeOceanEditorSubmissions = {
|
|||||||
stderr: message
|
stderr: message
|
||||||
}, true, 0);
|
}, true, 0);
|
||||||
this.sendError(message, response.id);
|
this.sendError(message, response.id);
|
||||||
this.showTab(0);
|
|
||||||
this.showOutputBar();
|
this.showOutputBar();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -130,7 +129,6 @@ CodeOceanEditorSubmissions = {
|
|||||||
runCode: function(event) {
|
runCode: function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if ($('#run').is(':visible')) {
|
if ($('#run').is(':visible')) {
|
||||||
this.runmode = this.WEBSOCKET;
|
|
||||||
this.createSubmission('#run', null, function(response) {
|
this.createSubmission('#run', null, function(response) {
|
||||||
//Run part starts here
|
//Run part starts here
|
||||||
$('#stop').data('url', response.stop_url);
|
$('#stop').data('url', response.stop_url);
|
||||||
|
Reference in New Issue
Block a user