Skip to content

Commit

Permalink
Fix pasteByEvent for IE
Browse files Browse the repository at this point in the history
  • Loading branch information
lqez committed Jan 13, 2020
2 parents 1f0f262 + 1fa88f6 commit d80cde5
Show file tree
Hide file tree
Showing 190 changed files with 5,174 additions and 5,109 deletions.
2 changes: 0 additions & 2 deletions .agignore

This file was deleted.

43 changes: 25 additions & 18 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"extends": "standard",
"plugins": [
"chai-friendly"
],
"rules": {
"semi": [2, "always"],
"space-before-function-paren": ["error", "never"],
"no-useless-escape": 0,
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2,
"comma-dangle": ["error", "always-multiline"]
},
"env": {
"es6": true,
"browser": true,
"jquery": true,
"mocha": true
}
"extends": "eslint:recommended",
"plugins": [
"chai-friendly"
],
"rules": {
"indent": ["warn", 2, {"ArrayExpression": "off", "SwitchCase": 1}],
"semi": [2, "always"],
"space-before-function-paren": ["error", "never"],
"no-useless-escape": 0,
"no-unused-expressions": 0,
"chai-friendly/no-unused-expressions": 2,
"comma-dangle": ["error", "always-multiline"]
},
"env": {
"amd": true,
"browser": true,
"es6": true,
"jquery": true,
"mocha": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
}
}
16 changes: 15 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ run tests with Karma and PhantomJS
npm run test
```
If you want run tests on other browser,
change the values for `broswers` properties in `karma.conf.js`.
change the values for `browsers` properties in `karma.conf.js`.

```
karma: {
Expand All @@ -50,6 +50,20 @@ $ npm run test -- --browsers Safari,Firefox
You can use `Chrome`, `ChromeCanary`, `Firefox`, `Opera`, `Safari`, `PhantomJS` and `IE` beside `PhantomJS`.
Once you run `npm test`, it will watch all javascript file. Therefore karma run tests every time you change code.

## Test a part of test

If you would like to run some part of your test codes, use the watch mode.

```bash
$ npm run test:watch
```

`karma` will run test and keep waiting other test requests. And then, run `test:grep` in another terminal. Below shows how to run `LinkDialog` related tests only.

```bash
$ npm run test:grep LinkDialog
```

## Prepush Hooks
As part of this repo, we use the NPM package husky to implement git hooks. We leverage the prepush hook to prevent bad commits.

Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Before submitting an issue, please make sure to search for already open issues, and add to that. This way we can track issues more easily. Thank you, and Thanks for using Summernote.

Please answer the below questions, this will help us to more easily resolve whatever issues you are having, and direct issue to the suitable people to with your issue or to give you correct answers.

#### Description of your Issue or Request:
Please provide a short description of the issue or request. If you don't provide one, we can't expedite helping to fix your issue or fullfill your request.

Expand All @@ -17,9 +19,7 @@ This can help find and resolve any issues.

2. Browser and Version:

3. Summernote Version:

4. Bootstrap Version or Lite:
3. Summernote Version (including which BS3, BS4, Lite or All):


#### screenshot of issue
Expand Down
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Thank you for taking the time to help us improve Summernote.
Please be sure that you are not submitting changes made to the files in the `dist/` folder, and only to the files contained in the `src/` folder.

#### What does this PR do?

- awesome stuff
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ test/reports/
selenium-debug.log

# Ignoring rpt2_cache
.rpt2_cache
.rpt2_cache

# direnv
.envrc
.env
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ Gruntfile.js
MAINTAIN.md
grunts/
test/
coverage/
4 changes: 2 additions & 2 deletions MAINTAIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ git pull
# Bump version in package.json

# build dist files and binary(.zip) for release post
npm run build
npm run build

# Commit and add tag for new version
git commit -a -m "Update dist files"
Expand All @@ -42,7 +42,7 @@ npm publish
```

### 5. Update summernote.github.io
Update summernote version in _config.yml.
Update summernote version in `_config.yml`.

### 6. Update connectors
Request maintainers of each connector to update package information.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Include the following code in the `<head>` tag of your HTML:

```html
<!-- include libraries(jQuery, bootstrap) -->
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" />
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" />
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>

<!-- include summernote css/js-->
<link href="summernote.css" rel="stylesheet">
Expand Down
3 changes: 3 additions & 0 deletions config/build-fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const webfontConfig = {
normalize: true,
};

// eslint-disable-next-line
console.log('Building fonts...');

webfont(webfontConfig).then(result => {
Expand All @@ -36,11 +37,13 @@ webfont(webfontConfig).then(result => {
} else {
file = path.resolve(webfontConfig['destTemplate']);
}
// eslint-disable-next-line
console.log('Writing ', file);

fs.writeFileSync(file, content);
});
}).catch(error => {
// eslint-disable-next-line
console.log(error);
throw error;
});
213 changes: 107 additions & 106 deletions config/common/dev.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,117 +18,118 @@ fs.readdirSync(path.resolve(__dirname, '../../lang')).forEach(file => {
entries[filename] = `./lang/${filename}`;
});

module.exports = function() {
return {
entries,
output: {
path: path.join(__dirname, 'dist'),
filename: (chunkData) => {
var isProduct = productList.includes(chunkData.chunk.name);
return isProduct ? '[name].js' : 'lang/[name].js';
},
},
externals: {
jquery: 'jQuery',
},
devServer: {
port: 3000,
contentBase: ['./dist'],
module.exports = {
entries,
output: {
path: path.join(__dirname, 'dist'),
filename: (chunkData) => {
var isProduct = productList.includes(chunkData.chunk.name);
return isProduct ? '[name].js' : 'lang/[name].js';
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
},
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'string-replace-loader',
options: {
search: '@@VERSION@@',
replace: pkg.version,
},
},
externals: {
jquery: 'jQuery', // dev includes jQuery by <script> tag
},
devServer: {
port: 3000,
contentBase: ['./dist'],
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
},
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{
loader: 'string-replace-loader',
options: {
search: '@@VERSION@@',
replace: pkg.version,
},
{
loader: 'babel-loader',
},
{
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env'],
},
],
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: {
minimize: false,
},
},
],
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: {
minimize: false,
},
],
},
scssConfig,
{
test: /\.(png|jpe?g|gif|svg)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'images',
},
},
],
},
scssConfig,
{
test: /\.(png|jpe?g|gif|svg)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'images',
},
],
},
{
test: /\.(woff|woff2|ttf|otf|eot)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'font',
},
},
],
},
{
test: /\.(woff|woff2|ttf|otf|eot)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'font',
},
],
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new CopyPlugin([
{
from: 'examples',
to: 'examples',
},
{
from: 'plugin',
to: 'plugin',
},
]),
new HtmlWebPackPlugin({
inject: true,
chunks: ['summernote'],
template: `./src/summernote-bs3.html`,
filename: 'index.html',
}),
new HtmlWebPackPlugin({
inject: true,
chunks: ['summernote-bs4'],
template: `./src/summernote-bs4.html`,
filename: 'bs4.html',
}),
new HtmlWebPackPlugin({
inject: true,
chunks: ['summernote-lite'],
template: `./src/summernote-lite.html`,
filename: 'lite.html',
}),
},
],
},
],
};
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
}),
new CopyPlugin([
{
from: 'examples',
to: 'examples',
},
{
from: 'plugin',
to: 'plugin',
},
]),
new HtmlWebPackPlugin({
inject: true,
chunks: ['summernote'],
template: `./src/summernote-bs3.html`,
filename: 'index.html',
}),
new HtmlWebPackPlugin({
inject: true,
chunks: ['summernote-bs4'],
template: `./src/summernote-bs4.html`,
filename: 'bs4.html',
}),
new HtmlWebPackPlugin({
inject: true,
chunks: ['summernote-lite'],
template: `./src/summernote-lite.html`,
filename: 'lite.html',
}),
],
};
Loading

0 comments on commit d80cde5

Please sign in to comment.