|
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. |
0 commit comments