Stop using window.info on webdav

This commit is contained in:
Henrique Dias committed 2017-07-01 09:38:31 +01:00
1 parent 4efdf9c547
commit 01c78d2b36
2 files changed
+4 -55

No files matched your search

+4 -5
View File
@@ -1,8 +1,7 @@
// TODO: use store
var $ = window.info
import store from '../store/store'
function convertURL (url) {
return window.location.origin + url.replace($.baseURL + '/', $.webdavURL + '/')
return window.location.origin + url.replace(store.state.baseURL + '/', store.state.webDavURL + '/')
}
function move (oldLink, newLink) {
@@ -10,8 +9,8 @@ function move (oldLink, newLink) {
let request = new window.XMLHttpRequest()
oldLink = convertURL(oldLink)
newLink = newLink.replace($.baseURL + '/', $.webdavURL + '/')
newLink = window.location.origin + newLink.substring($.baseURL.length)
newLink = newLink.replace(store.state.baseURL + '/', store.state.webDavURL + '/')
newLink = window.location.origin + newLink.substring(store.state.baseURL.length)
request.open('MOVE', oldLink, true)
request.setRequestHeader('Destination', newLink)