Moved codepilot into dedicated file.
Renamed prompt.js Moved requestComments out of flowr.js
This commit is contained in:
24
app/assets/javascripts/editor/codepilot.js.erb
Normal file
24
app/assets/javascripts/editor/codepilot.js.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
CodeOceanEditorCodePilot = {
|
||||
qa_api: undefined,
|
||||
QaApiOutputBuffer: {'stdout': '', 'stderr': ''},
|
||||
|
||||
initializeCodePilot: function () {
|
||||
if ($('#questions-column').isPresent() && (typeof QaApi != 'undefined') && QaApi.isBrowserSupported()) {
|
||||
$('#editor-column').addClass('col-md-10').removeClass('col-md-12');
|
||||
$('#questions-column').addClass('col-md-2');
|
||||
|
||||
var node = document.getElementById('questions-holder');
|
||||
var url = $('#questions-holder').data('url');
|
||||
|
||||
this.qa_api = new QaApi(node, url);
|
||||
}
|
||||
},
|
||||
|
||||
handleQaApiOutput: function () {
|
||||
if (this.qa_api) {
|
||||
this.qa_api.executeCommand('syncOutput', [[this.QaApiOutputBuffer]]);
|
||||
// reset the object
|
||||
}
|
||||
this.QaApiOutputBuffer = {'stdout': '', 'stderr': ''};
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user