aboutsummaryrefslogtreecommitdiff
path: root/public/js/dashboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/dashboard.js')
-rw-r--r--public/js/dashboard.js54
1 files changed, 27 insertions, 27 deletions
diff --git a/public/js/dashboard.js b/public/js/dashboard.js
index 9b1d8ca..a4de774 100644
--- a/public/js/dashboard.js
+++ b/public/js/dashboard.js
@@ -1,4 +1,4 @@
-let panel = {}
+let panel = {};
panel.page;
panel.username;
@@ -8,7 +8,7 @@ panel.filesView = localStorage.filesView;
panel.preparePage = function(){
if(!panel.token) return window.location = '/auth';
panel.verifyToken(panel.token, true);
-}
+};
panel.verifyToken = function(token, reloadOnError){
if(reloadOnError === undefined)
@@ -29,7 +29,7 @@ panel.verifyToken = function(token, reloadOnError){
localStorage.removeItem("token");
location.location = '/auth';
}
- })
+ });
return;
}
@@ -45,7 +45,7 @@ panel.verifyToken = function(token, reloadOnError){
console.log(error);
});
-}
+};
panel.prepareDashboard = function(){
panel.page = document.getElementById('page');
@@ -71,20 +71,20 @@ panel.prepareDashboard = function(){
document.getElementById('itemLogout').innerHTML = `Logout ( ${panel.username} )`;
panel.getAlbumsSidebar();
-}
+};
panel.logout = function(){
localStorage.removeItem("token");
location.reload('/');
-}
+};
panel.getUploads = function(album = undefined, page = undefined){
if(page === undefined) page = 0;
- let url = '/api/uploads/' + page
+ let url = '/api/uploads/' + page;
if(album !== undefined)
- url = '/api/album/' + album + '/' + page
+ url = '/api/album/' + album + '/' + page;
axios.get(url).then(function (response) {
if(response.data.success === false){
@@ -120,7 +120,7 @@ panel.getUploads = function(album = undefined, page = undefined){
</span>
</a>
</div>
- </div>`
+ </div>`;
if(panel.filesView === 'thumbs'){
@@ -213,13 +213,13 @@ panel.getUploads = function(album = undefined, page = undefined){
console.log(error);
});
-}
+};
panel.setFilesView = function(view, album, page){
localStorage.filesView = view;
panel.filesView = view;
panel.getUploads(album, page);
-}
+};
panel.deleteFile = function(id){
swal({
@@ -254,7 +254,7 @@ panel.deleteFile = function(id){
}
);
-}
+};
panel.getAlbums = function(){
@@ -331,7 +331,7 @@ panel.getAlbums = function(){
console.log(error);
});
-}
+};
panel.renameAlbum = function(id){
@@ -347,7 +347,7 @@ panel.renameAlbum = function(id){
if (inputValue === false) return false;
if (inputValue === "") {
swal.showInputError("You need to write something!");
- return false
+ return false;
}
axios.post('/api/albums/rename', {
@@ -375,7 +375,7 @@ panel.renameAlbum = function(id){
});
-}
+};
panel.deleteAlbum = function(id){
swal({
@@ -412,7 +412,7 @@ panel.deleteAlbum = function(id){
}
);
-}
+};
panel.submitAlbum = function(){
@@ -436,7 +436,7 @@ panel.submitAlbum = function(){
console.log(error);
});
-}
+};
panel.getAlbumsSidebar = function(){
@@ -474,12 +474,12 @@ panel.getAlbumsSidebar = function(){
console.log(error);
});
-}
+};
panel.getAlbum = function(item){
panel.setActiveMenu(item);
panel.getUploads(item.id);
-}
+};
panel.changeToken = function(){
@@ -515,7 +515,7 @@ panel.changeToken = function(){
console.log(error);
});
-}
+};
panel.getNewToken = function(){
@@ -534,7 +534,7 @@ panel.getNewToken = function(){
}, function(){
localStorage.token = response.data.token;
location.reload();
- })
+ });
})
.catch(function (error) {
@@ -542,7 +542,7 @@ panel.getNewToken = function(){
console.log(error);
});
-}
+};
panel.changePassword = function(){
@@ -578,7 +578,7 @@ panel.changePassword = function(){
});
}
});
-}
+};
panel.sendNewPassword = function(pass){
@@ -596,7 +596,7 @@ panel.sendNewPassword = function(pass){
type: "success"
}, function(){
location.reload();
- })
+ });
})
.catch(function (error) {
@@ -604,7 +604,7 @@ panel.sendNewPassword = function(pass){
console.log(error);
});
-}
+};
panel.setActiveMenu = function(item){
var menu = document.getElementById('menu');
@@ -613,8 +613,8 @@ panel.setActiveMenu = function(item){
items[i].className = "";
item.className = 'is-active';
-}
+};
window.onload = function () {
panel.preparePage();
-}
+};