From fa6c33e2e91a3b880b5b6473e868742f9694bd4b Mon Sep 17 00:00:00 2001 From: Bobby Wibowo Date: Thu, 26 Apr 2018 13:48:44 +0700 Subject: [PATCH] no-mixed-spaces-and-tabs (#95) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I wonder why I can't see the diffs from my vscode 🤔 --- controllers/uploadController.js | 2 +- public/js/dashboard.js | 16 +++++++-------- public/js/home.js | 36 ++++++++++++++++----------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/controllers/uploadController.js b/controllers/uploadController.js index 51c0cf4..342dc30 100644 --- a/controllers/uploadController.js +++ b/controllers/uploadController.js @@ -17,7 +17,7 @@ const storage = multer.diskStorage({ destination: function(req, file, cb) { cb(null, uploadDir); }, - filename: function(req, file, cb) { + filename: function(req, file, cb) { const access = i => { const name = randomstring.generate(config.uploads.fileLength) + path.extname(file.originalname); fs.access(path.join(uploadDir, name), err => { diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 7309908..2715f47 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -337,7 +337,7 @@ panel.getAlbums = function(){ panel.renameAlbum = function(id){ swal({ - title: "Rename album", + title: "Rename album", text: "New name you want to give the album:", type: "input", showCancelButton: true, @@ -345,13 +345,13 @@ panel.renameAlbum = function(id){ animation: "slide-from-top", inputPlaceholder: "My super album" },function(inputValue){ - if (inputValue === false) return false; - if (inputValue === "") { - swal.showInputError("You need to write something!"); - return false - } - - axios.post('/api/albums/rename', { + if (inputValue === false) return false; + if (inputValue === "") { + swal.showInputError("You need to write something!"); + return false + } + + axios.post('/api/albums/rename', { id: id, name: inputValue }) diff --git a/public/js/home.js b/public/js/home.js index 9fcef05..35c65a4 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -9,15 +9,15 @@ upload.myDropzone; upload.checkIfPublic = function(){ axios.get('/api/check') - .then(function (response) { - upload.isPrivate= response.data.private; + .then(function (response) { + upload.isPrivate= response.data.private; upload.maxFileSize = response.data.maxFileSize; upload.preparePage(); - }) - .catch(function (error) { - swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - return console.log(error); - }); + }) + .catch(function (error) { + swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); + return console.log(error); + }); } upload.preparePage = function(){ @@ -33,10 +33,10 @@ upload.verifyToken = function(token, reloadOnError){ axios.post('/api/tokens/verify', { token: token }) - .then(function (response) { + .then(function (response) { - if(response.data.success === false){ - swal({ + if(response.data.success === false){ + swal({ title: "An error ocurred", text: response.data.description, type: "error" @@ -47,17 +47,17 @@ upload.verifyToken = function(token, reloadOnError){ } }) return; - } + } - localStorage.token = token; + localStorage.token = token; upload.token = token; return upload.prepareUpload(); - }) - .catch(function (error) { - swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); - return console.log(error); - }); + }) + .catch(function (error) { + swal("An error ocurred", 'There was an error with the request, please check the console for more information.', "error"); + return console.log(error); + }); } @@ -129,7 +129,7 @@ upload.prepareDropzone = function(){ maxFiles: 1000, autoProcessQueue: true, headers: { - 'token': upload.token + 'token': upload.token }, init: function() { upload.myDropzone = this;