mirror of https://github.com/huashengdun/webssh
Moved out function resize_terminal
parent
99ed01ca84
commit
b58be46918
|
@ -66,6 +66,7 @@ jQuery(function($){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function restore_items(names) {
|
function restore_items(names) {
|
||||||
var i, name, value;
|
var i, name, value;
|
||||||
|
|
||||||
|
@ -77,9 +78,9 @@ jQuery(function($){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
restore_items(fields);
|
restore_items(fields);
|
||||||
|
|
||||||
|
|
||||||
function parse_xterm_style() {
|
function parse_xterm_style() {
|
||||||
var text = $('.xterm-helpers style').text();
|
var text = $('.xterm-helpers style').text();
|
||||||
var arr = text.split('xterm-normal-char{width:');
|
var arr = text.split('xterm-normal-char{width:');
|
||||||
|
@ -94,11 +95,13 @@ jQuery(function($){
|
||||||
style.height = term._core.renderer.dimensions.actualCellHeight;
|
style.height = term._core.renderer.dimensions.actualCellHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function toggle_fullscreen(term) {
|
function toggle_fullscreen(term) {
|
||||||
var func = term.toggleFullScreen || term.toggleFullscreen;
|
var func = term.toggleFullScreen || term.toggleFullscreen;
|
||||||
func.call(term, true);
|
func.call(term, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function current_geometry(term) {
|
function current_geometry(term) {
|
||||||
if (!style.width || !style.height) {
|
if (!style.width || !style.height) {
|
||||||
try {
|
try {
|
||||||
|
@ -113,6 +116,11 @@ jQuery(function($){
|
||||||
return {'cols': cols, 'rows': rows};
|
return {'cols': cols, 'rows': rows};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resize_terminal(term) {
|
||||||
|
var geometry = current_geometry(term);
|
||||||
|
term.on_resize(geometry.cols, geometry.rows);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function format_geometry(cols, rows) {
|
function format_geometry(cols, rows) {
|
||||||
return JSON.stringify({'cols': cols, 'rows': rows});
|
return JSON.stringify({'cols': cols, 'rows': rows});
|
||||||
|
@ -229,11 +237,6 @@ jQuery(function($){
|
||||||
console.log('The deault encoding of your server is ' + msg.encoding);
|
console.log('The deault encoding of your server is ' + msg.encoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
function resize_terminal(term) {
|
|
||||||
var geometry = current_geometry(term);
|
|
||||||
term.on_resize(geometry.cols, geometry.rows);
|
|
||||||
}
|
|
||||||
|
|
||||||
function term_write(text) {
|
function term_write(text) {
|
||||||
if (term) {
|
if (term) {
|
||||||
term.write(text);
|
term.write(text);
|
||||||
|
|
Loading…
Reference in New Issue