-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathptty.html
More file actions
73 lines (66 loc) · 1.92 KB
/
ptty.html
File metadata and controls
73 lines (66 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ptty terminal emulator example</title>
<style type="text/css">
html,body {height:100%;width:100%;margin:0;padding:0;}
.flex-container {
padding: 0;
margin: 0;
list-style: none;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
justify-content: space-around;
}
.flex-item {
background: tomato;
padding: 5px;
width: 200px;
height: 150px;
margin-top: 10px;
line-height: 150px;
color: white;
font-weight: bold;
font-size: 3em;
text-align: center;
}
</style>
</head>
<body>
<div id="terminal" ></div>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<link href="http://cdnjs.cloudflare.com/ajax/libs/simplelightbox/1.17.2/simplelightbox.css" rel="stylesheet"/>
<script src="http://cdnjs.cloudflare.com/ajax/libs/simplelightbox/1.17.2/simple-lightbox.js"></script>
<script src="ptty.jquery.js"></script>
<script>
var $ptty = null;
$(document).ready(function(){
// Start ptty
$ptty = $('#terminal').Ptty(
);
// Register a command.
$ptty.register('command', {
name : 'hello',
method : function(cmd){
cmd.out = '<h1>Hello World!</h1>';
return cmd;
},
help : 'A demo command.'
});
});
function addtext(txt) {
$ptty.echo(txt,true);
//console.log($ptty);
}
function setPrompt(txt) {
//console.log($ptty);
$ptty.change_settings({ ps:txt} );
}
</script>
</body>
</html>