[Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
We used to have a call to javascript as part of the script text, but that is 
not longer working:

Jmol.script(jmol0,'load data/123.pdb; javascript alert(“Back”);’);

On the following example, the alert() happens before the script gets executed. 
The threading mechanism plays here against us. 

Jmol.script(jmol0,'load data/123.pdb; select all; color blue;');
alert(“Back”);

Suggestions? The set (callback) mechanism doesn’t seem to be the right choice.

Jaim
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Robert Hanson
It's not that the alert is coming first; it's that there is no REFRESH
before the alert. If you had that command prior to the  javascript command,
then the structure will appear before the alert.

I would argue that this is proper behavior. There is no particular reason
to demand an automatic refresh prior to a javascript command, and the
behavior is the same for both Java and HTML5 modes.

Bob




On Mon, Jan 13, 2014 at 5:12 AM, Jaime Prilusky 
jaime.prilu...@weizmann.ac.il wrote:

 We used to have a call to javascript as part of the script text, but that
 is not longer working:

 Jmol.script(jmol0,'load data/123.pdb; javascript alert(“Back”);’);

 On the following example, the alert() happens before the script gets
 executed. The threading mechanism plays here against us.

 Jmol.script(jmol0,'load data/123.pdb; select all; color blue;');
 alert(“Back”);

 Suggestions? The set (callback) mechanism doesn’t seem to be the right
 choice.

 Jaim

 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
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
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Angel Herráez
I agree that the use of refresh is often needed; that's my 
experience, in many occasions it's been key.

However, the doc says otherwise:
http://chemapps.stolaf.edu/jmol/docs/#refresh

(Unnecessary, and thus deprecated.)

I would remove that phrase, Bob :)




--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
Dear Bob,
Can you please give me an example on how to call a javascript function after 
the Jmol.script() is done?
Thank you in advance,
Jaim

On Jan 13, 2014, at 1:55 PM, Robert Hanson 
hans...@stolaf.edumailto:hans...@stolaf.edu wrote:

It's not that the alert is coming first; it's that there is no REFRESH before 
the alert. If you had that command prior to the  javascript command, then the 
structure will appear before the alert.

I would argue that this is proper behavior. There is no particular reason to 
demand an automatic refresh prior to a javascript command, and the behavior is 
the same for both Java and HTML5 modes.

Bob




On Mon, Jan 13, 2014 at 5:12 AM, Jaime Prilusky 
jaime.prilu...@weizmann.ac.ilmailto:jaime.prilu...@weizmann.ac.il wrote:
We used to have a call to javascript as part of the script text, but that is 
not longer working:

Jmol.script(jmol0,'load data/123.pdb; javascript alert(“Back”);’);

On the following example, the alert() happens before the script gets executed. 
The threading mechanism plays here against us.

Jmol.script(jmol0,'load data/123.pdb; select all; color blue;');
alert(“Back”);

Suggestions? The set (callback) mechanism doesn’t seem to be the right choice.

Jaim
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.netmailto:Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users



--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
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

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
Even if adding refresh to Jmol.script, the alert happens before the model gets 
loaded:

Jmol.script(jmol0,'load data/123.pdb; select all; color blue; refresh;');
alert(“Back”);

Jaim

On Jan 13, 2014, at 2:03 PM, Angel Herráez angel.herr...@uah.es wrote:

 I agree that the use of refresh is often needed; that's my 
 experience, in many occasions it's been key.
 
 However, the doc says otherwise:
 http://chemapps.stolaf.edu/jmol/docs/#refresh
 
 (Unnecessary, and thus deprecated.)
 
 I would remove that phrase, Bob :)
 
 
 
 
 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today. 
 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Otis Rothenberger
I use the javascript command frequently. From past experience, arguments in 
functions can cause issues. At a minimum, I would put quotes around the 
javascript itself. I think this has to be rigged so that these are double 
quotes - i.e. javascript alert('Hey there!') This means changing your quote 
structure in the whole Jmol script.

One thing that made issues go away for me completely is to simply use a 
function without an argument. That function, when called, can do anything you 
need done after the Jmol script executes.

Otis


--
Otis Rothenberger
o...@chemagic.com
http://chemagic.com




On Jan 13, 2014, at 7:03 AM, Angel Herráez angel.herr...@uah.es wrote:

 I agree that the use of refresh is often needed; that's my 
 experience, in many occasions it's been key.
 
 However, the doc says otherwise:
 http://chemapps.stolaf.edu/jmol/docs/#refresh
 
 (Unnecessary, and thus deprecated.)
 
 I would remove that phrase, Bob :)
 
 
 
 
 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today. 
 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
Have you tried it on 14.0.5 with HTML5?

Jaim

On Jan 13, 2014, at 2:26 PM, Otis Rothenberger 
osrot...@chemagic.commailto:osrot...@chemagic.com wrote:

I use the javascript command frequently. From past experience, arguments in 
functions can cause issues. At a minimum, I would put quotes around the 
javascript itself. I think this has to be rigged so that these are double 
quotes - i.e. javascript alert('Hey there!') This means changing your quote 
structure in the whole Jmol script.

One thing that made issues go away for me completely is to simply use a 
function without an argument. That function, when called, can do anything you 
need done after the Jmol script executes.

Otis


--
Otis Rothenberger
o...@chemagic.commailto:o...@chemagic.com
http://chemagic.com




On Jan 13, 2014, at 7:03 AM, Angel Herráez 
angel.herr...@uah.esmailto:angel.herr...@uah.es wrote:

I agree that the use of refresh is often needed; that's my
experience, in many occasions it's been key.

However, the doc says otherwise:
http://chemapps.stolaf.edu/jmol/docs/#refresh

(Unnecessary, and thus deprecated.)

I would remove that phrase, Bob :)




--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Rolf Huehne
On 01/13/2014 01:21 PM, Jaime Prilusky wrote:
 Even if adding refresh to Jmol.script, the alert happens before the model 
 gets loaded:

 Jmol.script(jmol0,'load data/123.pdb; select all; color blue; refresh;');
 alert(“Back”);

If you take the 'alert' out of the 'Jmol.script' command set it is 
expected that the 'alert' is processed immediately after the Jmol script 
commands are put into the Jmol scripting command cue.

It should be sufficient to add 'refresh;' into your initial version:

Jmol.script(jmol0,'load data/123.pdb; select all; color blue; refresh; 
javascript alert(“Back”);’);

Maybe you need to allow javascript commands first, e.g. add it to your 
Info settings:

   Info = {...
   allowjavascript: true
  };

Regards,
Rolf

-- 

Rolf Huehne
Postdoc

Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI)
Beutenbergstrasse 11
07745 Jena, Germany

Phone:   +49 3641 65 6205
Fax: +49 3641 65 6210
E-Mail:  rhue...@fli-leibniz.de
Website: http://www.fli-leibniz.de

   Scientific Director: Prof. Dr. K. Lenhard Rudolph
Head of Administration: Dr. Daniele Barthel
Chairman of Board of Trustees: Dennys Klein

VAT No: DE 153 925 464
Register of Associations: No. 230296, Amtsgericht Jena
Tax Number: 162/141/08228


--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Otis Rothenberger
I'm using 14.0.2. I can check out 14.0.5 later this morning.

I should have mentioned in the previous note that the function without an 
argument no longer needs the quotes around the javascript.

The javascript command has been fussy for me for years. Keeping quotes out of 
the javascript itself made my problems go away - hence the function with no 
argument.

Otis


--
Otis Rothenberger
o...@chemagic.com
http://chemagic.com

On Jan 13, 2014, at 7:36 AM, Jaime Prilusky jaime.prilu...@weizmann.ac.il 
wrote:

 Have you tried it on 14.0.5 with HTML5?
 
 Jaim
  
 On Jan 13, 2014, at 2:26 PM, Otis Rothenberger osrot...@chemagic.com wrote:
 
 I use the javascript command frequently. From past experience, arguments in 
 functions can cause issues. At a minimum, I would put quotes around the 
 javascript itself. I think this has to be rigged so that these are double 
 quotes - i.e. javascript alert('Hey there!') This means changing your 
 quote structure in the whole Jmol script.
 
 One thing that made issues go away for me completely is to simply use a 
 function without an argument. That function, when called, can do anything 
 you need done after the Jmol script executes.
 
 Otis
 

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Otis Rothenberger
Jaim,

Quick test on your side: Does alert(1234) work. No quotes - just alert(1234)?

Otis

--
Otis Rothenberger
o...@chemagic.com
http://chemagic.com




On Jan 13, 2014, at 7:49 AM, Otis Rothenberger osrot...@chemagic.com wrote:

 I'm using 14.0.2. I can check out 14.0.5 later this morning.
 
 I should have mentioned in the previous note that the function without an 
 argument no longer needs the quotes around the javascript.
 
 The javascript command has been fussy for me for years. Keeping quotes out of 
 the javascript itself made my problems go away - hence the function with no 
 argument.
 
 Otis
 
 
 --
 Otis Rothenberger
 o...@chemagic.com
 http://chemagic.com
 
 On Jan 13, 2014, at 7:36 AM, Jaime Prilusky jaime.prilu...@weizmann.ac.il 
 wrote:
 
 Have you tried it on 14.0.5 with HTML5?
 
 Jaim
  
 On Jan 13, 2014, at 2:26 PM, Otis Rothenberger osrot...@chemagic.com wrote:
 
 I use the javascript command frequently. From past experience, arguments in 
 functions can cause issues. At a minimum, I would put quotes around the 
 javascript itself. I think this has to be rigged so that these are double 
 quotes - i.e. javascript alert('Hey there!') This means changing your 
 quote structure in the whole Jmol script.
 
 One thing that made issues go away for me completely is to simply use a 
 function without an argument. That function, when called, can do anything 
 you need done after the Jmol script executes.
 
 Otis
 
 

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Robert Hanson
so noted. Changing that to:
refresh

* Forces a screen repaint during script execution. Usually unnecessary,
this command is useful during selected looping operations or in conjunction
with such commands as javascript that otherwise might not initiate a screen
repaint. Refreshing is automatically carried out after a script completes
unless set refreshing FALSE has been invoked. Commands that automatically
invoke refresh include delay, move, moveto, navigate, write, and zap.*


On Mon, Jan 13, 2014 at 6:03 AM, Angel Herráez angel.herr...@uah.es wrote:

 I agree that the use of refresh is often needed; that's my
 experience, in many occasions it's been key.

 However, the doc says otherwise:
 http://chemapps.stolaf.edu/jmol/docs/#refresh

 (Unnecessary, and thus deprecated.)

 I would remove that phrase, Bob :)





 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
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
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Robert Hanson
That's right, too. In this case you are putting a script into the queue and
then immediately and independently firing the alert message. Your initial
way is correct; just add a REFRESH command prior to that if you want the
model to be displayed during the alert.


On Mon, Jan 13, 2014 at 6:21 AM, Jaime Prilusky 
jaime.prilu...@weizmann.ac.il wrote:

 Even if adding refresh to Jmol.script, the alert happens before the model
 gets loaded:

 Jmol.script(jmol0,'load data/123.pdb; select all; color blue; refresh;');
 alert(“Back”);

 Jaim

 On Jan 13, 2014, at 2:03 PM, Angel Herráez angel.herr...@uah.es wrote:

  I agree that the use of refresh is often needed; that's my
  experience, in many occasions it's been key.
 
  However, the doc says otherwise:
  http://chemapps.stolaf.edu/jmol/docs/#refresh
 
  (Unnecessary, and thus deprecated.)
 
  I would remove that phrase, Bob :)
 
 
 
 
 
 --
  CenturyLink Cloud: The Leader in Enterprise Cloud Services.
  Learn Why More Businesses Are Choosing CenturyLink Cloud For
  Critical Workloads, Development Environments  Everything In Between.
  Get a Quote or Start a Free Trial Today.
 
 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
  ___
  Jmol-users mailing list
  Jmol-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/jmol-users



 --
 CenturyLink Cloud: The Leader in Enterprise Cloud Services.
 Learn Why More Businesses Are Choosing CenturyLink Cloud For
 Critical Workloads, Development Environments  Everything In Between.
 Get a Quote or Start a Free Trial Today.

 http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
 ___
 Jmol-users mailing list
 Jmol-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/jmol-users




-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
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
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users