Changeset 7944:f53a4900be48
- Timestamp:
- 01/04/08 18:17:08 (5 years ago)
- Branch:
- default
- Parents:
- 7941:4330d50e65f7 (diff), 7943:0068bcfdf101 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- sage/server/notebook
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sage/server/notebook/cell.py
r7909 r7944 536 536 onInput = 'cell_input_resize(this); return true;' 537 537 onBlur = 'cell_blur(%s); return true;' 538 onFocus = 'this.className = "cell_input_active"; return true;'538 onFocus = 'this.className = "cell_input_active"; set_class("eval_button%s","eval_button_active"); return true;' 539 539 %s 540 540 >%s</textarea> 541 """%(cls, r, ncols, id, id, id, id,'readonly=1' if do_print else '', t) 541 """%(cls, r, ncols, id, id, id, id, id, 'readonly=1' if do_print else '', t) 542 543 if not do_print: 544 s+= '<a href="javascript:evaluate_cell(%s,0)" class="eval_button" id="eval_button%s">evaluate</a>'%(id,id) 542 545 543 546 t = t.replace("<","<")+" " -
sage/server/notebook/cell.py
r7942 r7944 603 603 size = F[i+5:-5] 604 604 else: 605 size = 400 606 script = 'jmolSetDocument(cell_writer); jmolApplet(%s, "script %s?");' % (size, url) 607 images.append('<script>%s</script>' % script) 608 elif F.endswith('.pmesh'): 605 size = 500 606 607 #popup = """<br><a href="javascript:jmol_popup('%s');">Enlarge</a>"""%url 608 #script = '<script>jmol_applet(%s, "%s");</script>%s' % (size, url, popup) 609 #script = '<script>jmol_popup("%s");</script>' % (url) 610 611 script = '<div><script>jmol_applet(%s, "%s");</script></div>' % (size, url) 612 images.append(script) 613 elif F.endswith('.jmol.zip'): 609 614 pass # jmol data 610 615 else: -
sage/server/notebook/css.py
r7902 r7944 1050 1050 } 1051 1051 1052 1053 1054 span.cell_evaluate { 1052 a.eval_button { 1053 display:none; 1054 } 1055 a.eval_button_active { 1056 display: block; 1055 1057 position: relative; 1056 1058 top: 2px; 1057 cursor:pointer; 1059 margin:0px; 1060 padding:0px; 1061 font-size:8pt; 1058 1062 } 1059 1063 -
sage/server/notebook/css.py
r7942 r7944 1589 1589 background-color: #990000; 1590 1590 } 1591 1592 1591 """ 1593 1592 if color == 'gmail': -
sage/server/notebook/js.py
r7929 r7944 1221 1221 if(cell == null) return; 1222 1222 1223 setTimeout("set_class('eval_button"+id+"','eval_button')", 100); //this is unclickable if we don't add a little delay. 1224 1223 1225 /* Disable coloring and change to div for now */ 1224 1226 cell.className="cell_input"; 1225 1227 cell_input_minimize_size(cell); 1226 1228 return true; /* disable for now */ 1227 1228 1229 1229 1230 cell.className="hidden"; -
sage/server/notebook/js.py
r7942 r7944 29 29 s = async_lib() 30 30 s += notebook_lib() 31 s += jmol_lib() 31 32 32 33 return s 33 34 34 35 36 def jmol_lib(): 37 s = r""" 38 function jmol_applet(size, url) { 39 jmolSetDocument(cell_writer); 40 jmolApplet(size, "script " + url); 41 } 42 43 function jmol_popup(url) { 44 win = window.open ("", "jmol viewer", "width=600,height=600,resizable=1,statusbar=0"); 45 win.document.body.innerHTML = ""; 46 win.document.title = "Sage 3d Viewer"; 47 win.document.writeln("<h1 align=center>Sage 3d Viewer</h1>"); 48 jmolSetDocument(win.document); 49 jmolApplet("100%", "script" + url); 50 win.focus(); 51 } 52 """ 53 54 return s 35 55 36 56 def async_lib(): … … 801 821 window.open ("/history", 802 822 "", "menubar=1,scrollbars=1,width=800,height=600, toolbar=1,resizable=1"); 803 804 823 } 805 824 … … 1870 1889 } 1871 1890 1891 /* When the page is loaded, let javascript write 1892 * directly to the document. After that, make sure 1893 * javascript writes to a CellWriter object. */ 1894 1872 1895 function CellWriter() { 1873 1896 function write(s) { … … 1878 1901 } 1879 1902 1880 var cell_writer = new CellWriter();1903 cell_writer = document; 1881 1904 1882 1905 function eval_script_tags(text) { … … 1887 1910 var code = s.slice(8+i,j); 1888 1911 try { 1889 cell_writer .buffer = "";1912 cell_writer = new CellWriter(); 1890 1913 window.eval(code); 1891 1914 } catch(e) {
Note: See TracChangeset
for help on using the changeset viewer.
