Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
e1b0ed39
Commit
e1b0ed39
authored
Apr 08, 2017
by
Jacob Schatz
Committed by
Luke "Jared" Bennett
Apr 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show thumbnails and their titles.
parent
ef07200c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
app/assets/javascripts/blob/balsamiq/index.js
app/assets/javascripts/blob/balsamiq/index.js
+18
-4
No files found.
app/assets/javascripts/blob/balsamiq/index.js
View file @
e1b0ed39
...
@@ -8,19 +8,33 @@ export default class BalsamiqViewer {
...
@@ -8,19 +8,33 @@ export default class BalsamiqViewer {
}
}
loadSqlFile
()
{
loadSqlFile
()
{
var
xhr
=
new
XMLHttpRequest
();
var
xhr
=
new
XMLHttpRequest
();
console
.
log
(
this
.
el
)
var
self
=
this
;
xhr
.
open
(
'
GET
'
,
this
.
el
.
dataset
.
endpoint
,
true
);
xhr
.
open
(
'
GET
'
,
this
.
el
.
dataset
.
endpoint
,
true
);
xhr
.
responseType
=
'
arraybuffer
'
;
xhr
.
responseType
=
'
arraybuffer
'
;
xhr
.
onload
=
function
(
e
)
{
xhr
.
onload
=
function
(
e
)
{
var
list
=
document
.
createElement
(
'
ul
'
);
var
uInt8Array
=
new
Uint8Array
(
this
.
response
);
var
uInt8Array
=
new
Uint8Array
(
this
.
response
);
var
db
=
new
SQL
.
Database
(
uInt8Array
);
var
db
=
new
SQL
.
Database
(
uInt8Array
);
var
contents
=
db
.
exec
(
"
SELECT * FROM thumbnails
"
);
var
contents
=
db
.
exec
(
"
SELECT * FROM thumbnails
"
);
console
.
log
(
contents
)
var
previews
=
contents
[
0
].
values
.
map
((
i
)
=>
{
return
JSON
.
parse
(
i
[
1
])});
// contents is now [{columns:['col1','col2',...], values:[[first row], [second row], ...]}]
previews
.
forEach
((
prev
)
=>
{
var
li
=
document
.
createElement
(
'
li
'
);
var
title
=
db
.
exec
(
`select * from resources where id = '
${
prev
.
resourceID
}
'`
)
var
template
=
`<div class="panel panel-default">
<div class="panel-heading">
${
JSON
.
parse
(
title
[
0
].
values
[
0
][
2
]).
name
}
</div>
<div class="panel-body">
<img class="img-thumbnail" src="data:image/png;base64,
${
prev
.
image
}
"/>
</div>
</div>`
;
li
.
innerHTML
=
template
;
list
.
appendChild
(
li
);
});
list
.
classList
+=
'
list-inline
'
;
self
.
el
.
appendChild
(
list
);
};
};
xhr
.
send
();
xhr
.
send
();
}
}
...
...
Write
Preview
Markdown
is supported
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