No more asking token on front if private

This commit is contained in:
Pitu 2017-01-30 06:00:01 -03:00
parent 66e7b676d9
commit 1ec6bbb640
2 changed files with 3 additions and 14 deletions

View File

@ -25,12 +25,7 @@
<div class="columns">
<div class="column is-hidden-mobile"></div>
<div class="column" id='uploadContainer'>
<p id='tokenContainer' class="control has-addons has-addons-centered">
<input id='token' class="input is-danger" type="text" placeholder="Your token">
<a id='tokenSubmit' class="button is-danger">Check</a>
</p>
<a id="loginToUpload" href="/auth" class="button is-danger">Running in private mode. Log in to upload.</a>
</div>
<div class="column is-hidden-mobile"></div>
</div>

View File

@ -21,13 +21,7 @@ upload.checkIfPublic = function(){
upload.preparePage = function(){
if(!upload.isPrivate) return upload.prepareUpload();
if(!upload.token){
document.getElementById('tokenSubmit').addEventListener('click', function(){
upload.verifyToken(document.getElementById('token').value)
});
document.getElementById('tokenContainer').style.display = 'flex';
return;
}
if(!upload.token) return document.getElementById('loginToUpload').style.display = 'inline-flex';
upload.verifyToken(upload.token, true);
}
@ -74,7 +68,7 @@ upload.prepareUpload = function(){
div.style.display = 'flex';
document.getElementById('maxFileSize').innerHTML = 'Maximum upload size per file is ' + upload.maxFileSize;
document.getElementById('tokenContainer').style.display = 'none';
document.getElementById('loginToUpload').style.display = 'none';
document.getElementById('uploadContainer').appendChild(div);
upload.prepareDropzone();