Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
Jonathan, I'm running this test (out of Jmol.js): var appletCount = 1; function test(a,b,nameSuffix) { nameSuffix == undefined (nameSuffix = appletCount); alert(nameSuffix); } var x = 0; test(0,0,x); // returns zero x = 0; test(0,0,x); // returns zero So how are you setting the n variable? -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
Maybe the culprit is earlier or later. I am setting n as a variable in a function that calls jmolApplet. The following change solves the problem but it is a bad kludge: var n = 0; var nquote = +n; jmolApplet([width,height],scriptStr, nquote); This makes a new jmolApplet0 to replace the one that was destroyed. Using n directly creates a jmolAppletXX, where XX = _jmol.appletCount. I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Jonathan On Oct 13, 2010, at 5:21 AM, Angel Herráez wrote: Jonathan, I'm running this test (out of Jmol.js): var appletCount = 1; function test(a,b,nameSuffix) { nameSuffix == undefined (nameSuffix = appletCount); alert(nameSuffix); } var x = 0; test(0,0,x); // returns zero x = 0; test(0,0,x); // returns zero So how are you setting the n variable? -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Can't see what or where. jmolApplet() directly calls _jmolApplet() which tests the ID. What browser are you testing on? I only did Firefox Win -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
I've encountered the problem on webkit browsers and FF on Mac Linux. Haven't tested FF Windows. You can see this problem by going to the link below and performing the following steps: https://141.233.197.45:4443/home/pub/0/ ***ignore the security warnings. I am using a self-signed certificate so that my students can use normal campus passwords. 1) Put the first applet (applet0) to sleep by clicking on the Sleep link. 2) Wake it up by clicking on the Wake link. 3) Try putting it back to sleep. You will find that applet0 does not exist. You will have no problem with this cycle with the second applet (applet1) because that is properly recreated. Jonathan On Oct 13, 2010, at 8:03 AM, Angel Herráez wrote: I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Can't see what or where. jmolApplet() directly calls _jmolApplet() which tests the ID. What browser are you testing on? I only did Firefox Win -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
Jonathan, I did that exact test, with just 0, and it works for me. I suppose it could be a browser issue. Are you ABSOLUTELY sure you are using the right Jmol.js? Here's some JavaScript test code to try: var undefined; // for IE 5 ... wherein undefined is undefined function test0(z) { z == undefined (z = 1) alert(z) } test0(0) // should report 0, not 1 Bob On Wed, Oct 13, 2010 at 7:49 AM, Jonathan Gutow gu...@uwosh.edu wrote: Maybe the culprit is earlier or later. I am setting n as a variable in a function that calls jmolApplet. The following change solves the problem but it is a bad kludge: var n = 0; var nquote = +n; jmolApplet([width,height],scriptStr, nquote); This makes a new jmolApplet0 to replace the one that was destroyed. Using n directly creates a jmolAppletXX, where XX = _jmol.appletCount. I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Jonathan On Oct 13, 2010, at 5:21 AM, Angel Herráez wrote: Jonathan, I'm running this test (out of Jmol.js): var appletCount = 1; function test(a,b,nameSuffix) { nameSuffix == undefined (nameSuffix = appletCount); alert(nameSuffix); } var x = 0; test(0,0,x); // returns zero x = 0; test(0,0,x); // returns zero So how are you setting the n variable? -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers -- 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
wrong Jmol.js /* Jmol 11.7 script library Jmol.js 12:17 AM 4/20/2009 Bob Hanson should be 4/5/2010 function _jmolApplet(size, inlineModel, script, nameSuffix) { /* AngelH, mar2007 Fixed percent / pixel business, to avoid browser errors: put px where needed, avoid where not. */ with (_jmol) { if (! nameSuffix) nameSuffix = appletCount; appletSuffixes.push(nameSuffix); ++appletCount; On Wed, Oct 13, 2010 at 8:45 AM, Jonathan Gutow gu...@uwosh.edu wrote: I've encountered the problem on webkit browsers and FF on Mac Linux. Haven't tested FF Windows. You can see this problem by going to the link below and performing the following steps: https://141.233.197.45:4443/home/pub/0/ ***ignore the security warnings. I am using a self-signed certificate so that my students can use normal campus passwords. 1) Put the first applet (applet0) to sleep by clicking on the Sleep link. 2) Wake it up by clicking on the Wake link. 3) Try putting it back to sleep. You will find that applet0 does not exist. You will have no problem with this cycle with the second applet (applet1) because that is properly recreated. Jonathan On Oct 13, 2010, at 8:03 AM, Angel Herráez wrote: I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Can't see what or where. jmolApplet() directly calls _jmolApplet() which tests the ID. What browser are you testing on? I only did Firefox Win -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers -- 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
Bob, It doesn't matter. I've tried it with the old version that is on my publicly accessible test site and with the latest version. The problem must be somewhere other than that comparison statement. If you want to verify it for yourself, I am planning to update my publicly accessible site. I can do it in two steps: first I'll update Jmol.js ; then later I'll update the Sage js libraries with my fix. I'm mystified, since that is the only place in the code I could find anything that might do what I am seeing. Again simply passing a string representation of the number as the appletID solves the problem with both versions of Jmol.js. For the time being that is what I have done for SageMath, but I would like to figure out what is going on. I'll keep looking, but if you have any ideas let me know. thanks, Jonathan On Oct 13, 2010, at 12:59 PM, Robert Hanson wrote: wrong Jmol.js /* Jmol 11.7 script library Jmol.js 12:17 AM 4/20/2009 Bob Hanson should be 4/5/2010 function _jmolApplet(size, inlineModel, script, nameSuffix) { /* AngelH, mar2007 Fixed percent / pixel business, to avoid browser errors: put px where needed, avoid where not. */ with (_jmol) { if (! nameSuffix) nameSuffix = appletCount; appletSuffixes.push(nameSuffix); ++appletCount; On Wed, Oct 13, 2010 at 8:45 AM, Jonathan Gutow gu...@uwosh.edu wrote: I've encountered the problem on webkit browsers and FF on Mac Linux. Haven't tested FF Windows. You can see this problem by going to the link below and performing the following steps: https://141.233.197.45:4443/home/pub/0/ ***ignore the security warnings. I am using a self-signed certificate so that my students can use normal campus passwords. 1) Put the first applet (applet0) to sleep by clicking on the Sleep link. 2) Wake it up by clicking on the Wake link. 3) Try putting it back to sleep. You will find that applet0 does not exist. You will have no problem with this cycle with the second applet (applet1) because that is properly recreated. Jonathan On Oct 13, 2010, at 8:03 AM, Angel Herráez wrote: I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Can't see what or where. jmolApplet() directly calls _jmolApplet() which tests the ID. What browser are you testing on? I only did Firefox Win -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers -- 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers Dr. Jonathan H. Gutow Chemistry Department
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
Jonathan, we have something to hold onto. Your test page https://141.233.197.45:4443/home/pub/0/ works fine in Firefox 3.6 Win. Both applets go to sleep and wake up correctly. However, when I click to sleep for a second time, there are errors: could not find applet jmolApplet0 (in a popup-alert) and (in the JS console): Error: stateStr.match(re_modelinline) is null File: https://141.233.197.45:4443/javascript/sage/main.js Line: 356 (the applet stays there) On subsequent clicks, only the 2nd error is shown (in the JS console) -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
show me a simpler demo that does this, not the sage page. Anyway, that page you have there HAS to cause the error. Bob On Wed, Oct 13, 2010 at 1:32 PM, Jonathan Gutow gu...@uwosh.edu wrote: Bob, It doesn't matter. I've tried it with the old version that is on my publicly accessible test site and with the latest version. The problem must be somewhere other than that comparison statement. If you want to verify it for yourself, I am planning to update my publicly accessible site. I can do it in two steps: first I'll update Jmol.js ; then later I'll update the Sage js libraries with my fix. I'm mystified, since that is the only place in the code I could find anything that might do what I am seeing. Again simply passing a string representation of the number as the appletID solves the problem with both versions of Jmol.js. For the time being that is what I have done for SageMath, but I would like to figure out what is going on. I'll keep looking, but if you have any ideas let me know. thanks, Jonathan On Oct 13, 2010, at 12:59 PM, Robert Hanson wrote: wrong Jmol.js /* Jmol 11.7 script library Jmol.js 12:17 AM 4/20/2009 Bob Hanson should be 4/5/2010 function _jmolApplet(size, inlineModel, script, nameSuffix) { /* AngelH, mar2007 Fixed percent / pixel business, to avoid browser errors: put px where needed, avoid where not. */ with (_jmol) { if (! nameSuffix) nameSuffix = appletCount; appletSuffixes.push(nameSuffix); ++appletCount; On Wed, Oct 13, 2010 at 8:45 AM, Jonathan Gutow gu...@uwosh.edu wrote: I've encountered the problem on webkit browsers and FF on Mac Linux. Haven't tested FF Windows. You can see this problem by going to the link below and performing the following steps: https://141.233.197.45:4443/home/pub/0/ ***ignore the security warnings. I am using a self-signed certificate so that my students can use normal campus passwords. 1) Put the first applet (applet0) to sleep by clicking on the Sleep link. 2) Wake it up by clicking on the Wake link. 3) Try putting it back to sleep. You will find that applet0 does not exist. You will have no problem with this cycle with the second applet (applet1) because that is properly recreated. Jonathan On Oct 13, 2010, at 8:03 AM, Angel Herráez wrote: I had assumed the problem was this test. But your results suggest not. Is there something earlier or later in the code that is also checking the appletID? I hadn't noticed anything. Can't see what or where. jmolApplet() directly calls _jmolApplet() which tests the ID. What browser are you testing on? I only did Firefox Win -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers -- 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today.
Re: [Jmol-developers] Call to jmolApplet with AppletID = 0 does not generate jmolApplet0, but some other jmolAppletXX...
On Oct 13, 2010, at 2:57 PM, Robert Hanson wrote: show me a simpler demo that does this, not the sage page. Good, idea. I can write a simple page that does the wake and sleep on two applets, not inside Sage. Don't think I'll have time the rest of the week to work on it. But I will try to get to it this weekend. In the meantime I have a workaround that solves the problem for Sage. Hopefully, we'll track this down. 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 -- Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb ___ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers