1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-03 16:44:12 +02:00
This commit is contained in:
Robin Appelman 2015-03-02 23:02:56 +01:00
commit 869cec2c88
8 changed files with 0 additions and 1099390 deletions

2868
browser.js

File diff suppressed because it is too large Load diff

View file

@ -1,34 +0,0 @@
var Demo = require('./demo');
document.addEventListener("DOMContentLoaded", function (event) {
console.log('as');
var input = document.getElementById('fileinput');
input.onchange = handleFileSelect;
});
function handleFileSelect(evt) {
var files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function (theFile) {
return function (buffer) {
console.log(buffer.target.result);
var demo = new Demo(buffer.target.result);
var parser = demo.getParser();
var head = parser.readHeader();
var state = parser.parseBody();
document.getElementById('head').value = JSON.stringify(head, null, 2);
document.getElementById('out').value = JSON.stringify(state, null, 2);
};
})(f);
// Read in the image file as a data URL.
console.log(f);
reader.readAsArrayBuffer(f);
}
}

BIN
gully.dem

Binary file not shown.

View file

@ -1,28 +0,0 @@
<html>
<head>
<script src="browser.js"></script>
<style>
textarea {
width: 100%;
height: 200px;
}
#out {
height: 500px;
}
</style>
</head>
<body>
<input type="file" id="fileinput" />
<p>Demo header</p>
<textarea id="head">
</textarea>
<p>Demo summary</p>
<textarea id="out">
</textarea>
</body>
</html>

1080895
parsed.txt

File diff suppressed because it is too large Load diff

Binary file not shown.

15553
strings.txt

File diff suppressed because it is too large Load diff

12
test.js
View file

@ -1,12 +0,0 @@
var Demo = require('./demo');
var fs = require('fs');
fs.readFile("bin/54cbce7f7479dmatch-20150130-1912-cp_process_final.dem", function (err, data) {
if (err) throw err;
var demo = Demo.fromNodeBuffer(data);
var parser = demo.getParser();
var head = parser.readHeader();
//console.log(head);
var body = parser.parseBody();
//console.log(body);
});