Passed
Pull Request — master (#555)
by John
02:37
created

src/main.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 34
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 19
c 0
b 0
f 0
dl 0
loc 34
rs 10
wmc 1
mnd 0
bc 0
fnc 1
bpm 0
cpm 1
noi 2
1
/**
2
 * @copyright Copyright (c) 2019 John Molakvoæ <[email protected]>
3
 *
4
 * @author John Molakvoæ <[email protected]>
5
 *
6
 * @license GNU AGPL version 3 or any later version
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU Affero General Public License as
10
 * published by the Free Software Foundation, either version 3 of the
11
 * License, or (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
 * GNU Affero General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Affero General Public License
19
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
 *
21
 */
22
23
import { generateFilePath } from '@nextcloud/router'
24
import { getRequestToken } from '@nextcloud/auth'
25
import { sync } from 'vuex-router-sync'
26
import { translate, translatePlural } from '@nextcloud/l10n'
27
import Vue from 'vue'
28
29
import Gallery from './Gallery'
30
import router from './router'
31
import store from './store'
32
33
// CSP config for webpack dynamic chunk loading
34
// eslint-disable-next-line
35
__webpack_nonce__ = btoa(getRequestToken())
0 ignored issues
show
Bug introduced by
The variable __webpack_nonce__ seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.__webpack_nonce__.
Loading history...
36
37
// Correct the root of the app for chunk loading
38
// OC.linkTo matches the apps folders
39
// OC.generateUrl ensure the index.php (or not)
40
// We do not want the index.php since we're loading files
41
// eslint-disable-next-line
42
__webpack_public_path__ = generateFilePath('gallery', '', 'js/')
0 ignored issues
show
Bug introduced by
The variable __webpack_public_path__ seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.__webpack_public_path__.
Loading history...
43
44
sync(store, router)
45
46
Vue.prototype.t = translate
47
Vue.prototype.n = translatePlural
48
49
export default new Vue({
50
	el: '#content',
51
	// eslint-disable-next-line vue/match-component-file-name
52
	name: 'GalleryRoot',
53
	router,
54
	store,
55
	render: h => h(Gallery),
56
})
57