##// END OF EJS Templates
recompute dummy size dynamically + styling in css
Bussonnier Matthias -
Show More
@@ -0,0 +1,13 b''
1 .terminal {
2 float: left;
3 border: black solid 5px;
4 font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;
5 font-size: 11px;
6 color: white;
7 background: black;
8 }
9
10 .terminal-cursor {
11 color: black;
12 background: white;
13 }
@@ -26,4 +26,4 b''
26 // notebook
26 // notebook
27 @import "../notebook/less/style.less";
27 @import "../notebook/less/style.less";
28
28
29
29 @import "../notebook/less/terminal.less";
@@ -10483,4 +10483,16 b' span#autosave_status {'
10483 -ms-transform: rotate(45deg);
10483 -ms-transform: rotate(45deg);
10484 -o-transform: rotate(45deg);
10484 -o-transform: rotate(45deg);
10485 }
10485 }
10486 .terminal {
10487 float: left;
10488 border: black solid 5px;
10489 font-family: "DejaVu Sans Mono", "Liberation Mono", monospace;
10490 font-size: 11px;
10491 color: white;
10492 background: black;
10493 }
10494 .terminal-cursor {
10495 color: black;
10496 background: white;
10497 }
10486 /*# sourceMappingURL=../style/style.min.css.map */ No newline at end of file
10498 /*# sourceMappingURL=../style/style.min.css.map */
@@ -17,9 +17,8 b' require(['
17 ){
17 ){
18 page = new page.Page();
18 page = new page.Page();
19 // Test size: 25x80
19 // Test size: 25x80
20 var termRowHeight = 1.00 * $("#dummy-screen")[0].offsetHeight / 25;
20 var termRowHeight = function(){ return 1.00 * $("#dummy-screen")[0].offsetHeight / 25;};
21 var termColWidth = 1.02 * $("#dummy-screen-rows")[0].offsetWidth / 80;
21 var termColWidth = function() { return 1.02 * $("#dummy-screen-rows")[0].offsetWidth / 80;};
22 $("#dummy-screen").hide();
23
22
24 var base_url = utils.get_body_data('baseUrl');
23 var base_url = utils.get_body_data('baseUrl');
25 var ws_path = utils.get_body_data('wsPath');
24 var ws_path = utils.get_body_data('wsPath');
@@ -30,10 +29,9 b' require(['
30 function calculate_size() {
29 function calculate_size() {
31 height = window.innerHeight - header.offsetHeight;
30 height = window.innerHeight - header.offsetHeight;
32 width = window.innerWidth;
31 width = window.innerWidth;
33 var rows = Math.min(1000, Math.max(20, Math.floor(height/termRowHeight)-1));
32 var rows = Math.min(1000, Math.max(20, Math.floor(height/termRowHeight())-1));
34 var cols = Math.min(1000, Math.max(40, Math.floor(width/termColWidth)-1));
33 var cols = Math.min(1000, Math.max(40, Math.floor(width/termColWidth())-1));
35 console.log("resize:", termRowHeight, termColWidth, height, width,
34 console.log("resize to :", rows , 'rows by ', cols, 'columns');
36 rows, cols);
37 return {rows: rows, cols: cols};
35 return {rows: rows, cols: cols};
38 }
36 }
39
37
@@ -5,7 +5,7 b' define ([], function() {'
5 cols: size.cols,
5 cols: size.cols,
6 rows: size.rows,
6 rows: size.rows,
7 screenKeys: true,
7 screenKeys: true,
8 useStyle: true
8 useStyle: false
9 });
9 });
10 ws.onopen = function(event) {
10 ws.onopen = function(event) {
11 ws.send(JSON.stringify(["set_size", size.rows, size.cols,
11 ws.send(JSON.stringify(["set_size", size.rows, size.cols,
@@ -27,7 +27,8 b' data-ws-path="{{ws_path}}"'
27 its size in JS in setting up the page. It is still invisible. Putting in
27 its size in JS in setting up the page. It is still invisible. Putting in
28 the script block gets it outside the initially undisplayed region. -->
28 the script block gets it outside the initially undisplayed region. -->
29 <!-- test size: 25x80 -->
29 <!-- test size: 25x80 -->
30 <pre id="dummy-screen" style="visibility:hidden; border: white solid 5px; font-family: &quot;DejaVu Sans Mono&quot;, &quot;Liberation Mono&quot;, monospace; font-size: 11px;">0
30 <div style='position:absolute; left:-1000em'>
31 <pre id="dummy-screen" style="" class='terminal' style'border: solid 5px white'>0
31 1
32 1
32 2
33 2
33 3
34 3
@@ -51,8 +52,9 b' data-ws-path="{{ws_path}}"'
51 1
52 1
52 2
53 2
53 3
54 3
54 <span id="dummy-screen-rows" style="visibility:hidden;">01234567890123456789012345678901234567890123456789012345678901234567890123456789</span>
55 <span id="dummy-screen-rows" style="">01234567890123456789012345678901234567890123456789012345678901234567890123456789</span>
55 </pre>
56 </pre>
57 </div>
56
58
57 {{super()}}
59 {{super()}}
58
60
General Comments 0
You need to be logged in to leave comments. Login now