Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. diff --git a/sagenb/notebook/cell.py b/sagenb/notebook/cell.py
  2. index 1580580..16675fe 100644
  3. --- a/sagenb/notebook/cell.py
  4. +++ b/sagenb/notebook/cell.py
  5. @@ -2374,9 +2374,10 @@ class Cell(Cell_generic):
  6. jmol_file.close()
  7.  
  8. #script = '<div><script>jmol_applet(%s, "%s?%d");</script></div>' % (size, url, time.time())
  9. - script = '<div id = "jmol_static%s">Sleeping...<button onClick="javascript:void(jmol_launch(%s, \'%s?%d\', %s))">Make Interactive</button>' % (self._id, size, url, time.time(), self._id)
  10. + #script = '<div id = "jmol_static%s">Sleeping...<button onClick="javascript:void(jmol_launch(%s, \'%s?%d\', %s))">Make Interactive</button>' % (self._id, size, url, time.time(), self._id)
  11. + script = '<div id = "jmol_static%s" style="display: none;"></div><script>setTimeout(function() {jmol_applet(%s, "%s?%d", %s);}, 100);</script>' % (self._id, size, url, time.time(), self._id)
  12. image_name = os.path.join(self.url_to_self(),'.jmol_images',F)
  13. - script += '<br><img src="%s.png?%d" alt="If no image appears re-execute the cell. 3-D viewer has been updated."></div>' % (image_name, time.time())
  14. + #script += '<br><img src="%s.png?%d" alt="If no image appears re-execute the cell. 3-D viewer has been updated."></div>' % (image_name, time.time())
  15. images.append(script)
  16. jmolimagebase = F
  17. hasjmol=True
  18. @@ -2395,6 +2396,7 @@ class Cell(Cell_generic):
  19. link_text = link_text[:10] + '...' + link_text[-20:]
  20. files.append('<a target="_new" href="%s" class="file_link">%s</a>' % (url, link_text))
  21.  
  22. + hasjmol=False
  23. if(hasjmol and not hasjmolimages):
  24. # This is probably an old worksheet. Generate the missing jmol static image(s)
  25. # Note: this is problematic in the notebook as it uses tools from Sage to
Add Comment
Please, Sign In to add comment