Nick,

For the record, this is achieved trivially using JmolApi.js instead of
Jmol.js.

1) There are no defaults -- you specify which applet in all calls.

2) The first parameter of all calls is the applet id -- the full name, not
the "extension" There are no extensions, just whatever you call the applet.

The way you set up an applet using JmolApi.js is with three commands
(recommended -- could all be one):

jmolLeft = "jmolLeft"
// looks odd, but it allows adding buttons and script calls
// prior to the introduction of the applet on the page.

Info = {....}   // all the parameters here -- see JmolApi.js

jmolLeft = Jmol.getApplet(jmolLeft, Info)  // creates the applet

Then all the calls look like this:

Jmol.xxxxx(jmolLeft,....)

Note that before the getApplet call, this variable "jmolLeft" is a string;
after it is a Jmol._JmolApplet object.

If you have more than one applet, you just define more variables:

jmolRight = "jmolRight"

etc. You can reuse Info or make separate ones. Info can be deleted after
the Jmol.getApplet() call if you want.

Along with JmolApi.js, you need two other files minimum:

JmolCore.js (first)
JmolApplet.js
JmolApi.js

That gets you the full capability of Jmol.js, plus some. All the functions
you will ever call, though, are in JmolApi.js

JmolPopup2.htm is designed for JmolApi.js. You can either define

Jmol._lastAppletID

or you can add that to the URL with "?ID=xxxx" to specify which applet is
the originator.

That's at http://chemapps.stolaf.edu/jmol/docs/examples-12/JmolPopup2.htm



Bob




-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to