Skip to content

Commit

Permalink
Added ids of found maps in web app.
Browse files Browse the repository at this point in the history
  • Loading branch information
dudaerich committed Jul 31, 2015
1 parent 6c5c067 commit 7a0e8a3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
4 changes: 4 additions & 0 deletions web/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ h1 {
text-align: center;
margin: 5px;
}
#result #search-identical-result div {
display: inline-block;
text-align: center;
}
#url-form {
text-align: center;
margin: 10px;
Expand Down
24 changes: 15 additions & 9 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,19 @@
if (response.data.found) {
var heading = document.createElement('h3');
heading.innerHTML = 'Identical image was found.';
var a = document.createElement('a');
a.href = 'http://staremapy.georeferencer.cz/map/' + response.data.record.id;
a.target = '_blank';
var imageWrapper = document.createElement('div');
var image = document.createElement('img');
image.width = 400;
image.src = response.data.record.thumbnail;
a.appendChild(image);
var a = document.createElement('a');
a.href = 'http://staremapy.georeferencer.cz/map/' + response.data.record.id;
a.target = '_blank';
a.innerHTML = response.data.record.id;
imageWrapper.appendChild(image);
imageWrapper.appendChild(document.createElement('br'));
imageWrapper.appendChild(a);
div.appendChild(heading);
div.appendChild(a);
div.appendChild(imageWrapper);
} else {
var heading = document.createElement('h3');
heading.innerHTML = 'Identical image was not found.';
Expand All @@ -156,15 +160,17 @@
for (var i = 0; i < response.data.length; i++) {
var object = response.data[i];
var imageWrapper = document.createElement('div');
var a = document.createElement('a');
a.href = 'http://staremapy.georeferencer.cz/map/' + object.record.id;
a.target = '_blank';
var image = document.createElement('img');
image.width = 400;
image.src = object.record.thumbnail;
var a = document.createElement('a');
a.href = 'http://staremapy.georeferencer.cz/map/' + object.record.id;
a.target = '_blank';
a.innerHTML = object.record.id;
var distance = document.createElement('span');
distance.innerHTML = object.distance;
a.appendChild(image);
imageWrapper.appendChild(image);
imageWrapper.appendChild(document.createElement('br'));
imageWrapper.appendChild(a);
imageWrapper.appendChild(document.createElement('br'));
imageWrapper.appendChild(distance);
Expand Down

0 comments on commit 7a0e8a3

Please sign in to comment.