Browse Source
Fix dynamic loading
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
pull/30020/head
John Molakvoæ (skjnldsv)
4 years ago
committed by
John Molakvoæ
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
19 changed files with
13 additions and
107 deletions
-
.eslintrc.js
-
apps/dashboard/lib/Controller/DashboardController.php
-
apps/dashboard/src/main.js
-
apps/dashboard/templates/index.php
-
apps/files/src/main-personal-settings.js
-
apps/files_sharing/src/additionalScripts.js
-
apps/files_sharing/src/collaborationresourceshandler.js
-
apps/files_sharing/src/files_sharing.js
-
apps/files_sharing/src/personal-settings.js
-
apps/settings/src/main-apps-users-management.js
-
apps/theming/lib/Listener/BeforeTemplateRenderedListener.php
-
apps/user_status/src/dashboard.js
-
apps/user_status/src/menu.js
-
apps/weather_status/src/weather-status.js
-
core/src/profile.js
-
core/src/recommendedapps.js
-
core/src/unified-search.js
-
webpack.common.js
-
webpack.modules.js
|
|
|
@ -1,7 +1,6 @@ |
|
|
|
module.exports = { |
|
|
|
globals: { |
|
|
|
__webpack_nonce__: true, |
|
|
|
__webpack_public_path__: true, |
|
|
|
_: true, |
|
|
|
$: true, |
|
|
|
moment: true, |
|
|
|
|
|
|
|
@ -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()); |
|
|
|
|
|
|
|
@ -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) |
|
|
|
|
|
|
|
@ -1,5 +1 @@ |
|
|
|
<?php |
|
|
|
declare(strict_types=1); |
|
|
|
\OCP\Util::addScript('dashboard', 'dashboard'); |
|
|
|
?>
|
|
|
|
<div id="app-content-vue"></div> |
|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|
|
|
@ -24,13 +24,9 @@ |
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
|
|
|
@ -21,8 +21,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) |
|
|
|
|
|
|
|
|
|
|
|
@ -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/') |
|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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'); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -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 |
|
|
|
|
|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|
|
|
@ -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() { |
|
|
|
|
|
|
|
@ -21,7 +21,6 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
import Vue from 'vue' |
|
|
|
import { generateFilePath } from '@nextcloud/router' |
|
|
|
import { getRequestToken } from '@nextcloud/auth' |
|
|
|
import { translate as t } from '@nextcloud/l10n' |
|
|
|
import VTooltip from 'v-tooltip' |
|
|
|
@ -31,7 +30,6 @@ import logger from './logger' |
|
|
|
import Profile from './views/Profile' |
|
|
|
|
|
|
|
__webpack_nonce__ = btoa(getRequestToken()) |
|
|
|
__webpack_public_path__ = generateFilePath('core', '', 'js/') |
|
|
|
|
|
|
|
Vue.use(VTooltip) |
|
|
|
|
|
|
|
|
|
|
|
@ -21,7 +21,6 @@ |
|
|
|
*/ |
|
|
|
|
|
|
|
import { getRequestToken } from '@nextcloud/auth' |
|
|
|
import { generateFilePath } from '@nextcloud/router' |
|
|
|
import { translate as t } from '@nextcloud/l10n' |
|
|
|
import Vue from 'vue' |
|
|
|
|
|
|
|
@ -30,8 +29,6 @@ import RecommendedApps from './components/setup/RecommendedApps' |
|
|
|
|
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
__webpack_nonce__ = btoa(getRequestToken()) |
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
__webpack_public_path__ = generateFilePath('core', '', 'js/') |
|
|
|
|
|
|
|
Vue.mixin({ |
|
|
|
methods: { |
|
|
|
|
|
|
|
@ -20,7 +20,6 @@ |
|
|
|
* |
|
|
|
*/ |
|
|
|
|
|
|
|
import { generateFilePath } from '@nextcloud/router' |
|
|
|
import { getLoggerBuilder } from '@nextcloud/logger' |
|
|
|
import { getRequestToken } from '@nextcloud/auth' |
|
|
|
import { translate as t, translatePlural as n } from '@nextcloud/l10n' |
|
|
|
@ -31,9 +30,6 @@ import UnifiedSearch from './views/UnifiedSearch.vue' |
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
__webpack_nonce__ = btoa(getRequestToken()) |
|
|
|
|
|
|
|
// eslint-disable-next-line camelcase
|
|
|
|
__webpack_public_path__ = generateFilePath('core', '', 'js/') |
|
|
|
|
|
|
|
const logger = getLoggerBuilder() |
|
|
|
.setApp('unified-search') |
|
|
|
.detectUser() |
|
|
|
|
|
|
|
@ -42,7 +42,8 @@ module.exports = { |
|
|
|
output: { |
|
|
|
// Step away from the src folder and extract to the js folder
|
|
|
|
path: path.join(__dirname, 'dist'), |
|
|
|
publicPath: '/dist/', |
|
|
|
// Let webpack determine automatically where it's located
|
|
|
|
publicPath: 'auto', |
|
|
|
filename: '[name].js?v=[contenthash]', |
|
|
|
chunkFilename: '[name]-[id].js?v=[contenthash]', |
|
|
|
// Make sure sourcemaps have a proper path and do not
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ module.exports = { |
|
|
|
systemtags: path.resolve(__dirname, 'core/src', 'systemtags/merged-systemtags.js'), |
|
|
|
}, |
|
|
|
dashboard: { |
|
|
|
'dashboard-main': path.join(__dirname, 'apps/dashboard/src', 'main.js'), |
|
|
|
main: path.join(__dirname, 'apps/dashboard/src', 'main.js'), |
|
|
|
}, |
|
|
|
dav: { |
|
|
|
'settings-admin-caldav': path.join(__dirname, 'apps/dav/src', 'settings.js'), |
|
|
|
|