Ticket #3053: sage-3053.patch

File sage-3053.patch, 2.5 KB (added by was, 13 years ago)
  • sage/server/notebook/css.py

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1210471128 25200
    # Node ID e062908ea727164243bf78dd042a094923dcaae9
    # Parent  0d7a666209ea6039e41c58e715774ee7c62e617c
    trac #3053 --  new cell_resize doesn't respect %hide at the beginning of a cell
      1. Fix the listed problem.
      2. Fix the %hide styling a bit; make %hide be grey
      3. Make %hide work consistently on new page refresh versus in a running worksheet
      4. Make cell be resized when clicking on an input area.  This makes editing
         a %hide much more natural.
    
    diff -r 0d7a666209ea -r e062908ea727 sage/server/notebook/css.py
    a b textarea.cell_input_hide { 
    10001000  border: 0px solid white;
    10011001  font-family: monospace;
    10021002  font-size:12pt;
     1003  color:#888888;
    10031004  overflow:hidden;
    10041005  padding-left:3px;
    10051006  padding-top:0px;
    10061007  padding-bottom:0px;
    10071008  /* width: 100%; */
    1008   height:0.5em;
     1009  height:1em;
    10091010  margin:0px;
    10101011}
    10111012
  • sage/server/notebook/js.py

    diff -r 0d7a666209ea -r e062908ea727 sage/server/notebook/js.py
    a b function lstrip(s) { 
    786786
    787787function resize_all_cells() {
    788788    /*
    789     Resizes all cells; called whenever the window gets resized.
     789    Resizes all cells that do not start with %hide;
     790    called whenever the window gets resized.
    790791   
    791792    GLOBAL INPUT:
    792793        cell_id_list -- a list of integers
    793794    */
    794     var i;
    795     for(i=0;i<cell_id_list.length;i++)
    796         cell_input_resize(cell_id_list[i]);
     795    var i,id;
     796    for(i=0;i<cell_id_list.length;i++) {
     797        // Get the id of the cell to resize
     798        id = cell_id_list[i];
     799        // Make sure it is not hidden, and if not resize it.
     800        if (get_cell(id).className != "cell_input_hide") {
     801           cell_input_resize(id);
     802        }   
     803    }
    797804}
    798805
    799806function input_keyup(id, event) {
    function cell_focused(cell, id) { 
    17741781    OUTPUT:
    17751782        sets the global variable current_cell and update display of the evaluate link.
    17761783    */
    1777     cell.className = "cell_input_active";
     1784    cell.className = "cell_input_active";
     1785
     1786    // This makes sure the input textarea is resized right when it is
     1787    // clicked on.
     1788    cell_input_resize(id);
     1789
    17781790    if(current_cell == id) return;
    1779    
    17801791    if (current_cell != -1) {
    17811792        set_class("eval_button"+current_cell,"eval_button");
    17821793    }