[Jmol-users] Model Kit Ring Fusion
Bob, This isn't pretty, but it works - sort of. I need some advice on the aromatic fusion. I'd also like to know if this all suggests something more elegant to you. First the fusion of two chair cyclohexanes. The atomIndexes represent adjacent carbons on each cyclohexane. The result is a trans fusion. It's not pretty to watch. It also takes some time: select connected(atomIndex=20);{atomIndex=0}.atomX={atomIndex=20}.atomX;{atomIndex=0}.atomY= {atomIndex=20}.atomY;{atomIndex=0}.atomZ={atomIndex=20}.atomZ;delete atomIndex=20;connect (atomIndex=0)(selected);select connected(atomIndex=21);{atomIndex=1}.atomX={atomIndex=21}.atomX;{atomIndex=1}.atomY= {atomIndex=21}.atomY;{atomIndex=1}.atomZ={atomIndex=21}.atomZ;delete atomIndex=21;connect (atomIndex=1)(selected);set useMinimizationThread false;minimize;delete hydrogen;calculate hydrogens Second the fusion of two benzenes - fusing aromatic doubles on both molecules: select connected(atomIndex=12);{atomIndex=2}.atomX={atomIndex=12}.atomX;{atomIndex=2}.atomY= {atomIndex=12}.atomY;{atomIndex=2}.atomZ={atomIndex=12}.atomZ;delete atomIndex=12;connect (atomIndex=2)(selected);select connected(atomIndex=13);{atomIndex=3}.atomX={atomIndex=13}.atomX;{atomIndex=3}.atomY= {atomIndex=13}.atomY;{atomIndex=3}.atomZ={atomIndex=13}.atomZ;delete atomIndex=13;connect (atomIndex=3)(selected);set useMinimizationThread false;connect (atomIndex=2) (atomIndex=3) AROMATICDOUBLE;delete hydrogen;calculate hydrogens;reset aromatic;calculate aromatic;minimize steps 300; The two aforementioned questions and one extra: 1) I had to cheat on the aromatic fusion. It's not a general case. It's rigged for double to double. Any thoughts on generalizing this. 2) I'm really hoping that the above catalyzes a more elegant approach in your mind - any thoughts? 3) I was kind of surprised that these scripts worked. I thought the deletions would screw up the atomIndexes. Then I recalled that you said something about the deleted atoms simply being marked deleted. Does this mean that all atoms retain their atomIndexes during editing? Otis -- 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
Re: [Jmol-users] Model Kit Ring Fusion
What's the exact user action you're after for this? Are we dragging a cyclohexane and dropping it on another? Could we just look for atoms at about the same spot and fuse them? yes, all atoms retain their atom indexes when you are deleting individual atoms. If you use set debug I think you can watch the atom indexes increasing as you delete and then add new atoms. On Mon, Jun 14, 2010 at 1:41 AM, Otis Rothenberger osrot...@chemagic.comwrote: Bob, This isn't pretty, but it works - sort of. I need some advice on the aromatic fusion. I'd also like to know if this all suggests something more elegant to you. First the fusion of two chair cyclohexanes. The atomIndexes represent adjacent carbons on each cyclohexane. The result is a trans fusion. It's not pretty to watch. It also takes some time: select connected(atomIndex=20);{atomIndex=0}.atomX={atomIndex=20}.atomX;{atomIndex=0}.atomY= {atomIndex=20}.atomY;{atomIndex=0}.atomZ={atomIndex=20}.atomZ;delete atomIndex=20;connect (atomIndex=0)(selected);select connected(atomIndex=21);{atomIndex=1}.atomX={atomIndex=21}.atomX;{atomIndex=1}.atomY= {atomIndex=21}.atomY;{atomIndex=1}.atomZ={atomIndex=21}.atomZ;delete atomIndex=21;connect (atomIndex=1)(selected);set useMinimizationThread false;minimize;delete hydrogen;calculate hydrogens Second the fusion of two benzenes - fusing aromatic doubles on both molecules: select connected(atomIndex=12);{atomIndex=2}.atomX={atomIndex=12}.atomX;{atomIndex=2}.atomY= {atomIndex=12}.atomY;{atomIndex=2}.atomZ={atomIndex=12}.atomZ;delete atomIndex=12;connect (atomIndex=2)(selected);select connected(atomIndex=13);{atomIndex=3}.atomX={atomIndex=13}.atomX;{atomIndex=3}.atomY= {atomIndex=13}.atomY;{atomIndex=3}.atomZ={atomIndex=13}.atomZ;delete atomIndex=13;connect (atomIndex=3)(selected);set useMinimizationThread false;connect (atomIndex=2) (atomIndex=3) AROMATICDOUBLE;delete hydrogen;calculate hydrogens;reset aromatic;calculate aromatic;minimize steps 300; The two aforementioned questions and one extra: 1) I had to cheat on the aromatic fusion. It's not a general case. It's rigged for double to double. Any thoughts on generalizing this. 2) I'm really hoping that the above catalyzes a more elegant approach in your mind - any thoughts? 3) I was kind of surprised that these scripts worked. I thought the deletions would screw up the atomIndexes. Then I recalled that you said something about the deleted atoms simply being marked deleted. Does this mean that all atoms retain their atomIndexes during editing? Otis -- 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
Re: [Jmol-users] Model Kit Ring Fusion
sounds like a nightmare to align the two atoms in 3D. Any other ideas? On Mon, Jun 14, 2010 at 10:29 AM, Otis Rothenberger osrot...@chemagic.comwrote: Bob, In my mind, I see this at a two atom at a time operation - like drag to bond. The difference would be that thedrag bond really forms a spiro connection. Two spiro connects = a fusion. Otis On 6/14/2010 10:20 AM, Robert Hanson wrote: What's the exact user action you're after for this? Are we dragging a cyclohexane and dropping it on another? Could we just look for atoms at about the same spot and fuse them? yes, all atoms retain their atom indexes when you are deleting individual atoms. If you use set debug I think you can watch the atom indexes increasing as you delete and then add new atoms. On Mon, Jun 14, 2010 at 1:41 AM, Otis Rothenberger osrot...@chemagic.comwrote: Bob, This isn't pretty, but it works - sort of. I need some advice on the aromatic fusion. I'd also like to know if this all suggests something more elegant to you. First the fusion of two chair cyclohexanes. The atomIndexes represent adjacent carbons on each cyclohexane. The result is a trans fusion. It's not pretty to watch. It also takes some time: select connected(atomIndex=20);{atomIndex=0}.atomX={atomIndex=20}.atomX;{atomIndex=0}.atomY= {atomIndex=20}.atomY;{atomIndex=0}.atomZ={atomIndex=20}.atomZ;delete atomIndex=20;connect (atomIndex=0)(selected);select connected(atomIndex=21);{atomIndex=1}.atomX={atomIndex=21}.atomX;{atomIndex=1}.atomY= {atomIndex=21}.atomY;{atomIndex=1}.atomZ={atomIndex=21}.atomZ;delete atomIndex=21;connect (atomIndex=1)(selected);set useMinimizationThread false;minimize;delete hydrogen;calculate hydrogens Second the fusion of two benzenes - fusing aromatic doubles on both molecules: select connected(atomIndex=12);{atomIndex=2}.atomX={atomIndex=12}.atomX;{atomIndex=2}.atomY= {atomIndex=12}.atomY;{atomIndex=2}.atomZ={atomIndex=12}.atomZ;delete atomIndex=12;connect (atomIndex=2)(selected);select connected(atomIndex=13);{atomIndex=3}.atomX={atomIndex=13}.atomX;{atomIndex=3}.atomY= {atomIndex=13}.atomY;{atomIndex=3}.atomZ={atomIndex=13}.atomZ;delete atomIndex=13;connect (atomIndex=3)(selected);set useMinimizationThread false;connect (atomIndex=2) (atomIndex=3) AROMATICDOUBLE;delete hydrogen;calculate hydrogens;reset aromatic;calculate aromatic;minimize steps 300; The two aforementioned questions and one extra: 1) I had to cheat on the aromatic fusion. It's not a general case. It's rigged for double to double. Any thoughts on generalizing this. 2) I'm really hoping that the above catalyzes a more elegant approach in your mind - any thoughts? 3) I was kind of surprised that these scripts worked. I thought the deletions would screw up the atomIndexes. Then I recalled that you said something about the deleted atoms simply being marked deleted. Does this mean that all atoms retain their atomIndexes during editing? Otis -- 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 listjmol-us...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenbergerchemagic.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
Re: [Jmol-users] Is there a way to force a javascript function to execute after all applets have loaded?
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 Departmentgu...@uwosh.edu UW-Oshkosh Office: 920-424-1326 800 Algoma BoulevardFAX: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
Re: [Jmol-users] Is there a way to force a javascript function to execute after all applets have loaded?
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.comwrote: 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 Departmentgu...@uwosh.edu UW-Oshkosh Office: 920-424-1326 800 Algoma BoulevardFAX: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
Re: [Jmol-users] Coloring A molecular dynamically....
Hi Bob, Jonathan, and others : The action would be, specifically, to allow a user to highlight a string of amino acids, and then that string gets colored. Im not sure how to configure javascript to support this, but Im sure its possible . Would the widget you mentioned be useful to this end ? -- Jay Vyas MMSB/UCHC -- 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
Re: [Jmol-users] Is there a way to force a javascript function to execute after all applets have loaded?
Bob, I ran into this problem when I needed to hold off on an inline load of Indiana University SMILES to molfile data until after an applet was loaded with a starter Xe model. The Xe is a quick load and it looks pretty sitting there while a please wait message echos on the screen. Once this Xe is loaded (applet and the model data), I can do business with the IU data. The Jmol javascript command in the load script worked, but not in MSIE. In trying to track this down, I used all of the following in the console: 1) javascript alert(nuts) 2) javascript 'alert(nuts)' 3) javascript alert('nuts') Item 2 does not work. For items 1 and 3, Firefox and Chrome say, nuts. MSIE (8.0.6001...) says: evalintermediatevaluetoreturn = eval ( !!_jmol.noEval ) Perhaps I have a syntax error in my script, but with the above result, I called it quits on MSIE. Let me go back and check this out. Maybe the console wasn't the way to test this. Also, I have not checked this recently. The above information was in an email to you a while back, and I was using an older version of Jmol - the HOLD version, I think! I'll get back to you after lunch. Otis On 6/14/2010 12:18 PM, Robert Hanson wrote: Hmm... On Mon, Jun 14, 2010 at 10:42 AM, Otis Rothenberger osrot...@chemagic.com mailto:osrot...@chemagic.com wrote: Jonathan, 3) MSIE (see below) 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 I think we have talked about this, but I'm forgetting the details. I have not seen this in any of my own production work, and I do not believe it is true. Can you give us an example, Otis? You are saying that the following does not work in MSIE? jmolApplet(300,'javascript alert(1234);') ? You sure? Please test that, Otis. Bob 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 mailto:gu...@uwosh.edu UW-Oshkosh Office: 920-424-1326 800 Algoma BoulevardFAX: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 mailto:Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenberger chemagic.com http://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 mailto: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
Re: [Jmol-users] Is there a way to force a javascript function to execute after all applets have loaded?
Ah ha! appletInfo.registry may be just the ticket. However, I found a mistake in my code where I was updating my list of applets twice, that was causing my apparent mixing of applet IDs and callback messages. So the simple message call back activated in a javascript ... command works fine. Thanks for the ideas. I still may have occasion to use them with SAGE. There is a tremendous amount of sever-browser traffic that can mess things up. I may need other checking routines. Jonathan On Jun 14, 2010, at 12:02 PM, jmol-users-requ...@lists.sourceforge.net wrote: 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] 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
Re: [Jmol-users] Is there a way to force a javascript function to execute after all applets have loaded?
Bob, If I do a page load with: body span id=jmol1 script type=text/javascript language=JavaScript jmolApplet(300, 'load ../models/methane.mol;javascript alert(1234);') /script /span /body All is well in MSIE. If I do the console test, all is well in MSIE However, the console on my loaded applet, which obviously has a problem, chokes on exactly the same console entry in MSIE: javascript alert(1234) The exact error is: 0 atoms selected 14 atoms selected script ERROR: invalid argument evalintermediatevaluetoreturn = eval ( !!_jmol.noEval ) Clearly, MSIE does not like something on my page. The applet behaves properly in all other respects in MSIE. I did not know that a page problem could screw up the applet console. It sure looks like your assertion is correct. Do you have any idea why MSIE and the Jmol console could be giving a hoot about 0 atoms selected and 14 atoms selected on a simple javascript alert command?? Otis On 6/14/2010 1:38 PM, Otis Rothenberger wrote: Bob, I ran into this problem when I needed to hold off on an inline load of Indiana University SMILES to molfile data until after an applet was loaded with a starter Xe model. The Xe is a quick load and it looks pretty sitting there while a please wait message echos on the screen. Once this Xe is loaded (applet and the model data), I can do business with the IU data. The Jmol javascript command in the load script worked, but not in MSIE. In trying to track this down, I used all of the following in the console: 1) javascript alert(nuts) 2) javascript 'alert(nuts)' 3) javascript alert('nuts') Item 2 does not work. For items 1 and 3, Firefox and Chrome say, nuts. MSIE (8.0.6001...) says: evalintermediatevaluetoreturn = eval ( !!_jmol.noEval ) Perhaps I have a syntax error in my script, but with the above result, I called it quits on MSIE. Let me go back and check this out. Maybe the console wasn't the way to test this. Also, I have not checked this recently. The above information was in an email to you a while back, and I was using an older version of Jmol - the HOLD version, I think! I'll get back to you after lunch. Otis On 6/14/2010 12:18 PM, Robert Hanson wrote: Hmm... On Mon, Jun 14, 2010 at 10:42 AM, Otis Rothenberger osrot...@chemagic.com mailto:osrot...@chemagic.com wrote: Jonathan, 3) MSIE (see below) 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 I think we have talked about this, but I'm forgetting the details. I have not seen this in any of my own production work, and I do not believe it is true. Can you give us an example, Otis? You are saying that the following does not work in MSIE? jmolApplet(300,'javascript alert(1234);') ? You sure? Please test that, Otis. Bob 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 mailto: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 mailto:Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users -- Otis Rothenberger chemagic.com
[Jmol-users] cross platform compatibility....
Hi guys : Is there a standard platform that works with JMol better than others ? I seem to lean towards firefox. I have an application that uses JMol seems to work differently on safari than on firefox, i.e. sometimes in safari it doesn't work, etc.. Just wondering if anyone knows about the testing procedures and platform compatibility of JMol. -- 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
Re: [Jmol-users] cross platform compatibility....
Jay, any page with Jmol applets should work the same in any browser. And that's important. What are the differences you are seeing? What is doesn't work? -- 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
Re: [Jmol-users] Coloring A molecular dynamically....
Jay, There are many wasy you can do that. Several parts: 1. How to pick the color. Simplest is e.g. to have a select control (a drop-down menu) with a few colors. The user selects one, the color value is passed to a javascript variable that will later be fed to a Jmol script. A more sophisticated pick could use Jonathan's new widget, but it is not yet prepared for that, only for background color. Easy to adapt, anyway. 2. How to select the amino acid sequence. Maybe the user types it in a textbox (input type=text). You read that using javascript. Then you can probably use JmolScript select WITHIN(sequence, atomExpression) command with that. http://www.stolaf.edu/academics/chemapps/jmol/docs/#atomexpressions Other ways to set the sequence may be available. 3. Apply the color. That's trivial. If you need help implementing this, please come back with a specific example page. -- 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