Set window title by control message

This commit is contained in:
Iwasaki Yudai 2015-08-23 20:40:18 +09:00
parent 67b54b7f20
commit a765d6c660
7 changed files with 106 additions and 55 deletions

View file

@ -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) {

View file

@ -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>