Gusts, thanks very much for your contribution and getting us thinking more
about integrating jQuery into pages that utilize Jmol. I hope we can
develop this more.

You might want to run your pages through W3C and XHTML validators. I did
that with my version of simple2.htm and discovered several miscodings. On
your page with XHTML I couldn't get the data-xxxx attribute to validate,
but maybe I was using the wrong dictionary. Do you know what the right
dictionary is to allow that?

All -- I have rewritten http://chemapps.stolaf.edu/jmol/simple2.htm to
implement some of Gusts' ideas. This page passes XHTML Strict and W3C html5
validation, and it works in Firefox, MSIE9, and Chrome. (A test in Safari
and any of these on the Mac would be appreciated.)

-- This implementation required modifications to JmolCore.js and
JmolApplet.js, because it turns out MSIE9 (but not MSIE8) in strict or
transitional mode appears to have a bug (or just a really strange feature)
that allows the applet can call Jmol._readyCallback but not
jmol._readyCallback (only difference being the capitalization of Jmol). Go
figure! I also made a minor friendly modification to jQuery.iecors.js.

-- This has all the platform-aware aspects of JmolApi.js (because it uses
that) but is more streamlined in the way it handles page creation, using
some of the more useful functionality of jQuery without compromising all
the really nice features of JmolApi.js that Gusts hasn't considered yet.
This includes  ChemDoodle WebGL and non-WebGL options, the glMol WebGL
option, JSpecView sychronization, and JME/Jmol integration.

-- I think any page developer familiar with jQuery will have no problem
extending JmolApi.js any way they choose, including additional callbacks,
events, etc., following my lead here.

-- This incorporates Gusts' idea of allowing a banner to be displayed
indicating that JavaScript is required.

-- This does not implement Gusts' idea of a link that works when JavaScript
is disabled to at least allow downloading of a model. Certainly you can add
any links like that you want on your own that would work with or without
JavaScript, I suppose. I just didn't see the point of making this rather
esoteric non-JavaScript option available.

-- The page does not use document.write. In fact, the body is just this:

<body>
<div id="centered">
<table>
    <tr>
        <td style="text-align:left;width:300px"><div
id="leftpanel"></div></td>
        <td style="text-align:center;width:460px"><div id="middlepanel">You
will need JavaScript enabled to use this page</div></td>
        <td style="text-align:left;width:200px"><div
id="rightpanel"></div></td>
    </tr>
    <tr>
        <td></td>
        <td style="text-align:center" colspan="2"><div
id="lowerpanel"></div></td>
    </tr>
</table>
</div>
</body>

All the rest is in $(document).ready() or $(window).resize(). So it seems
to me that right there solves a lot of Gusts' original concerns, and I have
to say that I wholeheartedly support his idea of getting all the
applet/control creation JavaScript out of the body. It really does look a
lot better, and it just feels right.

-- I had to play some jQuery tricks to implement <center>, but that's good
to learn how to do anyway. I did have a problem implementing my .center()
method without hard-coding widths, but that's probably what you need to do
anyway when you use anything that involves page centering.

Gusts, I couldn't figure out what the heck you were doing there with the
complicated div hierarchy. Is <table> deprecated? I don't know if you find
this helpful, dismissive (it's not meant to be), or just plain off-track.
But hopefully it provides an approach for those who want to use jQuery and
also want the full capabilities of Jmol.

Bob


On Fri, Aug 10, 2012 at 10:37 AM, Gusts Kaksis <gusts.kak...@gmail.com>wrote:

>  1. It's less - just raw setup-and-wrap for Jmol applet
> 2. It's W3C standards compliant
> 3. It's XHTML compliant
> 4. It uses events - so you can set up more callbacks than one
>
> I think that's it. Everything else should be done by the developer or
> Jmol.js (that one I leave for you, for now).
>
>
> On 2012.08.10. 18:28, Robert Hanson wrote:
>
> Great. Can you summarize the capabilitiesof jQuery-Jmol vis-a-vis Jmol.js
> and JmolApi.js?
>
>
> On Fri, Aug 10, 2012 at 10:19 AM, Gusts Kaksis <gusts.kak...@gmail.com>wrote:
>
>> I've released version 2.0 of jQuery plugin. It is a complete rewrite.
>> 1. I've managed to cheat jQuery and override bind() and unbind()
>> methods, so that callbacks are set up only when an event binding is
>> requested for the first time.
>> 2. I've introduced a wrapper class, that acts as a script cache and
>> event listener counter (once all the event listeners are removed,
>> callback is set to NONE)
>>
>> Documentation and examples: http://gusc.lv/jmol/
>>
>> --
>> Gusts Kaksis
>>
>>
>> --
>>
> --
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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to