##// 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 26 // notebook
27 27 @import "../notebook/less/style.less";
28 28
29
29 @import "../notebook/less/terminal.less";
@@ -10483,4 +10483,16 b' span#autosave_status {'
10483 10483 -ms-transform: rotate(45deg);
10484 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 10498 /*# sourceMappingURL=../style/style.min.css.map */ No newline at end of file
@@ -17,9 +17,8 b' require(['
17 17 ){
18 18 page = new page.Page();
19 19 // Test size: 25x80
20 var termRowHeight = 1.00 * $("#dummy-screen")[0].offsetHeight / 25;
21 var termColWidth = 1.02 * $("#dummy-screen-rows")[0].offsetWidth / 80;
22 $("#dummy-screen").hide();
20 var termRowHeight = function(){ return 1.00 * $("#dummy-screen")[0].offsetHeight / 25;};
21 var termColWidth = function() { return 1.02 * $("#dummy-screen-rows")[0].offsetWidth / 80;};
23 22
24 23 var base_url = utils.get_body_data('baseUrl');
25 24 var ws_path = utils.get_body_data('wsPath');
@@ -30,10 +29,9 b' require(['
30 29 function calculate_size() {
31 30 height = window.innerHeight - header.offsetHeight;
32 31 width = window.innerWidth;
33 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));
35 console.log("resize:", termRowHeight, termColWidth, height, width,
36 rows, cols);
32 var rows = Math.min(1000, Math.max(20, Math.floor(height/termRowHeight())-1));
33 var cols = Math.min(1000, Math.max(40, Math.floor(width/termColWidth())-1));
34 console.log("resize to :", rows , 'rows by ', cols, 'columns');
37 35 return {rows: rows, cols: cols};
38 36 }
39 37
@@ -5,7 +5,7 b' define ([], function() {'
5 5 cols: size.cols,
6 6 rows: size.rows,
7 7 screenKeys: true,
8 useStyle: true
8 useStyle: false
9 9 });
10 10 ws.onopen = function(event) {
11 11 ws.send(JSON.stringify(["set_size", size.rows, size.cols,
@@ -27,7 +27,8 b' data-ws-path="{{ws_path}}"'
27 27 its size in JS in setting up the page. It is still invisible. Putting in
28 28 the script block gets it outside the initially undisplayed region. -->
29 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 32 1
32 33 2
33 34 3
@@ -51,8 +52,9 b' data-ws-path="{{ws_path}}"'
51 52 1
52 53 2
53 54 3
54 <span id="dummy-screen-rows" style="visibility:hidden;">01234567890123456789012345678901234567890123456789012345678901234567890123456789</span>
55 <span id="dummy-screen-rows" style="">01234567890123456789012345678901234567890123456789012345678901234567890123456789</span>
55 56 </pre>
57 </div>
56 58
57 59 {{super()}}
58 60
General Comments 0
You need to be logged in to leave comments. Login now