diff options
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/index.html | 1 | ||||
-rw-r--r-- | frontend/js/app.js | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/frontend/index.html b/frontend/index.html index 5374339..a6d0eb0 100644 --- a/frontend/index.html +++ b/frontend/index.html | |||
@@ -183,6 +183,7 @@ | |||
183 | <th><span v-my-tooltip="foobar" data-toggle="tooltip" title="{{ entry.mtime }}">{{ entry.mtime | prettyDate }}</span></th> | 183 | <th><span v-my-tooltip="foobar" data-toggle="tooltip" title="{{ entry.mtime }}">{{ entry.mtime | prettyDate }}</span></th> |
184 | <th style="text-align: right;"> | 184 | <th style="text-align: right;"> |
185 | <span class="entry-toolbar"> | 185 | <span class="entry-toolbar"> |
186 | <button class="btn btn-sm btn-default" v-on:click.stop="download(entry)" title="Download" v-show="entry.isFile"><i class="fa fa-download"></i></button> | ||
186 | <button class="btn btn-sm btn-default" v-on:click.stop="renameAsk(entry)" title="Rename"><i class="fa fa-pencil"></i></button> | 187 | <button class="btn btn-sm btn-default" v-on:click.stop="renameAsk(entry)" title="Rename"><i class="fa fa-pencil"></i></button> |
187 | <button class="btn btn-sm btn-danger" v-on:click.stop="delAsk(entry)" title="Delete"><i class="fa fa-trash"></i></button> | 188 | <button class="btn btn-sm btn-danger" v-on:click.stop="delAsk(entry)" title="Delete"><i class="fa fa-trash"></i></button> |
188 | </span> | 189 | </span> |
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 | ||
138 | function 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 | |||
138 | function up() { | 144 | function 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, |