Use nextcloud-router more

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2019-06-25 17:20:59 +02:00 committed by John Molakvoæ (skjnldsv)
parent 4758947a4b
commit 97501ef635
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
5 changed files with 16 additions and 4 deletions

8
package-lock.json generated
View File

@ -7094,6 +7094,14 @@
"core-js": "^3.1.4"
}
},
"nextcloud-l10n": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/nextcloud-l10n/-/nextcloud-l10n-0.0.1.tgz",
"integrity": "sha512-yRyym3inJi5D3Z//Qd1a+WIymVjDJ/5JGJ3wY1tdu9KFhSq16ft8RohABmdRnLkxaNYUqe/ZmeHxp3Z+AxkxtQ==",
"requires": {
"core-js": "^3.1.4"
}
},
"nextcloud-router": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/nextcloud-router/-/nextcloud-router-0.0.6.tgz",

View File

@ -44,6 +44,7 @@
"moment": "^2.24.0",
"nextcloud-auth": "0.0.2",
"nextcloud-dialogs": "0.0.1",
"nextcloud-l10n": "0.0.1",
"nextcloud-router": "0.0.6",
"nextcloud-vue": "^0.11.4",
"p-limit": "^2.2.0",

View File

@ -207,7 +207,7 @@ export default {
'image/gif',
'image/x-xbitmap',
'image/bmp',
'image/svg+xml',
'image/svg+xml'
])
.build()

View File

@ -59,6 +59,7 @@
import debounce from 'debounce'
import moment from 'moment'
import { DatetimePicker } from 'nextcloud-vue'
import { getLocale } from 'nextcloud-l10n'
import { VCardTime } from 'ical.js'
import PropertyMixin from 'Mixins/PropertyMixin'
@ -132,7 +133,7 @@ export default {
mounted() {
// Load the locale
// convert format like en_GB to en-gb for `moment.js`
let locale = OC.getLocale().replace('_', '-').toLowerCase()
let locale = getLocale().replace('_', '-').toLowerCase()
// default load e.g. fr-fr
import('moment/locale/' + this.locale)

View File

@ -21,11 +21,13 @@
*/
import DavClient from 'cdav-library'
import { generateRemoteUrl } from 'nextcloud-router'
import { getRequestToken } from 'nextcloud-auth'
function xhrProvider() {
var headers = {
'X-Requested-With': 'XMLHttpRequest',
'requesttoken': OC.requestToken
'requesttoken': getRequestToken()
}
var xhr = new XMLHttpRequest()
var oldOpen = xhr.open
@ -43,5 +45,5 @@ function xhrProvider() {
}
export default new DavClient({
rootUrl: OC.linkToRemote('dav')
rootUrl: generateRemoteUrl('dav')
}, xhrProvider)