Commit 6438e800 authored by sauloal's avatar sauloal
Browse files

modular cmap parser

parent e4d0ff56
This diff is collapsed.
......@@ -3,7 +3,7 @@
<script src="bionano_parser.js"></script>
<script src="index.js"></script>
<style>
#holder { border: 10px dashed #ccc; width: 300px; min-height: 300px; margin: 20px auto;}
#holder { border: 10px dashed #ccc; width: 300px; min-height: 100px; margin: 20px auto;}
#holder.hover { border: 10px dashed #0c0; }
#holder img { display: block; margin: 10px auto; }
#holder p { margin: 10px; font-size: 14px; }
......@@ -13,7 +13,7 @@ progress:after { content: '%'; }
.hidden { display: none !important;}
</style>
<title>HTML5 Demo: Drag and drop, automatic upload</title>
<h1>Drag and drop, automatic upload</h1>
<h1>Drag and drop Xmap, (R/Q)_Cmap and knicked_key.txt </h1>
</head>
<body>
<div id="holder"></div>
......
......@@ -9,8 +9,8 @@ var dndSupported = function () {
};
function create_file(filename, text) {
var file = new File([text], filename, {type: "text/plain", lastModified: Date()});
function create_file(filename, ext, text) {
var file = new File([text], filename +'.'+ext, {type: "text/plain", lastModified: Date()});
var fr = new FileReader();
......@@ -20,9 +20,19 @@ function create_file(filename, text) {
console.log(file.lastModifiedDate);
//document.body.innerHTML = evt.target.result + "<br><a href="+URL.createObjectURL(file)+" download=" + file.name + ">Download " + file.name + "</a><br>type: "+file.type+"<br>last modified: "+ file.lastModifiedDate
//document.body.appendChild( document.createElement("br") );
var span = document.createElement("span");
var span = document.getElementById(filename);
if (! span) {
var br = document.createElement("br");
span = document.createElement("span");
span.id = filename;
span.innerHTML += filename + " : ";
document.body.appendChild( br );
document.body.appendChild( span );
span.innerHTML = "<br><a href="+URL.createObjectURL(file)+" download=" + file.name + ">Download " + file.name + "</a>";
}
span.innerHTML += " <a href="+URL.createObjectURL(file)+" download=" + file.name + ">" + ext + "</a>";
}
fr.readAsText(file);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment