Changeset 7944:f53a4900be48


Ignore:
Timestamp:
01/04/08 18:17:08 (5 years ago)
Author:
mabshoff@…
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.
Message:

merge

Location:
sage/server/notebook
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sage/server/notebook/cell.py

    r7909 r7944  
    536536              onInput    = 'cell_input_resize(this); return true;' 
    537537              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;' 
    539539              %s 
    540540           >%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) 
    542545 
    543546        t = t.replace("<","&lt;")+" " 
  • sage/server/notebook/cell.py

    r7942 r7944  
    603603                    size = F[i+5:-5] 
    604604                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'): 
    609614                pass # jmol data 
    610615            else: 
  • sage/server/notebook/css.py

    r7902 r7944  
    10501050} 
    10511051 
    1052  
    1053  
    1054 span.cell_evaluate { 
     1052a.eval_button { 
     1053  display:none; 
     1054} 
     1055a.eval_button_active { 
     1056  display: block; 
    10551057  position: relative; 
    10561058  top: 2px; 
    1057   cursor:pointer; 
     1059  margin:0px; 
     1060  padding:0px; 
     1061  font-size:8pt; 
    10581062} 
    10591063 
  • sage/server/notebook/css.py

    r7942 r7944  
    15891589   background-color: #990000;    
    15901590} 
    1591  
    15921591""" 
    15931592    if color == 'gmail': 
  • sage/server/notebook/js.py

    r7929 r7944  
    12211221    if(cell == null) return; 
    12221222 
     1223    setTimeout("set_class('eval_button"+id+"','eval_button')", 100); //this is unclickable if we don't add a little delay. 
     1224 
    12231225    /* Disable coloring and change to div for now */ 
    12241226    cell.className="cell_input"; 
    12251227    cell_input_minimize_size(cell); 
    12261228    return true;  /* disable for now */ 
    1227  
    12281229 
    12291230    cell.className="hidden"; 
  • sage/server/notebook/js.py

    r7942 r7944  
    2929    s = async_lib() 
    3030    s += notebook_lib() 
     31    s += jmol_lib() 
    3132 
    3233    return s 
    3334 
    3435 
     36def jmol_lib(): 
     37    s = r""" 
     38function jmol_applet(size, url) { 
     39    jmolSetDocument(cell_writer); 
     40    jmolApplet(size, "script " + url); 
     41} 
     42 
     43function 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 
    3555 
    3656def async_lib(): 
     
    801821    window.open ("/history",  
    802822      "", "menubar=1,scrollbars=1,width=800,height=600, toolbar=1,resizable=1"); 
    803  
    804823} 
    805824 
     
    18701889} 
    18711890 
     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 
    18721895function CellWriter() { 
    18731896    function write(s) { 
     
    18781901} 
    18791902 
    1880 var cell_writer = new CellWriter(); 
     1903cell_writer = document; 
    18811904 
    18821905function eval_script_tags(text) { 
     
    18871910       var code = s.slice(8+i,j); 
    18881911       try { 
    1889            cell_writer.buffer = ""; 
     1912           cell_writer = new CellWriter(); 
    18901913           window.eval(code); 
    18911914       } catch(e) { 
Note: See TracChangeset for help on using the changeset viewer.