Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Initializing WProofreader using init() in CKEditor 4

Code Block
languagejs
themeEmacs
<!-- Include the WEBSPELLCHECKER_CONFIG variable. -->
<script>
    window.WEBSPELLCHECKER_CONFIG = {
		autoSearch: true,
		autoDestroy: true,
		...	
    };
</script>

<script type="text/javascript" src="http(s)://host_name/wscservice/wscbundle/wscbundle.js"></script>

<!-- Use this path for the Cloud-based version
<script type="text/javascript" src="https://svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js"></script>
-->

<div id="ckeditor4-editor">
    <p>These are an examples of a sentences with two mispelled words and grammar problems. Just type text with misspelling to see how it works.</p>
</div>

<script>
	CKEDITOR.disableAutoInline = true;

	CKEDITOR.on('instanceReady', function(event) {
		var editor = event.editor;

    	WEBSPELLCHECKER.init({
			//catch both iframe and inline modes 
        	container: editor.window.getFrame() ? editor.window.getFrame().$ : editor.element.$
		});
	});
	
	CKEDITOR.replace('ckeditor4-editor', {});
</script>

...