<div dir="ltr"><div><div><div><div>Stuart,<br><br></div>I placed the jsmol.php file in /home/httpd/html/adm/jmol and editing Jmol.js.  When I view my .problem with Jsmol in itb I do not get the pop up windows but I don't get the molecule.  Where the molecule should be it says 'unrecognized file format' and shows the first line of the jsmol.php file.  It appears to not have executed the jsmol.php file.  I'm guessing that I have to install the php package on my server.  Is this correct?  I don't like installing things unnecessarily on my lon-capa servers so I just wanted to be sure.<br><br></div>Thanks,<br></div>Bob Gonzales<br></div><div>Binghamton University<br></div>Chemistry Dept<br><div><div><div><br><br><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 10, 2015 at 12:38 PM, Bob Gonzales <span dir="ltr"><<a href="mailto:rgonzal@binghamton.edu" target="_blank">rgonzal@binghamton.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Stuart,<br><br></div>I did see the comments in the wiki about extra server side processing for binary files but because I was using .mol files I didn't think that was the issue.  I will try the binary file fix.  <br></div><br>Thank you for the help.<br></div>Bob<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 9, 2015 at 10:26 PM, Stuart Raeburn <span dir="ltr"><<a href="mailto:raeburn@msu.edu" target="_blank">raeburn@msu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Bob,<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The file name does not contain the extension .bin, but if the URL was<br>
being examined instead of the file name, then the string ".bin" does<br>
appear (in .binghamton).<br>
</blockquote>
<br></span>
If I use the IP address for loncapa7.chem,<a href="http://binghamton.edu" rel="noreferrer" target="_blank">binghamton.edu</a> instead of the hostname, i.e., <a href="http://128.226.130.234/res/msu/raeburn/testing/jmol/jsmolwebpage.html" rel="noreferrer" target="_blank"><font color="red"><b>MailScanner has detected a possible fraud attempt from "128.226.130.234" claiming to be</b></font> <font color="red"><b>MailScanner warning: numerical links are often malicious:</b></font> http://128.226.130.234/res/msu/raeburn/testing/jmol/jsmolwebpage.html</a><br>
<br>
then Safari will display the molecule in jsmol without error.<br>
<br>
That supports my idea that the string: .bin within <a href="http://chem.binghamton.edu" rel="noreferrer" target="_blank">chem.binghamton.edu</a> is causing jsmol to consider that the "load caffeine.mol" call in jmolApplet() is a request for a binary file.<span><br>
<br>
Stuart Raeburn<br>
LON-CAPA Academic Consortium<br>
<br>
<br></span><div><div>
Quoting Stuart Raeburn <<a href="mailto:raeburn@msu.edu" target="_blank">raeburn@msu.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Bob,<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've coded up my first problem with Jsmol and it works fine on the latest<br>
Chrome and Firefox.  But it doesn't work on Internet Explorer 11 or Safari<br>
(latest).<br>
</blockquote>
<br>
This issue appears to be specific to the binghamton servers. I am able<br>
to display an example web page of mine (published public) which uses<br>
jmol/jsmol:<br>
<br>
/res/msu/raeburn/testing/jmol/jsmolwebpage.html<br>
<br>
successfully in Safari on a number of LON-CAPA servers in the network,<br>
apart from the ones in your domain. (I am also able to display that<br>
resource from servers in your domain if I use Firefox or Chrome).<br>
<br>
When I attempt to use Safari to display that page on:<br>
<a href="http://loncapaN.chem.binghamton.edu" rel="noreferrer" target="_blank">loncapaN.chem.binghamton.edu</a> (N = 2, 3, 5, 6, or 7) two errors are displayed:<br>
<br>
(a) A dialog box with the message: "JSmolCore.js: synchronous binary<br>
file transfer is requested but not available"<br>
and then (if I click "OK") some seconds later:<br>
<br>
(b) A dialog box with the message:<br>
<br>
Error connecting to server:<br>
<a href="http://your.server.here/jsmol.php?call=getRawDataFromDatabase&database=_&query=http%3A%2F%2Floncapa7.chem.binghamton.edu%2Fres%2Fmsu%2Fraeburn%2Ftesting%2Fjmol%2Fcaffeine.mol&encoding=base64" rel="noreferrer" target="_blank">http://your.server.here/jsmol.php?call=getRawDataFromDatabase&database=_&query=http%3A%2F%2Floncapa7.chem.binghamton.edu%2Fres%2Fmsu%2Fraeburn%2Ftesting%2Fjmol%2Fcaffeine.mol&encoding=base64</a><br>
<br>
Looking at the jsmol documentation:<br>
<a href="http://wiki.jmol.org/index.php/Jmol_JavaScript_Object" rel="noreferrer" target="_blank">http://wiki.jmol.org/index.php/Jmol_JavaScript_Object</a><br>
<br>
(see: "Reading binary files" section)<br>
<br>
I find that jsmol.php will be called if a binary format file (gz, zip,<br>
pse, etc.) is requested from Safari, Chrome, or MSIE, and a jsmol.php<br>
file needs to be used to convert the binary data to BASE64 format. The<br>
documentation states jsmol.php is a "A server-side PHP utility that<br>
allows a number of functions that can increase the platform and browser<br>
compatibility of JSmol".<br>
<br>
By default <a href="http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php" rel="noreferrer" target="_blank">http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php</a> will be used.<br>
However, if you modify /home/httpd/html/jmol/Jmol.js by modifying this line:<br>
<br>
serverURL: "<a href="http://your.server.here/jsmol.php" rel="noreferrer" target="_blank">http://your.server.here/jsmol.php</a>", // required for binary<br>
file loading (.bin .gz .zip .jpg .png .jmol .smol .spartan .mrc or .pse<br>
files).<br>
<br>
and replace <a href="http://your.server.here/jsmol.php" rel="noreferrer" target="_blank">http://your.server.here/jsmol.php</a> with the hostname of your<br>
server (and an appropriate path) you could use a local jsmol.php file,<br>
and thereby override the default behavior of jmolInitialize().<br>
<br>
You would need to obtain jsmol.php from the jmol binary (from<br>
<a href="http://sourceforge.net/projects/jmol/files/Jmol/Version%2014.2/Version%2014.2.13/Jmol-14.2.13_2015.03.23-binary.zip/download" rel="noreferrer" target="_blank">http://sourceforge.net/projects/jmol/files/Jmol/Version%2014.2/Version%2014.2.13/Jmol-14.2.13_2015.03.23-binary.zip/download</a> ) because the jmol-loncapa.zip file included in the LON-CAPA 2.11.1 tarball does not  include<br>
it.<br>
<br>
What is odd about this is that the caffeine.mol file (MIME:<br>
chemical/x-mdl-molfile) is not a binary file, and I am able to download<br>
this text file directly via:<br>
<a href="http://loncapa7.chem.binghamton.edu/res/msu/raeburn/testing/jmol/caffeine.mol" rel="noreferrer" target="_blank">http://loncapa7.chem.binghamton.edu/res/msu/raeburn/testing/jmol/caffeine.mol</a><br>
<br>
The documentation does say:<br>
<br>
'These "extensions" can appear anywhere in a file name to trigger the<br>
binary access mode. So, for example, if you rename any file to include<br>
.bin anywhere in its name, that will instruct JSmol to read it as a<br>
binary file'.<br>
<br>
The file name does not contain the extension .bin, but if the URL was<br>
being examined instead of the file name, then the string ".bin" does<br>
appear (in .binghamton).<br>
<br>
<br>
Stuart Raeburn<br>
LON-CAPA Academic Consortium<br>
<br>
Quoting Bob Gonzales <<a href="mailto:rgonzal@binghamton.edu" target="_blank">rgonzal@binghamton.edu</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I've coded up my first problem with Jsmol and it works fine on the latest<br>
Chrome and Firefox.  But it doesn't work on Internet Explorer 11 or Safari<br>
(latest).  The both complain about the file format.  IE says 'unrecognized<br>
file format for file xxx' and Safari says it doesn't know how to open the<br>
binary file.<br>
<br>
I'm using .mol files.<br>
<br>
I'm invoking the viewer with the following code:<br>
<br>
<script src="/adm/jmol/Jmol.js" type="text/javascript"></script><br>
<script type="text/javascript">jmolInitialize("/adm/jmol");</script><br>
<script type="text/javascript">jmolApplet(150,"background [xFFFFCC]; load<br>
../Graphics/type04/$correctMolecularGeometry.mol");</script><br>
<br>
It would be great to get this to work on IE since that is what is available<br>
on our instructional computers.<br>
<br>
Thanks,<br>
Bob Gonzales<br>
</blockquote>
<br>
_______________________________________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org" target="_blank">LON-CAPA-users@mail.lon-capa.org</a><br>
<a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users" rel="noreferrer" target="_blank">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><br>
</blockquote>
<br>
<br>
<br></div></div>
Stuart Raeburn, Ph.D.          LON-CAPA (cell) <a href="tel:%2B1%20517%20881-3308" value="+15178813308" target="_blank">+1 517 881-3308</a><br>
Dept. Physics & Astronomy      Other (cell) <a href="tel:%2B1%20734%20277-2795" value="+17342772795" target="_blank">+1 734 277-2795</a><br>
Michigan State University      <a href="mailto:raeburn@msu.edu" target="_blank">raeburn@msu.edu</a><br>
MI 48824 USA<div><div><br>
<br>
_______________________________________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org" target="_blank">LON-CAPA-users@mail.lon-capa.org</a><br>
<a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users" rel="noreferrer" target="_blank">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><br>
</div></div></blockquote></div><br></div>
<br>_______________________________________________<br>
LON-CAPA-users mailing list<br>
<a href="mailto:LON-CAPA-users@mail.lon-capa.org">LON-CAPA-users@mail.lon-capa.org</a><br>
<a href="http://mail.lon-capa.org/mailman/listinfo/lon-capa-users" rel="noreferrer" target="_blank">http://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><br>
<br></blockquote></div><br></div></div></div></div></div></div></div>