Hi, Bob!

Yes, the validation might not work (yet!), as the w3c still hasn't got XHTML5 validator (which is the XML version of HTML5) and HTML5 itself is still marked "experimental", thus it has no clue about data-xxxx attributes in XHTML 1.0.

My implementation will remain in this minimalist state - it's just for initialization and some basic wrapping. Everything else I'll leave to you and your JmolXXXX.js toolkit, so there is no need for data-xxxx attributes and linked files, if you don't feel using them. The jQuery-Jmol implementation does not require it.

The question about table layout is one of these things that changed around 2004-2006, as it is semantically incorrect to use them to build a layout. Tables are for tabular data - like spreadsheets. Layout is a concern of the design, thus a cascading style sheet related thing. HTML5 even introduced new tags, like article (for content blocks), aside (for secondary information - sidebar, for example), nav (for navigation), section (for single infological block), etc. I tend to use divs for now, as they are intended as page division blocks, which you can classify (with class name) or identify (with id), but in my latest projects, I've already implemented the new HTML5 tags.

My future plan now consists of two things:
1. I'll continue my work now on JME and JSpecView implementation in jQuery. I'll create a separate plugin for each of them in the same manner - initialize and wrap. 2. I have to take a deeper look into ChemDoodleWeb and GLmol - I quite do not understand them yet - are they just the same as JML/Jmol just in pure JavaScript or what?

One more thing. Once the number of required JavaScript files grows - for example, developer want's to implement Jmol and GLmol, and use GLmol when possible instead of Jmol, plus JME or ChemDoodleWeb in the same manner - it's about 10 JavaScript files to call in the head part of html. I'd suggest something like http://www.andresvidal.com/jsl or http://requirejs.org/ to handle script loading, so that GLmol is loaded only when it can be used, also it would basically require a single script tag with the main entry point to web application, that would handle dependency loading when necessary.

Anyway, thank you for your kind words. I'm really glad to be helpful. :)

Gusts

On 2012.08.11. 19:59, Robert Hanson wrote:
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 <mailto: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 <tel:2012.08.10.%2018>: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 <mailto: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


--
Gusts Kaksis

------------------------------------------------------------------------------
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