Skip to content

Commit 2b535e4

Browse files
committed
Merge branch 'development'
2 parents 01a59c3 + be4be52 commit 2b535e4

30 files changed

Lines changed: 10752 additions & 2 deletions

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
tab_width = 4
6+
charset = utf-8
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.json]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[{node_modules,dist}/**]
19+
indent_style = unset
20+
tab_width = unset
21+
indent_size = unset
22+
charset = unset
23+
end_of_line = unset
24+
trim_trailing_whitespace = unset
25+
insert_final_newline = unset

.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
mocha: true,
5+
es2021: true
6+
},
7+
plugins: ['chai', 'mocha'],
8+
ignorePatterns: ['dist/**/*.js'],
9+
extends: 'airbnb-base',
10+
parserOptions: {
11+
ecmaVersion: 'latest',
12+
sourceType: 'module',
13+
},
14+
rules: {
15+
'no-tabs': ['error', { allowIndentationTabs: true }],
16+
indent: ['error', 'tab'],
17+
'comma-dangle': ['off', {}],
18+
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
19+
'prefer-arrow-callback': ['error', { allowNamedFunctions: true }],
20+
'no-underscore-dangle': 'off',
21+
'no-unused-vars': ['error', { varsIgnorePattern: 'should|expect' }],
22+
'no-unused-expressions': 'off',
23+
'class-methods-use-this': 'off',
24+
'no-new': 'off',
25+
'no-prototype-builtins': 'off',
26+
'no-use-before-define': 'off',
27+
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
28+
'arrow-body-style': 'off'
29+
}
30+
};

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_STORE
2+
.vscode
3+
.idea
4+
node_modules/
5+
dist/

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint && npm run test

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# WProofreader plugin for TinyMCE Changelog
2+
3+
## 1.0.0 – 2025-03-31
4+
5+
This is the initial release of the WProofreader plugin for TinyMCE. Key differences from the classic WProofreader include:
6+
7+
* Delivered as a TinyMCE plugin, simplifying integration.
8+
* Added a toolbar button to launch WProofreader.
9+
10+
Future updates will focus on refining the styling to better match TinyMCE’s native appearance.

LICENCE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
WProofreader plugin for TinyMCE code is provided under the MIT license. Please see the license text further in this notice.
2+
3+
WProofreader plugin for TinyMCE uses WProofreader spelling and grammar checking functionality provided by WebSpellChecker under the commercial licenses.
4+
5+
* The cloud version of the WProofreader is governed by the [Terms of Service](https://webspellchecker.com/legal/terms-of-service/).
6+
* The server version of the WProofreader is governed by the [Software License Agreement](https://webspellchecker.com/legal/software-license-agreement/).
7+
8+
The corresponding pricing information can be found on our [website](https://webspellchecker.com/pricing/).
9+
10+
WProofreader plugin for TinyMCE
11+
Copyright 2025, WebSpellChecker LLC.
12+
13+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 167 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,167 @@
1-
# wproofreader-tinymce
2-
WProofreader spelling and grammar check plugin for TinyMCE
1+
WProofreader plugin TinyMCE
2+
===================================
3+
4+
The multilingual spelling and grammar checking solution for TinyMCE editor versions starting from v6, including the latest version 7. It provides both instant and in-dialog proofreading modes in a convenient UI.
5+
6+
WProofreader plugin for TinyMCE inherits all functionality of the WProofreader component with slight adaptation to the view and features of the editor. These adaptations include creating a button in the editor toolbar, listening for read-only mode switches and adding a theme adapted to the TinyMCE look and feel. For more details, visit the [WProofreader repo](https://github.com/WebSpellChecker/wproofreader) or [official web page](https://webspellchecker.com/wsc-proofreader/).
7+
8+
## Table of contents
9+
10+
* [Install instructions](#install-instructions)
11+
* [Documentation](#documentation)
12+
* [Reporting issues](#reporting-issues)
13+
* [Technical support or questions](#technical-support-or-questions)
14+
* [License](#license)
15+
16+
## Install instructions
17+
18+
1. Install the plugin
19+
20+
You can integrate the plugin using one of these methods:
21+
- [Using CDN](#using-cdn): Suitable for environments where no build process is involved.
22+
- [Using npm](#using-npm): Recommended for projects utilizing a JavaScript bundler.
23+
24+
### Using CDN
25+
26+
Use the `external_plugins` option to specify the URL-based location of the entry point file for the plugin and include it as a toolbar item using `toolbar` option.
27+
28+
```html
29+
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/7/tinymce.min.js" referrerpolicy="origin"></script>
30+
31+
<script>
32+
tinymce.init({
33+
selector: '#editorElement',
34+
external_plugins: {
35+
wproofreader: 'https://cdn.jsdelivr.net/npm/@webspellchecker/wproofreader-tinymce@1.0.0/dist/plugin.min.js'
36+
},
37+
toolbar: '... wproofreader',
38+
wproofreader: {
39+
/* WProofreader config */
40+
}
41+
});
42+
</script>
43+
```
44+
45+
### Using npm
46+
47+
To install the plugin via npm, run the following command:
48+
49+
```
50+
npm install @webspellchecker/wproofreader-tinymce
51+
```
52+
53+
The plugin will be installed into the next folder: `node_modules/@webspellchecker/wproofreader-tinymce/dist/plugin.min.js`.
54+
55+
Make the plugin accessible for application by using a web server or copying it to a public folder using a build tool. Then use the `external_plugins` option to specify the URL-based location of the entry point file for the plugin and include it as a toolbar item using `toolbar` option.
56+
57+
```html
58+
<script src="/path/or/uri/to/tinymce.min.js" referrerpolicy="origin"></script>
59+
60+
<script>
61+
tinymce.init({
62+
selector: '#editorElement',
63+
external_plugins: {
64+
wproofreader: '/path/or/uri/to/@webspellchecker/wproofreader-tinymce/dist/plugin.min.js'
65+
},
66+
toolbar: '... wproofreader',
67+
wproofreader: {
68+
/* WProofreader config */
69+
}
70+
});
71+
</script>
72+
```
73+
74+
Alternatively, copy the `dist` plugin subfolder into the TinyMCE plugins folder and rename it to `wproofreader`. Then use the `plugins` option to load the plugin and include it as a toolbar item using `toolbar` option.
75+
76+
```html
77+
<script src="/path/or/uri/to/tinymce.min.js" referrerpolicy="origin"></script>
78+
79+
<script>
80+
tinymce.init({
81+
selector: '#editorElement',
82+
plugins: '... wproofreader',
83+
toolbar: '... wproofreader',
84+
wproofreader: {
85+
/* WProofreader config */
86+
}
87+
});
88+
</script>
89+
```
90+
91+
For ES6 projects import the plugin to the source file and use the `plugins` option to load the plugin. Then include it as a toolbar item using `toolbar` option.
92+
93+
```js
94+
import tinymce from 'tinymce';
95+
import 'tinymce/icons/default/icons.min.js';
96+
import 'tinymce/themes/silver/theme.min.js';
97+
import 'tinymce/models/dom/model.min.js';
98+
import 'tinymce/skins/ui/oxide/skin.js';
99+
import 'tinymce/skins/ui/oxide/content.js';
100+
import 'tinymce/skins/content/default/content.js';
101+
...
102+
import '@webspellchecker/wproofreader-tinymce/src/plugin.js';
103+
...
104+
105+
export function render() {
106+
tinymce.init({
107+
selector: '#editorElement',
108+
plugins: '... wproofreader',
109+
toolbar: '... wproofreader',
110+
wproofreader: {
111+
/* WProofreader config */
112+
}
113+
});
114+
};
115+
```
116+
117+
2. Configure the plugin
118+
119+
After installing the plugin, you need to configure it in the TinyMCE setup. The configuration is added to the `wproofreader` field. For a detailed list of available customization options, refer to [Configuration reference](https://webspellchecker.com/docs/api/wscbundle/Options.html).
120+
121+
For the **Cloud-based** version of WProofreader:
122+
123+
```js
124+
wproofreader: {
125+
lang: 'en_US', // sets the default language
126+
serviceId: 'your-service-ID', // required for the Cloud version only
127+
srcUrl: 'https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js'
128+
}
129+
```
130+
131+
`serviceId` is a mandatory parameter for activating and using the plugin pointed to the Cloud-based version of WProofreader.
132+
133+
For the **Server-based** version of WProofreader:
134+
135+
```js
136+
wproofreader: {
137+
lang: 'en_US', // sets the default language
138+
serviceProtocol: 'https',
139+
serviceHost: 'localhost',
140+
servicePort: '443',
141+
servicePath: 'virtual_directory/api', // by default the virtual_directory is wscservice
142+
srcUrl: 'https://host_name/virtual_directory/wscbundle/wscbundle.js'
143+
}
144+
```
145+
146+
Unlike the Cloud-based version, the `serviceId` parameter is not used here. Instead, it is required to specify the path to the backend entry point hosted on the client’s infrastructure.
147+
148+
## Documentation
149+
150+
To find out more, refer to the following documentation:
151+
152+
* [WProofreader Configuration reference](https://webspellchecker.com/docs/api/wscbundle/Options.html)
153+
* [TinyMCE Documentation](https://www.tiny.cloud/docs/tinymce/latest/)
154+
155+
## Reporting issues
156+
157+
We use GitHub Issues as the official public bug tracker for WProofreader plugin for TinyMCE. Here are some recommendations to take into account when reporting an issue:
158+
159+
* Provide steps which help us to reproduce an issue. A sample page or JSFiddle is always welcomed.
160+
* Some issues may be browser and integration-specific. So, please specify what browser and integration you encountered the issue with.
161+
162+
## Technical support or questions
163+
164+
Holders of an active subscription to the services or a commercial license have access to professional technical assistance directly from the support team. [Contact us here](https://webspellchecker.com/contact-us/).
165+
166+
## License
167+
Licensed under the terms of the MIT license. For full details about the license, please check the `LICENSE.md` file.

karma.conf.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Karma configuration
2+
3+
module.exports = function (config) {
4+
config.set({
5+
6+
// base path that will be used to resolve all patterns (eg. files, exclude)
7+
basePath: '',
8+
9+
// frameworks to use
10+
// available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter
11+
frameworks: ['mocha', 'chai', 'sinon', 'webpack'],
12+
13+
// list of files / patterns to load in the browser
14+
files: [
15+
{ pattern: 'tests/unit/**/*.js' },
16+
{ pattern: 'tests/integration/**/*.js' },
17+
{ pattern: 'dist/**/*.js', included: false },
18+
{ pattern: 'tests/mocks/wscbundle.js', included: false },
19+
{ pattern: 'node_modules/tinymce/**/*.js', included: false },
20+
{ pattern: 'node_modules/tinymce/**/*.css', included: false }
21+
],
22+
23+
// list of files / patterns to exclude
24+
exclude: [
25+
],
26+
27+
// preprocess matching files before serving them to the browser
28+
// available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
29+
preprocessors: {
30+
'tests/unit/**/*.js': ['webpack', 'sourcemap'],
31+
'tests/integration/**/*.js': ['webpack', 'sourcemap']
32+
},
33+
webpack: {
34+
mode: 'development',
35+
devtool: 'eval-source-map',
36+
},
37+
38+
// test results reporter to use
39+
// possible values: 'dots', 'progress'
40+
// available reporters: https://www.npmjs.com/search?q=keywords:karma-reporter
41+
reporters: ['mocha'],
42+
43+
// web server port
44+
port: 9876,
45+
46+
// enable / disable colors in the output (reporters and logs)
47+
colors: true,
48+
49+
// level of logging
50+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN ||
51+
// config.LOG_INFO || config.LOG_DEBUG
52+
logLevel: config.LOG_INFO,
53+
54+
// enable / disable watching file and executing tests whenever any file changes
55+
autoWatch: false,
56+
57+
// start these browsers
58+
// available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher
59+
browsers: ['Chrome'],
60+
61+
// Continuous Integration mode
62+
// if true, Karma captures browsers, runs the tests and exits
63+
singleRun: true,
64+
65+
// Concurrency level
66+
// how many browser instances should be started simultaneously
67+
concurrency: Infinity
68+
});
69+
};

0 commit comments

Comments
 (0)