X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=frontend%2Fjs%2Fapp.js;h=0875f1459e0d820299ab9cb075e91c1ee9256dbd;hb=c667d125938bbf6e89c89572646cd06f3e2bffd3;hp=befed24f251ce893642c436df4a8241ccb972785;hpb=906f293ea74cd72252f2da71b40b9f792e8621ba;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git diff --git a/frontend/js/app.js b/frontend/js/app.js index befed24..0875f14 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -135,6 +135,12 @@ function open(entry) { window.open(encode(path)); } +function download(entry) { + if (entry.isDirectory) return; + + window.location.href = encode('/api/files/' + sanitize(app.path + '/' + entry.filePath)) + '?access_token=' + localStorage.accessToken; +} + function up() { window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/')); } @@ -329,6 +335,7 @@ var app = new Vue({ logout: logout, loadDirectory: loadDirectory, open: open, + download: download, up: up, upload: upload, delAsk: delAsk,