Commit 1084be47 authored by liuzheng712's avatar liuzheng712

update

parent 44b2bcb7
...@@ -102,10 +102,9 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) { ...@@ -102,10 +102,9 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) {
timer = setInterval(advance, TICK); timer = setInterval(advance, TICK);
}; };
var rc = textSize();
var term = new Terminal({ var term = new Terminal({
rows: rc.y, rows: 80,
cols: rc.x, cols: 24,
useStyle: true, useStyle: true,
screenKeys: true screenKeys: true
}); });
...@@ -122,36 +121,3 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) { ...@@ -122,36 +121,3 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) {
}) })
}) })
\ No newline at end of file
function textSize() {
var charSize = getCharSize();
var windowSize = getwindowSize();
var size = {
x: Math.floor(windowSize.width / charSize.width)
, y: Math.floor(windowSize.height / charSize.height)
};
if (size.x > 150)size.x = 150;
if (size.y > 35)size.y = 35;
size.x = 140;
size.y = 30;
return size;
}
function getCharSize() {
var $span = $("<span>", {text: "qwertyuiopasdfghjklzxcvbnm"});
$('body').append($span);
var size = {
width: $span.outerWidth() / 30
, height: $span.outerHeight() * 1.1
};
$span.remove();
return size;
}
function getwindowSize() {
var e = window,
a = 'inner';
if (!('innerWidth' in window )) {
a = 'client';
e = document.documentElement || document.body;
}
return {width: e[a + 'Width'] - 300, height: e[a + 'Height'] - 120};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment