Editor: Allow file retrieval after code run

This commit is contained in:
Sebastian Serth
2022-10-04 15:17:16 +02:00
committed by Sebastian Serth
parent fb9672c7a4
commit 60078701f5
22 changed files with 311 additions and 8 deletions

View File

@ -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'],