diff options
| author | Bobby Wibowo <[email protected]> | 2018-04-26 13:50:35 +0700 |
|---|---|---|
| committer | Crawl <[email protected]> | 2018-04-26 08:50:35 +0200 |
| commit | 19e965a77a6e5040d2ca6ad3c9a565408c5910fe (patch) | |
| tree | 5bb57a41e4ce20354ddc11e873c1467164ad2562 /public/js | |
| parent | no-useless-return (#94) (diff) | |
| download | host.fuwn.me-19e965a77a6e5040d2ca6ad3c9a565408c5910fe.tar.xz host.fuwn.me-19e965a77a6e5040d2ca6ad3c9a565408c5910fe.zip | |
SEMICOLONS, ermahgerd (#93)
Diffstat (limited to 'public/js')
| -rw-r--r-- | public/js/auth.js | 6 | ||||
| -rw-r--r-- | public/js/dashboard.js | 54 | ||||
| -rw-r--r-- | public/js/home.js | 18 |
3 files changed, 39 insertions, 39 deletions
diff --git a/public/js/auth.js b/public/js/auth.js index ecc7c7c..1ae9e4d 100644 --- a/public/js/auth.js +++ b/public/js/auth.js @@ -27,7 +27,7 @@ page.do = function(dest){ return swal('An error ocurred', 'There was an error with the request, please check the console for more information.', 'error'); console.log(error); }); -} +}; page.verify = function(){ page.token = localStorage.token; @@ -49,8 +49,8 @@ page.verify = function(){ console.log(error); }); -} +}; window.onload = function () { page.verify(); -}
\ No newline at end of file +};
\ No newline at end of file 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(); -} +}; diff --git a/public/js/home.js b/public/js/home.js index 35c65a4..383e245 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -24,7 +24,7 @@ upload.preparePage = function(){ if(!upload.isPrivate) return upload.prepareUpload(); if(!upload.token) return document.getElementById('loginToUpload').style.display = 'inline-flex'; upload.verifyToken(upload.token, true); -} +}; upload.verifyToken = function(token, reloadOnError){ if(reloadOnError === undefined) @@ -45,7 +45,7 @@ upload.verifyToken = function(token, reloadOnError){ localStorage.removeItem("token"); location.reload(); } - }) + }); return; } @@ -59,7 +59,7 @@ upload.verifyToken = function(token, reloadOnError){ return console.log(error); }); -} +}; upload.prepareUpload = function(){ // I think this fits best here because we need to check for a valid token before we can get the albums @@ -91,7 +91,7 @@ upload.prepareUpload = function(){ .catch(function(e) { swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); return console.log(e); - }) + }); } div = document.createElement('div'); @@ -109,7 +109,7 @@ upload.prepareUpload = function(){ upload.prepareDropzone(); -} +}; upload.prepareDropzone = function(){ var previewNode = document.querySelector('#template'); @@ -139,7 +139,7 @@ upload.prepareDropzone = function(){ // add the selected albumid, if an album is selected, as a header this.on('sending', function(file, xhr) { if (upload.album) { - xhr.setRequestHeader('albumid', upload.album) + xhr.setRequestHeader('albumid', upload.album); } }); } @@ -173,7 +173,7 @@ upload.prepareDropzone = function(){ }); upload.prepareShareX(); -} +}; upload.prepareShareX = function(){ if (upload.token) { @@ -192,10 +192,10 @@ upload.prepareShareX = function(){ \"ThumbnailURL\": \"$json:files[0].url$\"\r\n\ }"; var sharex_blob = new Blob([sharex_file], {type: "application/octet-binary"}); - sharex_element.setAttribute("href", URL.createObjectURL(sharex_blob)) + sharex_element.setAttribute("href", URL.createObjectURL(sharex_blob)); sharex_element.setAttribute("download", location.hostname + ".sxcu"); } -} +}; //Handle image paste event window.addEventListener('paste', function(event) { |