mirror of
https://github.com/yudai/gotty.git
synced 2026-02-13 11:54:21 +01:00
Set window title by control message
This commit is contained in:
parent
67b54b7f20
commit
a765d6c660
7 changed files with 106 additions and 55 deletions
|
|
@ -38,7 +38,15 @@
|
|||
};
|
||||
|
||||
ws.onmessage = function(event) {
|
||||
term.io.writeUTF16(event.data);
|
||||
data = event.data.slice(1);
|
||||
switch(event.data[0]) {
|
||||
case '0':
|
||||
term.io.writeUTF16(data);
|
||||
break;
|
||||
case '1':
|
||||
term.setWindowTitle(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ws.onclose = function(event) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ .Title }}</title>
|
||||
<title>GoTTY</title>
|
||||
<style>body {position: absolute; height: 100%; width: 100%; margin: 0px;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="static/hterm.js"></script>
|
||||
<script src="static/gotty.js"></script>
|
||||
<script src="hterm.js"></script>
|
||||
<script src="gotty.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue