Code Monkey home page Code Monkey logo

ckeditor-plugin-scayt's Introduction

SCAYT plugin for CKEditor 4

SpellCheckAsYouType (SCAYT) instantly underlines spelling and grammar errors while users type. To correct spelling or grammar error, a user simply needs to right-click the marked word to select from suggested corrections. SCAYT Plugin for CKEditor 4 View

This plugin brings the multi-language SCAYT functionality into CKEditor 4. It is integrated by default starting with Standard Package of CKEditor 4. You can find it on the CKEditor 4 toolbar panel under the ABC button (Enable SCAYT).

If your version of CKEditor doesn’t have SCAYT built-in, you can easily add it by following the steps outlined in the Get Started section.

The default version of SCAYT plugin for CKEditor 4 is using the free services of WebSpellChecker. It is provided with a banner ad and has some limitations.

To lift the limitations and get rid of the banner, obtain a license. Depending on your needs, you can choose a Cloud-based or Server (self-hosted) solution.

Demo

SCAYT plugin for CKEditor 4: https://webspellchecker.com/wsc-scayt-ckeditor4/

Supported languages

The SCAYT plugin for CKEditor as a part of the free services supports the next languages for check spelling: American English, British English, Canadian English, Canadian French, Danish, Dutch, Finnish, French, German, Greek, Italian, Norwegian Bokmal, Spanish, Swedish.

There are also additional languages and specialized dictionaries available for a commercial license, you can check the full list here.

Get started

  1. Clone/copy this repository contents in a new "plugins/scayt" folder in your CKEditor installation.

  2. Enable the "scayt" plugin in the CKEditor configuration file (config.js):

     config.extraPlugins = 'scayt';
    

That's all. SCAYT will appear on the editor toolbar under the ABC button and will be ready to use.

Supported browsers

This is the list of officially supported browsers for the SCAYT plugin for CKEditor 4. SCAYT may also work in other browsers and environments but we unable to check all of them and guarantee proper work.

  • Chrome (the latest)
  • Firefox (the latest)
  • Safari (the latest)
  • MS Edge (the latest)
  • Internet Explorer 8.0 (limited support)
  • Internet Explorer 9.0+ (close to full support)

Note: All browsers are to be supported for web pages that work in Standards Mode.

Resources

Technical support or questions

In cooperation with the CKEditor team, during the past 10 years we have simplified the installation and built the extensive amount of documentation devoted to SCAYT plugin for CKEditor 4 and less.

If you are experiencing any difficulties with the setup of the plugin, please check the links provided in the Resources section.

Holders of an active subscription to the services or a commercial license have access to professional technical assistance directly from the WebSpellChecker team. Contact us here!

Reporting issues

Please use the SCAYT plugin for CKEditor 4 GitHub issue page to report bugs and feature requests. We will do our best to reply at our earliest convenience.

License

This plugin is licensed under the terms of any of the following licenses at your choice: GPL, LGPL and MPL.

See LICENSE.md for more information.

Developed by WebSpellChecker in cooperation with CKSource.

ckeditor-plugin-scayt's People

Contributors

andrewwsc avatar annatomanek avatar artyomz avatar blackrabbit99 avatar bo-ora avatar bogdandidenko avatar egnedko avatar engineering-this avatar f1ames avatar fredck avatar garryyao avatar jacekbogdanski avatar jalners avatar jshaptala avatar kremyura avatar mlewand avatar oleq avatar reinmar avatar sculpt0r avatar wwalc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckeditor-plugin-scayt's Issues

Scayt removes styled spans from misspelled words in IE9-10

  1. Open api.html sample in IE9-10
  2. Enable SCAYT
  3. Insert below text in textarea <span style="color:red">red</span>
  4. Select 'om' from "This is s[om]e ..."
  5. Press insertHTML button to insert span
    Result: In IE9-10 span with red color is removed.

IE9-10: Opening CKEditor with scayt_autoStartup=true causes content area to be unclickable.

  1. Please see ticket: http://dev.ckeditor.com/ticket/11084
  2. Please use 11084.html sample - just put it into samples folder of editor
  3. Open page
  4. Click inside editor and type few words
  5. Click Kill editor
  6. Click Rebuild editor
  7. Click inside editor
    Result: No focus. Cursor can't be put inside content are with click. This doesn't happen when scayt_autoStartup is set to false.

Problem can be reproduced in IE9-10 only.

[Blink/Webkit] SCAYT does not focus nested editable after applying change

Reproducible with the latest (major) CKEditor and SCAYT. I was testing it on Chrome.

  1. Open image2 sample.
  2. Enable SCAYT.
  3. Go to nested editable and type some incorrect word.
  4. Try to correct it using options in context menu.
  5. Word is corrected, but caret is moved back to the main editable.

As I mentioned in #16 it's important on Blink/Webkit to focus the correct editable element. The editor takes care of that (in editable.focus()), so I guess that SCAYT is not using this method.

Scayt removes styled spans when correcting misspelled words

  1. Open api.html sample in Blink, Webkit or Firefox
  2. Enable SCAYT
  3. Insert below text in textarea
    <span style="color:red">red</span>
  4. Select 'om' from "This is s[om]e ..."
  5. Press insertHTML button to insert span
  6. Word gets underlined
  7. Select misspelled word, right-click on it and change it to one of suggested words.
    Result: both spans (red and misspelled) are removed but in editor elements path there is still span present and if you click on it JS error is thrown.

This may look like editor issue but IMO SCAYT should not remove red span. This is source of the error.

[IE] Scroll jumps when undoing/redoing if SCAYT is enabled

I tested this on IE11 and IE9:

  1. Open replacebycode sample.
  2. Enable SCAYT.
  3. Type something in few paragraphs, so undo steps are recorded.
  4. Scroll the viewport so not entire editable is visible.
  5. Undo - viewport will be scrolled. Additionally, I think that editor is blurred for a moment.

CKEditor is broken and JavaScript error is thrown in Firefox when SCAYT is enabled

Sample TC:

  1. Open in Firefox http://nightly.ckeditor.com/full/samples/replacebycode.html
  2. Wait 5 seconds for the editor to load fully
  3. Enable SCAYT, wait 5 seconds
  4. Click Source button, wait few seconds

In Firebug error console., the following error is shown:

TypeError: _3cf(...) is null

loader__base.js (line 3586)

Now click Source button again:

TypeError: doc is null

loader__base.js (line 2844)

CKEditor does not go back to Wysiwyg mode.

SCAYT and custom document.domain

Our page use custom value for document.domain and there is following code in the https://svc.webspellchecker.net/scayt26/_base.xd.js:

var html="javascript:void(0)";
var _69b=_4.doc.createElement("iframe");
_4.attr(_69b,{hidefocus:"true",frameborder:"0",src:html});
_4.body().appendChild(_69b);
_69b.contentWindow.document.open();
_69b.contentWindow.document.write("<html><head></head><body><script type="text/javascript">scayt=parent.scayt;scayt.iframeOnLoad()</script></body></html>");
_69b.contentWindow.document.close();

(I removed some lines that actually doesn't case this bug).

So, it creates blank iframe (with src = javascript:void(0)). And after that calls iframe.contentWindow.document methods. But there is a known issue in the IE that iframe with blank src won't work if document.domain is set in the parent page (see workarounds here: http://stackoverflow.com/questions/14715427/cant-access-an-aboutblank-iframe-in-ie-after-the-document-domain-changes). Access to iframe.contentWindow.document crashes with "access is denied" message.

Are there any way to receive js from webspellchecker with support for custom document.domain?

Disabled About tab

Tab containing informations about SCAYT in dialog is disabled. Therefore clicking About option in editors, will display options tab.

TC:

  1. open editor
  2. click SCAYT button
  3. click About SCAYT option

Uncaught TypeError: Cannot read property 'parentNode' of undefined

Scenario:

  1. Open browser (tested with FF and Chrome).
  2. Open samples/replacebyclass.html.
  3. Enable SCAYT.
  4. Wait for it (wait till "Aldrin" is underlined).
  5. Press Cltr+A, Cltr+X to remove content.

You will see error in console:
Uncaught TypeError: Cannot read property 'parentNode' of undefined.

It is important to remove content after SCAYT starts ("Aldrin" is underlined) but before it finished.

SCAYT completely blocks typing in nested editables

Hi,

During testing phase for CKEditor 4.3 beta which introduced Widgets System we found this issue: http://dev.ckeditor.com/ticket/10876.

Widgets are non-editable elements which can have nested contenteditable elements inside them. These nested editables have to be really carefully handled. One of the problematic things is focusing them, because they are separate focusable element beside the main editable.

When reproducing a TC described in #10875 I found these lines from SCAYT plugin:

}else{
if((/CKEDITOR/i.test(this.assocApp))&&evt.ctrlKey&&evt.charCode==118){
setTimeout(function(){
t.containerNode.focus();
},0);
}else{
t.containerNode.focus();
}

This code is executed on keydown and it moves focus from nested editable to containerNode which is the main editable (body element).

I don't understand why SCAYT does such a thing, but if it really needs to it should call focus on the editor.editable() which will assure that focus is moved to the nested editable, not to the main one. Although, I think that the best solution would be to get rid of these focus() calls at all, because it's really hard to predict their result.

Wrong status after enter key

Tested and confirmed in CKEditor version: 4.3.3 and 4.4.0 (prerelease)
Browsers: all

  1. Load the following content in editor

    <p>wrongspell</p>
    
    • Expected Result: The word is red-marked in wyswig mode.
  2. Set cursor after 'g' letter

    <p>wrong^spell</p>
    
  3. Press 'enter' at the cursor position

    • Expected Result: The marker underline is removed immediately after key down
    • Actual Result: The marker will remain for a while until next refresh happens.

Original bug reported at: http://dev.ckeditor.com/ticket/5701

SCAYT should require removeformat plugin or use it more carefully

  1. Clone ckeditor-dev repo.
  2. Clone SCAYT inside plugins dir.
  3. Add SCAYT to extraPlugins.
  4. Open inlineall sample.

Error is thrown:

[11:53:59.145] TypeError: this._.removeFormat is undefined @ http://localhost/cksource/ckeditor-dev/plugins/removeformat/plugin.js:142

SCAYT incorrectly tests for removeFormat. It may be loaded, but not initialized yet, since SCAYT doesn't require remofeFormat. So better test is needed than:

editor.addRemoveFormatFilter && editor.addRemoveFormatFilter( scaytFilter );

issue with CKEditor 4.3.2 with the SCAYT plugin

Hi,
I have an issue with CKEditor 4.3.2 (free) with the SCAYT plugin (free).
We don't like the double line spacing caused by P tags and have changed the setting config.enterMode = CKEDITOR.ENTER_BR; in the config.js file.
The trouble is that this causes the spell checker to move the cursor as you type.
For instance:
If I have a blank CKEditor, enter a character (say Q) and then move the cursor to the left of this character.
If I press enter it moves the cursor to AFTER the character.
If I then move the cursor up to the top of the page, it moves itself back down.
If I then turn the spell checker off this stops happening.
Is the config.enterMode = CKEDITOR.ENTER_BR; no longer supported?
Is there another way of stopping the double line spacing?
Or is this an issue with the spell checker?
Thanks
Michael

Big amount of invalid content slows down SCAYT

Tested and confirmed in CKEditor 4.3.3 and 4.4.0 (prerelease)
Browsers: Mainly in Chrome

  1. Copy to clipboard following text:
    sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdfsdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdfsdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf
  2. Enable SCAYT
  3. Paste above text quickly for a few(depends on system performance) times into editable area
  4. Press Enter and type some misspelled word
    • Actual Result: Browser freezes for some period of time

Enter mode BR break list after anabling SCAYT

Tested and confirmed in CKEditor 4.3.3 and 4.4.0 (prerelease)

Browsers: IE8 & IE9

  1. Load editor with configuration
    enterMode: CKEDITOR.ENTER_BR
  2. Load editor with no content
  3. Create two element list with misspelled words
  4. Escape list with double enter
  5. Type some misspelled word below list
  6. Enable SCAYT
    • Actual result: list is split into two parts.

Browsers: All

  1. Load editor with configuration
    enterMode: CKEDITOR.ENTER_BR
  2. Set content:
    `
    1. kldsjfkslj
    2. sdklfjskld
    sdjklfj ` or `

    Apollo 11

    Apollo is okay `
  3. Enable SCAYT
    • Actual result: list(first content) or header(second content) is split into two parts.

Bug may be related to: http://dev.ckeditor.com/ticket/8929

Enabling SCAYT breaks anchor text

Tested and confirmed in CKEditor 4.3.3 and 4.4.0 (prerelease)
Browsers: all

  1. Load the following content in editor

    <p><a name="anchor1">anchor mis</a>pell</p>
    
  2. Wait until word "mispell" is marked by SCAYT

    • Actual Result: marker splits up the anchor into two, with each of them get applies the anchor styles.
  3. Click "source button" to get into source mode

  4. Click "source button" to get into editor mode

    • Actual Result: creates new anchors

Original bug reported at: http://dev.ckeditor.com/ticket/7812

MathJax and SCAYT issue

  1. open Chrome,
  2. open "Mathematical Formulas" sample (samples/plugins/mathjax/mathjax.html),
  3. enable SCAYT,
  4. double click on any formula to open dialog.

Wield delay will appears. Sometimes it lasts couple seconds.

suggestions list is shown when there is no suggestions

  1. Enable SCAYT
  2. Paste some text in Latin (Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies.) and wait until words became underlined
  3. Right-click one of misspellings (Lorem) to be sure that there is "No suggestion" option
  4. Type some misspelling (testt) and wait until it became underlined
  5. Right-click the misspelling to be sure that there are some suggestions
  6. Right click one of Latin misspellings (Lorem)

Expected result: there are "Ignore", "Ignore All", "Add Word", "No suggestion" and default CKEditor menu items
Actual result: there are suggestions for the misspelling which was clicked before (testt) and "Ignore", "Ignore All", "Add Word", "No suggestion" and default CKEditor menu items

Unable to select text (for a moment) after enabling SCAYT

Hi,

Enable SCAYT and try to select text from the bottom upwards. See the screencast - ​http://www.screencast.com/t/SsQJEch3T2

When SCAYT finishes checking selection works as expected. SCAYT uses bookmarks and selection on checking and it resets the editor selection.

Ticket in CKEditor - http://dev.ckeditor.com/ticket/11157
IMHO this isn't anything critical. Can this even be fixed on your side or the way checks are made can't be changed?

Links in the banner are not active

Steps:

  1. Open sample page with SCAYT 3 + CKEditor 4
  2. Try to open the context menu for a misspelled word to display the banner
  3. Try to click the links

Expected result: Links are clickable

Actual result: Links are not clickable

JS error on Options dialog closing in the CKEditor with inline mode

Steps:

  1. Open sample page with SCAYT 3 + CKEditor 4 and Inline mode
  2. Open SCAYT Options dialog
  3. Click OK
  4. View console

Expected result: SCAYT Options dialog is closed without errors

Actual result: SCAYT Options dialog is closed with error:
Uncaught IndexSizeError: Index or size was negative, or greater than the allowed value. ckeditor.js:371

SCAYT does not work with CKEditor 4.2

Hi,

We've just found that SCAYT cannot be enabled on CKEditor 4.2. It tries to override CKEDITOR.plugins.undo.Image#equals which does not exist any more. It was split into two methods - equalsContent and equalsSelection. I guess that you'll be interested in the first one, although it's not a good practice to override private methods. Therefore maybe listening on new editor#change event will be a better option. Note that it will be introduced in CKEditor 4.2 too.

Steps:

[Blink] Hitting shift+enter twice from the top of a formatted block will add a space below the cursor

Reported here:http://dev.ckeditor.com/ticket/11462

  1. Enable SCAYT
  2. Create the new paragraph and set "Formatted" format
  3. Type "test" and move cursor to the start of the text ("|test")
  4. Hit shift+enter twice

Expected: the two new lines are added above the text. cursor stays at the start of the text.

Outcome: the second hitting shift+enter will create the new line under the text and move the cursor into it.

Page freeze when doing tasks repetitively via SCAYT's contextmenu, performance concerns

  1. Open CKEditor with SCAYT. Let's say http://ckeditor.com/demo#full
  2. Run SCAYT.
  3. Select different language so many words get underlined (i.e. French).
  4. R-click underlined word -> Ignore
  5. R-click another underlined word -> Add word
  6. Repeat 4-5. In most of the cases, the browser's tab hangs (100% CPU core load) for the second or third word.
  7. Even if nothing freezes, an excessive usage of CPU can be observed which implies the overall slow-down of the browser.

Reproduced in latest Chrome. Other browsers possibly affected.

Scayt undo conflict.

Reported here http://dev.ckeditor.com/ticket/11036.

Steps to reproduce:

  1. Open www.ckeditor.com/demo in IE
  2. Enable SCAYT
  3. Write 3-4 paragraphs
  4. Try to undo the text

Undo does not work properly and unable to undo all text inserted (undo just blocks).
Problem can be reproduced in IE8-10 from CKEditor 3.6.2.
Please also have a look at attached screen cast to that ticket.

Could you leave a comment if this is editor or scayt issue?

When trying to copy misspelled selected word, selection gone and word doesn't get copied

Tested and confirmed in CKEditor 4.4.0 prerelease
Browser: Latest Chrome

  1. Open this sample https://gist.github.com/adelura/8c440212f84875c1e3b5
  2. Enable SCAYT
  3. Next to 'Apollo 11' text type some two misspelled words for example
    fooor baaar
  4. Wait until words get underlined
  5. Use 'Check Spelling' option from SCAYT/WSC plugin menu button
  6. Click 'Finish Checking' and wait until words get underlined
  7. Select word 'fooor'

8a. Press Ctrl + C

  • Actual Result: selection is gone and selected word doesn't get copied to clipboard

8b. Press Backspace

  • Actual Result: Word is not deleted as expected. Cursor move left, and only space is deleted

CKEditor/IE10/SCAYT Issue

I have CKEditor v4.1.0 installed along with SCAYT. Everything works fine except that in IE10, SCAYT does not auto start (it works fine if you disable and reenable). I have the following in my config.js file:

config.scayt_autoStartup = true;

Auto startup works fine in all the other browsers. Any ideas?

Broken undo manager integration

  1. Open http://ckeditor.com/demo#full
  2. Enable SCAYT (it's 005c91b).
  3. Right-click several words to fix spelling.
  4. Press CTRL-Z to undo each change. Note that a single CTRL-Z reverts the substitution.

Now use the latest SCAYT and repeat all the steps. Note that each substitution requires two CTRL-Z to be undone: the first one that moves the caret and the second one that reverts the word.

I want to enable the plugin on Adobe AIR

Hi, the scayt plugin it checks for opera and air and disables itself if running that, I could not find the reason why in the comments or the code. I removed those checks and what I noticed is calls for window.scayt but this property is never asiogned any value in the plugin.js. I would apreciate if someone could let me know why is not working on Adobe AIR maybe I can workaround that. Here is a forum thread I started abgout this. P.S. version 4 of ckeditor is not working in AIR so I can't try that.

IE 8: JS error on SCAYT Options dialog openning

Steps:

  1. Open sample page with SCAYT 3 + CKEditor 4 in inline mode
  2. Open Languages dialog
  3. Change Language > Close the dialog
  4. Unfocus the editor
  5. Open Languages dialog again

Expected result: Languages dialog is opened without errors

Actual result: JS error.
Object doesn't support this property or method options.js?t=E2I8, line 3 character 397

Chrome: The word can't be copied after Finish Checking

Steps:

  1. Open Image 2 sample page
  2. Next to Apollo 11 header paste: ‘adamr udarek schol wolek’
  3. Enable SCAYT
  4. Open WSC pop-up
  5. Click Finish Checking and wait for the words to get underlined again.
  6. Select Word ‘udarek’ and press Ctrl+C

Expected result: The word is copied

Actual result: Selection is gone and selected word doesn’t get copied to clipboard.

Better support for multilanguage content

I initially reported it in http://dev.ckeditor.com/ticket/10888 but that's not the right issue tracker :-) so here it goes:

When I try the sample of CKEditor 4.3 Beta with the language plugin enabled, enter there content in a different language:

<span dir="ltr" lang="es">
El invierno pasado estuvo tan fr&iacute;o que literalmente se form&oacute; hielo en mi barba.&nbsp;
</span>

and then start SCAYT, it will underline the whole text, even though it has the proper Spanish dictionary included. It happens because it treats the whole content as if it was written in English.

SCAYT should not be available on inline editor

  1. Clone ckeditor-dev repo.
  2. Clone SCAYT inside plugins dir.
  3. Add SCAYT to extraPlugins.
  4. Fix issue #2.
  5. Open inlineall sample.
  • Expected: No SCAYT button.
  • Actual: There's SCAYT button in toolbar and it can be enabled. But nothing more than that works.

[IE] SCAYT cannot be disabled if selection is placed in nested editable.

Reproducible with the latest (major) CKEditor and SCAYT. I was testing it on IE9.

  1. Open image2 sample.
  2. Enable SCAYT.
  3. Place caret in nested editable.
  4. Try to disable SCAYT.
  5. Error is thrown. Unfortunately IE says that the error is thrown from HTML file, so I haven't got more details regarding it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.