reader.onload = (function(file) {
return function(e) {
var offset = 0;
+ var output = document.getElementById('output');
+ output.innerHTML = '';
while (offset < e.target.result.byteLength) {
- var atom = new Atom(e.target.result, offset);
+ var atom = Atom.create(e.target.result, offset);
if (!atom)
break;
atoms.push(atom);
+ output.appendChild(atom.toDOMNode());
offset += atom.size;
}
};
document.getElementById('file').addEventListener('change', onFileSelect, false);
}
</script>
+ <style>
+ dl { border: 1px solid black; }
+ dt, dd { display: inline; }
+ dt:after { content:": " }
+ dd:after { content:"\A"; white-space:pre; }
+ dd ol { display: inline-block; margin: 0; vertical-align: top }
+
+ /* make the output display as a table */
+ dl { display: table; }
+ dl div { display: table-row; }
+ dt, dd { display: table-cell; }
+ </style>
</head>
<body id="atomtester" onload="setup()">
<input type="file" id="file" name="file" />
+ <div id=output>
</body>
\ No newline at end of file