mkdir', {p: curPath + '/' + name}).then(function(d) { if (d.s === 'ok') { toast('Created', true); loadDir(curPath); } else toast('Failed', false); }); } function preview(path, name) { window.open(path, '_blank'); } // === Upload === function showUpload() { document.getElementById('uploadModal').classList.add('show'); } function closeUpload() { document.getElementById('uploadModal').classList.remove('show'); } function handleFiles(files) { var prog = document.getElementById('uploadProgress'); var html = ''; Array.from(files).forEach(function(f, i) { html += '
' + '' + esc(f.name) + ' ' + 'pending' + '
' + '
'; }); prog.innerHTML = html; Array.from(files).forEach(function(f, i) { var fd = new FormData();