KnowZero / tinymce4-languagetool

Attempt to port Language Tool Spelling and Grammar Check to TinyMCE 4 [ALPHA/EXPIREMENTAL]
Apache License 2.0
22 stars 11 forks source link

Add/Ignore #11

Open tooolbox opened 2 years ago

tooolbox commented 2 years ago

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:

  1. LanguageTool's API supports adding words to a custom dictionary. Maybe this could be supported?
  2. Another option would be to use local storage.

There are advantages to each of them; maybe both a worthwhile. What do you think @KnowZero ?

KnowZero commented 2 years ago

I think the best option would be a simple adapter that lets the user choose whether they wish to store it in localstorage or custom server.

localstorage is probably the least effort since all that requires is just dumping sgstore.ignore and retrieving it on initialization. But probably people would want custom servers cause users can use other devices. Also, ignore would probably would need fine tuning cause ignore in 1 document doesn't mean they want to ignore in all documents. or they might.

As for adding words, is that a normal feature or premium only?

That said, currently the development of this is in maintenance mode. Which means I am only doing bugfixes. I just added TinyMCE v5 to see if it still works properly and even then v5 is missing out on the progress bar which if you click in v4 will open a dialog and lets you fix things that way for those who prefer.

I have a few projects that I need to finish first before I can come back to this one. This entire thing needs to be refactored cause if you saw the source it is a bit of a mess.

The plan is to: 1) Remove dependence on jquery 2) Stop relying on lazy regexes 3) Spin off any UI into its own module so that it isn't tied down to TinyMCE v4 (Reason for why dialogs don't work in v5) 4) Support virtualdom based editors like ProseMirror and Slate (Personally, I actually planned to move onto ProseMirror over TinyMCE since it better meets my needs (Though Slate is good too, but I saw better performance with ProseMirror for large documents, which may have been fixed now its been a while), but I will support all of them)

But again, that will have to come after I finish the other stuff. Since the project that I was working this on for got delayed so until I finish the other stuff, I am only fixing bugs.

If you want you want, you can add it, as mentioned, just copy over sgstore.ignore into localstorage and then reload it back up on init.

tooolbox commented 2 years ago

I think the best option would be a simple adapter that lets the user choose whether they wish to store it in localstorage or custom server.

Makes sense.

As for adding words, is that a normal feature or premium only?

I believe that is a premium-only feature for LT.

If you want you want, you can add it, as mentioned, just copy over sgstore.ignore into localstorage and then reload it back up on init.

Yeah, I'm not super familiar with localstorage APIs, but I'll probably take a stab at that.