Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_pdfviewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/PDFView.vue')
-rw-r--r--src/views/PDFView.vue9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/views/PDFView.vue b/src/views/PDFView.vue
index 0849309..d74bcc4 100644
--- a/src/views/PDFView.vue
+++ b/src/views/PDFView.vue
@@ -40,6 +40,15 @@ export default {
encodedDavPath() {
const hasScheme = this.davPath.indexOf('://') !== -1
+ if (this.davPath.indexOf(generateUrl('/s/')) === 0) {
+ const host = window.location.protocol + '//' + window.location.host
+ const url = new URL(hasScheme ? this.davPath : host + this.davPath)
+ const path = this.filename.replace(this.basename, '')
+ url.searchParams.set('path', path)
+ url.searchParams.set('files', this.basename)
+ return hasScheme ? url.toString() : url.toString().substr(host.length)
+ }
+
const pathSections = this.davPath.split('/')
// Ignore scheme and domain in the loop (note that the scheme