aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend
diff options
context:
space:
mode:
authorJohannes Zellner <johannes@cloudron.io>2018-05-17 15:49:40 +0200
committerJohannes Zellner <johannes@cloudron.io>2018-05-17 15:49:40 +0200
commit552d44bbd28eb66c05b450f112ce20bff463fe6f (patch)
treea0662e0c4f0328f9a5884ad7794275a02bd00159 /frontend
parentf2f2b69322749c558f2dac8bf21b1620aacc284b (diff)
downloadSurfer-552d44bbd28eb66c05b450f112ce20bff463fe6f.tar.gz
Surfer-552d44bbd28eb66c05b450f112ce20bff463fe6f.tar.zst
Surfer-552d44bbd28eb66c05b450f112ce20bff463fe6f.zip
Make folder listing a global setting
Diffstat (limited to 'frontend')
-rw-r--r--frontend/404.html19
-rw-r--r--frontend/js/app.js10
-rw-r--r--frontend/welcome.html5
3 files changed, 31 insertions, 3 deletions
diff --git a/frontend/404.html b/frontend/404.html
new file mode 100644
index 0000000..21fd6b4
--- /dev/null
+++ b/frontend/404.html
@@ -0,0 +1,19 @@
1<html>
2<head>
3 <title> Surfer - File not found</title>
4
5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
6
7 <link rel="stylesheet" href="/_admin/css/style.css">
8</head>
9<body>
10
11<div class="wrapper">
12 <div class="content">
13 <h2> Surfer </h2>
14 <p>File not found</p>
15 </div>
16</div>
17
18</body>
19</html>
diff --git a/frontend/js/app.js b/frontend/js/app.js
index 57b831e..e9d469b 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -211,7 +211,9 @@ var app = new Vue({
211 }, 211 },
212 onOptionsMenu: function (command) { 212 onOptionsMenu: function (command) {
213 if (command === 'folderListing') { 213 if (command === 'folderListing') {
214 console.log('Not implemented'); 214 superagent.put('/api/settings').send({ folderListingEnabled: this.folderListingEnabled }).query({ access_token: localStorage.accessToken }).end(function (error) {
215 if (error) console.error(error);
216 });
215 } else if (command === 'about') { 217 } else if (command === 'about') {
216 this.$msgbox({ 218 this.$msgbox({
217 title: 'About Surfer', 219 title: 'About Surfer',
@@ -337,6 +339,12 @@ getProfile(localStorage.accessToken, function (error) {
337 if (error) return console.error(error); 339 if (error) return console.error(error);
338 340
339 loadDirectory(window.location.hash.slice(1)); 341 loadDirectory(window.location.hash.slice(1));
342
343 superagent.get('/api/settings').query({ access_token: localStorage.accessToken }).end(function (error, result) {
344 if (error) console.error(error);
345
346 app.folderListingEnabled = !!result.body.folderListingEnabled;
347 });
340}); 348});
341 349
342$(window).on('hashchange', function () { 350$(window).on('hashchange', function () {
diff --git a/frontend/welcome.html b/frontend/welcome.html
index d16dcef..ddc9c36 100644
--- a/frontend/welcome.html
+++ b/frontend/welcome.html
@@ -1,9 +1,10 @@
1<html> 1<html>
2<head> 2<head>
3 <title> Surfer </title> 3 <title> Surfer - Welcome</title>
4 4
5 <link rel="stylesheet" href="/_admin/css/style.css"> 5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
6 6
7 <link rel="stylesheet" href="/_admin/css/style.css">
7</head> 8</head>
8<body> 9<body>
9 10