# 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 { |
1000 | 1000 | border: 0px solid white; |
1001 | 1001 | font-family: monospace; |
1002 | 1002 | font-size:12pt; |
| 1003 | color:#888888; |
1003 | 1004 | overflow:hidden; |
1004 | 1005 | padding-left:3px; |
1005 | 1006 | padding-top:0px; |
1006 | 1007 | padding-bottom:0px; |
1007 | 1008 | /* width: 100%; */ |
1008 | | height:0.5em; |
| 1009 | height:1em; |
1009 | 1010 | margin:0px; |
1010 | 1011 | } |
1011 | 1012 | |
diff -r 0d7a666209ea -r e062908ea727 sage/server/notebook/js.py
a
|
b
|
function lstrip(s) { |
786 | 786 | |
787 | 787 | function resize_all_cells() { |
788 | 788 | /* |
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. |
790 | 791 | |
791 | 792 | GLOBAL INPUT: |
792 | 793 | cell_id_list -- a list of integers |
793 | 794 | */ |
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 | } |
797 | 804 | } |
798 | 805 | |
799 | 806 | function input_keyup(id, event) { |
… |
… |
function cell_focused(cell, id) { |
1774 | 1781 | OUTPUT: |
1775 | 1782 | sets the global variable current_cell and update display of the evaluate link. |
1776 | 1783 | */ |
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 | |
1778 | 1790 | if(current_cell == id) return; |
1779 | | |
1780 | 1791 | if (current_cell != -1) { |
1781 | 1792 | set_class("eval_button"+current_cell,"eval_button"); |
1782 | 1793 | } |