Merge branch 'master' of ssh://git.indexdata.com:222/home/git/private/mkws
authorWolfram Schneider <wosch@indexdata.dk>
Wed, 9 Apr 2014 10:52:39 +0000 (10:52 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Wed, 9 Apr 2014 10:52:39 +0000 (10:52 +0000)
examples/htdocs/mike.html
src/mkws-team.js
src/mkws-widgets.js

index 88a2531..d1ed232 100644 (file)
@@ -16,7 +16,7 @@
       }
     </style>
     <script type="text/javascript">
-      var mkws_config = { responsive_design_width: 990 };
+      var mkws_config = { service_proxy_auth: "//mkws.indexdata.com/service-proxy-testauth" };
     </script>
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
     <script type="text/javascript" src="http://x.mkws.indexdata.com/jquery.json-2.4.js"></script>
@@ -63,6 +63,7 @@
     </table>
     <div id="mkwsTargets"></div>
     <div id="mkwsStat"></div>
+    <div class="mkwsDone"></div>
     <div id="mkwsMOTD">Speak, friend, and enter!</div>
   </body>
 <!--
index ee18f1b..4447457 100644 (file)
@@ -115,8 +115,9 @@ function team($, teamName) {
     }
 
     function onStat(data) {
-       log("stat");
        queue("stat").publish(data);
+       if (parseInt(data.activeclients[0], 10) === 0)
+           queue("complete").publish(parseInt(data.hits[0], 10));
     }
 
     function onTerm(data) {
index 22b9820..8b43400 100644 (file)
@@ -308,3 +308,12 @@ mkws.registerWidgetType('Perpage', function() {
        return false;
     });
 });
+
+
+mkws.registerWidgetType('Done', function() {
+    var that = this;
+
+    this.team.queue("complete").subscribe(function(n) {
+       $(that.node).html("Search complete: found " + n + " records");
+    });
+});