aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/js
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2017-04-07 16:49:43 +0200
committerJohannes Zellner <johannes@cloudron.io>2017-04-07 16:49:43 +0200
commitf66b47bd92369aa3c289a8f08de98e7e2ba7b2b0 (patch)
treeed0110fe18bb461921d357fa471d346770739e02 /frontend/js
parent789485e5fbe923f351f2d94ace48561073223ae5 (diff)
downloadSurfer-f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0.tar.gz
Surfer-f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0.tar.zst
Surfer-f66b47bd92369aa3c289a8f08de98e7e2ba7b2b0.zip
Add file download button
Diffstat (limited to 'frontend/js')
-rw-r--r--frontend/js/app.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/frontend/js/app.js b/frontend/js/app.js
index befed24..bf9b534 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -135,6 +135,12 @@ function open(entry) {
135 window.open(encode(path)); 135 window.open(encode(path));
136} 136}
137 137
138function download(entry) {
139 if (entry.isDirectory) return;
140
141 window.open(encode('/api/files/' + sanitize(app.path + '/' + entry.filePath)) + '?access_token=' + localStorage.accessToken);
142}
143
138function up() { 144function up() {
139 window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/')); 145 window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/'));
140} 146}
@@ -329,6 +335,7 @@ var app = new Vue({
329 logout: logout, 335 logout: logout,
330 loadDirectory: loadDirectory, 336 loadDirectory: loadDirectory,
331 open: open, 337 open: open,
338 download: download,
332 up: up, 339 up: up,
333 upload: upload, 340 upload: upload,
334 delAsk: delAsk, 341 delAsk: delAsk,