Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f43b3c16
authored
May 17, 2018
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixup the config file usage
1 parent
552d44bb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
frontend/js/app.js
server.js
frontend/js/app.js
View file @
f43b3c1
...
@@ -35,8 +35,14 @@ function getProfile(accessToken, callback) {
...
@@ -35,8 +35,14 @@ function getProfile(accessToken, callback) {
app
.
session
.
username
=
result
.
body
.
username
;
app
.
session
.
username
=
result
.
body
.
username
;
app
.
session
.
valid
=
true
;
app
.
session
.
valid
=
true
;
superagent
.
get
(
'/api/settings'
).
query
({
access_token
:
localStorage
.
accessToken
}).
end
(
function
(
error
,
result
)
{
if
(
error
)
console
.
error
(
error
);
app
.
folderListingEnabled
=
!!
result
.
body
.
folderListingEnabled
;
callback
();
callback
();
});
});
});
}
}
function
sanitize
(
filePath
)
{
function
sanitize
(
filePath
)
{
...
@@ -339,12 +345,6 @@ getProfile(localStorage.accessToken, function (error) {
...
@@ -339,12 +345,6 @@ getProfile(localStorage.accessToken, function (error) {
if
(
error
)
return
console
.
error
(
error
);
if
(
error
)
return
console
.
error
(
error
);
loadDirectory
(
window
.
location
.
hash
.
slice
(
1
));
loadDirectory
(
window
.
location
.
hash
.
slice
(
1
));
superagent
.
get
(
'/api/settings'
).
query
({
access_token
:
localStorage
.
accessToken
}).
end
(
function
(
error
,
result
)
{
if
(
error
)
console
.
error
(
error
);
app
.
folderListingEnabled
=
!!
result
.
body
.
folderListingEnabled
;
});
});
});
$
(
window
).
on
(
'hashchange'
,
function
()
{
$
(
window
).
on
(
'hashchange'
,
function
()
{
...
...
server.js
View file @
f43b3c1
...
@@ -23,7 +23,7 @@ var express = require('express'),
...
@@ -23,7 +23,7 @@ var express = require('express'),
var
rootFolder
=
path
.
resolve
(
__dirname
,
process
.
argv
[
2
]
||
'files'
);
var
rootFolder
=
path
.
resolve
(
__dirname
,
process
.
argv
[
2
]
||
'files'
);
var
configFile
=
path
.
resolve
(
__dirname
,
process
.
argv
[
3
]
||
'.
/
config.json'
);
var
configFile
=
path
.
resolve
(
__dirname
,
process
.
argv
[
3
]
||
'.config.json'
);
// Ensure the root folder exists
// Ensure the root folder exists
mkdirp
.
sync
(
rootFolder
);
mkdirp
.
sync
(
rootFolder
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment