|
| 1 | +/** |
| 2 | + * @copyright Copyright (c) 2021 Lyseon Techh <[email protected]> |
| 3 | + * |
| 4 | + * @author Lyseon Tech <[email protected]> |
| 5 | + * @author Vinicios Gomes <[email protected]> |
| 6 | + * |
| 7 | + * @license GNU AGPL version 3 or any later version |
| 8 | + * |
| 9 | + * This program is free software: you can redistribute it and/or modify |
| 10 | + * it under the terms of the GNU Affero General Public License as |
| 11 | + * published by the Free Software Foundation, either version 3 of the |
| 12 | + * License, or (at your option) any later version. |
| 13 | + * |
| 14 | + * This program is distributed in the hope that it will be useful, |
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | + * GNU Affero General Public License for more details. |
| 18 | + * |
| 19 | + * You should have received a copy of the GNU Affero General Public License |
| 20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | + * |
| 22 | + */ |
| 23 | + |
| 24 | +import { generateFilePath } from '@nextcloud/router' |
| 25 | +import { getRequestToken } from '@nextcloud/auth' |
| 26 | +import { sync } from 'vuex-router-sync' |
| 27 | +import Vue from 'vue' |
| 28 | + |
| 29 | +import Validation from './views/Validation' |
| 30 | +import router from './router' |
| 31 | +import store from './store' |
| 32 | + |
| 33 | +import VTooltip from '@nextcloud/vue/dist/Directives/Tooltip' |
| 34 | + |
| 35 | +import '@nextcloud/dialogs/styles/toast.scss' |
| 36 | + |
| 37 | +// CSP config for webpack dynamic chunk loading |
| 38 | +// eslint-disable-next-line |
| 39 | +__webpack_nonce__ = btoa(getRequestToken()); |
| 40 | + |
| 41 | +// Correct the root of the app for chunk loading |
| 42 | +// OC.linkTo matches the apps folders |
| 43 | +// OC.generateUrl ensure the index.php (or not) |
| 44 | +// We do not want the index.php since we're loading files |
| 45 | +// eslint-disable-next-line |
| 46 | +__webpack_public_path__ = generateFilePath('libresign', '', 'js/'); |
| 47 | + |
| 48 | +sync(store, router) |
| 49 | + |
| 50 | +Vue.directive('Tooltip', VTooltip) |
| 51 | + |
| 52 | +Vue.prototype.t = t |
| 53 | +Vue.prototype.n = n |
| 54 | + |
| 55 | +Vue.prototype.OC = OC |
| 56 | +Vue.prototype.OCA = OCA |
| 57 | + |
| 58 | +if ( |
| 59 | + window.location.pathname.split('/')[1] === 'index.php' |
| 60 | + && OC.config.modRewriteWorking |
| 61 | +) { |
| 62 | + router.push({ name: 'Validation' }) |
| 63 | +} |
| 64 | + |
| 65 | +export default new Vue({ |
| 66 | + el: '#content', |
| 67 | + // eslint-disable-next-line vue/match-component-file-name |
| 68 | + name: 'Validation', |
| 69 | + router, |
| 70 | + store, |
| 71 | + render: (h) => h(Validation), |
| 72 | +}) |
0 commit comments