diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-12-03 15:12:18 +0100 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-01-08 10:14:53 +0100 |
commit | dd7bf0f902570d4561c07237ea9072f4fc1d3edc (patch) | |
tree | 0116d397d454e95f1ebbd584230f16820c5ebd72 /apps | |
parent | 806a176a57526b55c18817577325509dfb4ef648 (diff) | |
download | nextcloud-server-dd7bf0f902570d4561c07237ea9072f4fc1d3edc.tar.gz nextcloud-server-dd7bf0f902570d4561c07237ea9072f4fc1d3edc.zip |
Fix dynamic loading
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dashboard/lib/Controller/DashboardController.php | 2 | ||||
-rw-r--r-- | apps/dashboard/src/main.js | 7 | ||||
-rw-r--r-- | apps/dashboard/templates/index.php | 4 | ||||
-rw-r--r-- | apps/files/src/main-personal-settings.js | 26 | ||||
-rw-r--r-- | apps/files_sharing/src/additionalScripts.js | 4 | ||||
-rw-r--r-- | apps/files_sharing/src/collaborationresourceshandler.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/src/files_sharing.js | 6 | ||||
-rw-r--r-- | apps/files_sharing/src/personal-settings.js | 26 | ||||
-rw-r--r-- | apps/settings/src/main-apps-users-management.js | 8 | ||||
-rw-r--r-- | apps/theming/lib/Listener/BeforeTemplateRenderedListener.php | 3 | ||||
-rw-r--r-- | apps/user_status/src/dashboard.js | 6 | ||||
-rw-r--r-- | apps/user_status/src/menu.js | 6 | ||||
-rw-r--r-- | apps/weather_status/src/weather-status.js | 5 |
13 files changed, 10 insertions, 95 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php index 88baa641b45..f79f8b992d1 100644 --- a/apps/dashboard/lib/Controller/DashboardController.php +++ b/apps/dashboard/lib/Controller/DashboardController.php @@ -94,6 +94,8 @@ class DashboardController extends Controller { */ public function index(): TemplateResponse { \OCP\Util::addStyle('dashboard', 'dashboard'); + \OCP\Util::addScript('dashboard', 'main'); + $this->eventDispatcher->dispatchTyped(new LoadSidebar()); if (class_exists(LoadViewer::class)) { $this->eventDispatcher->dispatchTyped(new LoadViewer()); diff --git a/apps/dashboard/src/main.js b/apps/dashboard/src/main.js index 54c68bf71ee..f209b00baf4 100644 --- a/apps/dashboard/src/main.js +++ b/apps/dashboard/src/main.js @@ -25,18 +25,19 @@ import App from './App.vue' import { translate as t } from '@nextcloud/l10n' import VTooltip from '@nextcloud/vue/dist/Directives/Tooltip' import { getRequestToken } from '@nextcloud/auth' -import { generateFilePath } from '@nextcloud/router' // eslint-disable-next-line camelcase __webpack_nonce__ = btoa(getRequestToken()) -// eslint-disable-next-line camelcase -__webpack_public_path__ = generateFilePath('dashboard', '', 'js/') Vue.directive('Tooltip', VTooltip) Vue.prototype.t = t // FIXME workaround to make the sidebar work +if (!window.OCA.Files) { + window.OCA.Files = {} +} + Object.assign(window.OCA.Files, { App: { fileList: { filesClient: OC.Files.getClient() } } }, window.OCA.Files) const Dashboard = Vue.extend(App) diff --git a/apps/dashboard/templates/index.php b/apps/dashboard/templates/index.php index 9e345cdd34a..33fb41d3b78 100644 --- a/apps/dashboard/templates/index.php +++ b/apps/dashboard/templates/index.php @@ -1,5 +1 @@ -<?php - declare(strict_types=1); - \OCP\Util::addScript('dashboard', 'dashboard'); -?> <div id="app-content-vue"></div> diff --git a/apps/files/src/main-personal-settings.js b/apps/files/src/main-personal-settings.js index 4a56e836ecd..af98d3bea49 100644 --- a/apps/files/src/main-personal-settings.js +++ b/apps/files/src/main-personal-settings.js @@ -22,39 +22,13 @@ * */ -// global t - -/* - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - import Vue from 'vue' import { getRequestToken } from '@nextcloud/auth' -import { generateFilePath } from '@nextcloud/router' import PersonalSettings from './components/PersonalSettings' // eslint-disable-next-line camelcase __webpack_nonce__ = btoa(getRequestToken()) -// eslint-disable-next-line camelcase -__webpack_public_path__ = generateFilePath('files', '', 'js/') Vue.prototype.t = t diff --git a/apps/files_sharing/src/additionalScripts.js b/apps/files_sharing/src/additionalScripts.js index 6f07f7170ca..a91a84b5f91 100644 --- a/apps/files_sharing/src/additionalScripts.js +++ b/apps/files_sharing/src/additionalScripts.js @@ -24,14 +24,10 @@ import './share' import './sharebreadcrumbview' - import './style/sharebreadcrumb.scss' - import './collaborationresourceshandler.js' // eslint-disable-next-line camelcase -__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/') -// eslint-disable-next-line camelcase __webpack_nonce__ = btoa(OC.requestToken) window.OCA.Sharing = OCA.Sharing diff --git a/apps/files_sharing/src/collaborationresourceshandler.js b/apps/files_sharing/src/collaborationresourceshandler.js index 91558add383..cdbd603d4c7 100644 --- a/apps/files_sharing/src/collaborationresourceshandler.js +++ b/apps/files_sharing/src/collaborationresourceshandler.js @@ -22,8 +22,6 @@ */ // eslint-disable-next-line camelcase -__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/') -// eslint-disable-next-line camelcase __webpack_nonce__ = btoa(OC.requestToken) window.OCP.Collaboration.registerType('file', { diff --git a/apps/files_sharing/src/files_sharing.js b/apps/files_sharing/src/files_sharing.js index 1967006dd47..03ea2c739f7 100644 --- a/apps/files_sharing/src/files_sharing.js +++ b/apps/files_sharing/src/files_sharing.js @@ -23,9 +23,3 @@ import '../js/app' import '../js/sharedfilelist' - -// eslint-disable-next-line camelcase -__webpack_nonce__ = btoa(OC.requestToken) - -// eslint-disable-next-line camelcase -__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/') diff --git a/apps/files_sharing/src/personal-settings.js b/apps/files_sharing/src/personal-settings.js index fb36e022c0d..9f27b7bf5a1 100644 --- a/apps/files_sharing/src/personal-settings.js +++ b/apps/files_sharing/src/personal-settings.js @@ -21,39 +21,13 @@ * */ -// global t - -/* - * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - import Vue from 'vue' import { getRequestToken } from '@nextcloud/auth' -import { generateFilePath } from '@nextcloud/router' import PersonalSettings from './components/PersonalSettings' // eslint-disable-next-line camelcase __webpack_nonce__ = btoa(getRequestToken()) -// eslint-disable-next-line camelcase -__webpack_public_path__ = generateFilePath('files', '', 'js/') Vue.prototype.t = t diff --git a/apps/settings/src/main-apps-users-management.js b/apps/settings/src/main-apps-users-management.js index f50e98785d7..97f23c03f51 100644 --- a/apps/settings/src/main-apps-users-management.js +++ b/apps/settings/src/main-apps-users-management.js @@ -35,15 +35,9 @@ Vue.use(VTooltip, { defaultHtml: false }) sync(store, router) // CSP config for webpack dynamic chunk loading -// eslint-disable-next-line +// eslint-disable-next-line camelcase __webpack_nonce__ = btoa(OC.requestToken) -// Correct the root of the app for chunk loading -// OC.linkTo matches the apps folders -// OC.generateUrl ensure the index.php (or not) -// eslint-disable-next-line -__webpack_public_path__ = OC.linkTo('settings', 'js/') - // bind to window Vue.prototype.t = t Vue.prototype.n = n diff --git a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php index 30ebcb89ac8..10a9434835c 100644 --- a/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php +++ b/apps/theming/lib/Listener/BeforeTemplateRenderedListener.php @@ -77,6 +77,7 @@ class BeforeTemplateRenderedListener implements IEventListener { ] ); - \OCP\Util::addScript('theming', 'theming'); + // Making sure to inject just after core + \OCP\Util::addScript('theming', 'theming', 'core'); } } diff --git a/apps/user_status/src/dashboard.js b/apps/user_status/src/dashboard.js index 8b85b695f77..f419003f34d 100644 --- a/apps/user_status/src/dashboard.js +++ b/apps/user_status/src/dashboard.js @@ -21,17 +21,13 @@ */ import Vue from 'vue' -import { generateFilePath } from '@nextcloud/router' import { getRequestToken } from '@nextcloud/auth' import { translate, translatePlural } from '@nextcloud/l10n' import Dashboard from './views/Dashboard' -// eslint-disable-next-line +// eslint-disable-next-line camelcase __webpack_nonce__ = btoa(getRequestToken()) -// eslint-disable-next-line -__webpack_public_path__ = generateFilePath('user_status', '', 'js/') - Vue.prototype.t = translate Vue.prototype.n = translatePlural Vue.prototype.OC = OC diff --git a/apps/user_status/src/menu.js b/apps/user_status/src/menu.js index be10d700f08..3c29f61cc0c 100644 --- a/apps/user_status/src/menu.js +++ b/apps/user_status/src/menu.js @@ -31,12 +31,6 @@ import Avatar from '@nextcloud/vue/dist/Components/Avatar' // eslint-disable-next-line camelcase __webpack_nonce__ = btoa(getRequestToken()) -// Correct the root of the app for chunk loading -// OC.linkTo matches the apps folders -// OC.generateUrl ensure the index.php (or not) -// eslint-disable-next-line -__webpack_public_path__ = OC.linkTo('user_status', 'js/') - Vue.prototype.t = t Vue.prototype.$t = t diff --git a/apps/weather_status/src/weather-status.js b/apps/weather_status/src/weather-status.js index 0816f62e8dc..4b8b2ab79a4 100644 --- a/apps/weather_status/src/weather-status.js +++ b/apps/weather_status/src/weather-status.js @@ -22,16 +22,11 @@ import Vue from 'vue' import { getRequestToken } from '@nextcloud/auth' -import { generateUrl } from '@nextcloud/router' import App from './App' // eslint-disable-next-line camelcase __webpack_nonce__ = btoa(getRequestToken()) -// Correct the root of the app for chunk loading -// eslint-disable-next-line -__webpack_public_path__ = generateUrl('/apps/weather_status/js/') - Vue.prototype.t = t document.addEventListener('DOMContentLoaded', function() { |