knowzero / tinymce4-languagetool Goto Github PK
View Code? Open in Web Editor NEWAttempt to port Language Tool Spelling and Grammar Check to TinyMCE 4 [ALPHA/EXPIREMENTAL]
License: Apache License 2.0
Attempt to port Language Tool Spelling and Grammar Check to TinyMCE 4 [ALPHA/EXPIREMENTAL]
License: Apache License 2.0
I noticed that your plugin has an "Ignore" feature, which is nice.
However, when you refresh the page these settings seem to be lost. It would be valuable to me to have some kind of persistence for these settings. I have two ideas:
There are advantages to each of them; maybe both a worthwhile. What do you think @KnowZero ?
Hi,
When statusbar is disabled I have 2 errors:
Config:
tinymce.init({
menubar:false,
statusbar: false,
selector: '#mytextarea',
height: 300,
lt_lang: 'pl',
lt_mode: 'new_word',
lt_highlight_click: 'right',
plugins: ['code paste'],
external_plugins: {
languagetool: '/js/libs/languagetool/plugin.min.js'
}
});
Error 1:
Uncaught TypeError: Cannot read property 'insert' of undefined
at plugin.min.js:197
at LanguageTool.sgevent.init (languagetool.min.js:118)
at Object.getEvent (languagetool.min.js:387)
at Editor.<anonymous> (plugin.min.js:222)
at Dispatcher.fire (tinymce.js:31460)
at Editor.fire (tinymce.js:31700)
at initEditor (tinymce.js:44882)
at tinymce.js:45036
at tinymce.js:7689
at tinymce.js:7160
(anonymous) @ plugin.min.js:197
LanguageTool.sgevent.init @ languagetool.min.js:118
getEvent @ languagetool.min.js:387
(anonymous) @ plugin.min.js:222
fire @ tinymce.js:31460
fire @ tinymce.js:31700
initEditor @ tinymce.js:44882
(anonymous) @ tinymce.js:45036
(anonymous) @ tinymce.js:7689
(anonymous) @ tinymce.js:7160
setTimeout (async)
(anonymous) @ tinymce.js:7159
(anonymous) @ tinymce.js:7271
(anonymous) @ tinymce.js:7160
setTimeout (async)
(anonymous) @ tinymce.js:7159
(anonymous) @ tinymce.js:103
failed @ tinymce.js:7540
Error 2:
Uncaught TypeError: Cannot read property '$el' of undefined
at plugin.min.js:191
at lt_progress_bar (languagetool.min.js:1079)
at languagetool.min.js:577
at Function.grep (jquery.js:432)
at Array.<anonymous> (languagetool.min.js:550)
at Function.each (jquery.js:362)
at lt_timer_func (languagetool.min.js:549)
(anonymous) @ plugin.min.js:191
lt_progress_bar @ languagetool.min.js:1079
(anonymous) @ languagetool.min.js:577
grep @ jquery.js:432
(anonymous) @ languagetool.min.js:550
each @ jquery.js:362
lt_timer_func @ languagetool.min.js:549
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
Hi,
I have angular-ui-router (this is router by frontend side). After leave page with tinymce editor I have to remove all ckeditor instances. And after second tinymce.init I have an error
Config:
tinymce.init({
height: 150,
lt_highlight_click: 'right',
lt_lang: 'pl',
lt_mode: 'new_word',
menubar: false,
selector: '#' + textarea.id,
type: 'text',
// statusbar: false,
toolbar: false,
external_plugins: {
languagetool: '/js/libs/languagetool/plugin.min.js'
}
});
On page leave:
$onDestroy() {
element('#fb-render textarea').each((index, textarea) => {
tinymce.get(textarea.id).remove();
})
}
(It should remove all tinymce instances and it does)
After going back to the page it should call tinymce.init again
tinymce.init({
height: 150,
lt_highlight_click: 'right',
lt_lang: 'pl',
lt_mode: 'new_word',
menubar: false,
selector: '#' + textarea.id,
type: 'text',
// statusbar: false,
toolbar: false,
external_plugins: {
languagetool: '/js/libs/languagetool/plugin.min.js'
}
});
But after second initialization I have an error:
Uncaught TypeError: Cannot read property '$el' of undefined
at plugin.min.js:191
at lt_progress_bar (languagetool.min.js:1079)
at languagetool.min.js:577
at Function.grep (jquery.js:432)
at Array.<anonymous> (languagetool.min.js:550)
at Function.each (jquery.js:362)
at lt_timer_func (languagetool.min.js:549)
(anonymous) @ plugin.min.js:191
lt_progress_bar @ languagetool.min.js:1079
(anonymous) @ languagetool.min.js:577
grep @ jquery.js:432
(anonymous) @ languagetool.min.js:550
each @ jquery.js:362
lt_timer_func @ languagetool.min.js:549
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
Hi, would it work with webpack?
Because I'm trying to import it via "require()" and it has errors
Hey
In lt_setLanguage
I can set the language static, but the languagetool API support a language detection.
Why do not use it?
In every language there are new word from other languages, in german we call it "anglizismen".
With a static set language we get a lot of trouble with these english words that are imported to other languages.
Hello
I have a problem.
I'm trying to figure out how your script works for ckeditor.
In my test phase (ck.html file), I get an error:
Uncaught TypeError: $ is not a function
I have the impression that, when loading the remote file
https://knowzero.github.io/tinymce4-languagetool/languagetool/include/languagetool.min.js
The latter does not take into account the jquery previously loaded.
I seek to understand your source code in order to translate it into pure javascript, without any third-party libraries
Could you tell me how to understand your code?
I thank you in advance.
leknoppix
NB: Sorry, my English is a bit rusty.
I try to integrate your plugin into drupal 7 (wysiwyg module with tinyMCE installed).
Changed some of the drupal module code and the plugin is correctly loaded if the tinymce is initiated at a texfield.
The javascript of the plugin looka little bit problematic.
languagetool.min.js:90 Uncaught TypeError: $ is not a function
at new LanguageTool (/sites/all/libraries/tinymce/js/tinymce/plugins/languagetool/include/languagetool.min.js:90:17)
at c. (/sites/all/libraries/tinymce/js/tinymce/plugins/languagetool/plugin.min.js:121:11)
I am not really the best at JS coding, but looks in the drupal eviroment the $ is only available after the document is fully loaded, document.ready.
Hope we can get it more robust and working on Drupal 7.
Let me know if If can help.
Hi @KnowZero ,
I found great value in your repo and am very grateful that you open-source such a project!
I have two questions:
Could you guide me on these?
Thanks!
Here is my setup:
Here are my issues:
Any help pointing me to what i am doing wrong would be greatly appreciated.
Thanks!
Hi,
You have 2 mods.
Hey @KnowZero thanks for writing this.
I'm using TinyMCE v5.8.1 for an existing webapp and I wanted to add spellchecking. And guess what? My app lives on a legacy Windows server with no Internet connectivity. That severely limits my spellchecking options.
I found your plugin here, which could do half the work. I downloaded your v5 port and threw it in and configured some params.
Next, I tried to install LT on my server but, sparing the details, there were system incompatibilities. So I pulled together a few libraries and wrote a Go server that simulates output from an LT server in the exact JSON format (or very close). Then I pointed your plugin at that custom backend.
However, I'm now running into some strange inconsistencies with your plugin:
span>>
into the editor. (I know there's HTML in the editor and you can't see it; somehow the plugin generated a partial tag which made it appear since it wasn't valid HTML.)So: it's promising, but I'm guessing there are more incompatibilities with v5 than perhaps you first suspected. I would love to use v4 but I already have an app built with v5 and I don't know exactly how much work it would take to port back to v4. I'm hoping fixes could be made without too-too much effort.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.