Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
diff --git a/sage/interfaces/jmoldata.py b/sage/interfaces/jmoldata.py
--- a/sage/interfaces/jmoldata.py
+++ b/sage/interfaces/jmoldata.py
@@ -80,6 +80,8 @@
sage: type(JData.is_jvm_available())
<type 'bool'>
"""
+ # This is not working for some reason on mod.math.washington.edu
+ return False
#scratch file for Jmol errors and status
jmolscratch = os.path.join(DOT_SAGE, "sage_notebook.sagenb", "jmol_scratch")
if not os.path.exists(jmolscratch):
diff --git a/sagenb/notebook/cell.py b/sagenb/notebook/cell.py
index 1580580..16675fe 100644
--- a/sagenb/notebook/cell.py
+++ b/sagenb/notebook/cell.py
@@ -2374,9 +2374,10 @@ class Cell(Cell_generic):
jmol_file.close()
#script = '<div><script>jmol_applet(%s, "%s?%d");</script></div>' % (size, url, time.time())
- 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)
+ #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)
+ 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)
image_name = os.path.join(self.url_to_self(),'.jmol_images',F)
- 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())
+ #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())
images.append(script)
jmolimagebase = F
hasjmol=True
@@ -2395,6 +2396,7 @@ class Cell(Cell_generic):
link_text = link_text[:10] + '...' + link_text[-20:]
files.append('<a target="_new" href="%s" class="file_link">%s</a>' % (url, link_text))
+ hasjmol=False
if(hasjmol and not hasjmolimages):
# This is probably an old worksheet. Generate the missing jmol static image(s)
# Note: this is problematic in the notebook as it uses tools from Sage to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment