Hello Angel!

> First, although Jmol.js is the standard way of using Jmol applets, there is a 
> recent
> replacement that uses an object-based syntax. You should make sure to look at 
> it (only for
> Jmol 12.3.x). It's made up with JmolCore.js, JmolApi.js, JmolApplet.js, 
> JmolControls.js, etc
>
> http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/appletweb/
>
> I have used Jmol with jQuery without trouble, but I'm not an expert on jQuery 
> at all.

Yes, I took a look into the new JavaScript API, but it still does not
fix the problem I see. Of course, jQuery isn't the only solution, as
there are other powerful frameworks used today, like Prototype,
Mootools, YUI, extJS, etc., but as jQuery currently is one-of the
popular frameworks around, I thought my work could help.

The problem mostly, and I don't want to be a new guy in town bragging
about stuff, is that current JavaScript solutions do not work well
with modern web development paradigms. The paradigm goes like this:
1. HTML is used only for laying out the data (Java guy's should see
this in a similar way as XML - which is a human readable data markup
language, but it does not include any information about visual or
programmatic behaviour), which still is just a text - the majority of
information floating around the web;
2. CSS is used to add some visual sugar to our data
3. JavaScript is used to add some dynamic actions to our data (like
displaying molecular data on the page, where if you do not posses Java
or JavaScript you should be allowed to download this data, to use
locally, with your own viewer)
4. And last but not least - keep them all separated.

This is why in my example on GitHub I've used a separate file named
main.js where all the JavaScript logic happens, keeping HTML code free
from any in line actions, like
onclick="javascript:Jmol.doSomething();" - this is considered bad now
days.

In the coming day's I should probably come up with some good examples
of how I, as a web developer, see these things should be done, so that
I don't stir a tornado in the glass of water for nothing :)

> Please be careful with the upper/lowercase. There have been concerns before 
> with other
> software, so there should be no change in the name.

I agree, maybe not the best choice, but it was more like pun-intended.
:) Also because some of jQuery plugins are named starting with a
lowercase j and then some other name starting with a capital letter,
explicitly pointing out that it's something to do with jQuery.

>> Firefox 13.0.1 on Windows - started up, but displayed status message
>> "Jmol script terminated"
>
> Do you have a test URL?
> I'd like to have a look.

Sorry, I think I found the source of error already - it looks like,
there are times when Java does not, or misses the point when to,
register external methods with a browser, that's why my call to the
script() when into the error log (which I didn't check, sorry), and
the message was that HTMLObject does not have a function called
script()

>> And if we are still on a subject, where can I find some documentation on
>> external methods, that can be accessed through JavaScript?
>
> Whatever is available in Jmol.js is what most of us use to interface with 
> Jmol. But you will get
> advice from Bob.

Well, yes, the point for me still remains to avoid Jmol.js, so I was
looking for more information about external methods available directly
on applet from JavaScript.

>> except for a applet.script() method
>
>  I bet that's pretty old. For most browsers the applet tag is not being used, 
> but the object tag
> is.
> And from that it has been born the new "Jmol object" model that I mentioned 
> above. That
> creates a Jmol DOM/javascript object and has methods for it. I Haven't gone 
> through details
> yet, as this is quite recent..

Don't worry, it's a name of a private variable not the real
window.applets. I should have made my self clear:

var applet = $('#jmol-viewer').get(0); // The jQuery way
or
var applet = document.getElementById('jmol-viewer'); // native JavaScript way
and then
applet.script('load /my_molecule.pdb');

But as I've seen on the applet source (and Jmol.js), there seems to be
even more external methods like loadInline, syncScript, etc. And I
wanted to find out more about them, because there is no documentation
in the source, or should I look in some other source files?

-- 
Gusts Kaksis
Web Developer

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