Browse Source

Skip default action for paste.

pull/617/head
Sebastian 5 years ago
parent
commit
70797168b4
  1. 70
      frontend/app-config/webpack.config.js
  2. 2
      frontend/app/shared/components/forms/rich-editor.component.ts

70
frontend/app-config/webpack.config.js

@ -1,6 +1,4 @@
const webpack = require('webpack'), const webpack = require('webpack'), path = require('path');
path = require('path'),
fs = require('fs');
const appRoot = path.resolve(__dirname, '..'); const appRoot = path.resolve(__dirname, '..');
@ -34,7 +32,7 @@ const plugins = {
// https://www.npmjs.com/package/@angular-devkit/build-optimizer // https://www.npmjs.com/package/@angular-devkit/build-optimizer
BuildOptimizerWebpackPlugin: require('@angular-devkit/build-optimizer').BuildOptimizerWebpackPlugin, BuildOptimizerWebpackPlugin: require('@angular-devkit/build-optimizer').BuildOptimizerWebpackPlugin,
// https://webpack.js.org/plugins/copy-webpack-plugin/ // https://webpack.js.org/plugins/copy-webpack-plugin/
CopyPlugin : require('copy-webpack-plugin') CopyPlugin: require('copy-webpack-plugin')
}; };
module.exports = function (env) { module.exports = function (env) {
@ -155,7 +153,7 @@ module.exports = function (env) {
}, { }, {
loader: 'postcss-loader' loader: 'postcss-loader'
}, { }, {
loader: 'sass-loader', loader: 'sass-loader',
options: { options: {
additionalData: ` additionalData: `
@import '_vars'; @import '_vars';
@ -210,34 +208,34 @@ module.exports = function (env) {
}), }),
new plugins.CopyPlugin({ new plugins.CopyPlugin({
patterns: [ patterns: [
{ from: './node_modules/simplemde/dist', to: 'dependencies/simplemde' }, { from: './node_modules/simplemde/dist', to: 'dependencies/simplemde' },
{ from: './node_modules/tinymce/icons/default/icons.min.js', to: 'dependencies/tinymce/icons/default' }, { from: './node_modules/tinymce/icons/default/icons.min.js', to: 'dependencies/tinymce/icons/default' },
{ from: './node_modules/tinymce/plugins/advlist', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/advlist', to: 'dependencies/tinymce/plugins/advlist' },
{ from: './node_modules/tinymce/plugins/code', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/code', to: 'dependencies/tinymce/plugins/code' },
{ from: './node_modules/tinymce/plugins/image', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/image', to: 'dependencies/tinymce/plugins/image' },
{ from: './node_modules/tinymce/plugins/link', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/link', to: 'dependencies/tinymce/plugins/link' },
{ from: './node_modules/tinymce/plugins/lists', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/lists', to: 'dependencies/tinymce/plugins/lists' },
{ from: './node_modules/tinymce/plugins/media', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/media', to: 'dependencies/tinymce/plugins/media' },
{ from: './node_modules/tinymce/plugins/paste', to: 'dependencies/tinymce/plugins' }, { from: './node_modules/tinymce/plugins/paste', to: 'dependencies/tinymce/plugins/paste' },
{ from: './node_modules/tinymce/skins', to: 'dependencies/tinymce/skins' }, { from: './node_modules/tinymce/skins', to: 'dependencies/tinymce/skins' },
{ from: './node_modules/tinymce/themes/silver', to: 'dependencies/tinymce/themes/silver' }, { from: './node_modules/tinymce/themes/silver', to: 'dependencies/tinymce/themes/silver' },
{ from: './node_modules/tinymce/tinymce.min.js', to: 'dependencies/tinymce' }, { from: './node_modules/tinymce/tinymce.min.js', to: 'dependencies/tinymce' },
{ from: './node_modules/ace-builds/src-min/ace.js', to: 'dependencies/ace/ace.js' }, { from: './node_modules/ace-builds/src-min/ace.js', to: 'dependencies/ace/ace.js' },
{ from: './node_modules/ace-builds/src-min/mode-*.js', to: 'dependencies/ace/[name].[ext]' }, { from: './node_modules/ace-builds/src-min/mode-*.js', to: 'dependencies/ace/[name].[ext]' },
{ from: './node_modules/ace-builds/src-min/worker-*.js', to: 'dependencies/ace/[name].[ext]' }, { from: './node_modules/ace-builds/src-min/worker-*.js', to: 'dependencies/ace/[name].[ext]' },
{ from: './node_modules/ace-builds/src-min/ext-modelist.js', to: 'dependencies/ace/ext/modelist.js' }, { from: './node_modules/ace-builds/src-min/ext-modelist.js', to: 'dependencies/ace/ext/modelist.js' },
{ from: './node_modules/video.js/dist/video.min.js', to: 'dependencies/videojs' }, { from: './node_modules/video.js/dist/video.min.js', to: 'dependencies/videojs' },
{ from: './node_modules/video.js/dist/video-js.min.css', to: 'dependencies/videojs' }, { from: './node_modules/video.js/dist/video-js.min.css', to: 'dependencies/videojs' },
{ from: './node_modules/font-awesome/css/font-awesome.min.css', to: 'dependencies/font-awesome/css' }, { from: './node_modules/font-awesome/css/font-awesome.min.css', to: 'dependencies/font-awesome/css' },
{ from: './node_modules/font-awesome/fonts', to: 'dependencies/font-awesome/fonts' }, { from: './node_modules/font-awesome/fonts', to: 'dependencies/font-awesome/fonts' },
{ from: './node_modules/vis-network/standalone/umd/vis-network.min.js', to: 'dependencies' }, { from: './node_modules/vis-network/standalone/umd/vis-network.min.js', to: 'dependencies' },
], ],
}), }),
], ],
devServer: { devServer: {
@ -257,7 +255,7 @@ module.exports = function (env) {
config.entry = { config.entry = {
'shims': './app/shims.ts', 'shims': './app/shims.ts',
'style': './app/style.js', 'style': './app/style.js',
'app': './app/app.ts' 'app': './app/app.ts'
}; };
if (isProduction) { if (isProduction) {
@ -308,9 +306,9 @@ module.exports = function (env) {
config.plugins.push( config.plugins.push(
new plugins.HtmlWebpackPlugin({ new plugins.HtmlWebpackPlugin({
filename: 'theme.html', filename: 'theme.html',
hash: true, hash: true,
chunks: ['style'], chunks: ['style'],
chunksSortMode: 'none', chunksSortMode: 'none',
template: 'app/_theme.html' template: 'app/_theme.html'
}) })
); );
@ -367,7 +365,7 @@ module.exports = function (env) {
}; };
config.plugins.push(new plugins.BuildOptimizerWebpackPlugin()); config.plugins.push(new plugins.BuildOptimizerWebpackPlugin());
config.module.rules.push({ config.module.rules.push({
test: /\.js$/, test: /\.js$/,
use: [{ use: [{

2
frontend/app/shared/components/forms/rich-editor.component.ts

@ -148,6 +148,8 @@ export class RichEditorComponent extends StatefulControlComponent<{}, string> im
if (!hasFileDropped) { if (!hasFileDropped) {
self.onValueChanged(); self.onValueChanged();
} else {
return false;
} }
}); });

Loading…
Cancel
Save