mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-07 12:21:33 +00:00
Fix .eslintrc.json for client-side JS files
I can't remember why I extended the config with "eslint:recommended" instead of "standard" back then. I know I wanted to force an older ecmaversion, but even then it would still work just fine with standard. I've fixed it now to use standard. I've also applied auto-fix to dashboard.js and home.js, which fixed some stray or missing whitespaces, as well as the indenting of case's inside switch statement.
This commit is contained in:
parent
7587bfa408
commit
ed7612bd89
@ -7,33 +7,16 @@
|
|||||||
"browser": true
|
"browser": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended"
|
"standard"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"curly": [
|
"curly": [
|
||||||
"error",
|
"error",
|
||||||
"all"
|
"all"
|
||||||
],
|
],
|
||||||
"no-console": 0,
|
|
||||||
"semi": [
|
|
||||||
"error",
|
|
||||||
"never"
|
|
||||||
],
|
|
||||||
"space-before-function-paren": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"anonymous": "always",
|
|
||||||
"named": "never",
|
|
||||||
"asyncArrow": "always"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"quotes": [
|
"quotes": [
|
||||||
"error",
|
"error",
|
||||||
"single"
|
"single"
|
||||||
],
|
|
||||||
"indent": [
|
|
||||||
"error",
|
|
||||||
2
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,43 +141,43 @@ page.domClick = function (event) {
|
|||||||
var action = element.dataset.action
|
var action = element.dataset.action
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'page-prev':
|
case 'page-prev':
|
||||||
if (page.currentView.pageNum === 0) {
|
if (page.currentView.pageNum === 0) {
|
||||||
return swal('Can\'t do that!', 'This is already the first page!', 'warning')
|
return swal('Can\'t do that!', 'This is already the first page!', 'warning')
|
||||||
}
|
}
|
||||||
return page.getUploads(page.currentView.album, page.currentView.pageNum - 1, element)
|
return page.getUploads(page.currentView.album, page.currentView.pageNum - 1, element)
|
||||||
case 'page-next':
|
case 'page-next':
|
||||||
return page.getUploads(page.currentView.album, page.currentView.pageNum + 1, element)
|
return page.getUploads(page.currentView.album, page.currentView.pageNum + 1, element)
|
||||||
case 'view-list':
|
case 'view-list':
|
||||||
return page.setFilesView('list', element)
|
return page.setFilesView('list', element)
|
||||||
case 'view-thumbs':
|
case 'view-thumbs':
|
||||||
return page.setFilesView('thumbs', element)
|
return page.setFilesView('thumbs', element)
|
||||||
case 'clear-selection':
|
case 'clear-selection':
|
||||||
return page.clearSelection()
|
return page.clearSelection()
|
||||||
case 'add-selected-files-to-album':
|
case 'add-selected-files-to-album':
|
||||||
return page.addSelectedFilesToAlbum()
|
return page.addSelectedFilesToAlbum()
|
||||||
case 'bulk-delete':
|
case 'bulk-delete':
|
||||||
return page.deleteSelectedFiles()
|
return page.deleteSelectedFiles()
|
||||||
case 'select-file':
|
case 'select-file':
|
||||||
return page.selectFile(element, event)
|
return page.selectFile(element, event)
|
||||||
case 'add-to-album':
|
case 'add-to-album':
|
||||||
return page.addSingleFileToAlbum(id)
|
return page.addSingleFileToAlbum(id)
|
||||||
case 'delete-file':
|
case 'delete-file':
|
||||||
return page.deleteFile(id)
|
return page.deleteFile(id)
|
||||||
case 'select-all-files':
|
case 'select-all-files':
|
||||||
return page.selectAllFiles(element)
|
return page.selectAllFiles(element)
|
||||||
case 'display-thumbnail':
|
case 'display-thumbnail':
|
||||||
return page.displayThumbnail(id)
|
return page.displayThumbnail(id)
|
||||||
case 'delete-file-by-names':
|
case 'delete-file-by-names':
|
||||||
return page.deleteFileByNames()
|
return page.deleteFileByNames()
|
||||||
case 'submit-album':
|
case 'submit-album':
|
||||||
return page.submitAlbum(element)
|
return page.submitAlbum(element)
|
||||||
case 'edit-album':
|
case 'edit-album':
|
||||||
return page.editAlbum(id)
|
return page.editAlbum(id)
|
||||||
case 'delete-album':
|
case 'delete-album':
|
||||||
return page.deleteAlbum(id)
|
return page.deleteAlbum(id)
|
||||||
case 'get-new-token':
|
case 'get-new-token':
|
||||||
return page.getNewToken(element)
|
return page.getNewToken(element)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1246,7 +1246,6 @@ page.setFileLength = function (fileLength, element) {
|
|||||||
page.changeToken = function () {
|
page.changeToken = function () {
|
||||||
axios.get('api/tokens')
|
axios.get('api/tokens')
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
|
|
||||||
if (response.data.success === false) {
|
if (response.data.success === false) {
|
||||||
if (response.data.description === 'No token provided') {
|
if (response.data.description === 'No token provided') {
|
||||||
return page.verifyToken(page.token)
|
return page.verifyToken(page.token)
|
||||||
@ -1275,7 +1274,6 @@ page.changeToken = function () {
|
|||||||
' </a>\n' +
|
' </a>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
'</div>'
|
'</div>'
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@ -1385,7 +1383,6 @@ page.sendNewPassword = function (pass, element) {
|
|||||||
page.isLoading(element, false)
|
page.isLoading(element, false)
|
||||||
return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')
|
return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page.setActiveMenu = function (activeItem) {
|
page.setActiveMenu = function (activeItem) {
|
||||||
|
@ -25,7 +25,8 @@ var imageExtensions = ['.webp', '.jpg', '.jpeg', '.bmp', '.gif', '.png']
|
|||||||
|
|
||||||
page.checkIfPublic = function () {
|
page.checkIfPublic = function () {
|
||||||
axios.get('api/check')
|
axios.get('api/check')
|
||||||
.then(function (response) { page.private = response.data.private
|
.then(function (response) {
|
||||||
|
page.private = response.data.private
|
||||||
page.enableUserAccounts = response.data.enableUserAccounts
|
page.enableUserAccounts = response.data.enableUserAccounts
|
||||||
page.maxFileSize = response.data.maxFileSize
|
page.maxFileSize = response.data.maxFileSize
|
||||||
page.chunkSize = response.data.chunkSize
|
page.chunkSize = response.data.chunkSize
|
||||||
@ -38,7 +39,6 @@ page.checkIfPublic = function () {
|
|||||||
button.innerText = 'Error occurred. Reload the page?'
|
button.innerText = 'Error occurred. Reload the page?'
|
||||||
return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')
|
return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page.preparePage = function () {
|
page.preparePage = function () {
|
||||||
@ -302,12 +302,12 @@ page.uploadUrls = function (button) {
|
|||||||
if (button.classList.contains('is-loading')) { return }
|
if (button.classList.contains('is-loading')) { return }
|
||||||
button.classList.add('is-loading')
|
button.classList.add('is-loading')
|
||||||
|
|
||||||
function done(error) {
|
function done (error) {
|
||||||
if (error) { swal('An error occurred!', error, 'error') }
|
if (error) { swal('An error occurred!', error, 'error') }
|
||||||
button.classList.remove('is-loading')
|
button.classList.remove('is-loading')
|
||||||
}
|
}
|
||||||
|
|
||||||
function run() {
|
function run () {
|
||||||
var albumid = page.album
|
var albumid = page.album
|
||||||
var previewsContainer = tabDiv.getElementsByClassName('uploads')[0]
|
var previewsContainer = tabDiv.getElementsByClassName('uploads')[0]
|
||||||
var urls = document.getElementById('urls').value
|
var urls = document.getElementById('urls').value
|
||||||
@ -333,12 +333,12 @@ page.uploadUrls = function (button) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
function post(i) {
|
function post (i) {
|
||||||
if (i === files.length) { return done() }
|
if (i === files.length) { return done() }
|
||||||
|
|
||||||
var file = files[i]
|
var file = files[i]
|
||||||
|
|
||||||
function posted(result) {
|
function posted (result) {
|
||||||
file.previewElement.querySelector('.progress').style.display = 'none'
|
file.previewElement.querySelector('.progress').style.display = 'none'
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
page.updateTemplate(file, result.files[0])
|
page.updateTemplate(file, result.files[0])
|
||||||
@ -477,7 +477,6 @@ page.createAlbum = function () {
|
|||||||
return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')
|
return swal('An error occurred!', 'There was an error with the request, please check the console for more information.', 'error')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle image paste event
|
// Handle image paste event
|
||||||
|
Loading…
Reference in New Issue
Block a user