I am happy to report that JSmol (pure-HTML5 JavaScript-only Jmol) is now
loading within-domain and cross-domain binary file types in the three
browsers I have tested. (Firefox, Chrome, and MSIE/Windows)

see http://chemapps.stolaf.edu/jmol/jsmol/test2.htm

This page demonstrates reading PNGJ (PNG + JMOL) files and standard
GZ-compressed files in the two top middle links "1hxw.pngj" and
"water.xyz.gz"

It also reads files directly from pubChem, NCI resolver, and RCSB.

The page implements all standard aspects of Jmol, including scripting,
opaque and translucent isosurfaces, atomic and molecular orbitals,
cartoons, labels, 2D- and 3D-echos, crystallographic symmetry, JavaScript
callbacks, etc.

Commands that involve threading (hover, spin, animation, minimization,
script delay, and animated compare or moveTo, for instance) have not been
implemented yet. Writing of JPG and PNG data is not supported; background
images are not supported.

A complete file set can be unzipped from
http://chemapps.stolaf.edu/jmol/JSmol.zip

Note that MSIE and Chrome cannot read files on the local drive, but Firefox
can.

If you are interested in binary file reading, for compatibility with Chrome
and MSIE, be aware that you will need to have a base64 server-side piece
that will convert the binary data to BASE64 format. This is because only
Firefox allows clean (reliable) synchronous binary file transfer. The
test2.htm page I have is using the file jsmol.php in
http://chemapps.stolaf.edu/jmol/jsmol, which does that and considerably
more.

Not all binary file types are identified in the JavaScript version right
now (this is done by simple file extension check only), but you should be
able to rename any file to include ".bin" in its name to force JSmol to
read it as a binary file. For example, "c6h6.bin.spartan" should work.

A big THANK YOU goes to Atsuhiko Yamanaka for writing a Java version of
zlib (www.jcraft.com/jzlib), which reads GZIP and ZIP file data, and which
I was able to convert to JavaScript using Zhou Renjian's Java2Script
utility (https://code.google.com/p/java2script).

Notice that this also means that anyone can read binary files straight into
JavaScript on any web page, not just a page involving Jmol, using the
JavaScript library we have developed. (see
http://chemapps.stolaf.edu/jmol/jsmol/j2s) The combination of Jzlib and
Java2Script is very broadly applicable.



Bob


-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to