35 lines
801 B
HTML
35 lines
801 B
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>ElmHub</title>
|
|
<script type="text/javascript" src="github.js"></script>
|
|
<script type="text/javascript" src="elm.js"></script>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="elm-landing-pad"></div>
|
|
</body>
|
|
|
|
<script type="text/javascript">
|
|
var github = new Github();
|
|
var app = Elm.embed(
|
|
Elm.Main,
|
|
document.getElementById("elm-landing-pad"),
|
|
{githubResponse: []});
|
|
|
|
app.ports.githubSearch.subscribe(function(query) {
|
|
console.log("Searching for", query);
|
|
var search = github.getSearch(query);
|
|
|
|
search.repositories({}, function (err, repositories) {
|
|
console.log("Got response", repositories);
|
|
app.ports.githubResponse.send(repositories);
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</html>
|