web-terminal-addon
Version:
web-terminal for easy express integration
34 lines • 793 B
HTML
<html>
<head>
<title>node-web-repl</title>
<script src="jquery.min.js"></script>
<script src="jquery.terminal.min.js"></script>
<script src="unix_formatting.js"></script>
<link href="jquery.terminal.min.css" rel="stylesheet"/>
<link href="index.css" rel="stylesheet"/>
<script>
$(document).ready(function() {
// unix formatting always on
$.terminal.defaults.formatters[0].__meta__ = true;
let term = $('body').terminal(function(code){
var self = this;
$.ajax({
url: "api/"+encodeURIComponent(code),
dataType: 'text'
}).fail(function(err){
self.echo("\n --- offline --- \n");
}).done(function(data) {
self.echo(data);
});
}, {
greetings:'',
prompt: 'js> ',
unixFormattingEscapeBrackets: true
});
});
</script>
</head>
<body>
</body>
</html>