Editor: Allow file retrieval after code run
This commit is contained in:

committed by
Sebastian Serth

parent
fb9672c7a4
commit
60078701f5
@ -669,6 +669,7 @@ var CodeOceanEditor = {
|
||||
$('#flowrHint').fadeOut();
|
||||
this.clearHints();
|
||||
this.showOutputBar();
|
||||
this.clearFileDownloads();
|
||||
},
|
||||
|
||||
isActiveFileBinary: function () {
|
||||
@ -737,6 +738,24 @@ var CodeOceanEditor = {
|
||||
container.fadeIn();
|
||||
},
|
||||
|
||||
prepareFileDownloads: function(message) {
|
||||
const fileTree = $('#download-file-tree');
|
||||
fileTree.jstree(message.data);
|
||||
fileTree.on('select_node.jstree', function (node, selected, _event) {
|
||||
selected.instance.deselect_all();
|
||||
const downloadPath = selected.node.original.download_path;
|
||||
if (downloadPath) {
|
||||
window.location = downloadPath;
|
||||
}
|
||||
}.bind(this));
|
||||
$('#download-files').removeClass('d-none');
|
||||
},
|
||||
|
||||
clearFileDownloads: function() {
|
||||
$('#download-files').addClass('d-none');
|
||||
$('#download-file-tree').replaceWith($('<div id="download-file-tree">'));
|
||||
},
|
||||
|
||||
showContainerDepletedMessage: function () {
|
||||
$.flash.danger({
|
||||
icon: ['fa-regular', 'fa-clock'],
|
||||
|
Reference in New Issue
Block a user