##// END OF EJS Templates
Pager is working again.
Brian E. Granger -
Show More
@@ -122,7 +122,7 b' div#left_panel {'
122 122 }
123 123
124 124 div#left_panel_splitter {
125 width: 7px;
125 width: 8px;
126 126 top: 0px;
127 127 left: 202px;
128 128 margin: 0px;
@@ -131,7 +131,7 b' div#left_panel_splitter {'
131 131 }
132 132
133 133 div#notebook_panel {
134 margin: 0px 0px 0px 211px;
134 margin: 0px 0px 0px 209px;
135 135 padding: 0px;
136 136 }
137 137
@@ -139,14 +139,14 b' div#notebook {'
139 139 overflow-y: scroll;
140 140 overflow-x: auto;
141 141 width: 100%;
142 padding: 0px 0px;
142 padding: 0px 15px 15px 15px;
143 143 margin: 0px
144 144 background-color: white;
145 145 font-size: 12pt;
146 146 }
147 147
148 148 div#pager_splitter {
149 height: 7px;
149 height: 8px;
150 150 }
151 151
152 152 div#pager {
@@ -161,7 +161,7 b' div#pager {'
161 161
162 162 div.cell {
163 163 width: 100%;
164 padding: 0px;
164 padding: 5px;
165 165 /* This acts as a spacer between cells, that is outside the border */
166 166 margin: 15px 0px 15px 0px;
167 167 }
@@ -20,23 +20,6 b' var IPython = (function (IPython) {'
20 20 };
21 21
22 22
23 Cell.prototype.grow = function(element) {
24 // Grow the cell by hand. This is used upon reloading from JSON, when the
25 // autogrow handler is not called.
26 var dom = element.get(0);
27 var lines_count = 0;
28 // modified split rule from
29 // http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
30 var lines = dom.value.split(/\r|\r\n|\n/);
31 lines_count = lines.length;
32 if (lines_count >= 1) {
33 dom.rows = lines_count;
34 } else {
35 dom.rows = 1;
36 }
37 };
38
39
40 23 Cell.prototype.select = function () {
41 24 this.element.addClass('ui-widget-content ui-corner-all');
42 25 this.selected = true;
@@ -18,7 +18,7 b' var IPython = (function (IPython) {'
18 18
19 19
20 20 CodeCell.prototype.create_element = function () {
21 var cell = $('<div></div>').addClass('cell code_cell vbox');
21 var cell = $('<div></div>').addClass('cell border-box-sizing code_cell vbox');
22 22 var input = $('<div></div>').addClass('input hbox');
23 23 input.append($('<div/>').addClass('prompt input_prompt monospace-font'));
24 24 var input_area = $('<div/>').addClass('input_area box-flex1');
@@ -81,6 +81,22 b' var IPython = (function (IPython) {'
81 81 };
82 82 };
83 83 });
84
85 this.element.bind('collapse_pager', function () {
86 var that_height = that.element.outerHeight(true);
87 var pager_height = $('div#pager').outerHeight(true);
88 var new_height = that_height + pager_height;
89 console.log('collapse', that_height, pager_height, new_height);
90 that.element.animate({height : new_height + 'px'}, 'fast');
91 });
92
93 this.element.bind('expand_pager', function () {
94 var that_height = that.element.outerHeight(true);
95 var pager_height = $('div#pager').outerHeight(true);
96 var new_height = that_height - pager_height;
97 console.log('expand', that_height, pager_height, new_height);
98 that.element.animate({height : new_height + 'px'}, 'fast');
99 });
84 100 };
85 101
86 102
@@ -7,10 +7,11 b''
7 7 $(document).ready(function () {
8 8
9 9
10 $('div#notebook_app').addClass('ui-widget ui-widget-content')
11 $('div#left_panel').addClass('ui-widget')
12 $('div#left_panel_splitter').addClass('ui-widget ui-widget-content')
13 $('div#notebook_panel').addClass('ui-widget')
10 $('div#notebook_app').addClass('border-box-sizing ui-widget ui-widget-content');
11 $('div#left_panel').addClass('border-box-sizing ui-widget');
12 $('div#left_panel_splitter').addClass('border-box-sizing ui-widget ui-state-default');
13 $('div#notebook_panel').addClass('border-box-sizing ui-widget');
14 $('div#notebook').addClass('border-box-sizing');
14 15
15 16 $('div#left_panel_splitter').click(function () {
16 17 $('div#left_panel').toggle('fast');
@@ -40,12 +41,16 b' $(document).ready(function () {'
40 41 var win = $(window);
41 42 var w = win.width();
42 43 var h = win.height();
43 var app_height = h - 50;
44 $('div#notebook_app').height(app_height);
44 var header_height = $('div#header').outerHeight(true);
45 var app_height = h - header_height - 2;
46 var pager_height = $('div#pager').outerHeight(true);
47 var pager_splitter_height = $('div#pager_splitter').outerHeight(true);
48 $('div#notebook_app').height(app_height + 2);
45 49 $('div#left_panel').height(app_height);
46 50 $('div#left_panel_splitter').height(app_height);
47 51 $('div#notebook_panel').height(app_height);
48 $('div#notebook').height(app_height-211);
52 $('div#notebook').height(app_height-pager_height-pager_splitter_height);
53 console.log('resize: ', app_height);
49 54 };
50 55
51 56 $(window).resize(do_resize);
@@ -10,22 +10,27 b' var IPython = (function (IPython) {'
10 10 var Pager = function (pager_selector, pager_toggle_selector) {
11 11 this.pager_element = $(pager_selector);
12 12 this.pager_toggle_element = $(pager_toggle_selector);
13 this.expanded = true;
13 14 this.style();
14 15 this.bind_events();
15 this.collapse();
16 16 };
17 17
18 18
19 19 Pager.prototype.style = function () {
20 this.pager_toggle_element.addClass('ui-widget ui-widget-content')
21 this.pager_element.addClass('')
20 this.pager_toggle_element.addClass('border-box-sizing ui-widget ui-state-default');
21 this.pager_element.addClass('border-box-sizing ui-widget');
22 22 };
23 23
24 24
25 25 Pager.prototype.bind_events = function () {
26 26 var that = this;
27 this.pager_toggle_element.click(function () {
28 that.pager_element.toggle('fast');
27
28 this.pager_element.bind('collapse_pager', function () {
29 that.pager_element.hide('fast');
30 });
31
32 this.pager_element.bind('expand_pager', function () {
33 that.pager_element.show('fast');
29 34 });
30 35
31 36 this.pager_toggle_element.hover(
@@ -36,16 +41,35 b' var IPython = (function (IPython) {'
36 41 that.pager_toggle_element.removeClass('ui-state-hover');
37 42 }
38 43 );
44
45 this.pager_toggle_element.click(function () {
46 that.toggle();
47 });
39 48 };
40 49
41 50
42 51 Pager.prototype.collapse = function () {
43 this.pager_element.hide('fast');
52 if (this.expanded === true) {
53 this.pager_element.add($('div#notebook')).trigger('collapse_pager');
54 this.expanded = false;
55 };
44 56 };
45 57
46 58
47 59 Pager.prototype.expand = function () {
48 this.pager_element.show('fast');
60 if (this.expanded !== true) {
61 this.pager_element.add($('div#notebook')).trigger('expand_pager');
62 this.expanded = true;
63 };
64 };
65
66
67 Pager.prototype.toggle = function () {
68 if (this.expanded === true) {
69 this.collapse();
70 } else {
71 this.expand();
72 };
49 73 };
50 74
51 75
@@ -32,6 +32,7 b' IPython.utils = (function (IPython) {'
32 32 .replace(/`/g,'&'+'#96;')
33 33 }
34 34
35
35 36 //Map from terminal commands to CSS classes
36 37 attrib = {
37 38 "30":"cblack", "31":"cred",
@@ -63,9 +64,28 b' IPython.utils = (function (IPython) {'
63 64 return txt.trim()
64 65 }
65 66
67
68 grow = function(element) {
69 // Grow the cell by hand. This is used upon reloading from JSON, when the
70 // autogrow handler is not called.
71 var dom = element.get(0);
72 var lines_count = 0;
73 // modified split rule from
74 // http://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/2036424#2036424
75 var lines = dom.value.split(/\r|\r\n|\n/);
76 lines_count = lines.length;
77 if (lines_count >= 1) {
78 dom.rows = lines_count;
79 } else {
80 dom.rows = 1;
81 }
82 };
83
84
66 85 return {
67 86 uuid : uuid,
68 fixConsole : fixConsole
87 fixConsole : fixConsole,
88 grow : grow
69 89 }
70 90
71 91 }(IPython));
@@ -6,9 +6,9 b''
6 6
7 7 <title>IPython Notebook</title>
8 8
9 <!-- <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" /> -->
9 <link rel="stylesheet" href="static/jquery/css/themes/aristo/jquery-wijmo.css" type="text/css" />
10 10 <!-- <link rel="stylesheet" href="static/jquery/css/themes/rocket/jquery-wijmo.css" type="text/css" /> -->
11 <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />
11 <!-- <link rel="stylesheet" href="static/jquery/css/themes/smoothness/jquery-ui-1.8.14.custom.css" type="text/css" />-->
12 12
13 13 <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" charset="utf-8"></script>
14 14 <!-- <script type='text/javascript' src='static/mathjax/MathJax.js?config=TeX-AMS_HTML' charset='utf-8'></script> -->
General Comments 0
You need to be logged in to leave comments. Login now