Closed simlei closed 4 years ago
Implemented.
TODO: detail this in a wiki page more in-depth + command line parameter
org.jcryptool.core.help
.localhost:<random_open_port>
.<head>
is now automatically followed by a few script tags that tell javascript, which ports on the localhost
to communicate with. After that, the "bootstrap library" is loaded. Also, the string "${JCTJS_HOST}
" is replaced througout all HTML with the current http://127.0.0.1:<port>
for convenience (Javascript already knows the port, but with only that, we'd have to rely on Javascript to do everything, including loading other javascript files).
For convenience of Javascript developers, JCT can now start up to open the help system, even at a specific location. To achieve this. the command line parameter -StartupHelp
has been introduced. For now, It has to be the last argument on the command line (TODO: change this / parse better). After that command line parameter, another argument may follow that specifies the help location to be opened.
The syntax for the help content location is <plugin-name>/<path-to.html>
. An example of this for the RSA plug-in can be seen in the above screenshot. Note, that path elements that denote language-specific branches of the file system, like nl/en
, have to be replaced with $nl$
.
For improving the online help further it seems unavoidable to introduce our own javascript based code. The goal of this issue / feature request is to have a directory "javascript" in
org.jcryptool.core.help
, where.js
files are stored that can be loaded in the body of online help.html
files as follows:in
org.jcryptool.core.help
:and in the head of a
.html
file that contains an online help page:Of course there has to be some kind of bootstrapping JS code which makes the
loadJCTScript
functionality available. However, the authors of .html code should not have to worry about it. The reason why this has to be dynamical is, that at the time of writing the .html code, the author can't know on which local port the help system is served (static addresses that reference html look like this:http://localhost:32772/index.html
, where the part32772
changes with each JCT startup).I have already a proof-of-concept implementation of a local jetty webserver which serves
.js
files to the help system; what remains is bootstrapping it and a neat demonstration project so that others can copy how this is done.The mechnism used to inject javascript code into existing help pages (webapp/contentFilter extension point)