Closed danielnaber closed 6 years ago
@danielnaber as i far understood, it would be an ordinary js library that is connected to the page like everyone else. She will search for textareas in the DOM and add the necessary elements to them, as well as all the necessary api for checking words and everything else. Now we need to understand - all this code will need to be written from scratch? or not? What language is the addon for the browser written?
@neprev That's correct. Not much code needs to be written new, I hope. The code is all here at https://github.com/languagetool-org/languagetool-browser-addon/tree/master/webextension, mostly in sub directories bs
, cs
, and share
. It's 100% Javascript, that's why I think you could do this.
Hi @neprev, any chance you can work on this soon?
@neprev Any update about this?
@danielnaber Hi, plan to do on Wednesday
Have you started already? Can you estimate how much time this might take? I'd like to know a (rough) estimate before we spend a lot of time here.
@danielnaber First of all, we can not just use the code that is in the extension. There are two options for the plugin:
In the first case, we need to configure the communication between the window and the extension. For example, do not initialize the connected library if an extension is installed and running. I think that there will not be much to write, but I can not say for sure. Today I will ask my colleagues about this.
In the second case (in addition to the code that is in the first), we need to initialize the library. But this will not be an extension, so it will not work with the WebExtensions API and its add-ons, so half of the methods will need to be fixed, the other half can be re-used (mostly manipulations with the DOM). Here the work can be divided into a couple of stages: 1 . Write the basic part: when initializing, go through the DOM, find the textareas, make the necessary edits, elements, hang events, configure the sending of the request to the server (some of it can be re-used, some not). A rough estimate for this stage is 10 hours
Ready to work on the first stage. I'm waiting for your decision
Hi Nikita, thanks for the estimation. Someone else is currently making major changes to the add-on, so it makes sense to wait for that. Not sure yet how long it might take.
We have a browser add-on (Firefox, Chrome) that attaches itself to the textareas of each page to check them. Idea: use the same code so some Javascript snippet can be added to an HTML page so the add-on's functionality is in the page even when the user has not installed the add-on.
I image it can work like this: person who develops the HTML page adds a
<script>
tag with our code and maybe optionally calls some kind ofinit()
method to specify e.g. theid
s of the textarea to be enhanced by spell checking. That's all - the user gets the functionality of our add-on, the developer doesn't have to do anything else.To get a better understanding, please install the add-on first and see how it works: it places a small icon in the lower right corner of every textarea. User can click it to get errors. In the dialog, user can select suggestions which are then used to replace the errors in the textarea. This is exactly what this Javascript plugin (is that a good name?) should do.
Notes: