diff --git a/_assets/src/components/DeletePrompt.vue b/_assets/src/components/DeletePrompt.vue
index 820f3a57..97e581ea 100644
--- a/_assets/src/components/DeletePrompt.vue
+++ b/_assets/src/components/DeletePrompt.vue
@@ -31,7 +31,7 @@ export default {
webdav.trash(window.location.pathname)
.then(() => {
// buttons.setDone('delete')
- page.open(page.removeLastDir(window.location.pathname))
+ page.open(page.removeLastDir(window.location.pathname) + '/')
})
.catch(error => {
// buttons.setDone('delete', false)
diff --git a/_assets/src/components/Preview.vue b/_assets/src/components/Preview.vue
index 3e748dba..653e4167 100644
--- a/_assets/src/components/Preview.vue
+++ b/_assets/src/components/Preview.vue
@@ -50,8 +50,7 @@ export default {
return this.req.data.url + '?raw=true'
},
back: function (event) {
- let url = page.removeLastDir(window.location.pathname)
- if (url === '') url = '/'
+ let url = page.removeLastDir(window.location.pathname) + '/'
page.open(url)
},
allowEdit: function (event) {
diff --git a/_assets/src/components/Search.vue b/_assets/src/components/Search.vue
index 16a19680..656e0d87 100644
--- a/_assets/src/components/Search.vue
+++ b/_assets/src/components/Search.vue
@@ -13,7 +13,7 @@
{{ text() }}
- {{ c }}
@@ -92,7 +92,7 @@ export default {
let uri = window.location.host + window.location.pathname
if (this.$store.state.req.kind !== 'listing') {
- uri = page.removeLastDir(uri)
+ uri = page.removeLastDir(uri) + '/'
}
uri = `${(this.$store.state.ssl ? 'wss:' : 'ws:')}//${uri}`
@@ -121,7 +121,10 @@ export default {
conn.onopen = () => conn.send(this.value)
conn.onmessage = (event) => {
- this.search.push(event.data)
+ let url = event.data
+ if (url[0] === '/') url = url.substring(1)
+
+ this.search.push(url)
this.scrollable.scrollTop = this.scrollable.scrollHeight
}
diff --git a/_assets/src/utils/page.js b/_assets/src/utils/page.js
index 9a5eb416..affcf24a 100644
--- a/_assets/src/utils/page.js
+++ b/_assets/src/utils/page.js
@@ -36,7 +36,8 @@ function removeLastDir (url) {
if (arr.pop() === '') {
arr.pop()
}
- return (arr.join('/'))
+
+ return arr.join('/')
}
export default {
diff --git a/_assets/src/utils/webdav.js b/_assets/src/utils/webdav.js
index c6d797db..7bab3812 100644
--- a/_assets/src/utils/webdav.js
+++ b/_assets/src/utils/webdav.js
@@ -48,27 +48,6 @@ function put (link, body, headers = {}) {
})
}
-function propfind (link, body, headers = {}) {
- return new Promise((resolve, reject) => {
- let request = new window.XMLHttpRequest()
- request.open('PROPFIND', convertURL(link), true)
-
- for (let key in headers) {
- request.setRequestHeader(key, headers[key])
- }
-
- request.onload = () => {
- if (request.status < 300) {
- resolve(request.responseText)
- } else {
- reject(request.statusText)
- }
- }
- request.onerror = () => reject(request.statusText)
- request.send(body)
- })
-}
-
function trash (link) {
return new Promise((resolve, reject) => {
let request = new window.XMLHttpRequest()
@@ -104,7 +83,6 @@ function create (link) {
export default {
create: create,
trash: trash,
- propfind: propfind,
put: put,
move: move
}