From 7f0934ed28ecbc44c7f3de7d3a901abb1dd55f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6?= Date: Tue, 3 May 2022 08:46:11 +0200 Subject: [PATCH] Lint fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ --- package-lock.json | 1 + package.json | 1 + src/components/Audios.vue | 4 ++-- src/components/Error.vue | 2 +- src/components/Images.vue | 2 +- src/components/Videos.vue | 4 ++-- src/main.js | 6 ++--- src/mixins/Mime.js | 4 ++-- src/mixins/PreviewUrl.js | 8 +++---- src/models/audios.js | 4 ++-- src/models/file.js | 10 ++++---- src/models/images.js | 8 +++---- src/models/videos.js | 4 ++-- src/services/DavClient.js | 4 ++-- src/services/FileInfo.js | 6 ++--- src/services/FileList.js | 6 ++--- src/services/FilesActionHandler.js | 10 ++++---- src/services/Viewer.js | 8 +++---- src/services/logger.js | 2 +- src/utils/CancelableRequest.js | 2 +- src/utils/canDownload.js | 2 +- src/utils/davUtils.js | 2 +- src/utils/fileUtils.js | 10 ++++---- src/utils/numberUtil.js | 2 +- src/views/Viewer.vue | 38 +++++++++++++++--------------- 25 files changed, 76 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8d0964c0..5c8b1ce3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "path-parse": "^1.0.7", "vue": "^2.6.14", "vue-async-computed": "^3.9.0", + "vue-material-design-icons": "^5.0.0", "webdav": "^4.9.0" }, "devDependencies": { diff --git a/package.json b/package.json index d146f7e35..ea04e167e 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "path-parse": "^1.0.7", "vue": "^2.6.14", "vue-async-computed": "^3.9.0", + "vue-material-design-icons": "^5.0.0", "webdav": "^4.9.0" }, "browserslist": [ diff --git a/src/components/Audios.vue b/src/components/Audios.vue index 33ec13edd..fe8ff734b 100644 --- a/src/components/Audios.vue +++ b/src/components/Audios.vue @@ -3,7 +3,7 @@ - - @author Daniel Kesselberg - - - @license GNU AGPL version 3 or any later version + - @license AGPL-3.0-or-later - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as @@ -49,7 +49,7 @@ import Vue from 'vue' import VuePlyr from '@skjnldsv/vue-plyr' import '@skjnldsv/vue-plyr/dist/vue-plyr.css' -import logger from '../services/logger' +import logger from '../services/logger.js' Vue.use(VuePlyr) diff --git a/src/components/Error.vue b/src/components/Error.vue index fa114c98d..b16c6e366 100644 --- a/src/components/Error.vue +++ b/src/components/Error.vue @@ -3,7 +3,7 @@ - - @author John Molakvoæ - - - @license GNU AGPL version 3 or any later version + - @license AGPL-3.0-or-later - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as diff --git a/src/components/Images.vue b/src/components/Images.vue index 6f6e17bf3..7dcb26782 100644 --- a/src/components/Images.vue +++ b/src/components/Images.vue @@ -3,7 +3,7 @@ - - @author John Molakvoæ - - - @license GNU AGPL version 3 or any later version + - @license AGPL-3.0-or-later - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as diff --git a/src/components/Videos.vue b/src/components/Videos.vue index 815f98912..4e48cc441 100644 --- a/src/components/Videos.vue +++ b/src/components/Videos.vue @@ -3,7 +3,7 @@ - - @author John Molakvoæ - - - @license GNU AGPL version 3 or any later version + - @license AGPL-3.0-or-later - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as @@ -55,7 +55,7 @@ import Vue from 'vue' import VuePlyr from '@skjnldsv/vue-plyr' import '@skjnldsv/vue-plyr/dist/vue-plyr.css' -import logger from '../services/logger' +import logger from '../services/logger.js' const liveExt = ['jpg', 'jpeg', 'png'] const liveExtRegex = new RegExp(`\\.(${liveExt.join('|')})$`, 'i') diff --git a/src/main.js b/src/main.js index 411b6a557..5db53520e 100644 --- a/src/main.js +++ b/src/main.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,8 +20,8 @@ * */ import Vue from 'vue' -import ViewerComponent from './views/Viewer' -import ViewerService from './services/Viewer' +import ViewerComponent from './views/Viewer.vue' +import ViewerService from './services/Viewer.js' import { translate as t } from '@nextcloud/l10n' import { generateFilePath } from '@nextcloud/router' diff --git a/src/mixins/Mime.js b/src/mixins/Mime.js index 470fcaed9..ceceb0027 100644 --- a/src/mixins/Mime.js +++ b/src/mixins/Mime.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,7 +20,7 @@ * */ import debounce from 'debounce' -import PreviewUrl from '../mixins/PreviewUrl' +import PreviewUrl from '../mixins/PreviewUrl.js' import parsePath from 'path-parse' export default { diff --git a/src/mixins/PreviewUrl.js b/src/mixins/PreviewUrl.js index e50330d3d..c5bd387d0 100644 --- a/src/mixins/PreviewUrl.js +++ b/src/mixins/PreviewUrl.js @@ -4,7 +4,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -21,8 +21,8 @@ * */ import { generateUrl } from '@nextcloud/router' -import { getToken, isPublic } from '../utils/davUtils' -import { encodeFilePath, getDavPath } from '../utils/fileUtils' +import { getToken, isPublic } from '../utils/davUtils.js' +import { encodeFilePath, getDavPath } from '../utils/fileUtils.js' export default { computed: { @@ -62,7 +62,7 @@ export default { * @param {string} data.fileid the file id * @param {boolean} data.hasPreview have the file an existing preview ? * @param {string} data.davPath the absolute dav path - * @param data.filename + * @param {string} data.filename the file name * @return {string} the absolute url */ getPreviewIfAny({ fileid, filename, hasPreview, davPath }) { diff --git a/src/models/audios.js b/src/models/audios.js index 28f4ae7aa..5eaad9e26 100644 --- a/src/models/audios.js +++ b/src/models/audios.js @@ -3,7 +3,7 @@ * * @author Daniel Kesselberg * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,7 +20,7 @@ * */ -import Audios from '../components/Audios' +import Audios from '../components/Audios.vue' export default { id: 'audios', diff --git a/src/models/file.js b/src/models/file.js index 97decda1a..635a694a6 100644 --- a/src/models/file.js +++ b/src/models/file.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -19,12 +19,12 @@ * along with this program. If not, see . * */ -import { getDavPath } from '../utils/fileUtils' +import { getDavPath } from '../utils/fileUtils.js' /** - * @param fileInfo - * @param mime - * @param component + * @param {object} fileInfo a FileInfo object + * @param {string} mime the file mime type + * @param {object} component the component to render */ export default function(fileInfo, mime, component) { const data = { diff --git a/src/models/images.js b/src/models/images.js index a515729dd..9e625c4af 100644 --- a/src/models/images.js +++ b/src/models/images.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -21,8 +21,8 @@ */ import { loadState } from '@nextcloud/initial-state' -import logger from '../services/logger' -import Images from '../components/Images' +import logger from '../services/logger.js' +import Images from '../components/Images.vue' const enabledPreviewProviders = loadState(appName, 'enabled_preview_providers', []) @@ -62,7 +62,7 @@ export default { // Gif and svg images does not rely on previews 'image/gif', 'image/svg+xml', - ...enabledMimes + ...enabledMimes, ], component: Images, } diff --git a/src/models/videos.js b/src/models/videos.js index 4af9f236d..2491cb8f9 100644 --- a/src/models/videos.js +++ b/src/models/videos.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,7 +20,7 @@ * */ -import Videos from '../components/Videos' +import Videos from '../components/Videos.vue' export default { id: 'videos', diff --git a/src/services/DavClient.js b/src/services/DavClient.js index 96d65297a..ef2f05505 100644 --- a/src/services/DavClient.js +++ b/src/services/DavClient.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -23,7 +23,7 @@ import { createClient, getPatcher } from 'webdav' import axios from '@nextcloud/axios' -import { getRootPath, getToken, isPublic } from '../utils/davUtils' +import { getRootPath, getToken, isPublic } from '../utils/davUtils.js' // Add this so the server knows it is an request from the browserg axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest' diff --git a/src/services/FileInfo.js b/src/services/FileInfo.js index 4511549a6..b722024aa 100644 --- a/src/services/FileInfo.js +++ b/src/services/FileInfo.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,8 +20,8 @@ * */ -import client from './DavClient' -import { genFileInfo } from '../utils/fileUtils' +import client from './DavClient.js' +import { genFileInfo } from '../utils/fileUtils.js' /** * Retrieve the files list * diff --git a/src/services/FileList.js b/src/services/FileList.js index 5c9b8c02b..602bcbd62 100644 --- a/src/services/FileList.js +++ b/src/services/FileList.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,8 +20,8 @@ * */ -import client from './DavClient' -import { genFileInfo } from '../utils/fileUtils' +import client from './DavClient.js' +import { genFileInfo } from '../utils/fileUtils.js' /** * Retrieve the files list diff --git a/src/services/FilesActionHandler.js b/src/services/FilesActionHandler.js index 84dbd986e..546de44a8 100644 --- a/src/services/FilesActionHandler.js +++ b/src/services/FilesActionHandler.js @@ -3,7 +3,7 @@ * * @author Azul * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -23,8 +23,8 @@ import { encodePath } from '@nextcloud/paths' /** - * @param name - * @param context + * @param {string} name the file name + * @param {object} context the file context */ export default function(name, context) { // replace potential leading double slashes @@ -41,8 +41,8 @@ export default function(name, context) { } /** - * @param root0 - * @param root0.fileid + * @param {object} root destructuring object + * @param {number} root.fileid the opened file ID */ function pushToHistory({ fileid }) { const params = OC.Util.History.parseUrlQuery() diff --git a/src/services/Viewer.js b/src/services/Viewer.js index a3d0692bd..cc22ac86e 100644 --- a/src/services/Viewer.js +++ b/src/services/Viewer.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -20,9 +20,9 @@ * */ -import Images from '../models/images' -import Videos from '../models/videos' -import Audios from '../models/audios' +import Images from '../models/images.js' +import Videos from '../models/videos.js' +import Audios from '../models/audios.js' export default class Viewer { diff --git a/src/services/logger.js b/src/services/logger.js index e83190765..d2eb5c7bd 100644 --- a/src/services/logger.js +++ b/src/services/logger.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/utils/CancelableRequest.js b/src/utils/CancelableRequest.js index 9f48461c1..541a42757 100644 --- a/src/utils/CancelableRequest.js +++ b/src/utils/CancelableRequest.js @@ -4,7 +4,7 @@ * @author Marco Ambrosini * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/utils/canDownload.js b/src/utils/canDownload.js index 377de7dbd..153cdad80 100644 --- a/src/utils/canDownload.js +++ b/src/utils/canDownload.js @@ -4,7 +4,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/utils/davUtils.js b/src/utils/davUtils.js index f64801f08..8211ed755 100644 --- a/src/utils/davUtils.js +++ b/src/utils/davUtils.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/utils/fileUtils.js b/src/utils/fileUtils.js index 2400d7d21..74ac05730 100644 --- a/src/utils/fileUtils.js +++ b/src/utils/fileUtils.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -23,8 +23,8 @@ import { dirname } from '@nextcloud/paths' import { generateUrl } from '@nextcloud/router' import camelcase from 'camelcase' -import { getRootPath, getToken, isPublic } from './davUtils' -import { isNumber } from './numberUtil' +import { getRootPath, getToken, isPublic } from './davUtils.js' +import { isNumber } from './numberUtil.js' /** * Get an url encoded path @@ -127,8 +127,8 @@ const genFileInfo = function(obj) { * Generate absolute dav remote path of the file * * @param {object} fileInfo The fileInfo - * @param fileInfo.filename - * @param fileInfo.basename + * @param {string} fileInfo.filename the file full path + * @param {string} fileInfo.basename the file name * @return {string} */ const getDavPath = function({ filename, basename }) { diff --git a/src/utils/numberUtil.js b/src/utils/numberUtil.js index 0c3a96e5a..dd55f8ab1 100644 --- a/src/utils/numberUtil.js +++ b/src/utils/numberUtil.js @@ -3,7 +3,7 @@ * * @author John Molakvoæ * - * @license GNU AGPL version 3 or any later version + * @license AGPL-3.0-or-later * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index 16d6b0ba8..daf9411a5 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -4,7 +4,7 @@ - - @author John Molakvoæ - - - @license GNU AGPL version 3 or any later version + - @license AGPL-3.0-or-later - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as @@ -121,24 +121,24 @@ import '@nextcloud/dialogs/styles/toast.scss' import { showError } from '@nextcloud/dialogs' import { subscribe, unsubscribe } from '@nextcloud/event-bus' -import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' -import ActionLink from '@nextcloud/vue/dist/Components/ActionLink' -import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen' -import Modal from '@nextcloud/vue/dist/Components/Modal' - -import { extractFilePaths, sortCompare } from '../utils/fileUtils' -import { getRootPath } from '../utils/davUtils' -import canDownload from '../utils/canDownload' -import cancelableRequest from '../utils/CancelableRequest' -import Error from '../components/Error' -import File from '../models/file' -import filesActionHandler from '../services/FilesActionHandler' -import getFileInfo from '../services/FileInfo' -import getFileList from '../services/FileList' -import Mime from '../mixins/Mime' -import logger from '../services/logger' - -import Download from 'vue-material-design-icons/Download' +import ActionButton from '@nextcloud/vue/dist/Components/ActionButton.js' +import ActionLink from '@nextcloud/vue/dist/Components/ActionLink.js' +import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js' +import Modal from '@nextcloud/vue/dist/Components/Modal.js' + +import { extractFilePaths, sortCompare } from '../utils/fileUtils.js' +import { getRootPath } from '../utils/davUtils.js' +import canDownload from '../utils/canDownload.js' +import cancelableRequest from '../utils/CancelableRequest.js' +import Error from '../components/Error.vue' +import File from '../models/file.js' +import filesActionHandler from '../services/FilesActionHandler.js' +import getFileInfo from '../services/FileInfo.js' +import getFileList from '../services/FileList.js' +import Mime from '../mixins/Mime.js' +import logger from '../services/logger.js' + +import Download from 'vue-material-design-icons/Download.vue' export default { name: 'Viewer',