support /?term to auto-search on 'term', though latency sucks right now
authorMike Shaver <shaver@mozilla.org>
Fri, 28 Jan 2011 22:26:59 +0000
changeset 25 505340dfb06a9842fad0d9441120f31bafab9678
parent 24 6f4f1fc025c24c50d7f2438d12cf219d3808c5c9
child 26 ae8b3ff677cadc92b6d51299062fd2a5aee4e4ce
push id22
push usershaver@mozilla.com
push dateSat, 29 Jan 2011 00:37:43 +0000
support /?term to auto-search on 'term', though latency sucks right now
pulse/pulse.js
server/entry.html
--- a/pulse/pulse.js
+++ b/pulse/pulse.js
@@ -40,17 +40,17 @@ function addNewBug(bug)
 function updateSummary(before, after)
 {
 }
 
 function trackStatusChange(bug, before, after)
 {
     if (isOpen(before) && !isOpen(after)) {
         console.log("removing bug " + bug.id + " (" + before + "->" + after + ")");
-        store.removeBug(bug.id, before, after, bug.summary)
+        store.removeBug(bug.id, before, after, bug.summary);
     } else if (!isOpen(before) && isOpen(after)) {
         console.log("re-adding bug " + bug.id + " (" + before + "->" + after + ")");
         store.addNewBug(bug.id, bug.summary);
     }
 }
 
 function onBugzillaMessage(message)
 {
--- a/server/entry.html
+++ b/server/entry.html
@@ -43,22 +43,26 @@ var results;
   $("#keywords").bind("keydown", function(e){
 
  if(e.keyCode == 32 || e.keyCode == 13 ||
    (e.keyCode == 8 && $("#keywords").val().substr(-2, 1) == " "))
 {
       sendmsg();
   }});
 
+  if (location.search)
+      $("#keywords").val(location.search.substring(1)); 
+
   function log(data){
     $("#matchingbugs").html(data);
   };
 
   conn = new io.Socket(document.domain, { rememberTransport: false });
   conn.on("connecting", function(type) { $("#matchingbugs").html("Trying <i>" + type + "</i>"); });
+  conn.on("connect", sendmsg);
   conn.on("message",  function(data) {
   results = JSON.parse(data);
       var div = $("#matchingbugs");
       div.html(results.bugs.length + " results for '" + $("#keywords").val() + "' in " +  (Date.now() - conn.sendTime) + " (total)/" +
                results.times.server + " (server)/" + results.times.redis + " (redis) ms<br>");
 
       results.bugs.forEach(function (v) { div.append("<a href='https://bugzilla.mozilla.org/show_bug.cgi?id=" + v.id + "'>" + v.id + "</a>: ");
 div.append(document.createTextNode(v.summary)); div.append("<br>"); });