Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aflitos, Saulo Alves
bionanoconverter
Commits
6438e800
Commit
6438e800
authored
Apr 20, 2016
by
sauloal
Browse files
modular cmap parser
parent
e4d0ff56
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
public/converter/bionano_parser.js
View file @
6438e800
This diff is collapsed.
Click to expand it.
public/converter/index.html
View file @
6438e800
...
...
@@ -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
:
3
00px
;
margin
:
20px
auto
;}
#holder
{
border
:
10px
dashed
#ccc
;
width
:
300px
;
min-height
:
1
00px
;
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>
...
...
public/converter/index.js
View file @
6438e800
...
...
@@ -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
();
...
...
@@ -18,11 +18,21 @@ function create_file(filename, text) {
console
.
log
(
file
.
name
);
console
.
log
(
file
.
type
);
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
"
);
document
.
body
.
appendChild
(
span
);
span
.
innerHTML
=
"
<br><a href=
"
+
URL
.
createObjectURL
(
file
)
+
"
download=
"
+
file
.
name
+
"
>Download
"
+
file
.
name
+
"
</a>
"
;
//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
.
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
+=
"
<a href=
"
+
URL
.
createObjectURL
(
file
)
+
"
download=
"
+
file
.
name
+
"
>
"
+
ext
+
"
</a>
"
;
}
fr
.
readAsText
(
file
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment