Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added css/fonts/roboto-cyrillic-400-normal.woff
Binary file not shown.
Binary file added css/fonts/roboto-cyrillic-400-normal.woff2
Binary file not shown.
Binary file added css/fonts/roboto-cyrillic-ext-400-normal.woff
Binary file not shown.
Binary file added css/fonts/roboto-cyrillic-ext-400-normal.woff2
Binary file not shown.
Binary file added css/fonts/roboto-greek-400-normal.woff
Binary file not shown.
Binary file added css/fonts/roboto-greek-400-normal.woff2
Binary file not shown.
Binary file added css/fonts/roboto-latin-400-normal.woff
Binary file not shown.
Binary file added css/fonts/roboto-latin-400-normal.woff2
Binary file not shown.
Binary file added css/fonts/roboto-latin-ext-400-normal.woff
Binary file not shown.
Binary file added css/fonts/roboto-latin-ext-400-normal.woff2
Binary file not shown.
Binary file added css/fonts/roboto-vietnamese-400-normal.woff
Binary file not shown.
Binary file added css/fonts/roboto-vietnamese-400-normal.woff2
Binary file not shown.
4 changes: 2 additions & 2 deletions js/viewer-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-init.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions js/viewer-main.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@
*/

/**
* @copyright Copyright (c) 2020 Azul <[email protected]>
* @copyright Copyright (c) 2019 Marco Ambrosini <[email protected]>
*
* @author Azul <[email protected]>
* @author Marco Ambrosini <[email protected]>
* @author John Molakvoæ <[email protected]>
* @author Louis Chemineau <[email protected]>
*
* @license AGPL-3.0-or-later
*
Expand All @@ -88,9 +90,9 @@
*/

/**
* @copyright Copyright (c) 2020 John Molakvoæ <[email protected]>
* @copyright Copyright (c) 2020 Azul <[email protected]>
*
* @author John Molakvoæ <[email protected]>
* @author Azul <[email protected]>
*
* @license AGPL-3.0-or-later
*
Expand Down
2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@nextcloud/axios": "^2.5.0",
"@nextcloud/dialogs": "^5.3.7",
"@nextcloud/event-bus": "^3.3.1",
"@nextcloud/files": "^3.9.0",
"@nextcloud/files": "^3.10.0",
"@nextcloud/initial-state": "^2.2.0",
"@nextcloud/l10n": "^3.1.0",
"@nextcloud/logger": "^2.7.0",
Expand Down
40 changes: 25 additions & 15 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,34 +188,35 @@

<script>
import '@nextcloud/dialogs/style.css'
import Vue from 'vue'
import Vue, { defineComponent } from 'vue'

import axios from '@nextcloud/axios'
import { showError } from '@nextcloud/dialogs'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import getSortingConfig from '../services/FileSortingConfig.ts'
import { File as NcFile, Node, davGetRootPath } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'
import { showError } from '@nextcloud/dialogs'
import axios from '@nextcloud/axios'

import isFullscreen from '@nextcloud/vue/dist/Mixins/isFullscreen.js'
import isMobile from '@nextcloud/vue/dist/Mixins/isMobile.js'

import { extractFilePaths, sortCompare } from '../utils/fileUtils.ts'
import { getRootPath, getUserRoot } from '../utils/davUtils.ts'
import canDownload from '../utils/canDownload.js'
import cancelableRequest from '../utils/CancelableRequest.js'
import canDownload from '../utils/canDownload.js'
import Error from '../components/Error.vue'
import File from '../models/file.js'
import legacyFilesActionHandler from '../services/LegacyFilesActionHandler.js'
import getFileInfo from '../services/FileInfo.ts'
import getFileList from '../services/FileList.ts'
import Mime from '../mixins/Mime.js'
import getSortingConfig from '../services/FileSortingConfig.ts'
import legacyFilesActionHandler from '../services/LegacyFilesActionHandler.js'
import logger from '../services/logger.js'
import Mime from '../mixins/Mime.js'

import Delete from 'vue-material-design-icons/Delete.vue'
import Download from 'vue-material-design-icons/Download.vue'
import Fullscreen from 'vue-material-design-icons/Fullscreen.vue'
import FullscreenExit from 'vue-material-design-icons/FullscreenExit.vue'
import Pencil from 'vue-material-design-icons/Pencil.vue'
import { loadState } from '@nextcloud/initial-state'

// Dynamic loading
const NcModal = () => import(
Expand All @@ -225,7 +226,7 @@ const NcModal = () => import(
const NcActionLink = () => import(/* webpackChunkName: 'components' */'@nextcloud/vue/dist/Components/NcActionLink.js')
const NcActionButton = () => import(/* webpackChunkName: 'components' */'@nextcloud/vue/dist/Components/NcActionButton.js')

export default {
export default defineComponent({
name: 'Viewer',

components: {
Expand Down Expand Up @@ -963,7 +964,7 @@ export default {
event.preventDefault()
if (this.canDownload) {
const a = document.createElement('a')
a.href = this.currentFile.davPath
a.href = this.currentFile.source ?? this.currentFile.davPath
a.download = this.currentFile.basename
document.body.appendChild(a)
a.click()
Expand Down Expand Up @@ -1116,16 +1117,25 @@ export default {
async onDelete() {
try {
const fileid = this.currentFile.fileid
const url = this.source ?? this.currentFile.davPath
const url = this.currentFile.source ?? this.currentFile.davPath

// Fake node to emit the event until Viewer is migrated to the new Node API.
const node = new NcFile({
source: url,
fileid,
mime: this.currentFile.mime,
owner: this.currentFile.ownerId,
root: url.includes('remote.php/dav') ? davGetRootPath() : undefined,
})

await axios.delete(url)
emit('files:node:deleted', { fileid })
emit('files:node:deleted', node)

// fileid is not unique, basename is not unqiue, filename is
// fileid is not unique, basename is not unique, filename is
const currentIndex = this.fileList.findIndex(file => file.filename === this.currentFile.filename)
if (this.hasPrevious || this.hasNext) {
// Checking the previous or next file
this.hasPrevious ? this.previous() : this.next()
this.hasNext ? this.next() : this.previous()

this.fileList.splice(currentIndex, 1)
} else {
Expand Down Expand Up @@ -1194,7 +1204,7 @@ export default {
},

},
}
})
</script>

<style lang="scss" scoped>
Expand Down
Loading