Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 9beea3a073
Fetching contributors…

Cannot retrieve contributors at this time

86 lines (75 sloc) 2.58 kB
<html>
<head>
<title>Saw - Log Visualizer</title>
<script src="vendor/hterm/js/pubsub.js"></script>
<script src="vendor/hterm/js/dialogs.js"></script>
<!-- hterm -->
<script src="vendor/hterm/js/hterm.js"></script>
<script src="vendor/hterm/js/scrollport.js"></script>
<script src="vendor/hterm/js/terminal.js"></script>
<script src="vendor/hterm/js/terminal_io.js"></script>
<script src="vendor/hterm/js/options.js"></script>
<script src="vendor/hterm/js/screen.js"></script>
<script src="vendor/hterm/js/text_attributes.js"></script>
<script src="vendor/hterm/js/colors.js"></script>
<script src="vendor/hterm/js/vt.js"></script>
<script src="vendor/hterm/js/keyboard.js"></script>
<script src="vendor/hterm/js/default_keymap.js"></script>
<script src="vendor/hterm/js/preference_manager.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="js/hterm_overrides.js"></script>
<script>
Saw = function(argv) {
this.argv_ = argv;
this.io = null;
this.pid_ = -1;
};
Saw.init = function() {
var terminal = new hterm.Terminal("saw");
terminal.decorate(document.querySelector('#terminal'));
// Looks like there is a race between this and terminal initialization, thus adding timeout.
setTimeout(function() {
terminal.setCursorPosition(0, 0);
terminal.setCursorVisible(true);
terminal.runCommandClass(Saw, document.location.hash.substr(1));
}, 500);
return true;
};
Saw.prototype.run = function() {
var self = this;
this.io = this.argv_.io.push();
this.io.println("Ready!");
if (!window.EventSource) {
this.io.println("Sorry, this browser does not support EventSource. Try Google Chrome instead.");
} else {
var source = new EventSource("stream");
source.addEventListener("message", function(event) {
self.io.println(event.data);
}, false);
}
};
$(function() {
hterm.init(Saw.init);
});
</script>
<style>
body {
position: absolute;
padding: 0;
margin: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
#terminal {
display: block;
position: relative;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="terminal"></div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.