commit b58be469180fd0fd2002b8adbc006461abec7448
parent 99ed01ca84bb4466ad35e6d2264eea842c472084
Author: Sheng <webmaster0115@gmail.com>
Date: Fri, 17 May 2019 21:27:25 +0800
Moved out function resize_terminal
Diffstat:
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js
@@ -66,6 +66,7 @@ jQuery(function($){
}
}
+
function restore_items(names) {
var i, name, value;
@@ -77,9 +78,9 @@ jQuery(function($){
}
}
}
-
restore_items(fields);
+
function parse_xterm_style() {
var text = $('.xterm-helpers style').text();
var arr = text.split('xterm-normal-char{width:');
@@ -94,11 +95,13 @@ jQuery(function($){
style.height = term._core.renderer.dimensions.actualCellHeight;
}
+
function toggle_fullscreen(term) {
var func = term.toggleFullScreen || term.toggleFullscreen;
func.call(term, true);
}
+
function current_geometry(term) {
if (!style.width || !style.height) {
try {
@@ -113,6 +116,11 @@ jQuery(function($){
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) {
return JSON.stringify({'cols': cols, 'rows': rows});
@@ -229,11 +237,6 @@ jQuery(function($){
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) {
if (term) {
term.write(text);