#9238: J. Gutow's update to Jmol in the notebook...
---------------------------------------------------------------+------------
   Reporter:  gutow                                            |          
Owner:  gutow         
       Type:  enhancement                                      |         
Status:  needs_review  
   Priority:  major                                            |      
Milestone:  sage-4.7.2    
  Component:  notebook                                         |       
Keywords:  sd31, sd32    
Work_issues:                                                   |       
Upstream:  N/A           
   Reviewer:  Jason Grout, Karl-Dieter Crisman, William Stein  |         
Author:  Jonathan Gutow
     Merged:                                                   |   
Dependencies:                
---------------------------------------------------------------+------------

Comment(by gutow):

 First, take note of the first paragraph of this ticket.  Because this
 involves working with the notebook interface all development since June
 2011 has been on the Flask notebook version.  That means the package and
 patches here have not been updated since about 4.7.1.  They are up
 primarily so that people using 4.7.1 and older can get the controls that
 allow changing the display of surfaces.  Development has been limited to
 the Flask version of the notebook.  I have very limited time to work on
 this (I'm a chemistry professor), but if the Flask notebook is going to be
 severely delayed could try to package a version to work with the older
 notebook.  If you really want to test this you should test it in a Flask
 install (see the appropriate tickets).

 That said your concerns about the patch warnings are valid.  I did not
 know that any of it had been folded into 4.7.2.  This is odd.

 The pop-up warnings are because your server connection is relatively slow.
  The notebook now allows about 15 seconds for an applet to load.  If it
 hasn't loaded by that time, one of these warnings pops up.  The idea is to
 provide some feedback when it takes a long time to load.  The reason for
 the async load code is that worksheets with lots of applets in them can
 overwhelm the browsers if too many applets try to load simultaneously.
  This code requires them to load sequentially and limits worksheets to 4
 running Jmol applets at a time.  Those that are not running are replaced
 with a picture and a button to wake them.  The primary reason for this is
 constraints on the memory available for applets within browsers.  The
 async code is for all browsers.  There are warnings associated with
 specific browsers that we have had difficulty with (e.g. MS IE and certain
 versions of FF and Safari).

 If your worksheets worked without the async code, that suggests you were:
 1) lucky; 2) had only one or very few applets in your worksheet.  If your
 worksheet did not work at all with the async code could you package it up
 so that we could test it in the latest code? Thanks.

 Does this answer your questions?  I think the key message is that without
 more work on my part the enhanced Jmol interface may be tied to the Flask
 notebook.

 Replying to [comment:172 strogdon]:

 > I've tested some of the features of this ticket on vanilla
 sage-4.7.2.alpha2 and I have some questions. I installed
 Jmol_for_SageNoteBook-1.1.6.spkg and applied the patches {{{
 trac_9238_interactive_js.patch trac_9238-add-help.patch
 trac_9238_jmol_lib_async.patch }}} The add-help patch would not apply with
 the response that a JmolHelp.html file already existed. I did not attempt
 to apply the IE patches. After applying the patches I issued "sage -b" and
 started sage and the notebook. Now when I load a worksheet that has Jmol
 applets I get pop-ups. If there are numerous applets, I get numerous pop-
 ups. These pop-ups seem to be triggered by the follow alerts in
 trac_9238_jmol_lib_async.patch {{{ +    if(loading>=0){//we found a
 loading applet +        jmolStatus.attempts[loading]+=1; //update number
 of checks for load completion. +
 if(jmolStatus.defaultdirectory[loading]=="done"){//Applet is ready. +
 jmolAppletLive(loading); +            }else{ //Applet not ready. How many
 checks have we done? +            if(jmolStatus.attempts[loading]==10){ +
 alert("Jmol Applet #"+loading+" is having trouble loading.  Will retry
 once."); +                var scriptStr = 'x=defaultdirectory; data
 "directory @x";'; +                scriptStr += 'set MessageCallback
 "jmolMessageHandler"; show defaultdirectory;'; +
 jmolScript(scriptStr); +                } +
 if(jmolStatus.attempts[loading]==20){ +                alert("Second
 attempt to finish launch of Jmol Applet #"+loading+" failed.  Recommend
 reevaluating the cell manually."); +
 jmolStatus.jmolArray[loading]=-2; //launch failed. +                } +
 } +        }else{//no loading applets. Search for queued applet. }}} since
 the quoted expressions in the alerts appear in the pop-ups. Loading the
 applets is extremely slow and the pop-ups have to be "clicked" before
 loading continues. Now if I do not install trac_9238_jmol_lib_async.patch
 then I do not get the pop-ups and the loading of the applets is much
 faster. I have used Firefox 3 and Firefox 6 with the same result. Are the
 pop-ups a feature or is the jmol_lib_async only intended for safari
 browsers?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9238#comment:173>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to