Skip to content

Commit

Permalink
Merge branch 'master' of github.com:edsu/hathitime
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Sep 12, 2012
2 parents 2fb97b9 + 250014a commit 0b0e0cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions index.html
Expand Up @@ -22,11 +22,14 @@

<section id="summary">
Type a word or phrase into the box, and see how much it shows up
in the HathiTrust Research Center Solr instance by year.
in texts indexed by the HathiTrust Research Center Solr instance
by year. The code is all sitting in your browser, so view the
<a href="js/hathitime.js">JavaScript</a> and HTML
if you want to see what's going on.
</section>

<section id="search">
<form onsumbit="return false;">
<form onsubmit="return false;">
<input size="16" name="q" type="text">
<input type="submit" value="search"></input>
</form>
Expand Down
8 changes: 5 additions & 3 deletions js/hathitime.js
Expand Up @@ -12,9 +12,11 @@ function search() {

function printResults(response) {
var template = $("#result-template").html();
for (var i=0; i < response.facet_counts.facet_fields.publishDate.length; i=i+2) {
var year = response.facet_counts.facet_fields.publishDate[i];
var count = response.facet_counts.facet_fields.publishDate[i+1];
var result = response.facet_counts.facet_fields.publishDate;
for (var i=0; i < result.length; i=i+2) {
var year = result[i];
var count = result[i+1];
if (year > 2012 || year <= 1000) continue;
$("#results").append(Mustache.render(template, {
year: year,
count: count
Expand Down

0 comments on commit 0b0e0cb

Please sign in to comment.