Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 10d14fa

Browse filesBrowse files
committed
wip towards rows,cols in shell UI
1 parent 5342e83 commit 10d14fa
Copy full SHA for 10d14fa

File tree

Expand file treeCollapse file tree

1 file changed

+92
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+92
-5
lines changed

‎index.html

Copy file name to clipboardExpand all lines: index.html
+92-5Lines changed: 92 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
66
<title>Shell testbed</title>
77

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'>
99
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
1010
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
1111
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
@@ -32,10 +32,88 @@
3232
z-index: 1000;
3333
font-family: 'Source Code Pro', sans-serif;
3434
font-size: 0.9em;
35-
overflow:scroll;
36-
overflow-x:hidden;
35+
overflow: scroll;
36+
overflow-x: hidden;
3737
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>
39117
</head>
40118
<body>
41119
<div id="shell-panel">
@@ -44,6 +122,15 @@
44122
<div>
45123
<p>Press <strong>~</strong> to activate console.</p>
46124
</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>
48132
</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>
49136
</html>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.