Major improvements. Now with a much better css stylable terminal

This commit is contained in:
Florian Mounier
2014-01-23 09:57:56 +01:00
parent 105cc10843
commit 92408c8f8f
5 changed files with 5052 additions and 61 deletions

View File

@@ -11,7 +11,8 @@ $(function() {
console.log("WebSocket open", arguments);
term = new Terminal({
visualBell: true,
screenKeys: true
screenKeys: true,
scrollback: -1
});
term.on("data", function(data) {
return ws.send('SH|' + data);
@@ -27,7 +28,8 @@ $(function() {
if (term) {
term.destroy();
}
return console.log("WebSocket closed", arguments);
console.log("WebSocket closed", arguments);
return open('', '_self').close();
};
ws.onerror = function() {
return console.log("WebSocket error", arguments);
@@ -40,7 +42,7 @@ $(function() {
$main = $('main');
$termtest = $('<div>').addClass('terminal');
$test = $('<div>').css({
display: 'inline-block'
display: 'inline'
}).text('0123456789');
$termtest.append($test);
$main.append($termtest);
@@ -49,8 +51,8 @@ $(function() {
$termtest.remove();
w = $main.outerWidth();
h = $main.outerHeight();
cols = Math.floor(w / ew);
rows = Math.floor(h / eh);
cols = Math.floor(w / ew) - 1;
rows = Math.floor(h / eh) - 1;
term.resize(cols, rows);
return ws.send("RS|" + cols + "," + rows);
});