[Jmol-users] difficulties encountered in switching to JSmol -- advice please?

2013-09-23 Thread Grossman, Robert B
Hi all,

I am looking at switching from Jmol to JSmol.  The WIki page says ,

Modifying function calls from the format jmolXxxx(..., appletExtension) to 
Jmol.jmolXxxx(appletID, ...)

So I have done that, and I am seeing undefined methods errors in the error 
console:

TypeError: 'undefined' is not a function (evaluating 
'Jmol.jmolInitialize('../nosession/jsmol')')
TypeError: 'undefined' is not a function (evaluating 'Jmol.jmolApplet([width, 
height], jmolStartScript, jmolNum)')

Are these methods not supported in JSmol?  Are there workarounds?

Here are the methods that I have used to initiate and run Jmol in the past.  I 
have a js page with the following code:

var jmolMols = new Array();
var addlScripts = new Array();

function setJmol(jmolNum, jmolMol, bgcolor, width, height, addlScript) {
jmolMols[jmolNum] = jmolMol;
addlScripts[jmolNum] = addlScript;
var jmolStartScript = 'background ' + bgcolor
+ '; javascript jmolLoaded(' + jmolNum + '); ';
jmolApplet([width, height], jmolStartScript, jmolNum);
} // setJmol()

// this method will be called after the applet initialization is complete
function jmolLoaded(jmolNum) {
jmolLoadInline(jmolMols[jmolNum], jmolNum);
jmolScript(addlScripts[jmolNum], jmolNum);
} // jmolLoaded()

setJmol() is called by this script in the HTML, where I want the applet to 
appear:

script type=text/javascript
// !-- % %
setJmol(%= jmolNum %,
'%= Utils.toValidJS(
figData[Figure.STRUCT]) %',
'white', 250, 250,
'%= Utils.toValidJS(
figData[Figure.JMOL_SCRIPTS]) 
%');
// --
/script

The JSP page also has this call in its Javascript section:

Jmol.jmolInitialize('../nosession/jsmol')

-- Bob Grossman (not Bob Hanson)

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60133471iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] difficulties encountered in switching to JSmol -- advice please?

2013-09-23 Thread Angel Herráez
Hi Bob (Groosman)

Didn't you get the reply las Friday?

see
http://www.mail-archive.com/jmol-users@lists.sourceforge.net/msg21780.ht
ml


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60133471iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users