-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request JavaScript/ECMAscript JMRI scripting users contact us #13201
Request JavaScript/ECMAscript JMRI scripting users contact us #13201
Conversation
If users come forward with JavaScript examples, will it be necessary to add a dialog box later? I hope not... But if a dialog box is added in the future, be sure to allow users to disable that dialog box! |
if (engine.getLanguageName().equals(ECMA_SCRIPT)) { | ||
log.warn("*** Scripting with JavaScript/ECMAscript is being deprecated.***"); | ||
log.warn("*** Please contact us on the jmriusers group for assistance. ***"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me as a developer, it's very clear what this is about. But for a user, it might be confusing or seem to be irrelevant. I suggest adding: and is about to be removed
.
*** Scripting with JavaScript/ECMAscript is being deprecated and is about to be removed.***
I think it would be good to have the dialog box already in 5.9.x. I'm a developer and I never looks in the log unless I have a very specific reason to do so... I agree with @devel-bobm that the dialog box needs the ability to disable it. |
I might say 'and will be removed if nobody is using this' or something
like that to make it clear they need to respond or it will go away
later.
|
I agree. Thanks. |
I've added a dialog box and changed the language to
Can somebody please point me to an example of a dialog box that can be disabled? I know I've seen one of those, but I don't remember where. Thanks in advance. |
Sure. See class
The 'if()' checks if the delete warning has been disabled, and simply does the delete. The 'else' deals with the dialog box and manages the warning disable state. |
I've updated this so that the dialog box is shown when a JavaScript/ECMAscript script is first executed, then it's silent until the next run of the program. It does not remember that it's been shown from one run to another. The idea is to really, really encourage people to get in touch to learn how to turn that off. To turn the warning off, there's a new script that can be run at startup. Normally, handling options using startup-scripts is inconvenient, but I'm OK with that inconvenience because AFAIK nobody is ever going to encounter it. |
In an earlier version of this PR, I was using that method to identify whether the warning should be triggered or not. This version of the PR works at a lower level to make the detection happen when the actual execution of a script takes place, not when it's first selected. Since I'd already written this method, I just left it in place in case it's useful later on. |
When JavaScript/ECMAscript scripts are first run, a warning is posted to the log that requests the user get in touch on the jmriusers list. Hopefully this will help locate a few sample .js scripts for us...
After 5.10 is out, this might be upgraded to a dialog box warning to bring more attention to this.