lnreader icon indicating copy to clipboard operation
lnreader copied to clipboard

Check feature for js editor to verify if the code is applied

Open Palloxin opened this issue 2 years ago • 2 comments

Describe your suggested feature

Check feature for js editor to verify if the code is applied. Many times i type wrongly the syntax of javascript and this ends up in the whole code in the js editor to not apply, everything (a single [ missing is enough). So upon clicking the button Save the app should check if the code has been applied(not a syntax check). Nothing complicated, just minimum to know if everything doesn't work. If the code is not applied the app should pop up a warning saying that the js might not be applied.

This feature should be wrapped up in a togglw option

Why

QoL improvement. Many times i go back to the novel and then discover that the whole js didn't apply and then i have to go back to js editor section which is annoying. I would prefer to be warned upon clicking "Save", avoiding the continuous back and forth.

Other details

I know nothing of coding but here is an idea. Add a ghost script that the user can't see in the editor and applies to the text in the preview. For example there is Cum sociis natoque, IMG_20230717_054541 replace it so that it becomes -Cum sociis natoque- and then Check if -Cum sociis natoque exist. IF it does NOT, make the warning i cited pop up. The "ghost script" should be somehow linked(or not isolated idk) to the code of the js editor so that if the syntax typed by the user is wrong the "ghost script" will break too. In this way it woukd become checkable. Maybe this idea is just no sense, if so ignore it.

personally i modify the preview text in this way to detect if the js inserted is broken. If the red circles don't appear then the js in the editor has not the proper syntax(so broken). IMG_20230725_061507

Acknowledgements

  • [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
  • [X] I have written a short but informative title.
  • [X] If this is an issue with a source, I should be opening an issue in the sources repository.
  • [X] I have updated the app to version 1.1.14.
  • [X] I will fill out all of the requested information in this form.

Palloxin avatar Jul 16 '23 17:07 Palloxin

How do you define the code is applied? It is injected without error? or it is injected and run as your expectation? If second then this should be closed. Because app doesnt know your expectation. Some advices: Use try catch, alert to check if your code running as expected in underhood.

nyagami avatar Jun 10 '24 14:06 nyagami

Only "not injected". The kind of error that makes the whole thing not apply. For example if 🔴 dont appear, the js is broken OR partially broken

Palloxin avatar Jun 10 '24 15:06 Palloxin