Skip to content
Permalink
v3.4.1
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
43 lines (40 sloc) 1.35 KB
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WebTextTerminal Demo</title>
<link rel="stylesheet" href="textterm/textterm.css">
<link rel="stylesheet" href="web-demo.css">
</head>
<body>
<h1>WebTextTerminal Demo</h1>
<div id="textterm" class="textterm-pane">
<span class="textterm-pair">
<span class="textterm-prompt"></span>
<span contenteditable="true" class="textterm-input"></span>
</span>
</div>
<h3 id="app-done"> </h3>
<script src="textterm/textterm.js"></script>
<script>
var textTerm = createTextTerm(document.getElementById("textterm"));
textTerm.setLogLevelTrace();
textTerm.onDispose = function(resultData) {
console.log("Calling onDispose in web-demo...");
var message = "You can now close this window.";
if(resultData) {
message = resultData + " " + message;
}
document.getElementById("app-done").textContent = message;
textTerm.terminate();
}
textTerm.onAbort = function() {
console.log("Calling onAbort in web-demo...");
document.getElementById("app-done").textContent = "Program aborted by the user. You can now close this window.";
textTerm.terminate();
}
textTerm.settings.paneBackgroundColor = "#000022";
textTerm.execute("Thanks for using the WebTextTerminal!\n");
</script>
</body>
</html>