mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-18 17:21:33 +00:00
Yet another bunch of updates
* Self-host all libs (including but not limited to Font Awesome icons). LICENSE files were properly included as well. * Temporarily disabling error pages. * Added "start" and "pm2" scripts. To be used with "yarn SCRIPT_NAME" or "npm run SCRIPT_NAME". * Added container for the tables in dashboard. On narrow screens, such as phones, users will then have the ability to use horizontal scroll on the tables. * Fixed various resource paths. This should now work properly when not being hosted in root domain (e.i. https://fiery.me/lolisafe/). * Before checking API, the "Running in ..." button will now say "Loading..." instead.
This commit is contained in:
parent
fb63ed50ea
commit
32dd070e49
@ -8,3 +8,6 @@ insert_final_newline = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[LICENSE]
|
||||
insert_final_newline = false
|
||||
|
@ -52,8 +52,8 @@ for (let page of config.pages) {
|
||||
}
|
||||
}
|
||||
|
||||
safe.use((req, res, next) => res.status(404).sendFile('404.html', { root: './pages/error/' }))
|
||||
safe.use((req, res, next) => res.status(500).sendFile('500.html', { root: './pages/error/' }))
|
||||
// safe.use((req, res, next) => res.status(404).sendFile('404.html', { root: './pages/error/' }))
|
||||
// safe.use((req, res, next) => res.status(500).sendFile('500.html', { root: './pages/error/' }))
|
||||
|
||||
safe.listen(config.port, () => console.log(`lolisafe started on port ${config.port}`))
|
||||
|
||||
|
@ -14,6 +14,10 @@
|
||||
"node": ">=7.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"start": "node ./lolisafe.js",
|
||||
"pm2": "pm2 start --name lolisafe ./lolisafe.js "
|
||||
},
|
||||
"dependencies": {
|
||||
"bcrypt": "^1.0.3",
|
||||
"body-parser": "^1.18.2",
|
||||
|
@ -30,12 +30,12 @@
|
||||
<meta name="twitter:image:src" content="https://safe.fiery.me/images/logo_square.png">
|
||||
|
||||
<title>safe.fiery.me – A small safe worth protecting.</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js"></script>
|
||||
<script type="text/javascript" src="/js/album.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/sweetalert/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="libs/axios/axios.min.js"></script>
|
||||
<script type="text/javascript" src="js/album.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -31,13 +31,13 @@
|
||||
<meta name="twitter:image:src" content="https://safe.fiery.me/images/logo_square.png">
|
||||
|
||||
<title>safe.fiery.me – A small safe worth protecting.</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js"></script>
|
||||
<script type="text/javascript" src="https://use.fontawesome.com/cd26baa9bd.js"></script>
|
||||
<script type="text/javascript" src="/js/auth.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/sweetalert/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/fontello/fontello.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="libs/axios/axios.min.js"></script>
|
||||
<script type="text/javascript" src="js/auth.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
/** Based on KDE Breeze Dark **/
|
||||
|
@ -31,13 +31,13 @@
|
||||
<meta name="twitter:image:src" content="https://safe.fiery.me/images/logo_square.png">
|
||||
|
||||
<title>safe.fiery.me – A small safe worth protecting.</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js"></script>
|
||||
<script type="text/javascript" src="https://use.fontawesome.com/cd26baa9bd.js"></script>
|
||||
<script type="text/javascript" src="/js/dashboard.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/sweetalert/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/fontello/fontello.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="libs/axios/axios.min.js"></script>
|
||||
<script type="text/javascript" src="js/dashboard.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
/** Based on KDE Breeze Dark **/
|
||||
@ -155,7 +155,7 @@
|
||||
<aside class="menu" id="menu">
|
||||
<p class="menu-label">General</p>
|
||||
<ul class="menu-list">
|
||||
<li><a href="/">Frontpage</a></li>
|
||||
<li><a href=".">Frontpage</a></li>
|
||||
<li><a id="itemUploads" onclick="panel.getUploads()">Uploads</a></li>
|
||||
</ul>
|
||||
<p class="menu-label">Albums</p>
|
||||
@ -174,7 +174,7 @@
|
||||
</aside>
|
||||
</div>
|
||||
<div class="column has-text-centered" id='page'>
|
||||
<img src="/images/logo.png">
|
||||
<img src="images/logo.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>loli-safe</title>
|
||||
<title>safe.fiery.me</title>
|
||||
|
||||
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>loli-safe</title>
|
||||
<title>safe.fiery.me</title>
|
||||
|
||||
<link href='//fonts.googleapis.com/css?family=Lato:100' rel='stylesheet' type='text/css'>
|
||||
|
||||
|
@ -30,8 +30,8 @@
|
||||
<meta name="twitter:image:src" content="https://safe.fiery.me/images/logo_square.png">
|
||||
|
||||
<title>safe.fiery.me – A small safe worth protecting.</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
|
||||
<style>
|
||||
/** Based on KDE Breeze Dark **/
|
||||
|
@ -30,13 +30,13 @@
|
||||
<meta name="twitter:image:src" content="https://safe.fiery.me/images/logo_square.png">
|
||||
|
||||
<title>safe.fiery.me – A small safe worth protecting.</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/min/dropzone.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js"></script>
|
||||
<script type="text/javascript" src="/js/home.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/sweetalert/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="libs/dropzone/dropzone.min.js"></script>
|
||||
<script type="text/javascript" src="libs/axios/axios.min.js"></script>
|
||||
<script type="text/javascript" src="js/home.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -44,7 +44,7 @@
|
||||
<div class="hero-body">
|
||||
<div class="container">
|
||||
<p id="b">
|
||||
<img class="logo" src="/images/logo_smol.png">
|
||||
<img class="logo" src="images/logo_smol.png">
|
||||
</p>
|
||||
<h1 class="title">safe.fiery.me</h1>
|
||||
<h2 class="subtitle">A <strong>modern</strong> self-hosted file upload service</h2>
|
||||
@ -53,7 +53,7 @@
|
||||
<div class="columns">
|
||||
<div class="column is-hidden-mobile"></div>
|
||||
<div class="column" id="uploadContainer">
|
||||
<a id="loginToUpload" href="/auth" class="button is-danger">Running in private mode. Log in to upload.</a>
|
||||
<a id="loginToUpload" href="auth" class="button is-danger">Loading…</a>
|
||||
<div class="field" id="albumDiv" style="display: none">
|
||||
<p class="control select-wrapper">
|
||||
<span class="select">
|
||||
@ -79,9 +79,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="subtitle"><a href="/auth" id="loginLinkText"></a></h3>
|
||||
<h3 class="subtitle"><a href="auth" id="loginLinkText"></a></h3>
|
||||
<h3 id="links">
|
||||
<a href="https://fiery.me" target="_blank" class="is-danger">Home</a><span>|</span><a href="https://blog.fiery.me" target="_blank" class="is-danger">Blog</a><span>|</span><a id="ShareX" href="https://safe.fiery.me/sharex.txt">ShareX</a><span>|</span><a href="/faq" class="is-danger">FAQ</a><span>|</span><a href="/auth" target="_blank" class="is-danger">Dashboard</a><span>|</span><a href="https://github.com/BobbyWibowo/lolisafe" target="_blank" class="is-danger">View on GitHub</a>
|
||||
<a href="https://fiery.me" target="_blank" class="is-danger">Home</a><span>|</span><a href="https://blog.fiery.me" target="_blank" class="is-danger">Blog</a><span>|</span><a id="ShareX" href="https://safe.fiery.me/sharex.txt">ShareX</a><span>|</span><a href="faq" class="is-danger">FAQ</a><span>|</span><a href="auth" class="is-danger">Dashboard</a><span>|</span><a href="https://github.com/BobbyWibowo/lolisafe" target="_blank" class="is-danger">View on GitHub</a>
|
||||
</h3>
|
||||
|
||||
</div>
|
||||
|
@ -151,3 +151,7 @@ section#home #b {
|
||||
hr {
|
||||
background-color: #898b8d;
|
||||
}
|
||||
|
||||
.table-container {
|
||||
overflow-x: scroll;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square150x150logo src="/images/icons/mstile-150x150.png?v=ZqYs7M3fG4"/>
|
||||
<square150x150logo src="images/icons/mstile-150x150.png?v=ZqYs7M3fG4"/>
|
||||
<TileColor>#232629</TileColor>
|
||||
</tile>
|
||||
</msapplication>
|
||||
|
@ -13,7 +13,7 @@ page.do = function (dest) {
|
||||
return swal('Error', 'You need to specify a username', 'error')
|
||||
}
|
||||
|
||||
axios.post('/api/' + dest, {
|
||||
axios.post('api/' + dest, {
|
||||
username: user,
|
||||
password: pass
|
||||
})
|
||||
@ -23,7 +23,7 @@ page.do = function (dest) {
|
||||
}
|
||||
|
||||
localStorage.token = response.data.token
|
||||
window.location = '/dashboard'
|
||||
window.location = 'dashboard'
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error)
|
||||
@ -35,7 +35,7 @@ page.verify = function () {
|
||||
page.token = localStorage.token
|
||||
if (page.token === undefined) return
|
||||
|
||||
axios.post('/api/tokens/verify', {
|
||||
axios.post('api/tokens/verify', {
|
||||
token: page.token
|
||||
})
|
||||
.then(function (response) {
|
||||
@ -43,7 +43,7 @@ page.verify = function () {
|
||||
return swal('Error', response.data.description, 'error')
|
||||
}
|
||||
|
||||
window.location = '/dashboard'
|
||||
window.location = 'dashboard'
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error)
|
||||
|
@ -10,8 +10,7 @@ panel.filesView = localStorage.filesView
|
||||
|
||||
panel.preparePage = function () {
|
||||
if (!panel.token) {
|
||||
window.location = '/auth'
|
||||
return '/auth'
|
||||
window.location = 'auth'
|
||||
}
|
||||
panel.verifyToken(panel.token, true)
|
||||
}
|
||||
@ -21,7 +20,7 @@ panel.verifyToken = function (token, reloadOnError) {
|
||||
reloadOnError = false
|
||||
}
|
||||
|
||||
axios.post('/api/tokens/verify', {
|
||||
axios.post('api/tokens/verify', {
|
||||
token: token
|
||||
})
|
||||
.then(function (response) {
|
||||
@ -33,7 +32,7 @@ panel.verifyToken = function (token, reloadOnError) {
|
||||
}, function () {
|
||||
if (reloadOnError) {
|
||||
localStorage.removeItem('token')
|
||||
location.location = '/auth'
|
||||
location.location = 'auth'
|
||||
}
|
||||
})
|
||||
return
|
||||
@ -79,14 +78,14 @@ panel.prepareDashboard = function () {
|
||||
|
||||
panel.logout = function () {
|
||||
localStorage.removeItem('token')
|
||||
location.reload('/')
|
||||
location.reload('.')
|
||||
}
|
||||
|
||||
panel.getUploads = function (album = undefined, page = undefined) {
|
||||
if (page === undefined) page = 0
|
||||
|
||||
let url = '/api/uploads/' + page
|
||||
if (album !== undefined) { url = '/api/album/' + album + '/' + page }
|
||||
let url = 'api/uploads/' + page
|
||||
if (album !== undefined) { url = 'api/album/' + album + '/' + page }
|
||||
|
||||
axios.get(url).then(function (response) {
|
||||
if (response.data.success === false) {
|
||||
@ -112,12 +111,12 @@ panel.getUploads = function (album = undefined, page = undefined) {
|
||||
<div class="column">
|
||||
<a class="button is-small is-outlined is-danger" title="List view" onclick="panel.setFilesView('list', ${album}, ${page})">
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-list-ul"></i>
|
||||
<i class="fa icon-list-bullet"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="button is-small is-outlined is-danger" title="List view" onclick="panel.setFilesView('thumbs', ${album}, ${page})">
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-th-large"></i>
|
||||
<i class="fa icon-th-large"></i>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
@ -156,18 +155,20 @@ panel.getUploads = function (album = undefined, page = undefined) {
|
||||
${pagination}
|
||||
<hr>
|
||||
${listType}
|
||||
<table class="table is-striped is-narrow is-left">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<th>${albumOrUser}</th>
|
||||
<th>Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="table">
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="table-container">
|
||||
<table class="table is-striped is-narrow is-left">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<th>${albumOrUser}</th>
|
||||
<th>Date</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="table">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<hr>
|
||||
${pagination}
|
||||
`
|
||||
@ -193,7 +194,7 @@ panel.getUploads = function (album = undefined, page = undefined) {
|
||||
<td>
|
||||
<a class="button is-small is-danger is-outlined" title="Delete album" onclick="panel.deleteFile(${item.id})">
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-trash-o"></i>
|
||||
<i class="fa icon-trash"></i>
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
@ -227,7 +228,7 @@ panel.deleteFile = function (id) {
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function () {
|
||||
axios.post('/api/upload/delete', {
|
||||
axios.post('api/upload/delete', {
|
||||
id: id
|
||||
})
|
||||
.then(function (response) {
|
||||
@ -248,7 +249,7 @@ panel.deleteFile = function (id) {
|
||||
}
|
||||
|
||||
panel.getAlbums = function () {
|
||||
axios.get('/api/albums').then(function (response) {
|
||||
axios.get('api/albums').then(function (response) {
|
||||
if (response.data.success === false) {
|
||||
if (response.data.description === 'No token provided') return panel.verifyToken(panel.token)
|
||||
else return swal('An error ocurred', response.data.description, 'error')
|
||||
@ -295,12 +296,12 @@ panel.getAlbums = function () {
|
||||
<td>
|
||||
<a class="button is-small is-primary is-outlined" title="Edit name" onclick="panel.renameAlbum(${item.id})">
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-pencil"></i>
|
||||
<i class="fa icon-pencil"></i>
|
||||
</span>
|
||||
</a>
|
||||
<a class="button is-small is-danger is-outlined" title="Delete album" onclick="panel.deleteAlbum(${item.id})">
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-trash-o"></i>
|
||||
<i class="fa icon-trash"></i>
|
||||
</span>
|
||||
</a>
|
||||
</td>
|
||||
@ -336,7 +337,7 @@ panel.renameAlbum = function (id) {
|
||||
return false
|
||||
}
|
||||
|
||||
axios.post('/api/albums/rename', {
|
||||
axios.post('api/albums/rename', {
|
||||
id: id,
|
||||
name: inputValue
|
||||
})
|
||||
@ -370,7 +371,7 @@ panel.deleteAlbum = function (id) {
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function () {
|
||||
axios.post('/api/albums/delete', {
|
||||
axios.post('api/albums/delete', {
|
||||
id: id
|
||||
})
|
||||
.then(function (response) {
|
||||
@ -392,7 +393,7 @@ panel.deleteAlbum = function (id) {
|
||||
}
|
||||
|
||||
panel.submitAlbum = function () {
|
||||
axios.post('/api/albums', {
|
||||
axios.post('api/albums', {
|
||||
name: document.getElementById('albumName').value
|
||||
})
|
||||
.then(function (response) {
|
||||
@ -412,7 +413,7 @@ panel.submitAlbum = function () {
|
||||
}
|
||||
|
||||
panel.getAlbumsSidebar = function () {
|
||||
axios.get('/api/albums/sidebar')
|
||||
axios.get('api/albums/sidebar')
|
||||
.then(function (response) {
|
||||
if (response.data.success === false) {
|
||||
if (response.data.description === 'No token provided') return panel.verifyToken(panel.token)
|
||||
@ -451,7 +452,7 @@ panel.getAlbum = function (item) {
|
||||
}
|
||||
|
||||
panel.changeToken = function () {
|
||||
axios.get('/api/tokens')
|
||||
axios.get('api/tokens')
|
||||
.then(function (response) {
|
||||
if (response.data.success === false) {
|
||||
if (response.data.description === 'No token provided') return panel.verifyToken(panel.token)
|
||||
@ -484,7 +485,7 @@ panel.changeToken = function () {
|
||||
}
|
||||
|
||||
panel.getNewToken = function () {
|
||||
axios.post('/api/tokens/change')
|
||||
axios.post('api/tokens/change')
|
||||
.then(function (response) {
|
||||
if (response.data.success === false) {
|
||||
if (response.data.description === 'No token provided') return panel.verifyToken(panel.token)
|
||||
@ -542,7 +543,7 @@ panel.changePassword = function () {
|
||||
}
|
||||
|
||||
panel.sendNewPassword = function (pass) {
|
||||
axios.post('/api/password/change', {password: pass})
|
||||
axios.post('api/password/change', {password: pass})
|
||||
.then(function (response) {
|
||||
if (response.data.success === false) {
|
||||
if (response.data.description === 'No token provided') return panel.verifyToken(panel.token)
|
||||
|
@ -11,7 +11,7 @@ upload.album
|
||||
upload.myDropzone
|
||||
|
||||
upload.checkIfPublic = function () {
|
||||
axios.get('/api/check')
|
||||
axios.get('api/check')
|
||||
.then(response => {
|
||||
upload.isPrivate = response.data.private
|
||||
upload.maxFileSize = response.data.maxFileSize
|
||||
@ -24,18 +24,22 @@ upload.checkIfPublic = function () {
|
||||
}
|
||||
|
||||
upload.preparePage = function () {
|
||||
if (!upload.isPrivate) return upload.prepareUpload()
|
||||
if (!upload.token) {
|
||||
document.getElementById('loginToUpload').style.display = 'inline-flex'
|
||||
return 'inline-flex'
|
||||
if (upload.isPrivate) {
|
||||
if (upload.token) {
|
||||
return upload.verifyToken(upload.token, true)
|
||||
} else {
|
||||
document.getElementById('loginToUpload').innerText = 'Running in private mode. Log in to upload.'
|
||||
document.getElementById('loginToUpload').style.display = 'inline-flex' // ???
|
||||
}
|
||||
} else {
|
||||
return upload.prepareUpload()
|
||||
}
|
||||
upload.verifyToken(upload.token, true)
|
||||
}
|
||||
|
||||
upload.verifyToken = function (token, reloadOnError) {
|
||||
if (reloadOnError === undefined) { reloadOnError = false }
|
||||
|
||||
axios.post('/api/tokens/verify', { token: token })
|
||||
axios.post('api/tokens/verify', { token: token })
|
||||
.then(response => {
|
||||
if (response.data.success === false) {
|
||||
swal({
|
||||
@ -70,7 +74,7 @@ upload.prepareUpload = function () {
|
||||
upload.album = select.value
|
||||
})
|
||||
|
||||
axios.get('/api/albums', { headers: { token: upload.token } })
|
||||
axios.get('api/albums', { headers: { token: upload.token } })
|
||||
.then(res => {
|
||||
var albums = res.data.albums
|
||||
|
||||
@ -116,7 +120,7 @@ upload.prepareDropzone = function () {
|
||||
previewNode.parentNode.removeChild(previewNode)
|
||||
|
||||
var dropzone = new Dropzone('div#dropzone', {
|
||||
url: '/api/upload',
|
||||
url: 'api/upload',
|
||||
paramName: 'files[]',
|
||||
maxFilesize: upload.maxFileSize.slice(0, -2),
|
||||
parallelUploads: 2,
|
||||
|
19
public/libs/axios/LICENSE
Normal file
19
public/libs/axios/LICENSE
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014-present Matt Zabriskie
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
3
public/libs/axios/axios.min.js
vendored
Normal file
3
public/libs/axios/axios.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
21
public/libs/bulma/LICENSE
Normal file
21
public/libs/bulma/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Jeremy Thomas
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
1
public/libs/bulma/bulma.min.css
vendored
Normal file
1
public/libs/bulma/bulma.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
12
public/libs/dropzone/LICENSE
Normal file
12
public/libs/dropzone/LICENSE
Normal file
@ -0,0 +1,12 @@
|
||||
License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 Matias Meno <m@tias.me>
|
||||
Logo & Website Design (c) 2015 "1910" www.weare1910.com
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2
public/libs/dropzone/dropzone.min.js
vendored
Normal file
2
public/libs/dropzone/dropzone.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12
public/libs/fontello/LICENSE
Normal file
12
public/libs/fontello/LICENSE
Normal file
@ -0,0 +1,12 @@
|
||||
Font license info
|
||||
|
||||
|
||||
## Font Awesome
|
||||
|
||||
Copyright (C) 2016 by Dave Gandy
|
||||
|
||||
Author: Dave Gandy
|
||||
License: SIL ()
|
||||
Homepage: http://fortawesome.github.com/Font-Awesome/
|
||||
|
||||
|
46
public/libs/fontello/fontello.css
vendored
Normal file
46
public/libs/fontello/fontello.css
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('fontello.eot?90492172');
|
||||
src: url('fontello.eot?90492172#iefix') format('embedded-opentype'),
|
||||
url('fontello.woff2?90492172') format('woff2'),
|
||||
url('fontello.woff?90492172') format('woff'),
|
||||
url('fontello.ttf?90492172') format('truetype'),
|
||||
url('fontello.svg?90492172#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
||||
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
||||
/*
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('fontello.svg?90492172#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
[class^="fa icon-"]:before, [class*=" icon-"]:before {
|
||||
font: normal normal 14px/1 fontello;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
text-align: center;
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-th-large:before { content: '\e800'; } /* '' */
|
||||
.icon-pencil:before { content: '\e802'; } /* '' */
|
||||
.icon-list-bullet:before { content: '\f0ca'; } /* '' */
|
||||
.icon-trash:before { content: '\f1f8'; } /* '' */
|
BIN
public/libs/fontello/fontello.eot
Normal file
BIN
public/libs/fontello/fontello.eot
Normal file
Binary file not shown.
18
public/libs/fontello/fontello.svg
Normal file
18
public/libs/fontello/fontello.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2018 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="fontello" horiz-adv-x="1000" >
|
||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="th-large" unicode="" d="M429 279v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z m500-428v-215q0-29-22-50t-50-21h-286q-29 0-50 21t-21 50v215q0 29 21 50t50 21h286q29 0 50-21t22-50z m0 428v-214q0-29-22-50t-50-22h-286q-29 0-50 22t-21 50v214q0 29 21 50t50 22h286q29 0 50-22t22-50z" horiz-adv-x="928.6" />
|
||||
|
||||
<glyph glyph-name="pencil" unicode="" d="M203-7l50 51-131 131-51-51v-60h72v-71h60z m291 518q0 12-12 12-5 0-9-4l-303-302q-4-4-4-10 0-12 13-12 5 0 9 4l303 302q3 4 3 10z m-30 107l232-232-464-465h-232v233z m381-54q0-29-20-50l-93-93-232 233 93 92q20 21 50 21 29 0 51-21l131-131q20-22 20-51z" horiz-adv-x="857.1" />
|
||||
|
||||
<glyph glyph-name="list-bullet" unicode="" d="M214 64q0-44-31-76t-76-31-76 31-31 76 31 76 76 31 76-31 31-76z m0 286q0-45-31-76t-76-31-76 31-31 76 31 76 76 31 76-31 31-76z m786-232v-107q0-7-5-13t-13-5h-678q-8 0-13 5t-5 13v107q0 7 5 12t13 6h678q7 0 13-6t5-12z m-786 518q0-45-31-76t-76-31-76 31-31 76 31 76 76 31 76-31 31-76z m786-232v-108q0-7-5-12t-13-5h-678q-8 0-13 5t-5 12v108q0 7 5 12t13 5h678q7 0 13-5t5-12z m0 285v-107q0-7-5-12t-13-6h-678q-8 0-13 6t-5 12v107q0 8 5 13t13 5h678q7 0 13-5t5-13z" horiz-adv-x="1000" />
|
||||
|
||||
<glyph glyph-name="trash" unicode="" d="M286 82v393q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q8 0 13 5t5 13z m143 0v393q0 8-5 13t-13 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q8 0 13 5t5 13z m142 0v393q0 8-5 13t-12 5h-36q-8 0-13-5t-5-13v-393q0-8 5-13t13-5h36q7 0 12 5t5 13z m-303 554h250l-27 65q-4 5-9 6h-177q-6-1-10-6z m518-18v-36q0-8-5-13t-13-5h-54v-529q0-46-26-80t-63-34h-464q-37 0-63 33t-27 79v531h-53q-8 0-13 5t-5 13v36q0 8 5 13t13 5h172l39 93q9 21 31 35t44 15h178q23 0 44-15t30-35l39-93h173q8 0 13-5t5-13z" horiz-adv-x="785.7" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 2.3 KiB |
BIN
public/libs/fontello/fontello.ttf
Normal file
BIN
public/libs/fontello/fontello.ttf
Normal file
Binary file not shown.
BIN
public/libs/fontello/fontello.woff
Normal file
BIN
public/libs/fontello/fontello.woff
Normal file
Binary file not shown.
BIN
public/libs/fontello/fontello.woff2
Normal file
BIN
public/libs/fontello/fontello.woff2
Normal file
Binary file not shown.
9
public/libs/sweetalert/LICENSE
Normal file
9
public/libs/sweetalert/LICENSE
Normal file
@ -0,0 +1,9 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-present Tristan Edwards
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
5
public/libs/sweetalert/sweetalert.min.css
vendored
Normal file
5
public/libs/sweetalert/sweetalert.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
public/libs/sweetalert/sweetalert.min.js
vendored
Normal file
1
public/libs/sweetalert/sweetalert.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -30,11 +30,11 @@
|
||||
<meta name="twitter:image:src" content="{{ thumb }}">
|
||||
|
||||
<title>{{ title }}</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.3.0/css/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css">
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.15.3/axios.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="libs/bulma/bulma.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="libs/sweetalert/sweetalert.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="css/style.css">
|
||||
<script type="text/javascript" src="libs/sweetalert/sweetalert.min.js"></script>
|
||||
<script type="text/javascript" src="libs/axios/axios.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div class="column is-3" style="text-align: right; padding-top: 45px;">
|
||||
{{#if enableDownload}}
|
||||
<a class="button is-primary is-outlined" title="Download album" href="/api/album/zip/{{ identifier }}">Download Album</a>
|
||||
<a class="button is-primary is-outlined" title="Download album" href="api/album/zip/{{ identifier }}">Download Album</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user