jmol-developers

 Re: [Jmol-developers] JSmol and java.lang.Error From: Gareth Oakes - 2013-08-21 22:19:13 > Date: Tue, 20 Aug 2013 09:28:37 -0500 > From: Robert Hanson > > Yes, that's an important issue. I'm not satisfied, either, for just this > reason. It's not an easy one, because it relates to the Java2Script > compiler we use. There are many extensions we do need to use - especially > in the number area. Not sure about JavaScript error processing, although > obviously we need to catch those for our own purposes. I think the problem is to do with the fact that for some reason the java.lang.Error object is over-writing the core Javascript Error object. I would expect the Java2Script should place java.lang.Error into its own object (eg. a javascript object called "Java"). I don't know anything about Java2Script though so there may be good reasons why that isn't the case. > If you point me to a problem page and point me to the bit of your MathJax > code that is problematic, I can see what I can do. Thanks for the offer Bob. I will send some samples to you off-list. Cheers, Gareth 
 Re: [Jmol-developers] JSmol and java.lang.Error From: Gareth Oakes - 2013-08-21 22:52:51 > From: Robert Hanson > Subject: Re: [Jmol-developers] JSmol and java.lang.Error > > It's a pretty simple solution. Really what the problem is is that both >Jmol > and MathJax are competing for the AJAX processing. For compatibility with > MathJax, make sure: [snip] Thanks Bob we'll try your suggestion! -Gareth 
 Re: [Jmol-developers] JSmol and java.lang.Error From: Geoffrey Rowland - 2013-09-01 10:55:21 Attachments: Message as HTML > [you must be working with Gareth, right?] No, I noticed the MathJax issue a while back. Gareth's post just prompted me to add a follow up. >So what is MathJax, and what does it have to do with Jmol? Sounds interesting.... Bob, I guess you now know what MathJax is. For anyone else, who is not familiar, MathJax is an open source JavaScript display engine for Mathematics (MathML and TeX) that works cross-browser http://www.mathjax.org/ So, for science-focused web content, CMSs, blogs, forums etc there may well be occasions when it would be nice to have MathML and and Jmol on the same page. I came across DragMath/MathJax in the context of Moodle and Mahara. https://moodle.org/mod/forum/discuss.php?d=201737 https://mahara.org/interaction/forum/topic.php?id=3759 BTW If anyone is looking for another Java-to-JavaScript conversion project ;-) DragMath is an open-source Java applet Equation Editor that works nicely with MathJax. http://www.dragmath.bham.ac.uk/ I'm aware of some other JavaScript Equation Editors such as WIRIS and CodeCogs, but they are all proprietary. http://www.wiris.com/ http://www.codecogs.com/latex/about.php > It's a pretty simple solution. Really what the problem is is that both > .Jmol and MathJax are competing for the AJAX processing. [snip] Thanks, Bob that was really useful. Ended up using a variation on your suggestion, to display JSmol after MathJax, similar to the following: MathJax.Hub.Queue(function () { loadJmol(); }); loadJmol = function() { Jmol.setDocument(0); Info.deferApplet = false; Info.deferUncover = true; jmol1 = Jmol.getApplet("jmol1", Info) $("#appletplace1").html(Jmol.getAppletHtml(jmol1)); Info.deferApplet = true; Info.deferUncover = true; jmol2 = Jmol.getApplet("jmol2", Info)$("#appletplace2").html(Jmol.getAppletHtml(jmol2)); } Finally, I have recently noticed that Opera (latest version 12.16 on Windows 7 or Fedora 19) is no longer displaying JSmol for binary files (e.g. .pse, .pdb.zip) on, say, http://chemapps.stolaf.edu/jmol/jsmol/jsmol.htm This was all working with Opera a few weeks ago though I'm not sure if recent Opera or JSmol updates have broken things. Perhaps related to the recent removal of 'JSmol hacks to jQuery'' which otherwise seems to work well. Cheers Geoff