-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic ui #133
Open
MichaelKearnsSoftwire
wants to merge
2
commits into
flaxsearch:luwak-server
Choose a base branch
from
MichaelKearnsSoftwire:basic-ui
base: luwak-server
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Basic ui #133
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: java $JAVA_OPTS -Ddw.server.connector.port=$PORT -jar luwak-server/target/luwak-server-1.5.0-SNAPSHOT.jar server luwak-server/heroku.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This configuration is required to be able to allow Heroku to override the port via e.g. | ||
# -Ddw.server.connector.port=$PORT | ||
server: | ||
type: simple | ||
applicationContextPath: / | ||
connector: | ||
type: http | ||
port: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
*{ | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
body { | ||
font-family: "Segoue", sans-serif; | ||
line-height: 1.6em; | ||
color: #666; | ||
background: #e1e1e1 url(../img/creampaper.png); | ||
font-size: 14px; | ||
} | ||
|
||
a{ | ||
color: #333; | ||
text-decoration: none; | ||
} | ||
|
||
#container { | ||
width: 740px; | ||
background: #fff; | ||
margin: auto; | ||
} | ||
|
||
.clearfix { | ||
clear: both; | ||
} | ||
|
||
header { | ||
padding: 30px 30px; | ||
background: #f4f4f4; | ||
} | ||
|
||
header h1 { | ||
color: #000; | ||
margin-bottom: 5px; | ||
} | ||
|
||
header span { | ||
color: #dd2826; | ||
} | ||
|
||
section { | ||
padding: 30px 20px 20px 20px; | ||
} | ||
|
||
footer { | ||
padding: 20px; | ||
background: #f4f4f4; | ||
text-align: center; | ||
} | ||
|
||
#search-form { | ||
display: block; | ||
margin-bottom: 15px; | ||
} | ||
|
||
.fieldcontainer { | ||
display: block; | ||
position: relative; | ||
width: 90%; | ||
margin: 0 auto; | ||
} | ||
|
||
#search-btn:hover{ | ||
filter: alpha(opacity=90); | ||
opacity: 0.9; | ||
} | ||
|
||
#search-btn { | ||
position: absolute; | ||
right: 360px; | ||
top: 5px; | ||
height: 32px; | ||
width: 32px; | ||
cursor: pointer; | ||
border: 0; | ||
zoom: 1; | ||
|
||
filter: alpha(opacity=65); | ||
opacity: 0.65; | ||
background: transparent url(../img/search.png) top left no-repeat; | ||
} | ||
|
||
.search-field { | ||
-moz-box-sizing: border-box; | ||
-webkit-box-sizing: border-box; | ||
box-sizing: border-box; | ||
display: block; | ||
width: 45%; | ||
padding: 11px 7px; | ||
padding-right: 43px; | ||
background: #fff; | ||
color: #ccc; | ||
border: 1px solid #c8c8c8; | ||
font-size: 1.6em; | ||
border-bottom-color:#d2e2e7; | ||
border-radius: 1px; | ||
-moz-border-radius: 1px; | ||
-webkit-border-radius: 1px; | ||
box-shadow: inset 0 1px 2px rgba(0,0,0, 0.1), 0 0 0 6px #f0f0f0; | ||
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0, 0.1), 0 0 0 6px #f0f0f0; | ||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0, 0.1), 0 0 0 6px #f0f0f0; | ||
} | ||
|
||
#results li { | ||
padding: 10px 0; | ||
border-bottom: 1px #ccc dotted; | ||
list-style: none; | ||
overflow: auto; | ||
} | ||
|
||
.list-left { | ||
float: left; | ||
width: 20%; | ||
} | ||
|
||
.list-left img { | ||
width: 100px; | ||
padding: 3px; | ||
} | ||
|
||
.list-right { | ||
float: right; | ||
width: 78%; | ||
} | ||
|
||
.cTitle { | ||
color: #dd2826; | ||
} | ||
|
||
.button-container { | ||
margin-top: 25px; | ||
} | ||
.paging-button { | ||
background: #f4f4f4; | ||
|
||
padding: 8px 13px; | ||
border: #ccc 1px solid; | ||
border-radius: 5px; | ||
color: #ccc; | ||
margin: 10px; | ||
cursor: pointer; | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>LuwakMatch</title> | ||
<link rel="stylesheet" href="/ui/css/style.css"> | ||
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | ||
<script src="/ui/js/script.js"></script> | ||
</head> | ||
<body> | ||
<div id="container"> | ||
<header> | ||
<h1>Luwak<span>Match</span></h1> | ||
<p>Search claims with Luwak</p> | ||
</header> | ||
<section> | ||
<form id="search-form" name="search-form" onsubmit="return search()"> | ||
<div class = "fieldcontainer"> | ||
<input type="search" id="query" class="search-field" placeholder="Search facts..."> | ||
<input type="submit" name="search-btn" id="search-btn" value=""> | ||
</div> | ||
</form> | ||
|
||
<ul id="results"></ul> | ||
<div id="buttons"></div> | ||
</section> | ||
<footer> | ||
<p>Copyright 2017</p> | ||
</footer> | ||
</div> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
$(function() { | ||
var searchField = $('#query'); | ||
var icon = $('#search-btn'); | ||
|
||
// Focus Event Handler | ||
$(searchField).on('focus', function() { | ||
$(this).animate({ | ||
width:'100%' | ||
}, 400); | ||
$(icon).animate({ | ||
right: '10px' | ||
}, 400); | ||
}); | ||
|
||
// Blur Event Handler | ||
// Focus Event Handler | ||
$(searchField).on('blur', function() { | ||
if(searchField.val() == ''){ | ||
$(searchField).animate({ | ||
width:'45%' | ||
}, 400, function() {}) | ||
$(icon).animate({ | ||
right:'360px' | ||
}, 400, function() {}) | ||
|
||
} | ||
}); | ||
|
||
$('#search-form').submit(function(e){ | ||
e.preventDefault(); | ||
}); | ||
}) | ||
|
||
function search() { | ||
// Clear Results | ||
$('#results').html(''); | ||
$('#buttons').html(''); | ||
|
||
// Get Form Input | ||
q = $('#query').val(); | ||
inputDocument = { | ||
"id": "1", | ||
"fields": {"field": q} | ||
}; | ||
|
||
// Run POST Request on API | ||
$.ajax({ | ||
url: "/match", | ||
type: "POST", | ||
data: JSON.stringify(inputDocument), | ||
contentType:"application/json; charset=utf-8", | ||
dataType:"json", | ||
success: function(data) { | ||
console.log("success"); | ||
console.log(data); | ||
if(data.matches.length > 0) { | ||
// display results | ||
$('#results').append(getGood(data.matches[0])); | ||
} else { | ||
$('#results').append(getBad()); | ||
} | ||
}, | ||
failure: function(data) { | ||
console.log("failure"); | ||
} | ||
}); | ||
} | ||
|
||
function getGood(item) { | ||
|
||
var output = '<li>' + | ||
'<div class="list-left">' + | ||
'<img src="ui/img/found.png">' + | ||
'</div>' + | ||
'<div class="list-right">' + | ||
'<h3> Hurrah - we have found a match and its id is ' + item[0] + '</h3>' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Herebelow my proposition for parsing the result array. In order to insert a
|
||
return output; | ||
} | ||
|
||
function getBad() { | ||
|
||
var output = '<li>' + | ||
'<div class="list-left">' + | ||
'<img src="ui/img/not_found.png">' + | ||
'</div>' + | ||
'<div class="list-right">' + | ||
'<h3> Alas - none of our queries match</h3>' | ||
|
||
return output; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The match url sends an array as a result, while data.matches[0] processes only the first item . May I suggest adapting the getGood function so that it handles an array (see my next comment), then calling it with the whole
matches
array as a parameter?$('#results').append(getGood(data.matches));