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

modular cmap parser

parent e4d0ff56
This diff is collapsed.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<script src="bionano_parser.js"></script> <script src="bionano_parser.js"></script>
<script src="index.js"></script> <script src="index.js"></script>
<style> <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.hover { border: 10px dashed #0c0; }
#holder img { display: block; margin: 10px auto; } #holder img { display: block; margin: 10px auto; }
#holder p { margin: 10px; font-size: 14px; } #holder p { margin: 10px; font-size: 14px; }
...@@ -13,7 +13,7 @@ progress:after { content: '%'; } ...@@ -13,7 +13,7 @@ progress:after { content: '%'; }
.hidden { display: none !important;} .hidden { display: none !important;}
</style> </style>
<title>HTML5 Demo: Drag and drop, automatic upload</title> <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> </head>
<body> <body>
<div id="holder"></div> <div id="holder"></div>
......
...@@ -9,8 +9,8 @@ var dndSupported = function () { ...@@ -9,8 +9,8 @@ var dndSupported = function () {
}; };
function create_file(filename, text) { function create_file(filename, ext, text) {
var file = new File([text], filename, {type: "text/plain", lastModified: Date()}); var file = new File([text], filename +'.'+ext, {type: "text/plain", lastModified: Date()});
var fr = new FileReader(); var fr = new FileReader();
...@@ -18,11 +18,21 @@ function create_file(filename, text) { ...@@ -18,11 +18,21 @@ function create_file(filename, text) {
console.log(file.name ); console.log(file.name );
console.log(file.type ); console.log(file.type );
console.log(file.lastModifiedDate); 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.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") ); //document.body.appendChild( document.createElement("br") );
var span = document.createElement("span");
document.body.appendChild( span ); var span = document.getElementById(filename);
span.innerHTML = "<br><a href="+URL.createObjectURL(file)+" download=" + file.name + ">Download " + file.name + "</a>";
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 += " <a href="+URL.createObjectURL(file)+" download=" + file.name + ">" + ext + "</a>";
} }
fr.readAsText(file); 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