|
5 | 5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
6 | 6 | <title>Shell testbed</title>
|
7 | 7 |
|
8 |
| - <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'> |
| 8 | + <link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400normal,600normal' rel='stylesheet' type='text/css'> |
9 | 9 | <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
|
10 | 10 | <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
|
11 | 11 | <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
|
|
32 | 32 | z-index: 1000;
|
33 | 33 | font-family: 'Source Code Pro', sans-serif;
|
34 | 34 | font-size: 0.9em;
|
35 |
| - overflow:scroll; |
36 |
| - overflow-x:hidden; |
| 35 | + overflow: scroll; |
| 36 | + overflow-x: hidden; |
37 | 37 | overflow-y: scroll;
|
38 |
| - }</style> |
| 38 | + } |
| 39 | + |
| 40 | + .shell-unit { |
| 41 | + position: absolute; |
| 42 | + float: left; |
| 43 | + white-space: pre; |
| 44 | + visibility: hidden; |
| 45 | + font-family: 'Source Code Pro' !important; |
| 46 | + font-style: normal; |
| 47 | + font-weight: 400; |
| 48 | + height: auto; |
| 49 | + width: auto; |
| 50 | + } |
| 51 | + .shell-line { |
| 52 | + white-space: pre; |
| 53 | + } |
| 54 | + .shell-regular { |
| 55 | + font-family: 'Source Code Pro' !important; |
| 56 | + font-style: normal; |
| 57 | + font-weight: 400; |
| 58 | + } |
| 59 | + |
| 60 | + .shell-italic { |
| 61 | + font-family: 'Source Code Pro' !important; |
| 62 | + font-style: italic; |
| 63 | + font-weight: 400; |
| 64 | + } |
| 65 | + |
| 66 | + .shell-bold { |
| 67 | + font-family: 'Source Code Pro' !important; |
| 68 | + font-style: normal; |
| 69 | + font-weight: 600; |
| 70 | + } |
| 71 | + |
| 72 | + .shell-bold-italic { |
| 73 | + font-family: 'Source Code Pro' !important; |
| 74 | + font-style: italic; |
| 75 | + font-weight: 600; |
| 76 | + } |
| 77 | + </style> |
| 78 | + <script> |
| 79 | + TermInfo = {}; |
| 80 | + $(document).ready(function() { |
| 81 | + var unit = $('<div>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</div>') |
| 82 | + .addClass("shell-unit") |
| 83 | + .appendTo($('body')); |
| 84 | + var terminal = $("#terminal"); |
| 85 | + TermInfo.Unit = { w: unit.width()/50, h: unit.height()}; |
| 86 | + TermInfo.Size = { w: terminal.width(), h: terminal.height()}; |
| 87 | + TermInfo.Rows = TermInfo.Size.h / TermInfo.Unit.h; |
| 88 | + TermInfo.Cols = TermInfo.Size.w / TermInfo.Unit.w; |
| 89 | + draw(terminal,20,TermInfo.Cols); |
| 90 | + TermInfo.Size = { w: terminal.width(), h: terminal.height()}; |
| 91 | + TermInfo.Rows = TermInfo.Size.h / TermInfo.Unit.h; |
| 92 | + TermInfo.Cols = TermInfo.Size.w / TermInfo.Unit.w; |
| 93 | + $("#terminfo").text("(" + TermInfo.Rows + "," + TermInfo.Cols + ")"); |
| 94 | + }); |
| 95 | + |
| 96 | + function draw(div,rows,cols) { |
| 97 | + rows = rows -2; |
| 98 | + cols = cols -2; |
| 99 | + var border = "+"; |
| 100 | + for(var i=0;i<cols;i++) { |
| 101 | + border += "-"; |
| 102 | + } |
| 103 | + border += "+"; |
| 104 | + var line = "|"; |
| 105 | + for(var j=0;j<cols;j++) { |
| 106 | + line += " "; |
| 107 | + } |
| 108 | + line += "|"; |
| 109 | + div.append($('<div>'+border+'</div>').addClass("shell-line")); |
| 110 | + for(var i=0;i<rows;i++) { |
| 111 | + div.append($('<div>'+line+'</div>').addClass("shell-line")); |
| 112 | + } |
| 113 | + div.append($('<div>'+border+'</div>').addClass("shell-line")); |
| 114 | + } |
| 115 | + |
| 116 | + </script> |
39 | 117 | </head>
|
40 | 118 | <body>
|
41 | 119 | <div id="shell-panel">
|
|
44 | 122 | <div>
|
45 | 123 | <p>Press <strong>~</strong> to activate console.</p>
|
46 | 124 | </div>
|
47 |
| - |
| 125 | +<div class="shell-regular">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 ?/;:'"[{]}\|-_=+!@#$%^&*()`~,<.></div> |
| 126 | +<div class="shell-italic">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 ?/;:'"[{]}\|-_=+!@#$%^&*()`~,<.></div> |
| 127 | +<div class="shell-bold">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 ?/;:'"[{]}\|-_=+!@#$%^&*()`~,<.></div> |
| 128 | +<div class="shell-bold-italic">abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 ?/;:'"[{]}\|-_=+!@#$%^&*()`~,<.></div> |
| 129 | +<div id="terminal" class="shell-regular" style="margin: 0; padding: 0;"> |
| 130 | +</div> |
| 131 | +<div id="terminfo"></div> |
48 | 132 | </body>
|
| 133 | +<div class="shell-regular" style="margin: 0; padding: 0;">XXX</div> |
| 134 | +<div class="shell-regular" style="margin: 0; padding: 0;">XXX</div> |
| 135 | +<div class="shell-regular" style="margin: 0; padding: 0;">XXX</div> |
49 | 136 | </html>
|
0 commit comments