问题
I am using spellchecker from Google in my web application. It was working great but for some reason Google has stopped or removed their service and now it's not working. Here is the link for the SOAP API - https://developers.google.com/soap-search/?csw=1#1_3.
I tried with some other components like
http://www.jspell.com/tinymcespellchecker.html (it's require some intallation on the server and have some issues related to typing + some PHP code to execute)
http://jquery-spellchecker.badsyntax.co/tinymce.html (it's require some PHP code to execute and giving error "the method is not allowed with "POST")
Both aren't working well as expected.
I had also posted an question previously but don't get any reply there Tinymce: Spellchecker is not working.
回答1:
Why don't you use the browser spellchecking?
There is not much you will need to do to make it work.
The browser needs to have a dictionary of your language installed (AddOn) and additionally you will need to set the attribute spellcheck
of the editor body to true
.
tinyMCE.init({
...
setup : function(ed) {
ed.onInit.add(function(ed, evt) { //since tinymce4 use ed.on('init', function(evt){...
ed.getBody().setAttribute('spellcheck', true);
});
}
});
This is far faster than a remote spellchecker approach (using something like Google spellchecker or an other aspell server).
回答2:
The spellchecker plugin included in the 4.XX download WILL NOT WORK. That plugin relied on Google's spell checking API which has been permanently discontinued, disabled, removed. I too recommend using the browser-based spellchecker. After that you can remove all code for spellchecker.
tinymce.init({
selector: '.mceEditor',
browser_spellcheck: true,
contextmenu: false,
});
回答3:
Following up on mcain66's post, I was able to rewrite the .Net handler to use Google's new API.
New dll and source code are here.
Note that I updated the target framework to 3.5 in order to use the JavaScriptSerializer
. I can't imagine many people are using older versions of .Net at this point anyway.
The new API requires an API key, but the one in mcain66's post is the same one used by my version of Google toolbar, so it appears that every install of the toolbar uses the same key.
Anyway, I don't know if this is a great long-term solution since it's still an undocumented and unsupported API, but I'm hoping it gets us by until everyone is using IE10+ and can rely on native browser spell checking.
Ref: Post by dhammond member at TinyMCE
回答4:
For anyone still struggling with the latest version (4). All I had to do was add the following to my init statement. Note the plugin method. I have it on the toolbar as well as it doesnt appear if its not working - good check!
tinymce.init({
selector: "textarea",
menubar: false,
plugins: "spellchecker",
toolbar: "cut copy paste pastetext undo redo spellchecker | link unlink hr | bold italic underline | bullist numlist outdent indent blockquote | alignleft aligncenter alignright alignjustify",
statusbar: false
});
来源:https://stackoverflow.com/questions/17898359/is-there-any-working-spellchecker-plugin-for-tinymce