I assert:

jmolApplet(300,'.....;javascript "appletLoaded(1)" ')

where "1" might change with applets, is the definitive way to do this. You
can put anything in there you want, if you wish to inform the page WHICH
applet is loaded.

Prove me wrong!

Global arrays are tricky because they are common to all applets within the
browser, not just within a given page.

The "appletInfo.registry" property also indicates all applets loaded -- not
just for the current page, but for all pages. The long number is a random
number that is associated with a specific page. The current page's ID is
found by checking _jmol.params.syncId.

jmolGetPropertyAsArray("appletInfo.registry","")

appletInfo.registry={}
appletInfo.registry.jmolApplet0__246834263019686__="JmolApplet[panel0,0,0,350x350,layout=java.awt.FlowLayout]"

Bob

On Mon, Jun 14, 2010 at 11:26 AM, Otis Rothenberger
<osrot...@chemagic.com>wrote:

> Jonathan,
>
> I see that you want an outside of applet function doing this work on an
> unknown number of applets. This could be handled by having each applet's
> Jmol Javascript function set a unique global variable (in an array) to
> true (or whatever).  Even though the applets may complete loading
> randomly, I'm betting that their position in the document.applets array
> is sequential in Web page order. Your external function could then use
> document.applets.length to query these variables.
>
> Again in betting mode, I'd guess that calling the query function from a
> body onload would catch all the applets. In other words, that the
> document.applets array is complete on page load even if some of the
> applets are still "filling up."
>
> Otis
>
>
>
> On 6/14/2010 11:42 AM, Otis Rothenberger wrote:
> > Jonathan,
> >
> > There are three issues that I've encountered doing this.
> >
> > 1) There is the standard applet loaded issue.
> > 2) With Jmol the is also the post applet load issue of model loaded.
> > 3) MSIE (see below)
> >
> > By catching step 2 above in Jmol, you are really covering issue 1 and 2.
> > You do this by calling a JavaScript function ( e.g. JmolLoaded() ) at
> > the end of the Jmol Load script using the Jmol JavaScript command.
> > JavaScript does not get this call until 1 and 2 are both complete. It
> > works very nicely.
> >
> > HOWEVER,  MSIE
> >
> > MSIE seems to completely ignore the Jmol Javascript command. The only
> > way I've found around this is to use browser sniffing and write a clumsy
> > Timeout routine to call the JmolLoaded() function in MSIE
> >
> > Otis
> >
> >
> > On 6/14/2010 9:36 AM, Jonathan Gutow wrote:
> >
> >> A question for you javascript mavens.
> >>
> >> I'm trying to help the SageMath people with their Jmol interface.  I
> need to get some information about directories through the messageCallBack
> mechanism and am running into issues with the order applets are loaded.
>  When a page with many applets is loading the load order is unpredictable
> and I am finding that the message callback information seems to get garbled
> as to which applet the message comes from (maybe the messages are
> overlapping).  I have no way of knowing ahead of time how many applets are
> on a page as they are created on the fly by the server.
> >>
> >> Anyway.  I think my problem would be solved if I could simply run a
> function that queries each applet in sequence _after_ they have all loaded,
> rather than having each applet send a message callback as it finishes
> loading.  So I'm looking for a way to know that the page is ready for me to
> do this.
> >>
> >> Any ideas?
> >>
> >> Thanks,
> >> Jonathan
> >>                            Dr. Jonathan H. Gutow
> >> Chemistry Department                                gu...@uwosh.edu
> >> UW-Oshkosh                                          Office: 920-424-1326
> >> 800 Algoma Boulevard                                FAX:920-424-2042
> >> Oshkosh, WI 54901
> >>                   http://www.uwosh.edu/facstaff/gutow
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> >> lucky parental unit.  See the prize list and enter to win:
> >> http://p.sf.net/sfu/thinkgeek-promo
> >> _______________________________________________
> >> Jmol-users mailing list
> >> Jmol-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/jmol-users
> >>
> >>
> >>
> >
>
> --
> Otis Rothenberger
> chemagic.com
>
>
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to