Hi all,
I am currently working on the migration of the 'Jena3D Viewer'
(http://jena3d.fli-leibniz.de) from Jmol 11.6 to Jmol/JSmol 13.3 and got
stuck in adapting 'JSmol.min.js'.
I used to make the following changes to the 'Jmol.js' file:
-------- Jmol.js - Jena3D/JenaLib modifications ---------------------
var auto_zoom_script = "";
function jmolScript(script, targetSuffix) {
if (script) {
_jmolCheckBrowser();
if (targetSuffix == "all") {
with (_jmol) {
for (var i = 0; i < appletSuffixes.length; ++i) {
var applet = _jmolGetApplet(appletSuffixes[i]);
if (applet) {
/* ### Addition by Rolf Huehne for 'JenaLib' ### */
script = "set echo waitmessage 0% 100%; echo \"Please
wait...\"; refresh;\n" + script + auto_zoom_script + "\n set echo
waitmessage off;";
/* ### End of addition by Rolf Huehne for 'JenaLib' ### */
applet.script(script);
}
}
}
} else {
var applet=_jmolGetApplet(targetSuffix);
if (applet) {
/* ### Addition by Rolf Huehne for 'JenaLib' ### */
script = "set echo waitmessage 0% 100%; echo \"Please
wait...\"; refresh;\n" + script + auto_zoom_script + "\n set echo
waitmessage off;";
/* ### End of addition by Rolf Huehne for 'JenaLib' ### */
applet.script(script);
}
}
}
}
----------------------------------------------------------------------
These modifications are intended to serve two purposes:
1) Show a "Please wait..." message within the applet window each time
the 'jmolScript' function is called and hide it after the script is
finished. This will be even more necessary with the still much slower JSmol.
2) Enable a simple 'auto zoom/center' option. If the 'auto zoom/center'
option is activated the 'auto_zoom_script' variable is changed
'auto_zoom_script="zoomto 0.7 (selected) 0;";' and if you browse for
example through the different hetero components or sites within the
structure the view is automatically centered around this hetero
component or site and zoomed for full visibility at maximum size.
Unfortunately I couldn't identify the corresponding code within
'JSmol.min.js' to adapt it similarly. Any hints would be appreciated
very much.
Maybe a more generalized 'custom pre-/post-processing script' option
could be added generally if there is enough interest by other Jmol
users. The pre-processing script added at the beginning of each script
within a 'Jmol.script' call and the post-processing script added at the
end should be reconfigurable at any time.
What do you think about this?
Regards,
Rolf
--
Rolf Huehne
Postdoc
Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany
Phone: +49 3641 65 6205
Fax: +49 3641 65 6210
E-Mail: [email protected]
Website: http://www.fli-leibniz.de
Scientific Director: Prof. Dr. K. Lenhard Rudolph
Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein
VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users