Fixed the results and query urls.

Change-Id: I9ef84b730875e968f6297c3225078bdc6e206b0b
diff --git a/client/query/query.css b/client/query/query.css
deleted file mode 100644
index 9489526..0000000
--- a/client/query/query.css
+++ /dev/null
@@ -1,250 +0,0 @@
-body {
-    font-family: "Helvetica Neue", "HelveticaNeue-Light", Helvetica, Verdana, Arial, "Lucida Grande", sans-serif;
-}
-
-header {
-    width: 100%;
-}
-
-h1 {
-    text-align: center;
-    font-weight: 600;
-    color: #0F582A;
-    text-shadow: #0A3D1B;
-}
-
-.textbox {
-    width: 70%;
-}
-
-.cssmenu,
-.cssmenu ul,
-.cssmenu li,
-.cssmenu a,
-.cssmenu span {
-    width: 160px;
-    margin: 0;
-    padding: 0;
-    border: none;
-    outline: none;
-    text-transform: capitalize;
-}
-
-.cssmenu li {
-    list-style: none;
-}
-
-.cssmenu li > a {
-    display: block;
-    position: relative;
-    min-width: 110px;
-    padding-left: 3px;
-    padding-top: 3px;
-    padding-bottom: 3px;
-    color: #fdfdfd;
-    /*font: bold 12px/32px Arial, sans-serif;*/
-    float: left;
-    text-decoration: none;
-    text-shadow: 0px 1px 0px rgba(0, 0, 0, .35);
-    background: #6c6e74;
-    -webkit-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .1), 0px 1px 0px 0px rgba(0, 0, 0, .1);
-    -moz-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .1), 0px 1px 0px 0px rgba(0, 0, 0, .1);
-    box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .1), 0px 1px 0px 0px rgba(0, 0, 0, .1);
-}
-
-.cssmenu li > a span {
-    display: block;
-    position: absolute;
-    top: 7px;
-    right: 0;
-    padding: 0 10px;
-    margin-right: 10px;
-    font: normal bold 12px/18px Arial, sans-serif;
-    background: #404247;
-    -webkit-border-radius: 15px;
-    -moz-border-radius: 15px;
-    border-radius: 15px;
-    -webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .2), 1px 1px 1px rgba(255, 255, 255, .1);
-    -moz-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .2), 1px 1px 1px rgba(255, 255, 255, .1);
-    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .2), 1px 1px 1px rgba(255, 255, 255, .1);
-}
-
-.sub-menu li a {
-    color: #797979;
-    text-shadow: 1px 1px 0px rgba(255, 255, 255, .2);
-    background: #e5e5e5;
-    border-bottom: 1px solid #c9c9c9;
-    -webkit-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .1), 0px 1px 0px 0px rgba(0, 0, 0, .1);
-    -moz-box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .1), 0px 1px 0px 0px rgba(0, 0, 0, .1);
-    box-shadow: inset 0px 1px 0px 0px rgba(255, 255, 255, .1), 0px 1px 0px 0px rgba(0, 0, 0, .1);
-}
-
-.sub-menu li:last-child a {
-    border: none;
-}
-
-.sub-menu li > a span {
-    color: #964D25;
-    text-shadow: 1px 1px 0px rgba(255, 255, 255, .2);
-    background: transparent;
-    border: 1px solid #c9c9c9;
-    -webkit-box-shadow: none;
-    -moz-box-shadow: none;
-    box-shadow: none;
-}
-
-.cssmenu > li:hover > a,
-.cssmenu > li:target > a {
-    color: #964D25;
-    text-shadow: 1px 1px 1px rgba(255, 255, 255, .2);
-    background: #F9C83A;
-}
-
-.cssmenu > li:hover > a span,
-.cssmenu > li:target > a span {
-    color: #964D25;
-    text-shadow: 0px 1px 0px rgba(0, 0, 0, .35);
-    background: #964D25;
-}
-
-.sub-menu li:hover a {
-    background: #FFEF36;
-}
-
-.autocomplete, /autocompleteButton {
-    width: 80%;
-    /*padding-left: 100px;
-    margin: 0px;*/
-    display: block;
-    position: relative;
-}
-
-.currentSelections {
-    width: 80%;
-    /*padding-left: 100px;
-    margin: 0px;*/
-    display: block;
-    position: relative;
-}
-
-.textbox {
-    width: 70%;
-    padding-left: px;
-    margin: 0px;
-}
-
-.page {
-    padding-top: 10px;
-    padding-left: 10px;
-    width: 80%;
-}
-
-.resultTable {
-    margin: 0px;
-    padding: 0px;
-    width: 80%;
-    /*border: 1px solid #000000;*/
-    -moz-border-radius-bottomleft: 0px;
-    -webkit-border-bottom-left-radius: 0px;
-    border-bottom-left-radius: 0px;
-    -moz-border-radius-bottomright: 0px;
-    -webkit-border-bottom-right-radius: 0px;
-    border-bottom-right-radius: 0px;
-    -moz-border-radius-topright: 0px;
-    -webkit-border-top-right-radius: 0px;
-    border-top-right-radius: 0px;
-    -moz-border-radius-topleft: 0px;
-    -webkit-border-top-left-radius: 0px;
-    border-top-left-radius: 0px;
-    padding-left: 10px;
-}
-
-.resultTable table {
-    border-collapse: collapse;
-    border-spacing: 0;
-    width: 100%;
-    height: 100%;
-    margin: 0px;
-    padding: 0px;
-}
-
-.resultTable tr:last-child td:last-child {
-    -moz-border-radius-bottomright: 0px;
-    -webkit-border-bottom-right-radius: 0px;
-    border-bottom-right-radius: 0px;
-}
-
-.resultTable table tr:first-child td:first-child {
-    -moz-border-radius-topleft: 0px;
-    -webkit-border-top-left-radius: 0px;
-    border-top-left-radius: 0px;
-}
-
-.resultTable table tr:first-child td:last-child {
-    -moz-border-radius-topright: 0px;
-    -webkit-border-top-right-radius: 0px;
-    border-top-right-radius: 0px;
-}
-
-.resultTable tr:last-child td:first-child {
-    -moz-border-radius-bottomleft: 0px;
-    -webkit-border-bottom-left-radius: 0px;
-    border-bottom-left-radius: 0px;
-}
-
-.resultTable tr:hover td {}
-
-.resultTable tr:nth-child(odd) {
-    background-color: #86bd4a;
-}
-
-.resultTable tr:nth-child(even) {
-    background-color: #fdfdfd;
-}
-
-.resultTable td {
-    vertical-align: middle;
-    border: 1px solid #000000;
-    border-width: 0px 1px 1px 0px;
-    text-align: left;
-    padding: 7px;
-    font-size: 10px;
-    font-family: Arial;
-    font-weight: normal;
-    color: #000000;
-}
-
-.resultTable tr:last-child td {
-    border-width: 0px 1px 0px 0px;
-}
-
-.resultTable tr td:last-child {
-    border-width: 0px 0px 1px 0px;
-}
-
-.resultTable tr:last-child td:last-child {
-    border-width: 0px 0px 0px 0px;
-}
-
-.resultTable tr:first-child td {
-    background-color: #6c726b;
-    border: 0px solid #000000;
-    text-align: center;
-    border-width: 0px 0px 1px 1px;
-    font-size: 14px;
-    font-family: Arial;
-    font-weight: bold;
-    color: #ffffff;
-}
-
-.resultTable tr:first-child:hover td {
-    background-color: #6c726b;
-}
-
-.resultTable tr:first-child td:first-child {
-    border-width: 0px 0px 1px 0px;
-}
-
-.resultTable tr:first-child td:last-child {
-    border-width: 0px 0px 1px 1px;
-}
diff --git a/client/query/query.html b/client/query/query.html
index 1f2af4a..09b0fba 100644
--- a/client/query/query.html
+++ b/client/query/query.html
@@ -2,7 +2,7 @@
 <html lang="en-US">
 
 <head>
-<title>Atmospheric Query and Retrieval Tool</title>
+<title>NDN Query and Retrieval Tool</title>
 
 <script>
   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -17,13 +17,13 @@
 
 <!-- Styles -->
 <link rel="stylesheet"
-  href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.5/yeti/bootstrap.min.css">
+  href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.5/united/bootstrap.min.css">
 <link rel="stylesheet" href="query2.css">
 
 <!-- Scripts -->
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
-<script src="../ndn-js/build/ndn.min.js"></script>
+<script src="../ndn-js/build/ndn.js"></script>
 <script src="query.js"></script>
 
 </head>
@@ -32,7 +32,7 @@
   <header>
     <div class="navbar navbar-default container-fluid">
       <div class="navbar-header">
-        <div class="navbar-brand">Atmospheric Query and Retrieval Tool</div>
+        <div class="navbar-brand">NDN Query and Retrieval Tool</div>
       </div>
     </div>
   </header>
diff --git a/client/query/query.js b/client/query/query.js
index f6b81ad..01b1fb2 100644
--- a/client/query/query.js
+++ b/client/query/query.js
@@ -1,7 +1,7 @@
 //{@ @todo: this need to be configured before the document load
 var catalog = "/catalog/myUniqueName";
 var config = {
-  host: "ndn-atmos.atmos.colostate.edu",
+  host: "atmos-csu.research-lan.colostate.edu",
   port: 9696
 };
 
@@ -55,17 +55,19 @@
   this.resultTable.on('click', '.interest-button', function(){
     var button = $(this);
 
+    if (button.is(':disabled')){
+      console.warn("Attempt to request again!");
+    }
+
     var name = button.parent().prev().text();
     var interest = new Interest(new Name('/retrieve' + name));
-    scope.face.expressInterest(interest, function(){
-      var message = $('<div class="success"><span class="glyphicon glyphicon-ok"></span> Success!</div>');
-      message.insertAfter(button);
-      message.fadeOut(5000);
-    }, function(){
-      var message = $('<div class="fail"><span class="glyphicon glyphicon-remove"></span> Failed!</div>');
-      message.insertAfter(button);
-      message.fadeOut(5000);
-    });
+    scope.face.expressInterest(interest, function(){}, function(){});
+
+    button.text("Requested!")
+    .removeClass('btn-primary')
+    .addClass('btn-default')
+    .addClass('disabled')
+    .prop('disabled', true);
 
   });
 
@@ -113,7 +115,9 @@
 
   var scope = this;
 
-  $.each(this.queryResults, function (queryResult, field) {
+  //TODO Fix paging.
+
+  $.each(queryResults, function (queryResult, field) {
 
     if (queryResult == "next") {
       scope.populateAutocomplete(field);
@@ -284,8 +288,8 @@
 
 
   for (var i = startIndex; i < startIndex + 20 && i < this.results.length; ++i) {
-    resultTable.append('<tr><td>' + this.results[i]
-    + '</td><td><button class="interest-button btn btn-default btn-xs">Retrieve</button></td></tr>');
+    this.resultTable.append('<tr><td>' + this.results[i]
+    + '</td><td><button class="interest-button btn btn-primary btn-xs">Retrieve</button></td></tr>');
   }
 
   if (this.results.length <= 20) {
@@ -318,7 +322,7 @@
         currentPage.append(' ' + i);
       }
     } else { // Need to skip ahead
-      if (i == page + 6) {
+      if (i == this.page + 6) {
         currentPage.append(' ... ');
 
         currentPage.append(' <a href="#" onclick="getPage(this.id);" id=">">></a>')
@@ -420,7 +424,7 @@
 
 /**
  * Adds a filter to the list of filters.
- * There is no need to remove the filter, it is done via ui clicks.
+ * If a filter is already added, it will be removed instead.
  * 
  * @param {string} filter
  */
@@ -457,6 +461,7 @@
       return prev;
   }, {});
   console.log('Collected filters:', filters);
+  var scope = this;
   this.query(this.catalog, filters, function(data){
     scope.onData(data);
   }, 1);
diff --git a/client/query/query2.css b/client/query/query2.css
index 026c7b8..644a07a 100644
--- a/client/query/query2.css
+++ b/client/query/query2.css
@@ -39,6 +39,7 @@
   transition: background-color 1s, 
   
   border-color 2s;
+  cursor: pointer;
 }
 
 #filters .label:hover {
diff --git a/client/query/temp.json b/client/query/temp.json
deleted file mode 100644
index e69de29..0000000
--- a/client/query/temp.json
+++ /dev/null