Sfoglia il codice sorgente

Merge webpack into main one

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tags/v16.0.0alpha1
Julius Härtl 5 anni fa
parent
commit
cab704f0cc
Nessun account collegato all'indirizzo email del committer

+ 1
- 1
apps/files_sharing/appinfo/app.php Vedi File

@@ -42,7 +42,7 @@ $eventDispatcher = \OC::$server->getEventDispatcher();
$eventDispatcher->addListener(
'OCA\Files::loadAdditionalScripts',
function() {
\OCP\Util::addScript('files_sharing', 'additionalScripts');
\OCP\Util::addScript('files_sharing', 'dist/additionalScripts');
}
);


+ 23
- 0
apps/files_sharing/src/additionalScripts.js Vedi File

@@ -1,6 +1,29 @@
__webpack_public_path__ = OC.linkTo('files_sharing', 'js/');
__webpack_nonce__ = btoa(OC.requestToken);

import './share'
import './sharetabview'
import './sharebreadcrumbview'

import './style/sharetabview.scss'
import './style/sharebreadcrumb.scss'

window.OCP.Collaboration.registerType('files', {
action: () => {
return new Promise((resolve, reject) => {
OC.dialogs.filepicker('Link to a file', function (f) {
const client = OC.Files.getClient();
client.getFileInfo(f).then((status, fileInfo) => {
resolve(fileInfo.id);
}, () => {
reject();
});
}, false);
});
},
/** used in "Link to a {typeString}" */
typeString: t('files_sharing', 'file'),
typeIconClass: 'icon-files-dark'
});

window.OCA.Sharing = OCA.Sharing;

+ 1
- 25
apps/files_sharing/src/files_sharing.js Vedi File

@@ -1,29 +1,5 @@

__webpack_nonce__ = btoa(OC.requestToken);
__webpack_public_path__ = OC.linkTo('files_sharing', 'js/dist/');
__webpack_public_path__ = OC.linkTo('files_sharing', 'js/');

import '../js/app';
import '../js/sharedfilelist';
import '../js/sharetabview';
import '../js/share';
import '../js/sharebreadcrumbview';

window.OCP.Collaboration.registerType('files', {
action: () => {
return new Promise((resolve, reject) => {
OC.dialogs.filepicker('Link to a file', function (f) {
const client = OC.Files.getClient();
client.getFileInfo(f).then((status, fileInfo) => {
resolve(fileInfo.id);
}, () => {
reject();
});
}, false);
});
},
/** used in "Link to a {typeString}" */
typeString: t('files_sharing', 'file'),
typeIconClass: 'icon-files-dark'
});

window.OCA.Sharing = OCA.Sharing;

+ 1
- 1
apps/files_sharing/src/sharetabview.js Vedi File

@@ -83,7 +83,7 @@
self.trigger('sharesChanged', shareModel);
});

import('./../src/collaborationresources').then((Resources) => {
import('./collaborationresources').then((Resources) => {
var vm = new Resources.Vue({
el: '#collaborationResources',
render: h => h(Resources.View),

+ 0
- 47
apps/files_sharing/webpack.common.js Vedi File

@@ -1,47 +0,0 @@
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');

module.exports = {
entry: path.join(__dirname, 'src', 'files_sharing.js'),
output: {
path: path.resolve(__dirname, 'js/dist'),
publicPath: '/js/dist/',
filename: 'files_sharing.js',
chunkFilename: 'files_sharing.[name].js'
},
module: {
rules: [
{
test: /\.css$/,
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'file-loader',
options: {
name: '[name].[ext]?[hash]'
}
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
alias: {
vue$: 'vue/dist/vue.runtime.esm.js',
},
extensions: ['*', '.js', '.vue', '.json']
}
};

+ 0
- 12
apps/files_sharing/webpack.dev.js Vedi File

@@ -1,12 +0,0 @@
const merge = require('webpack-merge');
const common = require('./webpack.common.js');

module.exports = merge(common, {
mode: 'development',
devServer: {
historyApiFallback: true,
noInfo: true,
overlay: true
},
devtool: '#source-map',
})

+ 24
- 7
apps/files_sharing/webpack.js Vedi File

@@ -1,26 +1,39 @@
const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');

module.exports = {
entry: path.join(__dirname, 'src', 'additionalScripts.js'),
entry: {
'additionalScripts': path.join(__dirname, 'src', 'additionalScripts.js'),
'files_sharing': path.join(__dirname, 'src', 'files_sharing.js'),
},
output: {
path: path.resolve(__dirname, './js'),
path: path.resolve(__dirname, './js/dist/'),
publicPath: '/js/',
filename: 'additionalScripts.js'
filename: '[name].js',
chunkFilename: 'files_sharing.[id].js'

},
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
use: ['vue-style-loader', 'css-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader']
use: ['vue-style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
exclude: /node_modules/,
options: {
plugins: ['@babel/plugin-syntax-dynamic-import']
}
},
{
test: /\.(png|jpg|gif|svg)$/,
@@ -31,7 +44,11 @@ module.exports = {
}
]
},
plugins: [new VueLoaderPlugin()],
resolve: {
extensions: ['*', '.js']
alias: {
vue$: 'vue/dist/vue.runtime.esm.js',
},
extensions: ['*', '.js', '.vue', '.json']
}
};

+ 0
- 7
apps/files_sharing/webpack.prod.js Vedi File

@@ -1,7 +0,0 @@
const merge = require('webpack-merge')
const common = require('./webpack.common.js')

module.exports = merge(common, {
mode: 'production',
devtool: '#source-map'
})

Loading…
Annulla
Salva